Implemented heartbeats to the leader.

Pending election fixes.
Leader election handles leader failure.