Update code and tests for python3

When running the tests under python3 I found a few places where uses of iteritems needed to be removed.  I've unconditionally changed them to items calls but we can make them version specific if we need generators for any reason.  This should start (probably not complete) a migration to python3.