Replaced onmatch and onunmatch with onadd and onremove respectively
(fixes #4)