Better structure for incoming socket.io connections

changed the way the servermain class was instantiated by an incoming
socket.io connection