add thorough heartbeat encoding tests