Added duplex version. Listens to changes in Javascript object tree and generates patches.