Adds filter for labels (Fix #523)

This adds the filter for labels as requested at #523.  I've also optimized the class a little bit by consolidating the filters processed by the state into a single method and calling it from both methods building database queries.
Well it's either this or refactor how the labels are stored, or figure out how to do a wildcard search on that column that works.  It won't be an issue on the CMS repo (all the labels start at ID 21), but for the issue tracker repo I guess it could be since it has all the single digit labels.