Improve exporting/importing templates

Fixes newline issue at filenames