Naive heartbeat implementation. Does not yet check timeout on heartbeats and has no optimizations. Primarily used for testing purposes.