Eng 7326 plannode reorder

This pull requests is basically reordering the Projection node and ORDER BY node for step 1. Step 2 will make the Aggregation node and Projection node inline for certain cases.

For some cases we can not reorder the plan node tree for ORDER BY, I regressed it to use the old plans although they are not efficient.
The logic in this loop looks wrong or at least needlessly complex.
If it is correct, you chould test (hasComplexAgg() || hasComplexGroupby()) outside the loop and if it is true, run a simpler loop that executes
orderCol.expression = orderCol.expression.replaceWithTVE(aggTableIndexMap, indexToColumnMap);

Or if you want to keep it to one loop, outside the loop:
boolean replaceAll = hasComplexAgg() || hasComplexGroupby();
Then simplify the inside to 
if (replaceAll || orderCol.expression.hasAnySubexpressionOfClass(AggregateExpression.class)) {
    orderCol.expression = orderCol.expression.replaceWithTVE(aggTableIndexMap, indexToColumnMap);
}

Am I correct that there's no reason (like a side effect) to call orderCol.expression.replaceWithTVE if you are not actually going to use the value?