Revert "I literally can't even begin to offer an explanation"

This reverts commit 01b7d6543465803dda7f22b6bd720dce39645026.
Revert "Use scripttest with Trollius"

This reverts commit d0661b96f12c9ba10e51f391c7698dd56b4af847.
Explicitly flush sys.stdout and sys.stderr before sys.exit()