Fix stat math

Change-Id: Ie062175dc3e6a5c869f6c71e5821a426f41ce4e6
Add timezone aware dates

Change-Id: Ifda10f566590847948df30dfc7e1e895d0b83d5a
Fix sum stats

Add tests

Change-Id: I33b905c250eef000fe88648bb65eee726f4e5395
Merge remote-tracking branch 'upstream/master'