Massive rehaul of socket.io (primarily to allow wigsbot to connect)