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.
Found a possible solution, MySQL's [FIND_IN_SET](http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set) string function.