Bring back the folder caching from 38d87d8. Fixes #66