Added delegation through "on" and "off" events

Added undelegation and support for this and delegation when using "on" and "off" methods.