diff --git a/lib/filelocker/locker_test.go b/lib/filelocker/locker_test.go
index b58bfe2..cf483a7 100644
--- a/lib/filelocker/locker_test.go
+++ b/lib/filelocker/locker_test.go
@@ -42,7 +42,7 @@
 
 func testLockChild(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
 	// Lock the file
-	unlocker, err := Lock(args[1])
+	unlocker, err := Lock(args[0])
 	if err != nil {
 		return fmt.Errorf("Lock failed: %v", err)
 	}
diff --git a/lib/flags/flags.go b/lib/flags/flags.go
index b2c767e..241420c 100644
--- a/lib/flags/flags.go
+++ b/lib/flags/flags.go
@@ -5,6 +5,7 @@
 	"fmt"
 	"os"
 	"strings"
+	"sync"
 
 	"v.io/core/veyron/lib/flags/consts"
 )
@@ -236,12 +237,40 @@
 	return f
 }
 
+var (
+	defaultProtocol = "wsh" // GUARDED_BY listenMu
+	defaultHostPort = ":0"  // GUARDED_BY listenMu
+	listenMu        sync.RWMutex
+)
+
+// SetDefaultProtocol sets the default protocol used when --veyron.tcp.protocol is
+// not provided. It must be called before flags are parsed for it to take effect.
+func SetDefaultProtocol(protocol string) {
+	listenMu.Lock()
+	defaultProtocol = protocol
+	listenMu.Unlock()
+}
+
+// SetDefaultHostPort sets the default host and port used when --veyron.tcp.address
+// is not provided. It must be called before flags are parsed for it to take effect.
+func SetDefaultHostPort(s string) {
+	listenMu.Lock()
+	defaultHostPort = s
+	listenMu.Unlock()
+}
+
 // createAndRegisterListenFlags creates and registers the ListenFlags
 // group with the supplied flag.FlagSet.
 func createAndRegisterListenFlags(fs *flag.FlagSet) *ListenFlags {
+	listenMu.RLock()
+	defer listenMu.RUnlock()
+	var ipHostPortFlag IPHostPortFlag
+	if err := ipHostPortFlag.Set(defaultHostPort); err != nil {
+		panic(err)
+	}
 	f := &ListenFlags{
-		protocol:  TCPProtocolFlag{"wsh"},
-		addresses: ipHostPortFlagVar{validator: IPHostPortFlag{Port: "0"}},
+		protocol:  TCPProtocolFlag{defaultProtocol},
+		addresses: ipHostPortFlagVar{validator: ipHostPortFlag},
 	}
 	f.addresses.flags = f
 
diff --git a/lib/modules/core/core_test.go b/lib/modules/core/core_test.go
index a0e03e8..9f2b0b5 100644
--- a/lib/modules/core/core_test.go
+++ b/lib/modules/core/core_test.go
@@ -55,7 +55,7 @@
 }
 
 func testArgs(args ...string) []string {
-	var targs = []string{"--", "--veyron.tcp.address=127.0.0.1:0"}
+	var targs = []string{"--veyron.tcp.address=127.0.0.1:0"}
 	return append(targs, args...)
 }
 
diff --git a/lib/modules/core/echo.go b/lib/modules/core/echo.go
index 92160b9..8ba8f5f 100644
--- a/lib/modules/core/echo.go
+++ b/lib/modules/core/echo.go
@@ -50,13 +50,6 @@
 	ctx, shutdown := veyron2.Init()
 	defer shutdown()
 
-	fl, args, err := parseListenFlags(args)
-	if err != nil {
-		return fmt.Errorf("failed to parse args: %s", err)
-	}
-	if err := checkArgs(args, 2, "<message> <name>"); err != nil {
-		return err
-	}
 	id, mp := args[0], args[1]
 	disp := &treeDispatcher{id: id}
 	server, err := veyron2.NewServer(ctx)
@@ -64,7 +57,7 @@
 		return err
 	}
 	defer server.Stop()
-	eps, err := server.Listen(initListenSpec(fl))
+	eps, err := server.Listen(veyron2.GetListenSpec(ctx))
 	if err != nil {
 		return err
 	}
@@ -83,7 +76,6 @@
 	ctx, shutdown := veyron2.Init()
 	defer shutdown()
 
-	args = args[1:]
 	name := args[0]
 	args = args[1:]
 	client := veyron2.GetClient(ctx)
diff --git a/lib/modules/core/mounttable.go b/lib/modules/core/mounttable.go
index 6046c91..00acb04 100644
--- a/lib/modules/core/mounttable.go
+++ b/lib/modules/core/mounttable.go
@@ -34,11 +34,7 @@
 	ctx, shutdown := veyron2.Init()
 	defer shutdown()
 
-	fl, args, err := parseListenFlags(args)
-	if err != nil {
-		return fmt.Errorf("failed to parse args: %s", err)
-	}
-	lspec := initListenSpec(fl)
+	lspec := veyron2.GetListenSpec(ctx)
 	server, err := veyron2.NewServer(ctx, options.ServesMountTable(true))
 	if err != nil {
 		return fmt.Errorf("root failed: %v", err)
@@ -74,7 +70,6 @@
 	defer shutdown()
 
 	details := false
-	args = args[1:] // skip over command name
 	if len(args) > 0 && args[0] == "-l" {
 		details = true
 		args = args[1:]
diff --git a/lib/modules/core/proxy.go b/lib/modules/core/proxy.go
index 79d826b..691d1ca 100644
--- a/lib/modules/core/proxy.go
+++ b/lib/modules/core/proxy.go
@@ -22,18 +22,17 @@
 	ctx, shutdown := veyron2.Init()
 	defer shutdown()
 
-	fl, args, err := parseListenFlags(args)
-	if err != nil {
-		return fmt.Errorf("failed to parse args: %s", err)
-	}
 	expected := len(args)
 	rid, err := naming.NewRoutingID()
 	if err != nil {
 		return err
 	}
-	lf := fl.ListenFlags()
 
-	proxy, err := proxy.New(rid, veyron2.GetPrincipal(ctx), lf.Addrs[0].Protocol, lf.Addrs[0].Address, "")
+	listenSpec := veyron2.GetListenSpec(ctx)
+	protocol := listenSpec.Addrs[0].Protocol
+	addr := listenSpec.Addrs[0].Address
+
+	proxy, err := proxy.New(rid, veyron2.GetPrincipal(ctx), protocol, addr, "")
 	if err != nil {
 		return err
 	}
diff --git a/lib/modules/core/test_identityd.go b/lib/modules/core/test_identityd.go
index f1bc19a..793824a 100644
--- a/lib/modules/core/test_identityd.go
+++ b/lib/modules/core/test_identityd.go
@@ -10,7 +10,6 @@
 
 	"v.io/core/veyron2"
 
-	"v.io/core/veyron/lib/flags"
 	"v.io/core/veyron/lib/modules"
 
 	"v.io/core/veyron/services/identity/auditor"
@@ -23,46 +22,41 @@
 )
 
 var (
-	ifs *flag.FlagSet = flag.NewFlagSet("test_identityd", flag.ContinueOnError)
-
-	googleDomain = ifs.String("google_domain", "", "An optional domain name. When set, only email addresses from this domain are allowed to authenticate via Google OAuth")
-	host         = ifs.String("host", "localhost", "Hostname the HTTP server listens on. This can be the name of the host running the webserver, but if running behind a NAT or load balancer, this should be the host name that clients will connect to. For example, if set to 'x.com', Veyron identities will have the IssuerName set to 'x.com' and clients can expect to find the root name and public key of the signer at 'x.com/blessing-root'.")
-	httpaddr     = ifs.String("httpaddr", "localhost:0", "Address on which the HTTP server listens on.")
-	tlsconfig    = ifs.String("tlsconfig", "", "Comma-separated list of TLS certificate and private key files. This must be provided.")
-
-	ifl *flags.Flags = flags.CreateAndRegister(ifs, flags.Listen)
+	googleDomain = flag.CommandLine.String("google_domain", "", "An optional domain name. When set, only email addresses from this domain are allowed to authenticate via Google OAuth")
+	host         = flag.CommandLine.String("host", "localhost", "Hostname the HTTP server listens on. This can be the name of the host running the webserver, but if running behind a NAT or load balancer, this should be the host name that clients will connect to. For example, if set to 'x.com', Veyron identities will have the IssuerName set to 'x.com' and clients can expect to find the root name and public key of the signer at 'x.com/blessing-root'.")
+	httpaddr     = flag.CommandLine.String("httpaddr", "localhost:0", "Address on which the HTTP server listens on.")
+	tlsconfig    = flag.CommandLine.String("tlsconfig", "", "Comma-separated list of TLS certificate and private key files. This must be provided.")
 )
 
 func init() {
-	modules.RegisterChild(TestIdentitydCommand, usage(ifs), startTestIdentityd)
+	modules.RegisterChild(TestIdentitydCommand, usage(flag.CommandLine), startTestIdentityd)
 }
 
 func startTestIdentityd(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	if err := parseFlags(ifl, args); err != nil {
-		return fmt.Errorf("failed to parse args: %s", err)
-	}
-
 	// Duration to use for tls cert and blessing duration.
 	duration := 365 * 24 * time.Hour
 
+	ctx, shutdown := veyron2.Init()
+	defer shutdown()
+
 	// If no tlsconfig has been provided, generate new cert and key and use them.
-	if ifs.Lookup("tlsconfig").Value.String() == "" {
+	if flag.CommandLine.Lookup("tlsconfig").Value.String() == "" {
 		certFile, keyFile, err := util.WriteCertAndKey(*host, duration)
 		if err != nil {
 			return fmt.Errorf("Could not write cert and key: %v", err)
 		}
-		if err := ifs.Set("tlsconfig", certFile+","+keyFile); err != nil {
+		if err := flag.CommandLine.Set("tlsconfig", certFile+","+keyFile); err != nil {
 			return fmt.Errorf("Could not set tlsconfig: %v", err)
 		}
 	}
 
 	// Pick a free port if httpaddr flag is not set.
-	// We can't use :0 here, because the identity server calles
-	// http.ListenAndServeTLS, which block, leaving us with no way to tell
+	// We can't use :0 here, because the identity server calls
+	// http.ListenAndServeTLS, which blocks, leaving us with no way to tell
 	// what port the server is running on.  Hence, we must pass in an
 	// actual port so we know where the server is running.
-	if ifs.Lookup("httpaddr").Value.String() == ifs.Lookup("httpaddr").DefValue {
-		if err := ifs.Set("httpaddr", "localhost:"+freePort()); err != nil {
+	if flag.CommandLine.Lookup("httpaddr").Value.String() == flag.CommandLine.Lookup("httpaddr").DefValue {
+		if err := flag.CommandLine.Set("httpaddr", "localhost:"+freePort()); err != nil {
 			return fmt.Errorf("Could not set httpaddr: %v", err)
 		}
 	}
@@ -86,10 +80,7 @@
 		params,
 		caveats.NewMockCaveatSelector())
 
-	l := initListenSpec(ifl)
-
-	ctx, shutdown := veyron2.Init()
-	defer shutdown()
+	l := veyron2.GetListenSpec(ctx)
 
 	_, veyronEPs, externalHttpaddress := s.Listen(ctx, &l, *host, *httpaddr, *tlsconfig)
 
diff --git a/lib/modules/core/util.go b/lib/modules/core/util.go
index 3d16bb7..08c53f3 100644
--- a/lib/modules/core/util.go
+++ b/lib/modules/core/util.go
@@ -4,36 +4,8 @@
 	"flag"
 	"fmt"
 	"strings"
-
-	"v.io/core/veyron2/ipc"
-
-	"v.io/core/veyron/lib/flags"
 )
 
-func parseFlags(fl *flags.Flags, args []string) error {
-	if len(args) == 0 {
-		return nil
-	}
-	return fl.Parse(args[1:], nil)
-}
-
-// parseListenFlags parses the given args using just the flags and env vars
-// defined in the veyron/lib/flags package.
-func parseListenFlags(args []string) (*flags.Flags, []string, error) {
-	fs := flag.NewFlagSet("modules/core", flag.ContinueOnError)
-	fl := flags.CreateAndRegister(fs, flags.Listen)
-	err := parseFlags(fl, args)
-	return fl, fl.Args(), err
-}
-
-func initListenSpec(fl *flags.Flags) ipc.ListenSpec {
-	lf := fl.ListenFlags()
-	return ipc.ListenSpec{
-		Addrs: ipc.ListenAddrs(lf.Addrs),
-		Proxy: lf.ListenProxy,
-	}
-}
-
 // checkArgs checks for the expected number of args in args. A negative
 // value means at least that number of args are expected.
 func checkArgs(args []string, expected int, usage string) error {
diff --git a/lib/modules/core/wspr.go b/lib/modules/core/wspr.go
index 42db213..8e38a84 100644
--- a/lib/modules/core/wspr.go
+++ b/lib/modules/core/wspr.go
@@ -5,7 +5,6 @@
 	"fmt"
 	"io"
 
-	"v.io/core/veyron/lib/flags"
 	"v.io/core/veyron/lib/modules"
 	"v.io/wspr/veyron/services/wsprd/wspr"
 
@@ -13,29 +12,19 @@
 )
 
 var (
-	// TODO(sadovsky): We should restructure things so that we can avoid
-	// duplicating code between subprocess command impls and actual main()'s.
-	fs *flag.FlagSet = flag.NewFlagSet("wspr", flag.ContinueOnError)
-
-	port   *int    = fs.Int("port", 0, "Port to listen on.")
-	identd *string = fs.String("identd", "", "identd server name. Must be set.")
-
-	fl *flags.Flags = flags.CreateAndRegister(fs, flags.Listen)
+	port   *int    = flag.CommandLine.Int("port", 0, "Port to listen on.")
+	identd *string = flag.CommandLine.String("identd", "", "identd server name. Must be set.")
 )
 
 func init() {
-	modules.RegisterChild(WSPRCommand, usage(fs), startWSPR)
+	modules.RegisterChild(WSPRCommand, usage(flag.CommandLine), startWSPR)
 }
 
 func startWSPR(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	if err := parseFlags(fl, args); err != nil {
-		return fmt.Errorf("failed to parse args: %s", err)
-	}
-
 	ctx, shutdown := veyron2.Init()
 	defer shutdown()
 
-	l := initListenSpec(fl)
+	l := veyron2.GetListenSpec(ctx)
 	proxy := wspr.NewWSPR(ctx, *port, &l, *identd, nil)
 	defer proxy.Shutdown()
 
diff --git a/lib/modules/examples_test.go b/lib/modules/examples_test.go
index cb97b64..e4ab42a 100644
--- a/lib/modules/examples_test.go
+++ b/lib/modules/examples_test.go
@@ -36,9 +36,8 @@
 	h, _ := sh.Start("echo", nil, "a", "b")
 	h.Shutdown(os.Stdout, os.Stderr)
 	// Output:
-	// 0: echo
-	// 1: a
-	// 2: b
+	// 0: a
+	// 1: b
 }
 
 func ExampleDispatchAndExit() {
@@ -51,7 +50,6 @@
 	h, _ := sh.Start("echo", nil, "c", "d")
 	h.Shutdown(os.Stdout, os.Stderr)
 	// Output:
-	// 0: echo
-	// 1: c
-	// 2: d
+	// 0: c
+	// 1: d
 }
diff --git a/lib/modules/func.go b/lib/modules/func.go
index 5c5bc4c..24f1fde 100644
--- a/lib/modules/func.go
+++ b/lib/modules/func.go
@@ -88,7 +88,7 @@
 		cenv := envSliceToMap(env)
 		vlog.VI(1).Infof("Start: %q args: %v", fh.name, args)
 		vlog.VI(2).Infof("Start: %q env: %v", fh.name, cenv)
-		err := main(stdin, stdout, stderr, cenv, args...)
+		err := main(stdin, stdout, stderr, cenv, args[1:]...)
 		if err != nil {
 			fmt.Fprintf(stderr, "%s\n", err)
 		}
diff --git a/lib/modules/modules_test.go b/lib/modules/modules_test.go
index 277fb2f..a5c989d 100644
--- a/lib/modules/modules_test.go
+++ b/lib/modules/modules_test.go
@@ -62,7 +62,7 @@
 }
 
 func PrintFromEnv(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	for _, a := range args[1:] {
+	for _, a := range args {
 		if v := env[a]; len(v) > 0 {
 			fmt.Fprintf(stdout, "%s\n", a+"="+v)
 		} else {
@@ -286,7 +286,7 @@
 	var stdoutBuf bytes.Buffer
 	var stderrBuf bytes.Buffer
 	sh.Cleanup(&stdoutBuf, &stderrBuf)
-	stdoutOutput, stderrOutput := "stdout: "+command+"\n", "stderr: "+command+"\n"
+	var stdoutOutput, stderrOutput string
 	for _, a := range args {
 		stdoutOutput += fmt.Sprintf("stdout: %s\n", a)
 		stderrOutput += fmt.Sprintf("stderr: %s\n", a)
diff --git a/lib/modules/registry.go b/lib/modules/registry.go
index 8331f9c..f473d14 100644
--- a/lib/modules/registry.go
+++ b/lib/modules/registry.go
@@ -200,8 +200,8 @@
 		}
 	}(os.Getppid())
 
-	args := append([]string{command}, flag.Args()...)
-	return m.main(os.Stdin, os.Stdout, os.Stderr, envSliceToMap(os.Environ()), args...)
+	flag.Parse()
+	return m.main(os.Stdin, os.Stdout, os.Stderr, envSliceToMap(os.Environ()), flag.Args()...)
 }
 
 // WaitForEOF returns when a read on its io.Reader parameter returns io.EOF
diff --git a/lib/testutil/glob.go b/lib/testutil/glob.go
index 84d7ec7..0c6fd23 100644
--- a/lib/testutil/glob.go
+++ b/lib/testutil/glob.go
@@ -35,5 +35,6 @@
 	if ferr := call.Finish(&err); ferr != nil {
 		err = ferr
 	}
+
 	return results, err
 }
diff --git a/lib/testutil/integration/util.go b/lib/testutil/integration/util.go
index da7db76..82870e2 100644
--- a/lib/testutil/integration/util.go
+++ b/lib/testutil/integration/util.go
@@ -548,7 +548,7 @@
 // returns a handle for the started command along with the object name
 // of the mount table.
 func startRootMT(shell *modules.Shell) (modules.Handle, string, error) {
-	handle, err := shell.Start(core.RootMTCommand, nil, "--", "--veyron.tcp.address=127.0.0.1:0")
+	handle, err := shell.Start(core.RootMTCommand, nil, "--veyron.tcp.address=127.0.0.1:0")
 	if err != nil {
 		return nil, "", err
 	}
diff --git a/profiles/genericinit.go b/profiles/genericinit.go
index b071c31..936cd2f 100644
--- a/profiles/genericinit.go
+++ b/profiles/genericinit.go
@@ -24,7 +24,9 @@
 func init() {
 	veyron2.RegisterProfileInit(Init)
 	stream.RegisterUnknownProtocol("wsh", websocket.HybridDial, websocket.HybridListener)
-	commonFlags = flags.CreateAndRegister(flag.CommandLine, flags.Runtime)
+	flags.SetDefaultProtocol("tcp")
+	flags.SetDefaultHostPort("127.0.0.1:0")
+	commonFlags = flags.CreateAndRegister(flag.CommandLine, flags.Runtime, flags.Listen)
 }
 
 func Init(ctx *context.T) (veyron2.Runtime, *context.T, veyron2.Shutdown, error) {
@@ -34,13 +36,17 @@
 
 	ac := appcycle.New()
 
+	lf := commonFlags.ListenFlags()
+	listenSpec := ipc.ListenSpec{
+		Addrs:          ipc.ListenAddrs(lf.Addrs),
+		AddressChooser: internal.IPAddressChooser,
+		Proxy:          lf.ListenProxy,
+	}
+
 	runtime, ctx, shutdown, err := grt.Init(ctx,
 		ac,
 		nil,
-		&ipc.ListenSpec{
-			Addrs:          ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}},
-			AddressChooser: internal.IPAddressChooser,
-		},
+		&listenSpec,
 		commonFlags.RuntimeFlags(),
 		nil)
 	if err != nil {
diff --git a/runtimes/google/ipc/client_test.go b/runtimes/google/ipc/client_test.go
index b91f8c0..548db9a 100644
--- a/runtimes/google/ipc/client_test.go
+++ b/runtimes/google/ipc/client_test.go
@@ -36,17 +36,12 @@
 	return ctx, shutdown
 }
 
-func testArgs(args ...string) []string {
-	var targs = []string{"--", "--veyron.tcp.address=127.0.0.1:0"}
-	return append(targs, args...)
-}
-
 func runMountTable(t *testing.T, ctx *context.T) (*modules.Shell, func()) {
 	sh, err := modules.NewShell(ctx, nil)
 	if err != nil {
 		t.Fatalf("unexpected error: %s", err)
 	}
-	root, err := sh.Start(core.RootMTCommand, nil, testArgs()...)
+	root, err := sh.Start(core.RootMTCommand, nil)
 	if err != nil {
 		t.Fatalf("unexpected error for root mt: %s", err)
 	}
@@ -109,7 +104,7 @@
 
 	sh, fn := runMountTable(t, ctx)
 	defer fn()
-	srv, err := sh.Start(core.EchoServerCommand, nil, testArgs("echoServer", "echoServer")...)
+	srv, err := sh.Start(core.EchoServerCommand, nil, "echoServer", "echoServer")
 	if err != nil {
 		t.Fatalf("unexpected error: %s", err)
 	}
@@ -172,7 +167,7 @@
 	defer shutdown()
 	veyron2.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
 
-	name := args[1]
+	name := args[0]
 	call, err := veyron2.GetClient(ctx).StartCall(ctx, name, "Ping", nil)
 	if err != nil {
 		fmt.Errorf("unexpected error: %s", err)
@@ -334,7 +329,7 @@
 	// backoff of some minutes.
 	startServer := func() {
 		time.Sleep(10 * time.Millisecond)
-		srv, _ := sh.Start(core.EchoServerCommand, nil, testArgs("message", name)...)
+		srv, _ := sh.Start(core.EchoServerCommand, nil, "message", name)
 		s := expect.NewSession(t, srv.Stdout(), time.Minute)
 		s.ExpectVar("PID")
 		s.ExpectVar("NAME")
@@ -495,7 +490,7 @@
 		t.Fatalf("unexpected error: %s", err)
 	}
 	defer sh.Cleanup(os.Stderr, os.Stderr)
-	server, err := sh.Start(core.EchoServerCommand, nil, "--", "--veyron.tcp.address=127.0.0.1:0", "mymessage", "")
+	server, err := sh.Start(core.EchoServerCommand, nil, "--veyron.tcp.address=127.0.0.1:0", "mymessage", "")
 	if err != nil {
 		t.Fatalf("unexpected error: %s", err)
 	}
@@ -536,7 +531,7 @@
 	// Resurrect the server with the same address, verify client
 	// re-establishes the connection. This is racy if another
 	// process grabs the port.
-	server, err = sh.Start(core.EchoServerCommand, nil, "--", "--veyron.tcp.address="+ep.Address, "mymessage again", "")
+	server, err = sh.Start(core.EchoServerCommand, nil, "--veyron.tcp.address="+ep.Address, "mymessage again", "")
 	if err != nil {
 		t.Fatalf("unexpected error: %s", err)
 	}
diff --git a/runtimes/google/ipc/full_test.go b/runtimes/google/ipc/full_test.go
index 2db17e4..c7e5252 100644
--- a/runtimes/google/ipc/full_test.go
+++ b/runtimes/google/ipc/full_test.go
@@ -6,6 +6,7 @@
 	"fmt"
 	"io"
 	"net"
+	"os"
 	"path/filepath"
 	"reflect"
 	"runtime"
@@ -1745,6 +1746,10 @@
 }
 
 func init() {
-	testutil.Init()
 	vdl.Register(fakeTimeCaveat(0))
 }
+
+func TestMain(m *testing.M) {
+	testutil.Init()
+	os.Exit(m.Run())
+}
diff --git a/runtimes/google/ipc/proxy_test.go b/runtimes/google/ipc/proxy_test.go
new file mode 100644
index 0000000..08123c6
--- /dev/null
+++ b/runtimes/google/ipc/proxy_test.go
@@ -0,0 +1,330 @@
+package ipc_test
+
+import (
+	"fmt"
+	"os"
+	"reflect"
+	"sort"
+	"strings"
+	"testing"
+	"time"
+
+	"v.io/core/veyron2/context"
+	"v.io/core/veyron2/ipc"
+	"v.io/core/veyron2/naming"
+	"v.io/core/veyron2/security"
+	verror "v.io/core/veyron2/verror2"
+	"v.io/core/veyron2/vtrace"
+
+	"v.io/core/veyron/lib/expect"
+	"v.io/core/veyron/lib/flags"
+	"v.io/core/veyron/lib/modules"
+	"v.io/core/veyron/lib/modules/core"
+	tsecurity "v.io/core/veyron/lib/testutil/security"
+	_ "v.io/core/veyron/profiles"
+	iipc "v.io/core/veyron/runtimes/google/ipc"
+	imanager "v.io/core/veyron/runtimes/google/ipc/stream/manager"
+	"v.io/core/veyron/runtimes/google/ipc/stream/vc"
+	inaming "v.io/core/veyron/runtimes/google/naming"
+	tnaming "v.io/core/veyron/runtimes/google/testing/mocks/naming"
+	ivtrace "v.io/core/veyron/runtimes/google/vtrace"
+)
+
+func testContext() *context.T {
+	ctx, _ := context.WithTimeout(testContextWithoutDeadline(), 20*time.Second)
+	return ctx
+}
+
+func testContextWithoutDeadline() *context.T {
+	ctx, _ := context.RootContext()
+	ctx, err := ivtrace.Init(ctx, flags.VtraceFlags{})
+	if err != nil {
+		panic(err)
+	}
+	ctx, _ = vtrace.SetNewTrace(ctx)
+	return ctx
+}
+
+type testServer struct{}
+
+func (*testServer) Echo(ctx ipc.ServerContext, arg string) string {
+	return fmt.Sprintf("method:%q,suffix:%q,arg:%q", ctx.Method(), ctx.Suffix(), arg)
+}
+
+type testServerAuthorizer struct{}
+
+func (testServerAuthorizer) Authorize(c security.Context) error {
+	return nil
+}
+
+type testServerDisp struct{ server interface{} }
+
+func (t testServerDisp) Lookup(suffix string) (interface{}, security.Authorizer, error) {
+	return t.server, testServerAuthorizer{}, nil
+}
+
+type proxyHandle struct {
+	ns    naming.Namespace
+	sh    *modules.Shell
+	proxy modules.Handle
+	name  string
+}
+
+func (h *proxyHandle) Start(t *testing.T, ctx *context.T, args ...string) error {
+	sh, err := modules.NewShell(nil, nil)
+	if err != nil {
+		t.Fatalf("unexpected error: %s", err)
+	}
+	h.sh = sh
+	p, err := sh.Start(core.ProxyServerCommand, nil, args...)
+	if err != nil {
+		t.Fatalf("unexpected error: %s", err)
+	}
+	h.proxy = p
+	s := expect.NewSession(t, p.Stdout(), time.Minute)
+	s.ReadLine()
+	h.name = s.ExpectVar("PROXY_NAME")
+	if len(h.name) == 0 {
+		t.Fatalf("failed to get PROXY_NAME from proxyd")
+	}
+	return h.ns.Mount(ctx, "proxy", h.name, time.Hour)
+}
+
+func (h *proxyHandle) Stop(ctx *context.T) error {
+	defer h.sh.Cleanup(os.Stderr, os.Stderr)
+	if err := h.proxy.Shutdown(os.Stderr, os.Stderr); err != nil {
+		return err
+	}
+	if len(h.name) == 0 {
+		return nil
+	}
+	return h.ns.Unmount(ctx, "proxy", h.name)
+}
+
+func TestProxyOnly(t *testing.T) {
+	listenSpec := ipc.ListenSpec{Proxy: "proxy"}
+	testProxy(t, listenSpec)
+}
+
+func TestProxy(t *testing.T) {
+	proxyListenSpec := ipc.ListenSpec{Addrs: ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}}}
+	proxyListenSpec.Proxy = "proxy"
+	testProxy(t, proxyListenSpec)
+}
+
+func TestWSProxy(t *testing.T) {
+	proxyListenSpec := ipc.ListenSpec{Addrs: ipc.ListenAddrs{{"tcp", "127.0.0.1:0"}}}
+	proxyListenSpec.Proxy = "proxy"
+	// The proxy uses websockets only, but the server is using tcp.
+	testProxy(t, proxyListenSpec, "--veyron.tcp.protocol=ws")
+}
+
+func testProxy(t *testing.T, spec ipc.ListenSpec, args ...string) {
+	sm := imanager.InternalNew(naming.FixedRoutingID(0x555555555))
+	defer sm.Shutdown()
+	ns := tnaming.NewSimpleNamespace()
+	client, err := iipc.InternalNewClient(sm, ns, vc.LocalPrincipal{tsecurity.NewPrincipal("client")})
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer client.Close()
+	ctx := testContext()
+	server, err := iipc.InternalNewServer(ctx, sm, ns, nil, vc.LocalPrincipal{tsecurity.NewPrincipal("server")})
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer server.Stop()
+
+	// If no address is specified then we'll only 'listen' via
+	// the proxy.
+	hasLocalListener := len(spec.Addrs) > 0 && len(spec.Addrs[0].Address) != 0
+
+	name := "mountpoint/server/suffix"
+	makeCall := func() (string, error) {
+		ctx, _ := context.WithDeadline(testContext(), time.Now().Add(5*time.Second))
+		// Let's fail fast so that the tests don't take as long to run.
+		call, err := client.StartCall(ctx, name, "Echo", []interface{}{"batman"})
+		if err != nil {
+			// proxy is down, we should return here/.... prepend
+			// the error with a well known string so that we can test for that.
+			return "", fmt.Errorf("RESOLVE: %s", err)
+		}
+		var result string
+		if err = call.Finish(&result); err != nil {
+			return "", err
+		}
+		return result, nil
+	}
+	proxy := &proxyHandle{ns: ns}
+	if err := proxy.Start(t, ctx, args...); err != nil {
+		t.Fatal(err)
+	}
+	defer proxy.Stop(ctx)
+	addrs := verifyMount(t, ctx, ns, spec.Proxy)
+	if len(addrs) != 1 {
+		t.Fatalf("failed to lookup proxy")
+	}
+
+	eps, err := server.Listen(spec)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if err := server.ServeDispatcher("mountpoint/server", testServerDisp{&testServer{}}); err != nil {
+		t.Fatal(err)
+	}
+
+	// Proxy connections are started asynchronously, so we need to wait..
+	waitForMountTable := func(ch chan int, expect int) {
+		then := time.Now().Add(time.Minute)
+		for {
+			me, err := ns.Resolve(ctx, name)
+			if err == nil && len(me.Servers) == expect {
+				ch <- 1
+				return
+			}
+			if time.Now().After(then) {
+				t.Fatalf("timed out")
+			}
+			time.Sleep(100 * time.Millisecond)
+		}
+	}
+	waitForServerStatus := func(ch chan int, proxy string) {
+		then := time.Now().Add(time.Minute)
+		for {
+			status := server.Status()
+			if len(status.Proxies) == 1 && status.Proxies[0].Proxy == proxy {
+				ch <- 2
+				return
+			}
+			if time.Now().After(then) {
+				t.Fatalf("timed out")
+			}
+			time.Sleep(100 * time.Millisecond)
+		}
+	}
+	proxyEP, _ := naming.SplitAddressName(addrs[0])
+	proxiedEP, err := inaming.NewEndpoint(proxyEP)
+	if err != nil {
+		t.Fatalf("unexpected error for %q: %s", proxyEP, err)
+	}
+	proxiedEP.RID = naming.FixedRoutingID(0x555555555)
+	expectedNames := []string{naming.JoinAddressName(proxiedEP.String(), "suffix")}
+	if hasLocalListener {
+		expectedNames = append(expectedNames, naming.JoinAddressName(eps[0].String(), "suffix"))
+	}
+
+	// Proxy connetions are created asynchronously, so we wait for the
+	// expected number of endpoints to appear for the specified service name.
+	ch := make(chan int, 2)
+	go waitForMountTable(ch, len(expectedNames))
+	go waitForServerStatus(ch, spec.Proxy)
+	select {
+	case <-time.After(time.Minute):
+		t.Fatalf("timedout waiting for two entries in the mount table and server status")
+	case i := <-ch:
+		select {
+		case <-time.After(time.Minute):
+			t.Fatalf("timedout waiting for two entries in the mount table or server status")
+		case j := <-ch:
+			if !((i == 1 && j == 2) || (i == 2 && j == 1)) {
+				t.Fatalf("unexpected return values from waiters")
+			}
+		}
+	}
+
+	status := server.Status()
+	if got, want := status.Proxies[0].Endpoint, proxiedEP; !reflect.DeepEqual(got, want) {
+		t.Fatalf("got %q, want %q", got, want)
+	}
+
+	got := []string{}
+	for _, s := range verifyMount(t, ctx, ns, name) {
+		got = append(got, s)
+	}
+	sort.Strings(got)
+	sort.Strings(expectedNames)
+	if !reflect.DeepEqual(got, expectedNames) {
+		t.Errorf("got %v, want %v", got, expectedNames)
+	}
+
+	if hasLocalListener {
+		// Listen will publish both the local and proxied endpoint with the
+		// mount table, given that we're trying to test the proxy, we remove
+		// the local endpoint from the mount table entry!  We have to remove both
+		// the tcp and the websocket address.
+		sep := eps[0].String()
+		ns.Unmount(ctx, "mountpoint/server", sep)
+	}
+
+	addrs = verifyMount(t, ctx, ns, name)
+	if len(addrs) != 1 {
+		t.Fatalf("failed to lookup proxy: addrs %v", addrs)
+	}
+
+	// Proxied endpoint should be published and RPC should succeed (through proxy)
+	const expected = `method:"Echo",suffix:"suffix",arg:"batman"`
+	if result, err := makeCall(); result != expected || err != nil {
+		t.Fatalf("Got (%v, %v) want (%v, nil)", result, err, expected)
+	}
+	// Proxy dies, calls should fail and the name should be unmounted.
+	if err := proxy.Stop(ctx); err != nil {
+		t.Fatal(err)
+	}
+
+	if result, err := makeCall(); err == nil || (!strings.HasPrefix(err.Error(), "RESOLVE") && !strings.Contains(err.Error(), "EOF")) {
+		t.Fatalf(`Got (%v, %v) want ("", "RESOLVE: <err>" or "EOF") as proxy is down`, result, err)
+	}
+
+	for {
+		if _, err := ns.Resolve(ctx, name); err != nil {
+			break
+		}
+		time.Sleep(10 * time.Millisecond)
+	}
+	verifyMountMissing(t, ctx, ns, name)
+
+	status = server.Status()
+	if len(status.Proxies) != 1 || status.Proxies[0].Proxy != spec.Proxy || !verror.Is(status.Proxies[0].Error, verror.NoServers.ID) {
+		t.Fatalf("proxy status is incorrect: %v", status.Proxies)
+	}
+
+	// Proxy restarts, calls should eventually start succeeding.
+	if err := proxy.Start(t, ctx, args...); err != nil {
+		t.Fatal(err)
+	}
+
+	retries := 0
+	for {
+		if result, err := makeCall(); err == nil {
+			if result != expected {
+				t.Errorf("Got (%v, %v) want (%v, nil)", result, err, expected)
+			}
+			break
+		} else {
+			retries++
+			if retries > 10 {
+				t.Fatalf("Failed after 10 attempts: err: %s", err)
+			}
+		}
+	}
+}
+
+func verifyMount(t *testing.T, ctx *context.T, ns naming.Namespace, name string) []string {
+	me, err := ns.Resolve(ctx, name)
+	if err != nil {
+		t.Errorf("%s not found in mounttable", name)
+		return nil
+	}
+	return me.Names()
+}
+
+func verifyMountMissing(t *testing.T, ctx *context.T, ns naming.Namespace, name string) {
+	if me, err := ns.Resolve(ctx, name); err == nil {
+		names := me.Names()
+		t.Errorf("%s not supposed to be found in mounttable; got %d servers instead: %v", name, len(names), names)
+	}
+}
+
+func TestHelperProcess(t *testing.T) {
+	modules.DispatchInTest()
+}
diff --git a/runtimes/google/ipc/resolve_test.go b/runtimes/google/ipc/resolve_test.go
index ece505c..d7b5261 100644
--- a/runtimes/google/ipc/resolve_test.go
+++ b/runtimes/google/ipc/resolve_test.go
@@ -17,7 +17,7 @@
 )
 
 func startMT(t *testing.T, sh *modules.Shell) string {
-	h, err := sh.Start(core.RootMTCommand, nil, "--", "--veyron.tcp.address=127.0.0.1:0")
+	h, err := sh.Start(core.RootMTCommand, nil, "--veyron.tcp.address=127.0.0.1:0")
 	if err != nil {
 		t.Fatalf("unexpected error for root mt: %s", err)
 	}
diff --git a/runtimes/google/ipc/results_store_test.go b/runtimes/google/ipc/results_store_test.go
index 5c31331..c41bdec 100644
--- a/runtimes/google/ipc/results_store_test.go
+++ b/runtimes/google/ipc/results_store_test.go
@@ -8,8 +8,6 @@
 	"v.io/core/veyron/lib/testutil"
 )
 
-func init() { testutil.Init() }
-
 func randomKeys() []uint64 {
 	n := (testutil.Rand.Intn(256*10) / 10) + 256
 	k := make([]uint64, n)
diff --git a/runtimes/google/ipc/server_test.go b/runtimes/google/ipc/server_test.go
index d83367a..728a4bf 100644
--- a/runtimes/google/ipc/server_test.go
+++ b/runtimes/google/ipc/server_test.go
@@ -1,12 +1,9 @@
 package ipc
 
 import (
-	"fmt"
 	"net"
-	"os"
 	"reflect"
 	"sort"
-	"strings"
 	"testing"
 	"time"
 
@@ -18,9 +15,6 @@
 	verror "v.io/core/veyron2/verror2"
 	"v.io/core/veyron2/vlog"
 
-	"v.io/core/veyron/lib/expect"
-	"v.io/core/veyron/lib/modules"
-	"v.io/core/veyron/lib/modules/core"
 	"v.io/core/veyron/lib/netstate"
 	tsecurity "v.io/core/veyron/lib/testutil/security"
 	imanager "v.io/core/veyron/runtimes/google/ipc/stream/manager"
@@ -90,252 +84,6 @@
 	}
 }
 
-type proxyHandle struct {
-	ns    naming.Namespace
-	sh    *modules.Shell
-	proxy modules.Handle
-	name  string
-}
-
-func (h *proxyHandle) Start(t *testing.T, args ...string) error {
-	sh, err := modules.NewShell(nil, nil)
-	if err != nil {
-		t.Fatalf("unexpected error: %s", err)
-	}
-	h.sh = sh
-	p, err := sh.Start(core.ProxyServerCommand, nil, args...)
-	if err != nil {
-		t.Fatalf("unexpected error: %s", err)
-	}
-	h.proxy = p
-	s := expect.NewSession(t, p.Stdout(), time.Minute)
-	s.ReadLine()
-	h.name = s.ExpectVar("PROXY_NAME")
-	if len(h.name) == 0 {
-		t.Fatalf("failed to get PROXY_NAME from proxyd")
-	}
-	return h.ns.Mount(testContext(), "proxy", h.name, time.Hour)
-}
-
-func (h *proxyHandle) Stop() error {
-	defer h.sh.Cleanup(os.Stderr, os.Stderr)
-	if err := h.proxy.Shutdown(os.Stderr, os.Stderr); err != nil {
-		return err
-	}
-	if len(h.name) == 0 {
-		return nil
-	}
-	return h.ns.Unmount(testContext(), "proxy", h.name)
-}
-
-func TestProxyOnly(t *testing.T) {
-	listenSpec := ipc.ListenSpec{Proxy: "proxy"}
-	testProxy(t, listenSpec, "--", "--veyron.tcp.address=127.0.0.1:0")
-}
-
-func TestProxy(t *testing.T) {
-	proxyListenSpec := listenSpec
-	proxyListenSpec.Proxy = "proxy"
-	testProxy(t, proxyListenSpec, "--", "--veyron.tcp.address=127.0.0.1:0")
-}
-
-func TestWSProxy(t *testing.T) {
-	proxyListenSpec := listenSpec
-	proxyListenSpec.Proxy = "proxy"
-	// The proxy uses websockets only, but the server is using tcp.
-	testProxy(t, proxyListenSpec, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0")
-}
-
-func testProxy(t *testing.T, spec ipc.ListenSpec, args ...string) {
-	sm := imanager.InternalNew(naming.FixedRoutingID(0x555555555))
-	defer sm.Shutdown()
-	ns := tnaming.NewSimpleNamespace()
-	client, err := InternalNewClient(sm, ns, vc.LocalPrincipal{tsecurity.NewPrincipal("client")})
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer client.Close()
-	ctx := testContext()
-	server, err := testInternalNewServer(ctx, sm, ns, vc.LocalPrincipal{tsecurity.NewPrincipal("server")})
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer server.Stop()
-
-	// If no address is specified then we'll only 'listen' via
-	// the proxy.
-	hasLocalListener := len(spec.Addrs) > 0 && len(spec.Addrs[0].Address) != 0
-
-	name := "mountpoint/server/suffix"
-	makeCall := func() (string, error) {
-		ctx, _ := context.WithDeadline(testContext(), time.Now().Add(5*time.Second))
-		// Let's fail fast so that the tests don't take as long to run.
-		call, err := client.StartCall(ctx, name, "Echo", []interface{}{"batman"})
-		if err != nil {
-			// proxy is down, we should return here/.... prepend
-			// the error with a well known string so that we can test for that.
-			return "", fmt.Errorf("RESOLVE: %s", err)
-		}
-		var result string
-		if err = call.Finish(&result); err != nil {
-			return "", err
-		}
-		return result, nil
-	}
-	proxy := &proxyHandle{ns: ns}
-	if err := proxy.Start(t, args...); err != nil {
-		t.Fatal(err)
-	}
-	defer proxy.Stop()
-	addrs := verifyMount(t, ns, spec.Proxy)
-	if len(addrs) != 1 {
-		t.Fatalf("failed to lookup proxy")
-	}
-
-	eps, err := server.Listen(spec)
-	if err != nil {
-		t.Fatal(err)
-	}
-	if err := server.ServeDispatcher("mountpoint/server", testServerDisp{&testServer{}}); err != nil {
-		t.Fatal(err)
-	}
-
-	// Proxy connections are started asynchronously, so we need to wait..
-	waitForMountTable := func(ch chan int, expect int) {
-		then := time.Now().Add(time.Minute)
-		for {
-			me, err := ns.Resolve(testContext(), name)
-			if err == nil && len(me.Servers) == expect {
-				ch <- 1
-				return
-			}
-			if time.Now().After(then) {
-				t.Fatalf("timed out")
-			}
-			time.Sleep(100 * time.Millisecond)
-		}
-	}
-	waitForServerStatus := func(ch chan int, proxy string) {
-		then := time.Now().Add(time.Minute)
-		for {
-			status := server.Status()
-			if len(status.Proxies) == 1 && status.Proxies[0].Proxy == proxy {
-				ch <- 2
-				return
-			}
-			if time.Now().After(then) {
-				t.Fatalf("timed out")
-			}
-			time.Sleep(100 * time.Millisecond)
-		}
-	}
-	proxyEP, _ := naming.SplitAddressName(addrs[0])
-	proxiedEP, err := inaming.NewEndpoint(proxyEP)
-	if err != nil {
-		t.Fatalf("unexpected error for %q: %s", proxyEP, err)
-	}
-	proxiedEP.RID = naming.FixedRoutingID(0x555555555)
-	expectedNames := []string{naming.JoinAddressName(proxiedEP.String(), "suffix")}
-	if hasLocalListener {
-		expectedNames = append(expectedNames, naming.JoinAddressName(eps[0].String(), "suffix"))
-	}
-
-	// Proxy connetions are created asynchronously, so we wait for the
-	// expected number of endpoints to appear for the specified service name.
-	ch := make(chan int, 2)
-	go waitForMountTable(ch, len(expectedNames))
-	go waitForServerStatus(ch, spec.Proxy)
-	select {
-	case <-time.After(time.Minute):
-		t.Fatalf("timedout waiting for two entries in the mount table and server status")
-	case i := <-ch:
-		select {
-		case <-time.After(time.Minute):
-			t.Fatalf("timedout waiting for two entries in the mount table or server status")
-		case j := <-ch:
-			if !((i == 1 && j == 2) || (i == 2 && j == 1)) {
-				t.Fatalf("unexpected return values from waiters")
-			}
-		}
-	}
-
-	status := server.Status()
-	if got, want := status.Proxies[0].Endpoint, proxiedEP; !reflect.DeepEqual(got, want) {
-		t.Fatalf("got %q, want %q", got, want)
-	}
-
-	got := []string{}
-	for _, s := range verifyMount(t, ns, name) {
-		got = append(got, s)
-	}
-	sort.Strings(got)
-	sort.Strings(expectedNames)
-	if !reflect.DeepEqual(got, expectedNames) {
-		t.Errorf("got %v, want %v", got, expectedNames)
-	}
-
-	if hasLocalListener {
-		// Listen will publish both the local and proxied endpoint with the
-		// mount table, given that we're trying to test the proxy, we remove
-		// the local endpoint from the mount table entry!  We have to remove both
-		// the tcp and the websocket address.
-		sep := eps[0].String()
-		ns.Unmount(testContext(), "mountpoint/server", sep)
-	}
-
-	addrs = verifyMount(t, ns, name)
-	if len(addrs) != 1 {
-		t.Fatalf("failed to lookup proxy: addrs %v", addrs)
-	}
-
-	// Proxied endpoint should be published and RPC should succeed (through proxy)
-	const expected = `method:"Echo",suffix:"suffix",arg:"batman"`
-	if result, err := makeCall(); result != expected || err != nil {
-		t.Fatalf("Got (%v, %v) want (%v, nil)", result, err, expected)
-	}
-	// Proxy dies, calls should fail and the name should be unmounted.
-	if err := proxy.Stop(); err != nil {
-		t.Fatal(err)
-	}
-
-	if result, err := makeCall(); err == nil || (!strings.HasPrefix(err.Error(), "RESOLVE") && !strings.Contains(err.Error(), "EOF")) {
-		t.Fatalf(`Got (%v, %v) want ("", "RESOLVE: <err>" or "EOF") as proxy is down`, result, err)
-	}
-
-	for {
-		if _, err := ns.Resolve(testContext(), name); err != nil {
-			break
-		}
-		time.Sleep(10 * time.Millisecond)
-	}
-	verifyMountMissing(t, ns, name)
-
-	status = server.Status()
-	if len(status.Proxies) != 1 || status.Proxies[0].Proxy != spec.Proxy || !verror.Is(status.Proxies[0].Error, verror.NoServers.ID) {
-		t.Fatalf("proxy status is incorrect: %v", status.Proxies)
-	}
-
-	// Proxy restarts, calls should eventually start succeeding.
-	if err := proxy.Start(t, args...); err != nil {
-		t.Fatal(err)
-	}
-
-	retries := 0
-	for {
-		if result, err := makeCall(); err == nil {
-			if result != expected {
-				t.Errorf("Got (%v, %v) want (%v, nil)", result, err, expected)
-			}
-			break
-		} else {
-			retries++
-			if retries > 10 {
-				t.Fatalf("Failed after 10 attempts: err: %s", err)
-			}
-		}
-	}
-}
-
 func TestServerArgs(t *testing.T) {
 	sm := imanager.InternalNew(naming.FixedRoutingID(0x555555555))
 	defer sm.Shutdown()
@@ -382,11 +130,12 @@
 }
 
 func TestServerStatus(t *testing.T) {
+	ctx := testContext()
 	sm := imanager.InternalNew(naming.FixedRoutingID(0x555555555))
 	defer sm.Shutdown()
 	ns := tnaming.NewSimpleNamespace()
 	principal := vc.LocalPrincipal{tsecurity.NewPrincipal("testServerStatus")}
-	server, err := testInternalNewServer(testContext(), sm, ns, principal)
+	server, err := testInternalNewServer(ctx, sm, ns, principal)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -414,12 +163,12 @@
 	progress := make(chan error)
 
 	client, err := InternalNewClient(sm, ns, principal)
-	makeCall := func() {
-		call, err := client.StartCall(testContext(), "test", "Hang", nil)
+	makeCall := func(ctx *context.T) {
+		call, err := client.StartCall(ctx, "test", "Hang", nil)
 		progress <- err
 		progress <- call.Finish()
 	}
-	go makeCall()
+	go makeCall(ctx)
 
 	// Wait for RPC to start
 	if err := <-progress; err != nil {
@@ -473,6 +222,7 @@
 	sm := imanager.InternalNew(naming.FixedRoutingID(0x555555555))
 	defer sm.Shutdown()
 	ns := tnaming.NewSimpleNamespace()
+	ctx := testContext()
 
 	expectBadState := func(err error) {
 		if !verror.Is(err, verror.BadState.ID) {
@@ -486,7 +236,7 @@
 		}
 	}
 
-	server, err := testInternalNewServer(testContext(), sm, ns)
+	server, err := testInternalNewServer(ctx, sm, ns)
 	expectNoError(err)
 	defer server.Stop()
 
@@ -873,8 +623,3 @@
 	}
 
 }
-
-// Required by modules framework.
-func TestHelperProcess(t *testing.T) {
-	modules.DispatchInTest()
-}
diff --git a/runtimes/google/ipc/signature_test.go b/runtimes/google/ipc/signature_test.go
index bd54d06..7dcc056 100644
--- a/runtimes/google/ipc/signature_test.go
+++ b/runtimes/google/ipc/signature_test.go
@@ -17,8 +17,6 @@
 	_ "v.io/core/veyron/profiles"
 )
 
-func init() { testutil.Init() }
-
 func startSigServer(ctx *context.T, sig sigImpl) (string, func(), error) {
 	server, err := veyron2.NewServer(ctx)
 	if err != nil {
diff --git a/runtimes/google/ipc/stream/manager/manager_test.go b/runtimes/google/ipc/stream/manager/manager_test.go
index e1fb7b4..861b3f4 100644
--- a/runtimes/google/ipc/stream/manager/manager_test.go
+++ b/runtimes/google/ipc/stream/manager/manager_test.go
@@ -555,7 +555,7 @@
 
 func runServer(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
 	server := InternalNew(naming.FixedRoutingID(0x55555555))
-	_, ep, err := server.Listen(args[1], args[2])
+	_, ep, err := server.Listen(args[0], args[1])
 	if err != nil {
 		fmt.Fprintln(stderr, err)
 		return err
diff --git a/runtimes/google/ipc/stream/proxy/proxy_test.go b/runtimes/google/ipc/stream/proxy/proxy_test.go
index 8fd3b8c..9d23ab4 100644
--- a/runtimes/google/ipc/stream/proxy/proxy_test.go
+++ b/runtimes/google/ipc/stream/proxy/proxy_test.go
@@ -4,6 +4,7 @@
 	"bytes"
 	"fmt"
 	"io"
+	"os"
 	"reflect"
 	"strings"
 	"testing"
@@ -19,7 +20,10 @@
 	"v.io/core/veyron/runtimes/google/ipc/stream/vc"
 )
 
-func init() { testutil.Init() }
+func TestMain(m *testing.M) {
+	testutil.Init()
+	os.Exit(m.Run())
+}
 
 func TestProxy(t *testing.T) {
 	proxy, err := proxy.New(naming.FixedRoutingID(0xbbbbbbbbbbbbbbbb), nil, "tcp", "127.0.0.1:0", "")
diff --git a/runtimes/google/ipc/stream/vc/vc_test.go b/runtimes/google/ipc/stream/vc/vc_test.go
index aa6e129..05f4edd 100644
--- a/runtimes/google/ipc/stream/vc/vc_test.go
+++ b/runtimes/google/ipc/stream/vc/vc_test.go
@@ -7,6 +7,7 @@
 	"fmt"
 	"io"
 	"net"
+	"os"
 	"reflect"
 	"runtime"
 	"strings"
@@ -29,7 +30,10 @@
 	"v.io/core/veyron2/security"
 )
 
-func init() { testutil.Init() }
+func TestMain(m *testing.M) {
+	testutil.Init()
+	os.Exit(m.Run())
+}
 
 const (
 	// Convenience alias to avoid conflicts between the package name "vc" and variables called "vc".
diff --git a/runtimes/google/ipc/stream/vif/vif_test.go b/runtimes/google/ipc/stream/vif/vif_test.go
index 0ba3a12..232f985 100644
--- a/runtimes/google/ipc/stream/vif/vif_test.go
+++ b/runtimes/google/ipc/stream/vif/vif_test.go
@@ -9,6 +9,7 @@
 	"fmt"
 	"io"
 	"net"
+	"os"
 	"reflect"
 	"runtime"
 	"sort"
@@ -27,7 +28,10 @@
 	"v.io/core/veyron2/naming"
 )
 
-func init() { testutil.Init() }
+func TestMain(m *testing.M) {
+	testutil.Init()
+	os.Exit(m.Run())
+}
 
 func newPrincipal(defaultBlessing string) vc.LocalPrincipal {
 	return vc.LocalPrincipal{tsecurity.NewPrincipal("defaultBlessing")}
diff --git a/runtimes/google/ipc/testutil_test.go b/runtimes/google/ipc/testutil_test.go
index 1011dd6..01f9444 100644
--- a/runtimes/google/ipc/testutil_test.go
+++ b/runtimes/google/ipc/testutil_test.go
@@ -6,12 +6,8 @@
 
 	"v.io/core/veyron2/security"
 	"v.io/core/veyron2/verror2"
-
-	"v.io/core/veyron/lib/testutil"
 )
 
-func init() { testutil.Init() }
-
 func makeResultPtrs(ins []interface{}) []interface{} {
 	outs := make([]interface{}, len(ins))
 	for ix, in := range ins {
diff --git a/runtimes/google/rt/rt_test.go b/runtimes/google/rt/rt_test.go
index aaebf45..0935d28 100644
--- a/runtimes/google/rt/rt_test.go
+++ b/runtimes/google/rt/rt_test.go
@@ -151,7 +151,7 @@
 	if err != nil {
 		return err
 	}
-	if _, err := sh.Start("principal", nil, args[1:]...); err != nil {
+	if _, err := sh.Start("principal", nil, args...); err != nil {
 		return err
 	}
 	// Cleanup copies the output of sh to these Writers.
diff --git a/services/mgmt/application/impl/acl_test.go b/services/mgmt/application/impl/acl_test.go
index c16dd3f..aae2619 100644
--- a/services/mgmt/application/impl/acl_test.go
+++ b/services/mgmt/application/impl/acl_test.go
@@ -42,7 +42,6 @@
 }
 
 func appRepository(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	args = args[1:]
 	if len(args) < 2 {
 		vlog.Fatalf("repository expected at least name and store arguments and optionally ACL flags per TaggedACLMapFromFlag")
 	}
diff --git a/services/mgmt/binary/impl/acl_test.go b/services/mgmt/binary/impl/acl_test.go
index 67e468b..7f81a0f 100644
--- a/services/mgmt/binary/impl/acl_test.go
+++ b/services/mgmt/binary/impl/acl_test.go
@@ -40,7 +40,6 @@
 }
 
 func binaryd(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	args = args[1:]
 	if len(args) < 2 {
 		vlog.Fatalf("binaryd expected at least name and store arguments and optionally ACL flags per TaggedACLMapFromFlag")
 	}
diff --git a/services/mgmt/device/impl/impl_test.go b/services/mgmt/device/impl/impl_test.go
index 74e7291..79957c6 100644
--- a/services/mgmt/device/impl/impl_test.go
+++ b/services/mgmt/device/impl/impl_test.go
@@ -79,13 +79,17 @@
 	modules.RegisterChild(execScriptCmd, "", execScript)
 	modules.RegisterChild(deviceManagerCmd, "", deviceManager)
 	modules.RegisterChild(appCmd, "", app)
-	testutil.Init()
 
 	if modules.IsModulesProcess() {
 		return
 	}
 }
 
+func TestMain(m *testing.M) {
+	testutil.Init()
+	os.Exit(m.Run())
+}
+
 // TestHelperProcess is the entrypoint for the modules commands in a
 // a test subprocess.
 func TestHelperProcess(t *testing.T) {
@@ -107,7 +111,6 @@
 
 // execScript launches the script passed as argument.
 func execScript(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	args = args[1:]
 	if want, got := 1, len(args); want != got {
 		vlog.Fatalf("execScript expected %d arguments, got %d instead", want, got)
 	}
@@ -134,7 +137,6 @@
 func deviceManager(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
 	ctx, shutdown := testutil.InitForTest()
 
-	args = args[1:]
 	if len(args) == 0 {
 		vlog.Fatalf("deviceManager expected at least an argument")
 	}
@@ -257,7 +259,6 @@
 
 	veyron2.GetNamespace(ctx).CacheCtl(naming.DisableCache(true))
 
-	args = args[1:]
 	if expected, got := 1, len(args); expected != got {
 		vlog.Fatalf("Unexpected number of arguments: expected %d, got %d", expected, got)
 	}
diff --git a/services/mgmt/lib/testutil/modules.go b/services/mgmt/lib/testutil/modules.go
index 23aa53e..dcfecf4 100644
--- a/services/mgmt/lib/testutil/modules.go
+++ b/services/mgmt/lib/testutil/modules.go
@@ -31,7 +31,7 @@
 
 // StartRootMT sets up a root mount table for tests.
 func StartRootMT(t *testing.T, sh *modules.Shell) (string, modules.Handle) {
-	h, err := sh.Start(core.RootMTCommand, nil, "--", "--veyron.tcp.address=127.0.0.1:0")
+	h, err := sh.Start(core.RootMTCommand, nil, "--veyron.tcp.address=127.0.0.1:0")
 	if err != nil {
 		t.Fatalf("failed to start root mount table: %s", err)
 	}
diff --git a/tools/naming/simulator/shell_functions.go b/tools/naming/simulator/shell_functions.go
index 552635b..5a8f899 100644
--- a/tools/naming/simulator/shell_functions.go
+++ b/tools/naming/simulator/shell_functions.go
@@ -43,11 +43,11 @@
 }
 
 func mountServer(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	if err := checkArgs(args[1:], -3, "<mount point> <server> <ttl> [M][R]"); err != nil {
+	if err := checkArgs(args, -3, "<mount point> <server> <ttl> [M][R]"); err != nil {
 		return err
 	}
 	var opts []naming.MountOpt
-	for _, arg := range args[4:] {
+	for _, arg := range args[3:] {
 		for _, c := range arg {
 			switch c {
 			case 'R':
@@ -57,7 +57,7 @@
 			}
 		}
 	}
-	mp, server, ttlstr := args[1], args[2], args[3]
+	mp, server, ttlstr := args[0], args[1], args[2]
 	ttl, err := time.ParseDuration(ttlstr)
 	if err != nil {
 		return fmt.Errorf("failed to parse time from %q", ttlstr)
@@ -71,7 +71,7 @@
 }
 
 func namespaceCache(stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	if err := checkArgs(args[1:], 1, "on|off"); err != nil {
+	if err := checkArgs(args, 1, "on|off"); err != nil {
 		return err
 	}
 	disable := true
@@ -90,10 +90,10 @@
 type resolver func(ctx *context.T, name string, opts ...naming.ResolveOpt) (me *naming.MountEntry, err error)
 
 func resolve(fn resolver, stdin io.Reader, stdout, stderr io.Writer, env map[string]string, args ...string) error {
-	if err := checkArgs(args[1:], 1, "<name>"); err != nil {
+	if err := checkArgs(args, 1, "<name>"); err != nil {
 		return err
 	}
-	name := args[1]
+	name := args[0]
 	me, err := fn(ctx, name)
 	if err != nil {
 		fmt.Fprintf(stdout, "RN=0\n")
diff --git a/tools/servicerunner/main.go b/tools/servicerunner/main.go
index 3e0b345..0631399 100644
--- a/tools/servicerunner/main.go
+++ b/tools/servicerunner/main.go
@@ -55,19 +55,12 @@
 }
 
 func main() {
-	ctx, shutdown := veyron2.Init()
-
 	if modules.IsModulesProcess() {
-		// TODO(suharshs): This is a hack and we should find a better way to parse flags in the modules.
-		// This is needed because the modules commands call veyron2.Init and multiple runtimes cannot
-		// be initialized simultaneously.
-		// In addition the modules read their args from flag.Args() (all flags after "--") which means
-		// the flags must still be parsed before calling modules.Dispatch(). Thus moving veyron2.Init
-		// below this clause solves nothing.
-		shutdown()
 		panicOnError(modules.Dispatch())
 		return
 	}
+
+	ctx, shutdown := veyron2.Init()
 	defer shutdown()
 
 	vars := map[string]string{}
@@ -78,7 +71,7 @@
 	}
 	defer sh.Cleanup(os.Stderr, os.Stderr)
 
-	h, err := sh.Start(core.RootMTCommand, nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0")
+	h, err := sh.Start(core.RootMTCommand, nil, "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0")
 	panicOnError(err)
 	panicOnError(updateVars(h, vars, "MT_NAME"))
 
@@ -90,15 +83,15 @@
 
 	// NOTE(sadovsky): The proxyd binary requires --protocol and --address flags
 	// while the proxyd command instead uses ListenSpec flags.
-	h, err = sh.Start(core.ProxyServerCommand, nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "test/proxy")
+	h, err = sh.Start(core.ProxyServerCommand, nil, "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "test/proxy")
 	panicOnError(err)
 	panicOnError(updateVars(h, vars, "PROXY_NAME"))
 
-	h, err = sh.Start(core.WSPRCommand, nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "--veyron.proxy=test/proxy", "--identd=test/identd")
+	h, err = sh.Start(core.WSPRCommand, nil, "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "--veyron.proxy=test/proxy", "--identd=test/identd")
 	panicOnError(err)
 	panicOnError(updateVars(h, vars, "WSPR_ADDR"))
 
-	h, err = sh.Start(core.TestIdentitydCommand, nil, "--", "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "--veyron.proxy=test/proxy", "--host=localhost", "--httpaddr=localhost:0")
+	h, err = sh.Start(core.TestIdentitydCommand, nil, "--veyron.tcp.protocol=ws", "--veyron.tcp.address=127.0.0.1:0", "--veyron.proxy=test/proxy", "--host=localhost", "--httpaddr=localhost:0")
 	panicOnError(err)
 	panicOnError(updateVars(h, vars, "TEST_IDENTITYD_NAME", "TEST_IDENTITYD_HTTP_ADDR"))
 
