More code cleanup, fix issue where aggregate functions could only be used for grouping, ie not able to get the sum of an entire column