[OPTIQ-309] WITH ... ORDER BY query gives AssertionError
More tests for WITH ... ORDER BY.
Reduce count(not null) to count()
Add test case for [OPTIQ-307]
Re-organize planner initialization, to make it easier to use heuristic join order.
[OPTIQ-310] Implement LEAD, LAG and NTILE windowed aggregates.

Refactor aggregate implementation to interfaces.
Add rowInFrame, and rowInPartition, and needCacheWhenFrameIntact APIs for
windowed aggregates.