This removes `STATES` from `state.py` and adds support to
`statecheck` class to handle its features.
`getrepostate()` function is modified accordingly.
This also adds a method 'cmdutil.addunfinished()' for appending to
the unfinishedstate list so as to keep 'merge' and 'bisect' at the last.
Results of test changed are shown.