Checkpoint on my way to a better range implementation
Better implementation of range scan. This one is correct.
Updated tests for range scan impl.