Allow for providing our own ioloop

Using the global default ioloop doesn't alway work. This just adds optional arguments.