Added socket.io dependency, fixed tests, cleaned some stuffs