Moved some code from templates.class.php to libtemplate module