Range index performance improvements

Improve performance of new range index lookups if context set is small (one node). Add filter to restrict lookup. Fix optimizer to properly handle boolean expressions.