Make viewer and latexmk work on windows

Added conditions to replace `sh`-style command lines with `cmd`-style command lines on windows. Sync, async and continuous preview all work for me on windows.

The non-windows stuff hasn't changed (much), so it should still work -- don't have a linux box at hand to test on though.