Update lib/mime to find MIME type by extension instead of path
Improve tests