[OPTIQ-310] Implement LEAD, LAG and NTILE windowed aggregates.

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