Convert iterators to generators

@pbadenski
@maxfliri