Fixing bug and tweaking states

The state record has a rank in it, so it now extends the has_rank class.
The role_has_state table how cascades on delete.
The number of participants using a state is now included in the state
list and view.