Better Windows support (primarily handling paths with spaces in them)

This doesn't generally matter on Linux systems, but Windows machines are pretty likely to have paths with spaces in them. Quoting the paths prevents this from causing problems.
could we split this onto two separate gsub! (not gsub) lines just for readability?