Get the cache from metadata factory

I need to clear the cache from a CLI tool, not being able to access the cache from the MetadataFactory is a bit annoying. I think we should be able to access it.