Various and sundry fixes

Fixes for bugs uncovered by @bbangert's [tester](https://github.com/bbangert/push-tester) and my [Go port](https://github.com/kitcambridge/push-tester-go), along with a Heka logging refactor.
I don't mind being explicit, but why break this out into a var instead of using in place?