Improve unit test running

Call all unit tests using "python -m run_unittest" where 'run_unittest.py'
is a simple utility script that calls unit test functions, optionally via
the coverage mechanism.  This gives us coverage measuring for all unit
tests without needing to implement it in every unit test (some but not all
existing tests did this.)

Also check that running test X in a module's unit test outputs "X: ok",
and add 'print "X: ok"' at the end of each test function.  This simple
mechanism verifies that the test function was actually called, and that
it actually ran to completion.  Simple typos and copy-paste errors could
otherwise lead to parts of unit tests being silently dead code.

Also refactor the unit test running code in the testing framework to
share more code between the different instance types.