templater: resurrect cache of engine instance
The engine-level cache was effectively disabled at 48289eafb37d "templater:
drop extension point of engine classes (API)" by mistake, which made template
rendering quite slow.
Spotted by Martin von Zweigbergk.
templater: extract template loader to separate class
This avoids reference cycle in the subsequent patch:
templater -> _proc -> templater.load -> templater
The templater class will be a thin wrapper around the loader and the engine.