Refactoring to allow versatile workflow

Allow source_root to be specified on the command line; now added as a variable for other paths.