Various changes for issues that cropped up in the review. Including ...

* PEP8 adherence
* Better use of Pythonic syntax
* Refactoring to allow for improved unit testing
* HeartBeatPublisher now takes a callback which generates
  the heartbeat message body
Adding unit tests for HeartBeat changes