major refactoring resulting with much better caching of directories
now very large query results are usable
some bugfixes