[NUCCORE-1150] Update handling of aggregates so that we clear out any
expressions added to the stack during the aggregate process calculation.
Allow use of aggregates in filter clause also