Refactored tornado test cases.

Use an explicit IOLoop instance so it should be more clear what's going
on internally.