Several small py3-related cleanups.

I made a quick pass at low-hanging py3 compatibility bits; got a few, but
there's still real work to be done dealing with flags/appcommands.

Also swapped out the existing uses of `six.iterkeys` and `six.iteritems`,
since they were all over small python objects anyway.
9 files changed