MDL-37641 files: Improve file name suggestion and performance
MDL-37641 files: Tests for draftfile_exists and get_unused_filename