browser: 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: 5/8

Change-Id: Iea100c6bf34cc7de1a367423cbdc09c25051df0f
diff --git a/go/src/v.io/x/browser/runner/main.go b/go/src/v.io/x/browser/runner/main.go
index a8c8eaa..98ec54e 100644
--- a/go/src/v.io/x/browser/runner/main.go
+++ b/go/src/v.io/x/browser/runner/main.go
@@ -46,7 +46,7 @@
 }
 
 // TODO(sadovsky): Switch to using v23test.Shell.StartRootMountTable.
-var runMT = gosh.Register("runMT", func(mp string) error {
+var runMT = gosh.RegisterFunc("runMT", func(mp string) error {
 	ctx, shutdown := v23.Init()
 	defer shutdown()
 
@@ -141,7 +141,7 @@
 	ctx := sh.Ctx
 
 	// Run a mounttable for tests
-	cRoot := sh.Fn(runMT, "root")
+	cRoot := sh.FuncCmd(runMT, "root")
 	cRoot.Args = append(cRoot.Args, "--v23.tcp.protocol=wsh", fmt.Sprintf("--v23.tcp.address=%s:%d", host, port))
 	cRoot.Start()
 	exitOnError(err, "Failed to start root mount table")
@@ -152,13 +152,13 @@
 	v23.GetNamespace(ctx).SetRoots(vars["MT_NAME"])
 
 	// Run the cottage mounttable at host/cottage.
-	cCottage := sh.Fn(runMT, "cottage")
+	cCottage := sh.FuncCmd(runMT, "cottage")
 	cCottage.Args = append(cCottage.Args, "--v23.tcp.protocol=wsh", fmt.Sprintf("--v23.tcp.address=%s:%d", host, cottagePort))
 	cCottage.Start()
 	exitOnError(err, "Failed to start cottage mount table")
 
 	// run the house mounttable at host/house.
-	cHouse := sh.Fn(runMT, "house")
+	cHouse := sh.FuncCmd(runMT, "house")
 	cHouse.Args = append(cHouse.Args, "--v23.tcp.protocol=wsh", fmt.Sprintf("--v23.tcp.address=%s:%d", host, housePort))
 	cHouse.Start()
 	exitOnError(err, "Failed to start house mount table")
@@ -184,7 +184,7 @@
 		<-proxy.Closed()
 	}()
 
-	cIdentityd := sh.Fn(identitylib.TestIdentityd)
+	cIdentityd := sh.FuncCmd(identitylib.TestIdentityd)
 	cIdentityd.Args = append(cIdentityd.Args, "--v23.tcp.protocol=wsh", "--v23.tcp.address=:0", "--http-addr=localhost:0")
 	cIdentityd.Start()
 	exitOnError(err, "Failed to start identityd")