[WIP] Refactor to use dispatch_io for tasks, and wait for EOF

Hopefully resolves #151, #139, and #135.

/cc @joshaber @keithduncan
We should be able to use a global queue, the source / io won’t invoke the handler concurrently