Support aggregation queries (eg GROUP BY...).
An example can be found in the ACInfoDB class under tests/.
Code cleanup