Convert to python 3

This should do the job of converting to python 3. Only tested with one dtb so far, though.