add support for scanning indexes, allow external callers to call generic...

... queries

I added two things in this commit. Happy to split into multiple commits if you would prefer that.

* Support for scanning an index the opposite direction
* Make RunQuery more accessible so external callers can use QueryBuilder style query creation and still be able to execute the queries.