major refactoring of ruby and python testing code

Handle exceptions from invoking ruby test method(s) gracefully:
the previous code didn't even attempt to handle them, leading
to a situation where no TestResults were produced.
Now the common case of referring to an undefined variable or
method is handled nicely (producing a CompilerDiagnostic), and
there is a catch-all case for other (currently unexpected)
kinds of exceptions.

Also, did some refactoring of the python testing code.  Factored
the IsolatedTask into a standalone class.  Factored out the
utility methods for creating a "dynamic" compilation result so that
they can be shared with the ruby testing code.

We should be a lot closer to robust Python and Ruby support at
this point.