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 hosts fixtures is about to disappear entirely (#1806) so this will need rewriting to use Host factories. I can help if you need a hand - I'd rather avert conflicts now than later :)