Refactor and Provisioning templates

Refactoring some of the resources which contain common auth.
Also adding support for the new resource config_template (Provisioning
templates)