Add some new features to the Tornado Websocket client.

Specifically:

* Allowed passing in an IO loop; this allows the class to be used in unit tests.
* Allowed passing extra HTTP headers; for authentication or other purposes.
* Detect if we're able to use websockets, and call a handler that can take action if the remote end doesn't support it.