copied template.loader from Mezzanine v0.9