[CLEANUP] Clean up the cache clearing methods.

Also clear the cache when emogrify() is run.