Factor out a custom scons builder for running our plugin.

This removes a big chunk of Python code that had been copied and
pasted into every SConscript under the "tests" directory.  More could
be factored out too, but this is a good start.
Remove several variables that are set but never subsequently used.
Refactor lots of common scons code used in test subdirectories.

Discovery and running of tests is now quite automated.  That is
convenient but fairly inflexible.  I've left little room for
variation: only the things that already vary from one subdirectory to
another are accommodated here.  If we decide that more flexibility is
needed, we can certainly add that back in later.
Oops, this is the rest of the refactoring.

I mistakenly omitted these from the previous commit.
Merge pull request #4 from AlisaMaas/refactor-test-builder

Refactor test builder logic