Rewrote state machine to be function pointer containers w/ move semantics. Untested...