The code is largely taken from the nowclient repository, except with a
few modifications to maintain API parity and reflect bugfixes in nowjs
itself.
Note that while this commit may not seem to work, this is due to a
known issue with socket.io-client; for more information, see
socketio/socket.io-client#336 .