Simple finite state machine class for D language