Ported codebase to Python 3. Long Live Python 3!