a powerful Finite and Hierarchical State Machine (FSM / HSM) for javascript and JQuery