Add timestamp to heartbeats storage. Add more tests