Unit test temp dir now properly cleaned up

Uses a test rule to ensure the temp directory is cleaned up as soon as
the test is completed. This prevents potential problems with re-running
the test and having an old directory present.