Move extension and mime type guessing to file format class