removed need for prependTemplateFile, added global variable $metric, added way to register additional global template variables