Make defined_names importable at top-level
Move tests for defined_names to test_defined_names.py
Refactor TestDefinedNames
dedent source before passing it to defined_names

test_nested_definitions fails now
Fix: api.defined_names was run against wrong scope

when there is only one class is defined in the module.
Merge pull request #223 from tkf/fix-defined_names

Fix defined_names