Added FrequencyMetrics and some tests.