Refactor around channels instead of locks.

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

For comment only...
The reason for the sleep is to backoff, so we don't try to reconnect very frequently. Which in my opinion should go in reconnect() which monitors the rate and slow down if it's connecting too frequently.