Rearrange steps in MIME type sniffing algorithm for logic.
Remove unnecessary undefined checks.