Added module statemachine.js