Implemented aggregation framework for flat queries.
Added aggregation test for tiles, need to handle other cases.
Should create static project and group arrays in the object, instead of iterating offsets?