Refactoring code for computing and caching `ElecMeter` stats. #216