[VOL-1644]  Add test cases to the Core Utils package

As part of this update some utilities which were inside the flow
decomposer file has been moved to the utils package.  Otherwise,
the code would have to be duplicated to work around package
circular dependencies.

Change-Id: I77dc6cdb23d832323e58ff6d9351db809fff30ba
diff --git a/rw_core/core/device_agent.go b/rw_core/core/device_agent.go
index d45fca6..e7089cd 100755
--- a/rw_core/core/device_agent.go
+++ b/rw_core/core/device_agent.go
@@ -290,10 +290,13 @@
 
 		}
 		// Send update to adapters
+
+		// Create two channels to receive responses from the dB and from the adapters.
+		// Do not close these channels as this function may exit on timeout before the dB or adapters get a chance
+		// to send their responses.  These channels will be garbage collected once all the responses are
+		// received
 		chAdapters := make(chan interface{})
-		defer close(chAdapters)
 		chdB := make(chan interface{})
-		defer close(chdB)
 		dType := agent.adapterMgr.getDeviceType(device.Type)
 		if !dType.AcceptsAddRemoveFlowUpdates {