Added ability to specify header and footer for template.