Detect ie 11 properly

In IE 11, the user agent string was changed and attacheEvent was also
removed. This does not directly depend on the user agent string as this
has changed a bit.