Fixed ifchanged tests on python 3

The generator.next() function is not used, and next(iter) works as of
Python 2.6. Also thanks to @bpeschier for making these ifchanges patches.