Refactor heartbeats within WorkerCommunication class.

Resolves #40