Moved all the websocket logic out into SocketController