Add template file extensions and mimetypes, revert file types.

From #6647.