Node.js: Tree update and cleanups