Reimplemented the foreach loop iterator stack using just a single unsigned int

The generated code is now required to call the startLoop() and stopLoop() before
and after the loops. This so far only works from the C code, this is not yet
implemented in jit.