tree: Reorganize unit tests to be promise-based and to work in IE