Moved OPTIONAL MATCH to use the new IfOrElseIterator
Added locking for MERGE for relationships