Ensure root logger passes all messages to all handlers

This lets the handlers set their own levels. Otherwise all
handlers are limited to the messages that the root logger
is willing to pass to them (e.g. they only get messages that
pass root logger's level setting)
Enable real-time output from __run_test (e.g. simulate linux tee)

Instead of opening a file handler, just use the logging framework.
In addition to the normal StreamHandler, register a FileHandler to
save a log file from running each test.

The setup.py files depend on out and err file objects, so we fake
them with a new class WrapLogger. This allows us to see real-time
output from those files as well. It is also easier for the setup.py
files as they use subprocess heavily, and it uses parameters for
errfile and outfile
Modify requires_database, includes test type in check
Minor improvements to __run_test