Fix resolveMode's handling of MIME types in name fields

Also configure the htmlmixed option to pass through xml-mode-specific
options to its inner xml mode.

Issue #2265