Refactor locale cache using extract method

This makes the Locale cache a nice seperate class with less dependencies
and an easy to test interface.
It's also more similar to the refactored version of the pages
cacheBuilder