Refactor around channels instead of locks.

This does not fully work yet and I'm not sure why.

For comment only...
Is there a reason why we're checking for EOF errors as opposed to `err != nil`