Add regression test for @wilsonpage's fix

Add regression test for @wilsonpage's fix (event listener should be rebound after last event is removed and new events are added) in pull request #10.