A few py3k fixes.
Merge branch 'pmg3' of github.com:materialsproject/pymatgen into pmg3