Add support for SN-DBS.

When running in "batch mode", instead of running subprocesses
write their command lines to a script file. Once no more edges
are ready to run, kick off the script.