keep window of metrics

* store limited history of metrics in MetricWindow
* added aggregate functions on MetricWindows
* convert from custom MetricValue to BigDecimal