Add a class which applies display: none to badges we don’t want to see. This is accomplished by passing a `shouldDisplay` function along with each badge, which pulls the current query through a closure and applies it.
A bit roundabout, but it works.
The rest of the changes are refactors to avoid code duplication.
I decreased the debouce rate to 50, which seems to work well.
Fix#1314