First protocoll draft and minor stuff in WebSocket event handling.