Make dmg2john work under Python 2.4 to Python 3.3
misc. Python portability fixes
even more portability fixes