Don't modify data while iterating, esp for Python 3 compat.
Encode unicode string before hashing, esp for Python 3 compat.
Merge branch 'py3' into aron