Iteritems does not exist in Python 3

Leftovers from adding Python 3 support.

Thanks to GraylinKim for bug report #28.
Python3 requires writing bytes to binary files.

In Python3 any file opened in binary mode must be written with byte
data. Python2 ignores the byte literal so the change is backwards
compatible with all versions of Python2.