Added template-based code generation for aggregate functions: min, max, sum, count, avg.  These support several data types both nullable and non-nullable.