* Improve stream termination handling; add websocket ping generation to keep connection alive.
* Rework stream closing to better comply with draft-moffitt-xmpp-over-websocket-03