Add state qualifier table

    This refactors the existing rule code and reuses it for state-quals.
    It also changes the rendering logic: segments are displayed only if
    they match both state-qualifier AND filter rule criteria.