Implement client-side heartbeat method.

 - Implement unit-tests.