Use WebSockets instead of socket.io.

Changed the socket implementation to use WS-server, and added
utility function to generate the web socket url with the correct
protocol and relative path.