add config.dep_cache_file
'tree' functionality: add caching + some refactoring and fixes