Modified to use real iterators

Coroutines are the easiest way to implement true iterators in lua.