Removed dependency on mimetypes.

Also simplified output a little bit.