Revised State and StateMachine, and also added import ram.ai.new.mainState as mainState to OCI