Allow the introduction of new aggregate functions for outer aggregation when not ambiguous

This allows for new aggregate functions for outer aggregates by finding the appropriate AggregateSource via a mapping of TableSources to AggregateSources (instead of a mapping of AggregateFunctionExpressions to AggregateSources).

This also cleans up and consolidates some of the code.