Mostly functional implementation of state checker.

 * validate mast method added
 * state lookup for aliased states added