Refactor mime file identification into File.

Use long option names in commands where avaliable.