Add common test class with test_dir setup

Remove restriction on win32 in test_callbacks by removing use of NamedTemporaryFile
