Refactored Aggregated statistics stuff into separate modules, issue #93