fixed Metrics objects to be serializable
Changed HeapMetricGroupFactory to be serializable