Use stmt instead of node. Rename projectFinal to delayProjection.
Fix aspects of projection and sorting. Sort using aliases. Fix MB-12534.