Bug 904720 and Bug 915757: Count event listeners. r=smaug,njn a=khuey