TBR: todos: syncbase: s/yncGroup/yncgroup/

With this change, we establish a convention of treating
"syncgroup" as a single, common (non-proper) noun.

The main motivation for this change was consistency, for
a term that's used widely across our codebase and docs.

Arguments for "Syncgroup" over "SyncGroup" were:
- it's "Syncbase", not "SyncBase"
- we'd probably like to use "syncgroup" rather than
"sync_group" in snake-case text, e.g. in filenames like
"syncgroup_test.go"; using "SyncGroup" for camel-case
text would make these two inconsistent (Nick pointed
this out)
- avoids ambiguity about capitalization at the start of a
sentence vs. inside a sentence ("SyncGroup" vs.
"syncgroup"?)

(Note, I discussed this change with Bindu, Raja, and Nick
before making it.)

I mainly used 'find -exec perl -pi -e' to prepare this
change, plus manual inspection and tweaks. The main
painful part was updating lots of comments in the Syncbase
implementation to use "syncgroup" instead of "Syncgroup"
where that was the intended usage.

MultiPart: 10/11

Change-Id: I1e79f69264a436d455bc0b1488173654123b1fc3
diff --git a/browser/index.js b/browser/index.js
index 20a5059..ed6fa86 100644
--- a/browser/index.js
+++ b/browser/index.js
@@ -434,10 +434,10 @@
           }
           var sgName = disp.listIdToSgName(list._id);
           if (shared) {
-            disp.addToSyncGroupPerms(sgName, emailToBlessing(value),
+            disp.addToSyncgroupPerms(sgName, emailToBlessing(value),
                                      alertOnError);
           } else {
-            disp.createSyncGroup(sgName, [
+            disp.createSyncgroup(sgName, [
               emailToBlessing(userEmail),
               emailToBlessing(value)
             ], mtName, alertOnError);
@@ -511,7 +511,7 @@
           placeholder: 'Join list'
         }, okCancelEvents({
           ok: function(value, e) {
-            that.props.joinSyncGroup(value.trim(), alertOnError);
+            that.props.joinSyncgroup(value.trim(), alertOnError);
             e.target.value = '';
           }
         })))));
@@ -618,11 +618,11 @@
     });
   },
   // Joins the specified syncgroup and displays the associated list.
-  joinSyncGroup_: function(sgName, cb) {
+  joinSyncgroup_: function(sgName, cb) {
     var that = this;
     console.assert(this.props.dispType === DISP_TYPE_SYNCBASE);
-    disp.joinSyncGroup(sgName, function(err) {
-      // Note, joinSyncGroup is a noop (no error) if the caller is already a
+    disp.joinSyncgroup(sgName, function(err) {
+      // Note, joinSyncgroup is a noop (no error) if the caller is already a
       // member, which is the desired behavior here.
       if (err) return cb(err);
       var listId = disp.sgNameToListId(sgName);
@@ -648,7 +648,7 @@
       alertOnError(err);
       that.setState({dispInitialized: true}, function() {
         if (props.joinSgName) {
-          that.joinSyncGroup_(props.joinSgName, alertOnError);
+          that.joinSyncgroup_(props.joinSgName, alertOnError);
         }
       });
     });
@@ -756,8 +756,8 @@
           that.setListId_(listId);
           that.setState({showStatusDialog: true});
         },
-        joinSyncGroup: function(sgName, cb) {
-          that.joinSyncGroup_(sgName, cb);
+        joinSyncgroup: function(sgName, cb) {
+          that.joinSyncgroup_(sgName, cb);
         }
       }),
       h('div#tags-and-todos-pane', {key: 'tags-and-todos-pane'}, [
diff --git a/browser/syncbase_dispatcher.js b/browser/syncbase_dispatcher.js
index 1286cb1..f764fe7 100644
--- a/browser/syncbase_dispatcher.js
+++ b/browser/syncbase_dispatcher.js
@@ -59,7 +59,7 @@
     var stream = that.db_.watch(that.ctx_, that.tb_.name, '', marker, errCb);
 
     // TODO(aghassemi): Ideally the app would update its in-memory data
-    // structures directly from the watch stream, but since SyncGroup changes do
+    // structures directly from the watch stream, but since syncgroup changes do
     // not yet show up in the watch stream, it can't. See v.io/i/764.
     stream.on('data', function(change) {
       // TODO(aghassemi): fromSync ought to be change.fromSync, but due to issue
@@ -159,14 +159,14 @@
   });
 });
 
-// Returns a list of objects describing SyncGroups.
+// Returns a list of objects describing syncgroups.
 // TODO(sadovsky): Would be nice if this could be done with a single RPC.
-define('getSyncGroups_', function(ctx, cb) {
+define('getSyncgroups_', function(ctx, cb) {
   var that = this;
-  this.db_.getSyncGroupNames(ctx, function(err, sgNames) {
+  this.db_.getSyncgroupNames(ctx, function(err, sgNames) {
     if (err) return cb(err);
     async.map(sgNames, function(sgName, cb) {
-      that.getSyncGroup_(ctx, sgName, cb);
+      that.getSyncgroup_(ctx, sgName, cb);
     }, cb);
   });
 });
@@ -179,7 +179,7 @@
       that.getListsOnly_(ctx, cb);
     },
     function(cb) {
-      that.getSyncGroups_(ctx, cb);
+      that.getSyncgroups_(ctx, cb);
     }
   ], function(err, results) {
     if (err) return cb(err);
@@ -291,10 +291,10 @@
 });
 
 ////////////////////////////////////////
-// SyncGroup methods
+// Syncgroup methods
 
 // TODO(sadovsky): It's not clear from the Syncbase API how SG names should be
-// constructed, and it's also weird that db.SyncGroup(name) expects an absolute
+// constructed, and it's also weird that db.Syncgroup(name) expects an absolute
 // name. We should probably allow clients to specify DB-relative SG names.
 
 // Currently, SG names must be of the form <syncbaseName>/%%sync/<suffix>.
@@ -312,10 +312,10 @@
   return prefix + '/' + listId;
 };
 
-// Returns an object describing the SyncGroup with the given name.
+// Returns an object describing the syncgroup with the given name.
 // Currently, this object will have two fields: 'name' and 'spec'.
-define('getSyncGroup_', function(ctx, sgName, cb) {
-  var sg = this.db_.syncGroup(sgName);
+define('getSyncgroup_', function(ctx, sgName, cb) {
+  var sg = this.db_.syncgroup(sgName);
   async.parallel([
     function(cb) {
       sg.getSpec(ctx, function(err, spec, version) {
@@ -327,7 +327,7 @@
       // TODO(sadovsky): For now, in the UI we just want to show who's on the
       // ACL for a given list, so we don't bother with getMembers. On top of
       // that, currently getMembers returns a map of random Syncbase instance
-      // ids to SyncGroupMemberInfo structs, neither of which tell us anything
+      // ids to SyncgroupMemberInfo structs, neither of which tell us anything
       // useful.
       if (true) {
         process.nextTick(cb);
@@ -346,7 +346,7 @@
 
 // TODO(sadovsky): Copied from test-syncgroup.js. I have no idea whether this
 // value is appropriate.
-var MEMBER_INFO = new nosql.SyncGroupMemberInfo({
+var MEMBER_INFO = new nosql.SyncgroupMemberInfo({
   syncPriority: 8
 });
 
@@ -361,11 +361,11 @@
   ]);
 }
 
-define('createSyncGroup', function(ctx, sgName, blessings, mtName, cb) {
-  var sg = this.db_.syncGroup(sgName);
-  var spec = new nosql.SyncGroupSpec({
+define('createSyncgroup', function(ctx, sgName, blessings, mtName, cb) {
+  var sg = this.db_.syncgroup(sgName);
+  var spec = new nosql.SyncgroupSpec({
     perms: mkSgPerms(blessings),
-    prefixes: [new nosql.SyncGroupPrefix({
+    prefixes: [new nosql.SyncgroupPrefix({
       tableName: 'tb',
       rowPrefix: this.sgNameToListId(sgName)
     })],
@@ -377,13 +377,13 @@
 // TODO(sadovsky): The update to the syncgroup won't show up immediately in the
 // UIs of remote peers, since the watch stream does not include changes to
 // syncgroups. See v.io/i/764.
-define('addToSyncGroupPerms', function(ctx, sgName, blessing, cb) {
+define('addToSyncgroupPerms', function(ctx, sgName, blessing, cb) {
   var that = this;
-  var sg = this.db_.syncGroup(sgName);
+  var sg = this.db_.syncgroup(sgName);
   sg.getSpec(ctx, function(err, spec, version) {
     var blessings = spec.perms.get('Admin')['in'];
     if (_.includes(blessings, blessing)) {
-      return cb();  // addToSyncGroupPerms is idempotent
+      return cb();  // addToSyncgroupPerms is idempotent
     }
     blessings.push(blessing);
     spec.perms = mkSgPerms(blessings);
@@ -391,8 +391,8 @@
   });
 });
 
-define('joinSyncGroup', function(ctx, sgName, cb) {
-  var sg = this.db_.syncGroup(sgName);
+define('joinSyncgroup', function(ctx, sgName, cb) {
+  var sg = this.db_.syncgroup(sgName);
   sg.join(ctx, MEMBER_INFO, this.maybeEmit_(cb));
 });
 
@@ -420,7 +420,7 @@
 ////////////////////////////////////////
 // Internal helpers
 
-// TODO(aghassemi): Remove this once changes to SyncGroups are included in the
+// TODO(aghassemi): Remove this once changes to syncgroups are included in the
 // watch stream.
 SyncbaseDispatcher.prototype.maybeEmit_ = function(cb) {
   var that = this;