Permit use of Git while still supporting Subversion. Improve the script structure and reduce dependence on hard-coded paths.