Python 3

* Code migrated to Python 3
* use python logging instead of `if debug: print()`
* use `"".format(args)` instead of `"" % args`
* add `.gitignore`