chat: gosh: address TODOs

More specifically:
- Eliminates Shell.Main, since it's easy enough to use
Shell.Fn and set the returned Cmd's Args
- Renames Shell.Fn to Shell.FuncCmd
- Extends Shell.{Cmd,FuncCmd} comments to explain what's
done with the given arguments
- Makes it so NewShell takes a snapshot of os.Environ() and
uses that henceforth
- Makes it so NewShell filters out any gosh env vars coming
from outside
- Renames registry.go's Fn to Func, Register to
RegisterFunc, and Call to CallFunc
- Adjusts the behavior of RegisterFunc so that names are
augmented to produce collision-resistant handles of the
form "file:line:name"
- Makes callFunc and Func.call private for now, until
there's a clear need for them to be exported
- Eliminates gosh.Run
- Renames Cmd.Shutdown (which we decided to keep) to
Cmd.Terminate
- Changes Cmd.Signal and Cmd.Terminate to fail if Wait
has been called
- Drops Cmd.Kill; if it proves necessary, we'll add a
gosh.Kill implementation of os.Signal that tells
Cmd.Signal and Cmd.Terminate to issue Process.Kill

Also, updates v23test:
- Same changes as in gosh (Fn->FuncCmd, no more Main)
- Replaces v23test.Run with TestMain (simple case) and
InitTestMain (advanced case)
- Eliminates the hack with credentials env vars

MultiPart: 6/8

Change-Id: I0e64bace584bdfbea2e8bc6fd584d8aafbc0c230
diff --git a/clients/shell/go/src/v.io/x/chat/channel_test.go b/clients/shell/go/src/v.io/x/chat/channel_test.go
index 4c233a5..63ccbc2 100644
--- a/clients/shell/go/src/v.io/x/chat/channel_test.go
+++ b/clients/shell/go/src/v.io/x/chat/channel_test.go
@@ -19,7 +19,7 @@
 )
 
 // TODO(sadovsky): Switch to using v23test.Shell.StartRootMountTable.
-var rootMT = gosh.Register("rootMT", func() error {
+var rootMT = gosh.RegisterFunc("rootMT", func() error {
 	ctx, shutdown := v23.Init()
 	defer shutdown()
 
@@ -88,7 +88,7 @@
 	defer sh.Cleanup()
 	ctx := sh.Ctx
 
-	c := sh.Fn(rootMT)
+	c := sh.FuncCmd(rootMT)
 	c.Args = append(c.Args, "--v23.tcp.address=127.0.0.1:0")
 	c.Start()
 	c.S.ExpectVar("PID")
@@ -158,7 +158,7 @@
 	defer sh.Cleanup()
 	ctx := sh.Ctx
 
-	c := sh.Fn(rootMT)
+	c := sh.FuncCmd(rootMT)
 	c.Args = append(c.Args, "--v23.tcp.address=127.0.0.1:0")
 	c.Start()
 	c.S.ExpectVar("PID")
@@ -216,5 +216,5 @@
 }
 
 func TestMain(m *testing.M) {
-	os.Exit(v23test.Run(m.Run))
+	v23test.TestMain(m)
 }