Add socket.io and websocket tests.
Fix bug where reentrancy did not work with socket.io