Clean up topo2 initialization.  (WIP)

Change-Id: I417800019a5ebdf90da0f29ef11e7c05a4999b77
diff --git a/web/gui/src/main/webapp/app/fw/svg/svgUtil.js b/web/gui/src/main/webapp/app/fw/svg/svgUtil.js
index 60a8be1..8b1c499 100644
--- a/web/gui/src/main/webapp/app/fw/svg/svgUtil.js
+++ b/web/gui/src/main/webapp/app/fw/svg/svgUtil.js
@@ -154,6 +154,7 @@
             .attr('in', String);
     }
 
+    // deprecated -- we'll use something else to highlight instances for affinity
     function loadGlowDefs(defs) {
         loadGlow(defs, 0.0, 0.0, 0.7, 'blue-glow');
         loadGlow(defs, 1.0, 1.0, 0.3, 'yellow-glow');
diff --git a/web/gui/src/main/webapp/app/fw/util/prefs.js b/web/gui/src/main/webapp/app/fw/util/prefs.js
index 16f2607..1cf590b 100644
--- a/web/gui/src/main/webapp/app/fw/util/prefs.js
+++ b/web/gui/src/main/webapp/app/fw/util/prefs.js
@@ -77,7 +77,17 @@
         cache[name] = obj;
         wss.sendEvent('updatePrefReq', { key: name, value: obj });
     }
-    
+
+    // merge preferences:
+    // The assumption here is that obj is a sparse object, and that the
+    //  defined keys should overwrite the corresponding values, but any
+    //  existing keys that are NOT explicitly defined here should be left
+    //  alone (not deleted).
+    function mergePrefs(name, obj) {
+        var merged = cache[name] || {};
+        setPrefs(name, angular.extend(merged, obj));
+    }
+
     function updatePrefs(data) {
         cache = data;
         listeners.forEach(function (lsnr) { lsnr(); });
@@ -114,6 +124,7 @@
                 getPrefs: getPrefs,
                 asNumbers: asNumbers,
                 setPrefs: setPrefs,
+                mergePrefs: mergePrefs,
                 addListener: addListener,
                 removeListener: removeListener
             };