add template_file parameter to specify catalog

this lets you set the catalog to use when catalog_type
is set to 'template'.
Also added some tests according to catalog settings.

Change-Id: I48c3b903ceafe94f2ec31b49d617e5a9951de7f9