Fix #42, fix #43, fix #45, fix #46, fix #47, added Hooks support, added onBeforeChange option and event