Backend changes to support improved badge pages.
Add consistency check to revoke duplicate badges.