Basic websocket connection, code cleanup.