More Python > 3.x support

Replace {}.iteritems with .items and
cast the return value to a list.

This should fix issue  #18