Ensure handlebars engine always returns a string

Handlebars can return a SafeString instance in some situations.