Refactor around channels instead of locks.

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

For comment only...