Rewrite #2 of caching logic

I got rid of all the localization stuff, it was just a huge pain
to manage and really confusing. The functionality isn't removed
entirely, {{int:}} functions should still work properly.

This makes the code a bunch simpler and easier to follow.

Change-Id: I32cd876485398b5b860c375797e70bb7d8e31cd9