Add evil detection functionality for IE

We really shouldn't be doing browser sniffing, but for now
we have to do it to make Internet Explorer work. Eventually
(i.e. over the course of the next three months) we should get
rid of it.

Change-Id: Ia511ca9b5226d85520b57384e1b451d4d8be19a6