Make it easy to test produced logical plans

o CardinalityEstimator and CostModel now are functions
o Introduce caching of plan cardinality and cost per planning run
o Changed ASTRewriter to optionally not do parameter extraction (for tests)