Moved most Templating classes in separate source files.