Heartbeat

Implements #136.