moved websocket stuff out of app.js