Refactor MetricRegistry to not be a global singleton