syncbase/vsync: SyncGroup membership view.

Create a view of all SyncGroup members and refresh it on a timeout.
Scan the SyncGroups in each database across all apps.

Additional fixes from previous CLs:
- Switch to using verror.
- Reuse the existing random number generator.
- Assert that a store.Transaction is passed where it is required.
- Improve some comments.

Change-Id: I69bbed808c3b91f38f8f11bef51865b38736651f
diff --git a/services/syncbase/server/app.go b/services/syncbase/server/app.go
index 1b5217d..81276f0 100644
--- a/services/syncbase/server/app.go
+++ b/services/syncbase/server/app.go
@@ -88,6 +88,17 @@
 	return d, nil
 }
 
+func (a *app) NoSQLDatabaseNames(ctx *context.T, call rpc.ServerCall) ([]string, error) {
+	// In the future this API should be replaced by one that streams the database names.
+	a.mu.Lock()
+	defer a.mu.Unlock()
+	dbNames := make([]string, 0, len(a.dbs))
+	for n := range a.dbs {
+		dbNames = append(dbNames, n)
+	}
+	return dbNames, nil
+}
+
 func (a *app) CreateNoSQLDatabase(ctx *context.T, call rpc.ServerCall, dbName string, perms access.Permissions) error {
 	// TODO(sadovsky): Crash if any step fails, and use WAL to ensure that if we
 	// crash, upon restart we execute any remaining steps before we start handling