Small refactor of the common classes of the metric service. Implemented base tests to help validate that a custom metric function meets the expected criteria for the custom metric store