Make map-building in MetricRegistry overrideable.

Closes #373.
Move all the tests out of test packages.

No one seems to want to do this, including my own IDE.