Update to latest version of Smarty
Rework to use Smarty's caching correctly this time