Add mutex for write access to global metric map.
Restructure as methods on types.
Merge pull request #5 from prometheus/restructure-on-types

Restructure on types