Python 3 fixes of the hftools codebase

With this pull request it is possible to run the test suite on python 3.4 without errors.