Fix event unbinding and add namespace support

Fixes #260 and #264