overhaul event-delivery code (EventSource, EventChannel)

The frontend now uses a single EventSource to receive events from the
backend. The channel is created with one API call, then the EventSource
is created, the frontend waits for a "ready" event, then the frontend
subscribes to "addressbook" and "messages". Later, type-specific
messages are delivered.

This will pave the way for things like:

* subscribing to hear about addressbook updates only when the
  addressbook pane is open
* subscribing to per-room message events only when appropriate
* subscribing to hear about the progress of a specific invitation

Note that this requires a frontend which can do EventSource, which
precludes Internet Explorer (even the current IE11 lacks EventSource).
We may eventually need to replace this with a more poly-fill-able tool.