Refs #2260 Refactor Foreman::Renderer and HostTemplateHelpers into SafeRender

Adds code to parse the global & class parameters, and adds a setting (default true)
to disable this if needed. Also has some tests.

Thanks to Dmitri Dolguikh for the contributions that were squashed in!