Move debug Foo class into module scope

otherwise the class name in repr() differs in python3
Merge pull request #335 from ThiefMaster/py3fix-debug

Move debug Foo class into module scope