[PATCH] small cleanup, towards running ekg without snap

Hi Johan,

this pull request is just for a refactor (d782506) which extracts the JSON etc. bytestring generation from the Snap() functions.

I'm working towards making ekg work with the webserver package, which has fewer dependencies than snap, let me know if you have any ideas/caveats.

Conrad.