Dev catalogtree refactoring take2

This fixes the issues of #396, which was merged a bit too fast. Sorry about that.