Improved scratchdir creation and handling.

Scratchdir usage is now handled by a class that wraps all nosetests
that use one. Scratchdirs are created as tmpdirs and torn down as part
of the testing process.