Refactor recently added bugfix into more testable code by using a
method for windows file name sanitization.  Splits the unittest up
into several based on platform.