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.
Whoops, I forgot to collapse this after removing the `fmt.Printf` calls.