Renames and re-references template files with proper prefixing