Add state qualifier table

    This refactors the existing rule code and reuses it for state-quals.
    - Display doesn't update in all cases