Fix issue #622 Join memory issue

The changes include QueryPlan / Scanner / ResultIterator refactoring:
1. Remove Scanner interface.
2. Move all Scanner methods into QueryPlan.