Don't modify data while iterating, esp for Python 3 compat.
Encode unicode string before hashing, esp for Python 3 compat.
Merge pull request #20 from agriffis/py3

Fixes for Python 3 compatibility.