Adds badge model and basic test, with refactoring out of test helpers