Added new merge method. It can merge an update node into the graph, or add it if not present.