added option for gateway page template name, changed parseUrl function to return rendered page to prevent issues with render hooks and prependTemplateFile, appendTemplateFile