Python 3: Replace iter.next() with six.next(iter)

Use six.next() to be Python 3 compatible.

Change-Id: Ia16148a759d368872787d5896a7b1dc42ffcdfb5
Replace dict.iteritems() with dict.items()

dict.iteritems() has been removed in Python 3. In Python 2, dict.items()
creates a temporary list, but Samuel Merritt wrote:

"The size of the data is small enough that we don't need to worry about the
memory consumption; it's all just HTTP headers."

Change-Id: Iac427b8bbd032e4a1efb2bdc84a3968217eb6ddf
Merge "Python 3: Replace iter.next() with six.next(iter)"