* Re-emit room state events on rooms
This also fixes some potential memory leaks and abuse of
removeAllListeners in sync.ts.
* Remove some stray whitespace
* Deduplicate some code to appease SonarCloud
* Name helper function more explicitly
And also add a test so I can be confident it's actually doing the
same thing.
NB. There was some logic there previously to reduce the number of
bound functions that had to be kept around, but it subsequently
started adding the source object as the last arg, at which point
there's now one bound function in memory per re-emitted event name
(plus the previous per-event-name handlers). This reduces it so it's
just one per re-emitted event name, so still could be quite a few,
but fewer than before.