Use six.iteritems to iterate over dictionaries.

This switches us over to the six helper method for bridging the gap between
Python 2.x's iteritems() and 3.x's items().

Testing done:
Ran unit tests.

Reviewed at https://reviews.reviewboard.org/r/6585/