logical rework of ReportAggregation (query-focused now), liable to be buggy for a few commits