Experimental extensions implementation

This is just an experiment to see what extensions might look like and also to get a better understanding of all the nooks and crannies of the problem.
Need to change the exports because extensions.js needs access to groupTypes and the extension itself needed access to buildExpression.  I also exported buildGroup because I thought other extensions might need that too.