veyron2/vdl: Refactor go imports logic.

[NOTE: Real changes are under veyron2/vdl/..., everything else is
 mostly just vdl updates]

This CL refactors the logic for go imports in the vdl tool.  It
is a pre-requisite for the upcoming native type support, which is
necessary for the standard "time" package.

All dependency tracking should be performed in the codegen
modules, rather than in the vdl compiler.  The reasoning is
because dependency requirements are different for each codegen
language, and it's hard to come up with general-purpose rules.

In this CL we only implement the new dependency tracking /
imports mechanism for go.  Eventually all codegen languages will
implement their own mechanism, and we'll be able to remove the
common imports logic.

As a side-effect, we get nicer generated code; rather than having
special local package names like "__ipc", we just use the default
in most cases.  If there is a collision, we simply pick a
non-conflicting name.

MultiPart: 1/6
Change-Id: I715bf9170fa2bedd00eccc340feccdb460cd519c
diff --git a/services/mgmt/device/config.vdl.go b/services/mgmt/device/config.vdl.go
index 1a14ccb..978ed96 100644
--- a/services/mgmt/device/config.vdl.go
+++ b/services/mgmt/device/config.vdl.go
@@ -4,10 +4,10 @@
 package device
 
 import (
-	// The non-user imports are prefixed with "__" to prevent collisions.
-	__veyron2 "v.io/core/veyron2"
-	__context "v.io/core/veyron2/context"
-	__ipc "v.io/core/veyron2/ipc"
+	// VDL system imports
+	"v.io/core/veyron2"
+	"v.io/core/veyron2/context"
+	"v.io/core/veyron2/ipc"
 )
 
 // ConfigClientMethods is the client interface
@@ -16,20 +16,20 @@
 // Config is an RPC API to the config service.
 type ConfigClientMethods interface {
 	// Set sets the value for key.
-	Set(ctx *__context.T, key string, value string, opts ...__ipc.CallOpt) error
+	Set(ctx *context.T, key string, value string, opts ...ipc.CallOpt) error
 }
 
 // ConfigClientStub adds universal methods to ConfigClientMethods.
 type ConfigClientStub interface {
 	ConfigClientMethods
-	__ipc.UniversalServiceMethods
+	ipc.UniversalServiceMethods
 }
 
 // ConfigClient returns a client stub for Config.
-func ConfigClient(name string, opts ...__ipc.BindOpt) ConfigClientStub {
-	var client __ipc.Client
+func ConfigClient(name string, opts ...ipc.BindOpt) ConfigClientStub {
+	var client ipc.Client
 	for _, opt := range opts {
-		if clientOpt, ok := opt.(__ipc.Client); ok {
+		if clientOpt, ok := opt.(ipc.Client); ok {
 			client = clientOpt
 		}
 	}
@@ -38,18 +38,18 @@
 
 type implConfigClientStub struct {
 	name   string
-	client __ipc.Client
+	client ipc.Client
 }
 
-func (c implConfigClientStub) c(ctx *__context.T) __ipc.Client {
+func (c implConfigClientStub) c(ctx *context.T) ipc.Client {
 	if c.client != nil {
 		return c.client
 	}
-	return __veyron2.GetClient(ctx)
+	return veyron2.GetClient(ctx)
 }
 
-func (c implConfigClientStub) Set(ctx *__context.T, i0 string, i1 string, opts ...__ipc.CallOpt) (err error) {
-	var call __ipc.Call
+func (c implConfigClientStub) Set(ctx *context.T, i0 string, i1 string, opts ...ipc.CallOpt) (err error) {
+	var call ipc.Call
 	if call, err = c.c(ctx).StartCall(ctx, c.name, "Set", []interface{}{i0, i1}, opts...); err != nil {
 		return
 	}
@@ -65,7 +65,7 @@
 // Config is an RPC API to the config service.
 type ConfigServerMethods interface {
 	// Set sets the value for key.
-	Set(ctx __ipc.ServerContext, key string, value string) error
+	Set(ctx ipc.ServerContext, key string, value string) error
 }
 
 // ConfigServerStubMethods is the server interface containing
@@ -78,7 +78,7 @@
 type ConfigServerStub interface {
 	ConfigServerStubMethods
 	// Describe the Config interfaces.
-	Describe__() []__ipc.InterfaceDesc
+	Describe__() []ipc.InterfaceDesc
 }
 
 // ConfigServer returns a server stub for Config.
@@ -90,9 +90,9 @@
 	}
 	// Initialize GlobState; always check the stub itself first, to handle the
 	// case where the user has the Glob method defined in their VDL source.
-	if gs := __ipc.NewGlobState(stub); gs != nil {
+	if gs := ipc.NewGlobState(stub); gs != nil {
 		stub.gs = gs
-	} else if gs := __ipc.NewGlobState(impl); gs != nil {
+	} else if gs := ipc.NewGlobState(impl); gs != nil {
 		stub.gs = gs
 	}
 	return stub
@@ -100,38 +100,38 @@
 
 type implConfigServerStub struct {
 	impl ConfigServerMethods
-	gs   *__ipc.GlobState
+	gs   *ipc.GlobState
 }
 
-func (s implConfigServerStub) Set(ctx __ipc.ServerContext, i0 string, i1 string) error {
+func (s implConfigServerStub) Set(ctx ipc.ServerContext, i0 string, i1 string) error {
 	return s.impl.Set(ctx, i0, i1)
 }
 
-func (s implConfigServerStub) Globber() *__ipc.GlobState {
+func (s implConfigServerStub) Globber() *ipc.GlobState {
 	return s.gs
 }
 
-func (s implConfigServerStub) Describe__() []__ipc.InterfaceDesc {
-	return []__ipc.InterfaceDesc{ConfigDesc}
+func (s implConfigServerStub) Describe__() []ipc.InterfaceDesc {
+	return []ipc.InterfaceDesc{ConfigDesc}
 }
 
 // ConfigDesc describes the Config interface.
-var ConfigDesc __ipc.InterfaceDesc = descConfig
+var ConfigDesc ipc.InterfaceDesc = descConfig
 
 // descConfig hides the desc to keep godoc clean.
-var descConfig = __ipc.InterfaceDesc{
+var descConfig = ipc.InterfaceDesc{
 	Name:    "Config",
 	PkgPath: "v.io/core/veyron/services/mgmt/device",
 	Doc:     "// Config is an RPC API to the config service.",
-	Methods: []__ipc.MethodDesc{
+	Methods: []ipc.MethodDesc{
 		{
 			Name: "Set",
 			Doc:  "// Set sets the value for key.",
-			InArgs: []__ipc.ArgDesc{
+			InArgs: []ipc.ArgDesc{
 				{"key", ``},   // string
 				{"value", ``}, // string
 			},
-			OutArgs: []__ipc.ArgDesc{
+			OutArgs: []ipc.ArgDesc{
 				{"", ``}, // error
 			},
 		},