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.
Given the timeframe we're in I think it's safer to not refactor Renderer here either, it can be done for 1.8 with more testing time.