Add python 3 support

Just changed iteritems to items and add decode.