Custom IOLoop instance support

Hi!

I stumbled upon the question on StackOverflow on [how to test WebSocket handlers using tornado.testing](http://stackoverflow.com/questions/9336080/how-do-you-use-tornado-testing-for-creating-websocket-unit-tests).

I've tried to use your implementation as a WS-client but found a lack of custom IOLoop instance support which is critical for tests based on AsyncHTTPTestCase.

So, here is a small fix and test example. Hope it worth to be pulled.