Refs #969 - Foreman-side changes for serving templates from the proxy

Needs the proxy-side PR to function.

This is a rebase of @GregSutcliffe's original https://github.com/theforeman/foreman/pull/751.
The Templates feature cannot exist in Foreman unless you copy in teh db migration from the original PR - Features are currently hardcoded on the core side (yes, i know, it's terrible)