fixed loading of classes (checks for namespace first)
added methods for setting a template root (base path for templates)