Replaced test stderr pipe with struct pipe.

Moved printing of most error messages out of run_tests() into main().