Added tests for complex queries and for querying within document fragments.