allow some leniency, if target is undefined completely, then we can create it as an empty array to pass schema validation
refactoring of xmpp platform
move handler for close into right scope, but we still have issues with refresh