added "emit", "on" and "off" functions
added new events ("link" and "unlink")