Simplified dispatchEvent and fixed custom event firing for IE9+ and standard compliant browsers

TODO: Custom events still can't be fired under IE<=8 because fireEvent doesn't work for event types that the browser doesn't recognize.