Add some plumbing for subquery factoring (CTE)