Fixes #739, tree.expand now returns a promise.