rose bush: improve filtering of job states

This change makes it possible to filter state over all
jobs, as opposed to the old behaviour of filtering state
only on task final job statuses.

This is done by calculating state filtering in Python
rather than via a SQL query.

The state filtering API and GUI is improved to avoid
negative logic.

@matthewrmshin, please test and review.