Use dict.keys & items instead of iterkeys & iteritems

for python 3.3 compatibility.