Unsubscribe from events on unmount

Fixes #234