MetadataCache now caches the file hashes. also some cleanups.
fixed broken tests.