This imports unfinishedstates, checkunfinished(), and clearunfinished()
from cmdutil.py and makes it compatible with the new statecheck class.
This also adds support of the new class state.statecheck
throughout core and extensions. This also removes the
previous method cmdutil.unfinishedstates and its API.
The results are shown in tests.