Implement get_preset_file() in cmdutils.h and use it to factorize code