Adding IE11 compatability

Since IE11 no longer contains "msie" in the useragent string it is wrongly identified as Mozilla/gecko. We must detect "trident" (the IE layout engine) instead.  I tested this with older versions of IE and it still seems to work as it did before, but it now also correctly detects IE11.