Reduce number of global variables used

This is the first step to make the exporter more testable.
Merge pull request #28 from prometheus/reduce-globals

Reduce number of global variables used