Implement Python Generators

This rather large patch which implement python generators.

looks like insideGenerator isn't used any more?