Several improvements to the external commands backend

* more reliable VCS detection
* customizable external commands
* added a few missing docstring