VOL-1497 : Add more control to kv/memory access

- Added kv locking mechanism (etcd only)
- (watch) control path access whenever possible
- (watch) use a transaction for updates and merge with memory
- cleaned up vendoring
- misc changes to fix exceptions found along the way

Amendments:

- Copyright header got removed in auto-generated file
- Changed default locking to false for KV list operation
- Updated backend api to allow the passing of locking parameter

Change-Id: Ie1a55d3ca8b9d92ae71a85ce42bb22fcf1419e2c
diff --git a/db/model/merge.go b/db/model/merge.go
index b230076..c59dda4 100644
--- a/db/model/merge.go
+++ b/db/model/merge.go
@@ -90,6 +90,8 @@
 	mergeChildFunc func(Revision) Revision,
 	dryRun bool) (rev Revision, changes []ChangeTuple) {
 
+	log.Debugw("3-way-merge-request", log.Fields{"dryRun": dryRun})
+
 	var configChanged bool
 	var revsToDiscard []Revision
 
@@ -246,7 +248,7 @@
 		}
 	}
 
-	if !dryRun && len(newChildren) > 0{
+	if !dryRun && len(newChildren) > 0 {
 		if configChanged {
 			rev = srcRev
 		} else {
@@ -257,11 +259,11 @@
 			discarded.Drop("", true)
 		}
 
-		dstRev.GetBranch().GetLatest().Drop("", configChanged)
+		// FIXME: Do not discard the latest value for now
+		//dstRev.GetBranch().GetLatest().Drop("", configChanged)
 		rev = rev.UpdateAllChildren(newChildren, dstRev.GetBranch())
 
 		if configChanged {
-			// FIXME: what type of previous/latest data do we want to show? Specific node or Root
 			changes = append(changes, ChangeTuple{POST_UPDATE, dstRev.GetBranch().GetLatest().GetData(), rev.GetData()})
 		}
 		return rev, changes