Chat works with new XdmProtocol wrapper; WIP: js events