added ability to set up templating when not using express (for error pages)