Lots of changes. Catalog support added.