Link mime-detection behavior to whether or not htmlOnly is set.
Update test cases for new mime sniffing capability.