Factor out generation of data for leaderboards and recent changes

This is so that these data can be used on the home page too without lots
of duplicated code.  Maybe yet another mixin isn't a great idea though :/