Added onchange event and some unit tests for it.