New addGroupBy() function.  Make query functions private.