Refactor main.coffee and socket.coffee