Made templating fully recursive, move templating content to separate file and added content.