createDir() shouldn't also change the cwd because it limits the generality of the function.