Fix path_to_mimes/2 and generate_etag/2, add tests

Add tests for these two functions and fix them.

make ct passes
Add negative test cases to the suite

make ct passes