[performance] Redesign query optimizer for operations using range index (comparisons, contains, starts-with...): split query rewriting into two parts: 1) inject pragma (for top-level optimizations) and rewrite filter expressions to use range functions, 2) check at runtime if optimization can be applied (index is available) or not. Fall back to default processing if no index available.

This approach should be more expensive than the compile-time optimization we used before, but has the advantage that queries do not need to be recompiled if the collection configuration changes. The overhead for rewriting the query on the fly was not measurable in my tests though (below the threshold of the profiler).
[performance] When reindexing a collection, trigger a sync on the lucene-based indexes after the collection indexes got removed and before updated data is saved.
Merge branch 'develop' of https://github.com/eXist-db/exist into develop
Merge pull request #146 from wolfgangmm/develop

Redesign query rewriting for index operations