Move socket.io code to own server module.