Catalog tests

This is just a resubmission of #563 (see comments there).  Should be ready to go.