Cleanup template loaders

These changes are very nice. They will definitely simplify some of the patches I've worked on. I'm happy about having a locmem loader for testing.

Will the locmem loader be documented?

Also, I didn't know you could pass args through the TEMPLATE_LOADER setting like this. Is that an official api? The docs don't currently mention this that I'm aware of.