Get file format from file name during export pt 2

refactor https://github.com/jsonresume/resume-cli/pull/68/ to be more DRY