Completed implementation of base state machine system.