Incremental Evaluation of Range Queries

Includes also some code cleanup