Refactor caching methods.
Write cachemods to filesystem.
Fix caching.
Fix matching of deps in markDep.
Merge branch 'cachemods' into develop