Adding onchange event and adding the throttle function for the keyup event

- Saving some JS execution by throttling the keydown event to a timer
- Adding an onchange event so that pasting through context menu also can update the style