RF: simplify and generalize run_mod_cmd

`run_mod_cmd` was getting complicated and it was failing on Windows.
Because it was complicated I couldn't work out why it was failing.
Simplify by writing the script in the temporary directory rather than
trying to use a long command string.  The refactoring may mean that
paths with spaces will work.
BF: use raw strings for Windows paths in script

Windows paths inside the script were not being properly escaped leading to
obscure errors - for example for a path that happened to contain an x after a
backslash.  Use raw strings for variables interpolated into the script.
Merge pull request #202 from matthew-brett/safer-mod-command

RF: refactoring the nisext routines

Make the nisext tester routines simpler to make them easier to debug,
and to fix an error on windows. We should probably deprecate the
testers routines at some point because virtualenvs are a better
solution to this problem, and the buildbot does a fair amount of this
testing.