Some more py3 compatibility tweaks

iteritems -> items
xrange -> range
  I pedantically replaced range with xrange for < 3...because it apparently matters :/