Use a hash-based approach for detecting changes in directory structures.

That way, we can get consistent results even when files not matching a pattern are added or removed. A change to the directory alone won't change the hash.
The set of resources and their meaning should be opaque for clients of ConfigCache. They never need to deal with it directly, but only carry it to pass it along to a ConfigCache later on. Thus, using array_unique is an optimization only relevant in the cache implementation.
Re-use code we already got