Changed the way templates are instantiated and pages served