Prevent NPE
Core logic refactored into method for reuse
ScriptURL reuses logic from ScriptFileNodeStep

* update tests to expect remote file remove command