using normalized ids for xmpp elements. Fixed logic error with order of callbacks. can emit events