Python3

Fixed bugs found when running Ninja with Python 3. Can open and edit files in the program, but not sure if all issues have been found.

Note that the resources file will break again next time it's generated with the tool!