Adds utils with hearbeats from Caspa.

This was before on caspa/utils.js but we'll reuse the same
to implement heartbeats for Mosto and Patero, so moving them here.
Merge pull request #65 from inaes-tic/utils-from-caspa

Adds utils with hearbeats from Caspa.