Make sure contents are a template when outputting to preview

With 2ccdf379b2de35bf2c4dd2d1b6dd5dd105b2b797, `getModuleContents` may now return a string even with `$bAllowTemplate` set to true.
This is correct behaviour but we did not expect it when rendering preview markup.