efficient iterator w/ inlining

Proposed approximate fix for issue 3147
Allows full inlining, and gets around the generic types problem with
iterators in haxe (and especially C#) even when not inlined.
Unfortunately, currently incompatible with @:coreApi specifier, even
though it should work.