Correcting calculations for PeriodItem
Tidy controllers; implement some crude caching.
Tests, measures, use of ngResource in place of $http.