Changed the code generation to avoid tail recursion.
Instead, each simcode now returns the index of the next simcode to be executed.
All 26 tests pass
test 4 (68965 events per second)