Catalog tree refactoring

This refactors the catalog tree directive using the promise API and as discussed in #359.