Sort the badges on the user profile page

Also clean up UserBadgesController so it isn't doing two things in one
method
Fix badge type ordering
Merge pull request #2692 from riking/sorted_badges

Sort the badges on the user profile page