Fixed this issue by switching the main parent filter to 'ancestor' inste...

...ad, which picks up children no matter how they are nested.

Also:
* Consolodated the way queries are created in the Java code
* Added more tests
* Fixed an issue that happened when we found a child folder (the ui now excludes the folders)