use correct function arguments
these should be Addon Metadata, and not Addon Metadata Reader
remove extraneous line, correct comments referring to extensions.rdf
remove non-working observer version
use processNextEvent to wait until the datasource is built
clean up debugging output and unused code