Fix TargetDirectory to cope with Parameterized tests.

Parameterized tests have square brackets in their method names (as
reported by org.junit.runner.Description). This method name is used to
construct a subdirectory for each test. On Windows square brackets are
not valid path characters, so we need to avoid including them. This
fix converts all non-alphanumerical characters to hyphens in
TargetDirectory.