Give chatroom's occupants view a ref to the chatroom view

and thereby fix bug with directInvites.
Properly remove chat room occupants who leave.
Chat room messages are now stored in browser storage.
Fixed a timing issue with keepalive.

When loading a page with an existing session, the roster view's elements were
being added too early, resulting in event handlers not being properly
registered.
Bugfix concerning trimmed chats.

Chats were being trimmed even though there was enough room.