Implement heartbeat inside protocol.

Also, try to handle errors and destruction of stream in a saner way (but
that doesn't work).
Fix a bug in auth layer not forwarding messages once authentication is done.
Make heartbeat configurable.
Add some watch command.