Update JavaScript shim to correctly send direct messages to other peers