Move debug Foo class into module scope

otherwise the class name in repr() differs in python3 (includes `.ContainingClass.<local>`)