Wrapped CustomEvent constructors in try...catch blocks for IE compatibility.
Added workarounds for dataset property that is not supported in IE 10 or lower.