Refactored metering.

* Use data attributes in HTML to convey configurtion
* Added a dropdown time window