Deduplicate badge thumbnail markup

This is an attempt to have a single badge thumbnail include that works in all
view contexts. There are currently some hacks and ideally there would be more
logic pushed back up into the controllers.
Merge in badge template de-duping
Use consistent capitalization