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

This reverts commit 890db36c8d1a7139e33fb83aee6b14f942c6d48a.