added tree.onOpen() and tree.onClose() event emitters. ex: tree.onOpen = function() { do something when tree is opened };