For maintainability, it would be good to refactor updateNodes in ExecutePlugin.SafeSave.js.
Longer term, it would be good to migrate ExecutePlugin.SafeSave.js to it's own standalone library to use when writing plugins which want to use 2-phase commit.