fire the 'input' event after setting input value

This is required to support angular.js apps.
If DOM elements in the browser responds to 
'oninput', the angular.js framework listens for 
this event as a cue to update data bindings.
small refactoring

cleans up event firing after setting 
input value
Merge pull request #357 from leebyrd/master

fire the 'input' event after setting input value