Better aggregation support

Added support and tests for aggregation operations.
I don't know if we even have one :-O  - I'm not too concerned as long as it's consistent within the patch itself.  From what GitHub is showing me there's a few inconsistencies?  I've pointed out one below as an example.