Moved from createEvent and initEvent to CustomEvent constructor

I've moved to customEvent constructor since createEvent is deprecated and didn't work on Firefox for Android.

I've used the createEvent as fallback since createEvent don't works on Android Browser (Android 4.2)

Tested on: Android Browser, Firefox for Android (including Beta) and Safari on iOS6.

In my personal experience it works better using a treshold of 5 but I didn't include that on the commit since it may be a subjective issue.