Get file format from file name during export

If a valid file format is included in the file name, use it and don't prompt the user for the format.

If the file format is not valid, the export process ends, and no file is created.
Prompt for valid file format

If the file format written in the file name isn't valid, prompt the
user for a valid format.
refactor file name & format resolution into function
Merge pull request #82 from mchelen/FixExportFileName

Get file format from file name during export