Errors and warnings are printed to stderr.
Cleaned up ``print_thread`` code.
Merge pull request #919 from kyleknap/errors-to-stderr

Errors and warnings are printed to stderr.