client: add on_{dis,}connect signals
client: make heartbeat_period an advanced setting
client: disconnect from server if it goes away

The logic is a little complex here. Essentially, if a request to the
server times out, we disconnect and reconnect the control socket and
re-submit any pending messages. It we do this more than a certain number
of times, we give up and disconnect the client.
client: use default tornado IOLoop if none is specified
depth_client: make robust to servers appearing and disappearing