Convert to a work queue.

Still does what it did before, batching synchronous operations, but it
can now also multiplex the operations into multiple workers.

Closes #26.