Fixed issue where the file entity was storing too much information on Sy...

...napse which confused the os.path module.

Also refactored the reading of the cache map into a generator.