Rails cache optimize

This uses the Rails caching mechanism to optimize database load on the application layer.
These optimizations were initially developed in #112 and rebased to the current staging branch.
Oh, no, I think I had to add the locale manually to the cache key. I added it in the header cache key (and I tested that locale works right there), but I might have forgotten to add it here (localization switching doesn't work right with the user_stats dropdown menu yet)