moving all socket functionality to game.js