Heartbeat support

Fixes #44 
Closes #22 

Opened PR for discussion
A constructor should have no side effects, better move this to its own method.