fix for Safari 5.1 compatibility

It seems that Safari 5.1 (and probably everything below) for some reason doesn't have the window.CustomEvent function that is used as the basis for the MDN CustomEvent polyfill (https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent?redirectlocale=en-US&redirectslug=Web%2FAPI%2FEvent%2FCustomEvent#Browser_compatibility). It is however possible to still get the CustomEvent functionality to work consistently with the changes in this pull request (tested on OSX Lion with Safari 5.1.5 [6534.55.3]).

In addition to this fix, I added some graceful degradation handling in case the CustomEvent polyfill should fail for another reason to ensure that scripts depending on Anzeixer do not simply fail.