Add getCacheDir() functions to unify getting (creating if necessary) a cache directory.