Add pushgateway support to the simpleclient.

Refactor production of the text format into a separate module.
An integration test would be nice here to prove it's working