Device driver framework enhancements and CLI.

Change-Id: I5dea67620259797eff89a985718934034a86d63e
diff --git a/core/api/src/main/java/org/onosproject/net/driver/DefaultDriver.java b/core/api/src/main/java/org/onosproject/net/driver/DefaultDriver.java
index e95ddca..e7cd89e 100644
--- a/core/api/src/main/java/org/onosproject/net/driver/DefaultDriver.java
+++ b/core/api/src/main/java/org/onosproject/net/driver/DefaultDriver.java
@@ -69,15 +69,17 @@
      * @param other other driver
      * @return new driver
      */
-    DefaultDriver merge(DefaultDriver other) {
+    @Override
+    public Driver merge(Driver other) {
         // Merge the behaviours.
         ImmutableMap.Builder<Class<? extends Behaviour>, Class<? extends Behaviour>>
                 behaviours = ImmutableMap.builder();
-        behaviours.putAll(other.behaviours).putAll(this.behaviours);
+        behaviours.putAll(this.behaviours);
+        other.behaviours().forEach(b -> behaviours.put(b, other.implementation(b)));
 
         // Merge the properties.
         ImmutableMap.Builder<String, String> properties = ImmutableMap.builder();
-        properties.putAll(other.properties).putAll(this.properties);
+        properties.putAll(this.properties).putAll(other.properties());
 
         return new DefaultDriver(name, manufacturer, hwVersion, swVersion,
                                  behaviours.build(), properties.build());
@@ -109,6 +111,11 @@
     }
 
     @Override
+    public Class<? extends Behaviour> implementation(Class<? extends Behaviour> behaviour) {
+        return behaviours.get(behaviour);
+    }
+
+    @Override
     public boolean hasBehaviour(Class<? extends Behaviour> behaviourClass) {
         return behaviours.containsKey(behaviourClass);
     }