Template changes

Whole bunch of changes of the template views directory structure.

Made a fix to Template.php