Switch to mime module for content-type resolution

- less code
- more supported mime-types
- less errors, like misspelled variables (line 61)