Socket cleanup

A first batch of steps towards cleaning up the lower level connection stuff.

The goal is to have a clear tuple: client -> connection -> socket including the ZMQ stuff.