Moved most debugging support to test_io module