Cache template instantiation

Seems like this is a very safe thing to cache, and cuts down on rendering time quite a bit. Open to suggestions on how to make this better (read: acceptable).