Close webSocket connection, when handshake timed-out/ wrong command is received.

 - Connection with WebSocket is closed in friendly way, when WebSocket
   client does not finish handshake within 30 seconds.
 - When wrong command is received, then connection is closed too.
 - Added some more debug prints.
Small refactoring.