Leaderboard json

This pulls out the code that generated JSON for `/user/<id>/json` into something that other methods can call, then adds a JSON api that includes that info along with an ordered array of users which forms the leaderboard.