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

Hopefully resolves #151, #139, and #135.

/cc @joshaber @keithduncan
My thought was that this also serializes _across_ the cancellation and read handlers. The docs are ambiguous as to whether only a single kind of handler is serialized.