Working CopyDirectiveDependenciesFilter, with (I think) working caching.