Fixes issues with trim and srcElement in IE8, and fix tests with fireEvent