Allow `tree.cleanup` to return a promise.

This change was the result of running `npm install --save` (it now calls `JSON.stringify(contents, null, 2);` to enforce spacing).