veyron2/services/mgmt/node: rename node->device, cl 2 of N (go/vissue/496)

Rename node->device throughout type/method names and comments. Virtually all
mechanical replacements, except for comment reformatting.

Renaming files and packages left for future cls.

Change-Id: I49cfd04c3ae2a7e6ffed8c76f6868d5981118fcf
diff --git a/tools/mgmt/nodex/impl.go b/tools/mgmt/nodex/impl.go
index 51fb0f6..1bda19b 100644
--- a/tools/mgmt/nodex/impl.go
+++ b/tools/mgmt/nodex/impl.go
@@ -15,9 +15,9 @@
 	Name:     "install",
 	Short:    "Install the given application.",
 	Long:     "Install the given application.",
-	ArgsName: "<node> <application>",
+	ArgsName: "<device> <application>",
 	ArgsLong: `
-<node> is the veyron object name of the node manager's app service.
+<device> is the veyron object name of the device manager's app service.
 <application> is the veyron object name of the application.`,
 }
 
@@ -25,12 +25,12 @@
 	if expected, got := 2, len(args); expected != got {
 		return cmd.UsageErrorf("install: incorrect number of arguments, expected %d, got %d", expected, got)
 	}
-	nodeName, appName := args[0], args[1]
-	appID, err := node.ApplicationClient(nodeName).Install(runtime.NewContext(), appName)
+	deviceName, appName := args[0], args[1]
+	appID, err := node.ApplicationClient(deviceName).Install(runtime.NewContext(), appName)
 	if err != nil {
 		return fmt.Errorf("Install failed: %v", err)
 	}
-	fmt.Fprintf(cmd.Stdout(), "Successfully installed: %q\n", naming.Join(nodeName, appID))
+	fmt.Fprintf(cmd.Stdout(), "Successfully installed: %q\n", naming.Join(deviceName, appID))
 	return nil
 }
 
@@ -76,11 +76,11 @@
 var cmdClaim = &cmdline.Command{
 	Run:      runClaim,
 	Name:     "claim",
-	Short:    "Claim the node.",
-	Long:     "Claim the node.",
-	ArgsName: "<node> <grant extension>",
+	Short:    "Claim the device.",
+	Long:     "Claim the device.",
+	ArgsName: "<device> <grant extension>",
 	ArgsLong: `
-<node> is the veyron object name of the node manager's app service.
+<device> is the veyron object name of the device manager's app service.
 
 <grant extension> is used to extend the default blessing of the
 current principal when blessing the app instance.`,
@@ -90,8 +90,8 @@
 	if expected, got := 2, len(args); expected != got {
 		return cmd.UsageErrorf("claim: incorrect number of arguments, expected %d, got %d", expected, got)
 	}
-	nodeName, grant := args[0], args[1]
-	if err := node.DeviceClient(nodeName).Claim(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant}); err != nil {
+	deviceName, grant := args[0], args[1]
+	if err := node.DeviceClient(deviceName).Claim(runtime.NewContext(), &granter{p: runtime.Principal(), extension: grant}); err != nil {
 		return fmt.Errorf("Claim failed: %v", err)
 	}
 	fmt.Fprintln(cmd.Stdout(), "Successfully claimed.")
@@ -101,9 +101,9 @@
 func root() *cmdline.Command {
 	return &cmdline.Command{
 		Name:  "nodex",
-		Short: "Tool for interacting with the veyron node manager",
+		Short: "Tool for interacting with the veyron device manager",
 		Long: `
-The nodex tool facilitates interaction with the veyron node manager.
+The nodex tool facilitates interaction with the veyron device manager.
 `,
 		Children: []*cmdline.Command{cmdInstall, cmdStart, associateRoot(), cmdClaim, cmdStop, cmdSuspend, cmdResume, aclRoot()},
 	}