make compatible with python 2.7

Python 2 needs class and instance as parameters to super() call and
needs a method called next() instead of __next__() in iterators.