Fix runtime error when running with python 3

Python 3 strings are UTF-8 by default, so the decode method was
removed from newer python versions.
Fix header generation
Merge pull request #19 from ISF/fix_decode_under_py3

Fix runtime error when running with python 3 due to `decode()`