Moved the code from tests into the main module, and tried to monkey-patch check_output.  Not currently working.