Support basic common table expressions.

Note that this requires modifying the clause-order, thus users cannot use the built in extensibility alone to support CTEs.