Attempt to detect IE in compatibility mode.
Based on https://gist.github.com/jasongaylord/5733469