(refactor) simplified content_type retrieval

This commit changes the content_type retrieval
to use the built in method `extension` that is
provided on the Path.

It also adds a test.
I think this can be `path.extension_str().and_then(get_generated_content_type)`.

(BTW, unless you're 100% sure that the extension will be valid UTF-8 then you shouldn't use `.unwrap`... and even then, at least using `.expect("get_content_type: non-UTF8 file extension")` to help debugging if the assumption is wrong is nice.)