Little refactoring
Add a test for leaking vars
Remove unused debug output
Make test_doctest target depend on test_ex_unit
Deduplicate test generation code