Add code and tests to work on windows and unix.