Global variable fixing and socket.io testing