Improved file management

If non-existing subdir is provided it will be created
If filename already exists, it will be overwritten, or a suffix is added
to the new file, depending on option indicated in GUI