moved all socket logic out of app/chess.js