Adding support for "for" loops and execution limits, as well as minor optimizations.