Further improvements for FSM AST generation
Refactoring of state.rb