A re-write of the badges framework.