Use event constructors to create onchange and click events

Dispatching just the onchange event doesn't call the click event handlers on the input checkbox. Also, AngularJS updates the model values in these click event handlers. 

This change triggers a click event in addition to the change event. It also uses the Event constructor for instead of using deprecated createEvent API.