builds catalog tree from directory structure