javascript: Server and Client API Changes.

This with CL JavaScript' server API is changing
to match the new server API in Go and also client
API is chaning a bit so it is more consistent.

Server API Changes:
Changes are made to align with the server API
changes in Go that was submitted with http:/v.io/c/15257

In short, server.serve and server.serveDispatcher were
removed from the server object and new asynchronous methods
were added to runtime so users can create a server
object at the same time as starting the server.

`
var server = rt.newServer();
server.serve(name, serviceObject, cb);
`

is changing to:

`
rt.newServer(name, serviceObject, cb);
`

a server object will be passed to cb.

With this change, runtime.newServer no longer
immediately returns a server object, instead it also
takes in the serviceObject and a name and creates AND
starts the server before returning it.
new method runtime.newDispatchingServer was also added to
replace the server.serveDispatcher.

Client API Changes:
Now that runtime.newServer is asynchronous, having
runtime.newClient be synchronous would have been
inconsistent, also Go side is removing the ability
to create multiple clients anyway. Therefore with
this cl runtime.newClient was renamed to runtime.getClient
which would return a singleton client object.

runtime.namespace was also renamed to runtime.getNamespace
to be consistent with runtime.getContext and runtime.getClient

MultiPart: 2/10
Change-Id: I47415bfa42070f36c6b2f08c53ef5fb034cb320f
diff --git a/jsdocs/index.md b/jsdocs/index.md
index 6883d78..4b336c9 100644
--- a/jsdocs/index.md
+++ b/jsdocs/index.md
@@ -1,13 +1,13 @@
-##Vanadium JavaScript API
+## Vanadium JavaScript API
 Vanadium is an ongoing effort to build an open source, cross-platform application framework for secure, cross-device user experiences. For more details about the Vanadium project, please visit [https://v.io](https://v.io).
 
 [Vanadium module](./module-vanadium.html) provides JavaScript APIs into its application environment to enable development of Vanadium-based applications in JavaScript. These applications currently work in NodeJS and in the desktop Chrome browser.
 
-##[Vanadium Module](./module-vanadium.html)
+## [Vanadium Module](./module-vanadium.html)
 [Vanadium module](./module-vanadium.html) is the entry point to the public Vanadium API.
 
 [Runtime](./module-vanadium-Runtime.html), as returned by the
 [init](module-vanadium.html#.init) function, defines entry points to create servers, client, blessing and other Vanadium functionality.
 
-##Tutorials
+## Tutorials
 Please visit tutorials section of [v.io website](https://v.io/tutorials/javascript/) for JavaScript tutorials.
\ No newline at end of file
diff --git a/src/gen-vdl/v.io/x/ref/services/wspr/internal/app/index.js b/src/gen-vdl/v.io/x/ref/services/wspr/internal/app/index.js
index 0d99bb0..9b0db82 100644
--- a/src/gen-vdl/v.io/x/ref/services/wspr/internal/app/index.js
+++ b/src/gen-vdl/v.io/x/ref/services/wspr/internal/app/index.js
@@ -131,8 +131,8 @@
 
     
       
-Controller.prototype.serve = function(ctx, serverCall, name, serverId, serverOpts) {
-  throw new Error('Method Serve not implemented');
+Controller.prototype.newServer = function(ctx, serverCall, name, serverId, serverOpts) {
+  throw new Error('Method NewServer not implemented');
 };
     
       
@@ -221,8 +221,8 @@
     
       
     {
-    name: 'Serve',
-    doc: "// Serve instructs WSPR to start listening for calls on behalf\n// of a javascript server.",
+    name: 'NewServer',
+    doc: "// NewServer instructs WSPR to create a server and start listening for calls on\n// behalf of a JavaScript server.",
     inArgs: [{
       name: 'name',
       doc: "",
diff --git a/src/rpc/client.js b/src/rpc/client.js
index d9ebfb9..7f6fdea 100644
--- a/src/rpc/client.js
+++ b/src/rpc/client.js
@@ -329,7 +329,7 @@
  *
  * @description
  * <p>Private Constructor, use
- * [Runtime#newClient]{@link module:vanadium~Runtime#newClient}</p>
+ * [Runtime#getClient]{@link module:vanadium~Runtime#getClient}</p>
  * @inner
  * @constructor
  * @memberof module:vanadium.rpc
diff --git a/src/rpc/server-option.js b/src/rpc/server-option.js
index ec980be..da2791e 100644
--- a/src/rpc/server-option.js
+++ b/src/rpc/server-option.js
@@ -15,10 +15,9 @@
  * @param {object} opts Server options.
  * @param {bool} opts.isLeaf Indicates server will be used to serve a leaf
  * service. This option is automatically set to true if
- * [server.serve()]{@link module:vanadium.rpc~Server#serve} is used.
- * It defaults to false if
- * [server.serveDispatcher()]{@link module:vanadium.rpc~Server#serveDispatcher}
- * is used instead.
+ * [rt.newServer()]{@link module:vanadium~Runtime#newServer} is used.
+ * but defaults to false if [rt.newDispatchingServer()]
+ * {@link module:vanadium~Runtime#newDispatchingServer} is used.
  * @param {bool} opts.servesMountTable Indicates server will be used to serve
  * a MountTable. This server cannot be used for any other purpose.
  * @return {module:vanadium.rpc~Server~ServerOption}
diff --git a/src/rpc/server-router.js b/src/rpc/server-router.js
index eebfa17..08bf38d 100644
--- a/src/rpc/server-router.js
+++ b/src/rpc/server-router.js
@@ -89,7 +89,7 @@
       this.handleCaveatValidationRequest(messageId, request);
       break;
     case Incoming.LOG_MESSAGE:
-      if (request.level ===  typeUtil.unwrap(lib.LogLevel.INFO)) {
+      if (request.level === typeUtil.unwrap(lib.LogLevel.INFO)) {
         vlog.logger.info(request.message);
       } else if (request.level === typeUtil.unwrap(lib.LogLevel.ERROR)) {
         vlog.logger.error(request.message);
@@ -104,7 +104,7 @@
 
 Router.prototype.handleAuthorizationRequest = function(messageId, request) {
   try {
-   request = byteUtil.hex2Bytes(request);
+    request = byteUtil.hex2Bytes(request);
   } catch (e) {
     var authReply = new AuthReply({
       // TODO(bjornick): Use the real context
@@ -112,8 +112,8 @@
     });
 
     this._proxy.sendRequest(hexVom.encode(authReply, undefined,
-                                          this._typeEncoder),
-                            Outgoing.AUTHORIZATION_RESPONSE, null, messageId);
+        this._typeEncoder),
+      Outgoing.AUTHORIZATION_RESPONSE, null, messageId);
     return;
   }
 
@@ -125,7 +125,7 @@
   }).then(function(req) {
     decodedRequest = req;
     var ctx = router._rootCtx.withValue(SharedContextKeys.LANG_KEY,
-                                        decodedRequest.context.language);
+      decodedRequest.context.language);
     var server = router._servers[decodedRequest.serverId];
     if (!server) {
       var authReply = new AuthReply({
@@ -134,28 +134,28 @@
       });
       var bytes = hexVom.encode(authReply, undefined, router._typeEncoder);
       router._proxy.sendRequest(bytes,
-                                Outgoing.AUTHORIZATION_RESPONSE,
-                                null, messageId);
+        Outgoing.AUTHORIZATION_RESPONSE,
+        null, messageId);
       return;
     }
     return createSecurityCall(decodedRequest.call, router._blessingsCache)
-    .then(function(call) {
-      return server.handleAuthorization(decodedRequest.handle, ctx, call);
-    });
+      .then(function(call) {
+        return server._handleAuthorization(decodedRequest.handle, ctx, call);
+      });
   }).then(function() {
     var authReply = new AuthReply({});
     router._proxy.sendRequest(hexVom.encode(authReply, undefined,
-                                            router._typeEncoder),
-                              Outgoing.AUTHORIZATION_RESPONSE, null, messageId);
+        router._typeEncoder),
+      Outgoing.AUTHORIZATION_RESPONSE, null, messageId);
   }).catch(function(e) {
     var authReply = new AuthReply({
       err: ErrorConversion.fromNativeValue(e, router._appName,
-                                           decodedRequest.call.method)
+        decodedRequest.call.method)
     });
     router._proxy.sendRequest(hexVom.encode(authReply, undefined,
-                                            router._typeEncoder),
-                              Outgoing.AUTHORIZATION_RESPONSE, null,
-                              messageId);
+        router._typeEncoder),
+      Outgoing.AUTHORIZATION_RESPONSE, null,
+      messageId);
   });
 };
 
@@ -187,24 +187,24 @@
 Router.prototype.handleCaveatValidationRequest = function(messageId, request) {
   var router = this;
   createSecurityCall(request.call, this._blessingsCache)
-  .then(function(call) {
-    var ctx = router._rootCtx.withValue(SharedContextKeys.LANG_KEY,
-      request.context.language);
-    var resultPromises = request.cavs.map(function(cav) {
-      return router._validateChain(ctx, call, cav);
-    });
-    return Promise.all(resultPromises).then(function(results) {
-      var response = new CaveatValidationResponse({
-        results: results
+    .then(function(call) {
+      var ctx = router._rootCtx.withValue(SharedContextKeys.LANG_KEY,
+        request.context.language);
+      var resultPromises = request.cavs.map(function(cav) {
+        return router._validateChain(ctx, call, cav);
       });
-      var data = hexVom.encode(response, undefined, router._typeEncoder);
-      router._proxy.sendRequest(data, Outgoing.CAVEAT_VALIDATION_RESPONSE, null,
-        messageId);
+      return Promise.all(resultPromises).then(function(results) {
+        var response = new CaveatValidationResponse({
+          results: results
+        });
+        var data = hexVom.encode(response, undefined, router._typeEncoder);
+        router._proxy.sendRequest(data, Outgoing.CAVEAT_VALIDATION_RESPONSE,
+          null, messageId);
+      });
+    }).catch(function(err) {
+      vlog.logger.error('Got err ' + err + ': ' + err.stack);
+      throw new Error('Unexpected error (all promises should resolve): ' + err);
     });
-  }).catch(function(err) {
-    vlog.logger.error('Got err ' + err + ': ' + err.stack);
-    throw new Error('Unexpected error (all promises should resolve): ' + err);
-  });
 };
 
 Router.prototype.handleLookupRequest = function(messageId, request) {
@@ -216,34 +216,34 @@
       err: new verror.NoExistError(this._rootCtx, 'unknown server')
     });
     this._proxy.sendRequest(hexVom.encode(reply, undefined, this._typeEncoder),
-                            Outgoing.LOOKUP_RESPONSE,
-                            null, messageId);
+      Outgoing.LOOKUP_RESPONSE,
+      null, messageId);
     return;
   }
 
   var self = this;
   return server._handleLookup(request.suffix).then(function(value) {
-   var signatureList = value.invoker.signature();
-   var hasAuthorizer = (typeof value.authorizer === 'function');
-   var hasGlobber = value.invoker.hasGlobber();
-   var reply = {
-     handle: value._handle,
-     signature: signatureList,
-     hasAuthorizer: hasAuthorizer,
-     hasGlobber: hasGlobber
-   };
-   self._proxy.sendRequest(hexVom.encode(reply, LookupReply.prototype._type,
-                                         self._typeEncoder),
-                           Outgoing.LOOKUP_RESPONSE,
-                           null, messageId);
- }).catch(function(err) {
-   var reply = new LookupReply({
-     err: ErrorConversion.fromNativeValue(err, self._appName, '__Signature')
-   });
-   self._proxy.sendRequest(hexVom.encode(reply, undefined, self._typeEncoder),
-                           Outgoing.LOOKUP_RESPONSE,
-                           null, messageId);
- });
+    var signatureList = value.invoker.signature();
+    var hasAuthorizer = (typeof value.authorizer === 'function');
+    var hasGlobber = value.invoker.hasGlobber();
+    var reply = {
+      handle: value._handle,
+      signature: signatureList,
+      hasAuthorizer: hasAuthorizer,
+      hasGlobber: hasGlobber
+    };
+    self._proxy.sendRequest(hexVom.encode(reply, LookupReply.prototype._type,
+        self._typeEncoder),
+      Outgoing.LOOKUP_RESPONSE,
+      null, messageId);
+  }).catch(function(err) {
+    var reply = new LookupReply({
+      err: ErrorConversion.fromNativeValue(err, self._appName, '__Signature')
+    });
+    self._proxy.sendRequest(hexVom.encode(reply, undefined, self._typeEncoder),
+      Outgoing.LOOKUP_RESPONSE,
+      null, messageId);
+  });
 };
 
 Router.prototype.createRPCContext = function(request) {
@@ -258,13 +258,13 @@
     ctx = ctx.withCancel();
   }
   ctx = ctx.withValue(SharedContextKeys.LANG_KEY,
-                      request.call.context.language);
+    request.call.context.language);
   // Plumb through the vtrace ids
   var suffix = request.call.securityCall.suffix;
-  var spanName = '<jsserver>"'+suffix+'".'+request.method;
+  var spanName = '<jsserver>"' + suffix + '".' + request.method;
   // TODO(mattr): We need to enforce some security on trace responses.
   return vtrace.withContinuedTrace(ctx, spanName,
-                                   request.call.traceRequest);
+    request.call.traceRequest);
 };
 
 function getMethodSignature(invoker, methodName) {
@@ -287,13 +287,13 @@
     var readType = (methodSig.inStream ? methodSig.inStream.type : null);
     var writeType = (methodSig.outStream ? methodSig.outStream.type : null);
     var stream = new Stream(messageId, this._proxy.senderPromise, false,
-                        readType, writeType, this._typeEncoder);
+      readType, writeType, this._typeEncoder);
     this._streamMap[messageId] = stream;
     var rpc = new StreamHandler(ctx, stream, this._typeDecoder);
     this._proxy.addIncomingStreamHandler(messageId, rpc);
   } else {
     this._proxy.addIncomingStreamHandler(messageId,
-                                         new StreamCloseHandler(ctx));
+      new StreamCloseHandler(ctx));
   }
 };
 
@@ -323,6 +323,7 @@
 Router.prototype._maybeHandleReservedMethod = function(
   ctx, messageId, server, invoker, methodName, request) {
   var self = this;
+
   function globCompletion() {
     // There are no results to a glob method.  Everything is sent back
     // through the stream.
@@ -341,11 +342,11 @@
     this.incrementOutstandingRequestForId(messageId);
     var globPattern = typeUtil.unwrap(request.args[0]);
     return createServerCall(request, this._blessingsCache)
-    .then(function(call) {
-      self.handleGlobRequest(messageId, call.securityCall.suffix,
-                             server, new Glob(globPattern), ctx, call, invoker,
-                             globCompletion);
-    });
+      .then(function(call) {
+        self.handleGlobRequest(messageId, call.securityCall.suffix,
+          server, new Glob(globPattern), ctx, call, invoker,
+          globCompletion);
+      });
   }
   return null;
 };
@@ -392,7 +393,7 @@
     return;
   }
 
-  var invoker = server.getInvokerForHandle(request.handle);
+  var invoker = server._getInvokerForHandle(request.handle);
   if (!invoker) {
     vlog.logger.error('No invoker found: ', request);
     err = new Error('No service found');
@@ -415,8 +416,8 @@
   if (methodSig === undefined) {
     err = new verror.NoExistError(
       ctx, 'Requested method', methodName, 'not found on');
-      this.sendResult(messageId, methodName, null, err);
-      return;
+    this.sendResult(messageId, methodName, null, err);
+    return;
   }
 
   this._setupStream(messageId, ctx, methodSig);
@@ -443,25 +444,25 @@
           if (!(result instanceof Blessings)) {
             vlog.logger.error(
               'Encoding non-blessings value as wire blessings');
-              return null;
+            return null;
           }
           return result;
         }
         return vdl.canonicalize.fill(result, t);
       });
       self.sendResult(messageId, methodName, canonResults, undefined,
-                      methodSig.outArgs.length);
+        methodSig.outArgs.length);
     }, function(err) {
       var stackTrace;
       if (err instanceof Error && err.stack !== undefined) {
         stackTrace = err.stack;
       }
       vlog.logger.error('Requested method ' + methodName +
-          ' threw an exception on invoke: ', err, stackTrace);
+        ' threw an exception on invoke: ', err, stackTrace);
 
       // The error case has no results; only send the error.
       self.sendResult(messageId, methodName, undefined, err,
-          methodSig.outArgs.length);
+        methodSig.outArgs.length);
     });
   });
 };
@@ -483,20 +484,20 @@
   var request;
   var router = this;
   try {
-   request = byteUtil.hex2Bytes(vdlRequest);
+    request = byteUtil.hex2Bytes(vdlRequest);
   } catch (e) {
     err = new Error('Failed to decode args: ' + e);
     this.sendResult(messageId, '', null, err);
     return;
   }
   return vom.decode(request, false, this._typeDecoder)
-  .then(function(request) {
-    return router._handleRPCRequestInternal(messageId, request);
-  }, function(e) {
-    vlog.logger.error('Failed to decode args : ' + e + ': ' + e.stack);
-    err = new Error('Failed to decode args: ' + e);
-    router.sendResult(messageId, '', null, err);
-  });
+    .then(function(request) {
+      return router._handleRPCRequestInternal(messageId, request);
+    }, function(e) {
+      vlog.logger.error('Failed to decode args : ' + e + ': ' + e.stack);
+      err = new Error('Failed to decode args: ' + e);
+      router.sendResult(messageId, '', null, err);
+    });
 };
 
 function methodIsStreaming(methodSig) {
@@ -521,6 +522,7 @@
   };
 
   var def = new Deferred();
+
   function InvocationFinishedCallback(err, results) {
     if (err) {
       return def.reject(err);
@@ -535,7 +537,9 @@
 function createGlobReply(name) {
   name = name || '';
   return new naming.GlobReply({
-    'entry': new naming.MountEntry({ name: name })
+    'entry': new naming.MountEntry({
+      name: name
+    })
   });
 }
 
@@ -543,19 +547,22 @@
   name = name || '';
   var convertedError = ErrorConversion.fromNativeValue(err, appName, 'glob');
   return new naming.GlobReply({
-    'error': new naming.GlobError({ name: name, error: convertedError })
+    'error': new naming.GlobError({
+      name: name,
+      error: convertedError
+    })
   });
 }
 
 Router.prototype.handleGlobRequest = function(messageId, name, server, glob,
-                                              context, call, invoker, cb) {
+  context, call, invoker, cb) {
   var self = this;
   var options;
 
   function invokeAndCleanup(invoker, options, method) {
     self.invokeMethod(invoker, options).catch(function(err) {
       var verr = new verror.InternalError(context,
-         method +'() failed', glob, err);
+        method + '() failed', glob, err);
       var errReply = createGlobErrorReply(name, verr, self._appName);
       self._streamMap[messageId].write(errReply);
       vlog.logger.info(verr);
@@ -568,7 +575,9 @@
     options = {
       methodName: '__glob',
       args: [glob.toString()],
-      methodSig: { outArgs: [] },
+      methodSig: {
+        outArgs: []
+      },
       ctx: context,
       call: call,
       // For the __glob method we just write the
@@ -591,7 +600,9 @@
     options = {
       methodName: '__globChildren',
       args: [],
-      methodSig: { outArgs: [] },
+      methodSig: {
+        outArgs: []
+      },
       ctx: context,
       call: call,
       stream: globStream
@@ -617,13 +628,13 @@
         return server._handleLookup(suffix);
       }).then(function(value) {
         nextInvoker = value.invoker;
-        return server.handleAuthorization(value._handle, context,
-                                          subCall.securityCall);
+        return server._handleAuthorization(value._handle, context,
+          subCall.securityCall);
       }).then(function() {
         var match = glob.matchInitialSegment(child);
         if (match.match) {
           self.handleGlobRequest(messageId, suffix, server, match.remainder,
-                                 context, subCall, nextInvoker, cb);
+            context, subCall, nextInvoker, cb);
         } else {
           self.decrementOutstandingRequestForId(messageId, cb);
         }
@@ -675,7 +686,7 @@
   var errorStruct = null;
   if (err !== undefined && err !== null) {
     errorStruct = ErrorConversion.fromNativeValue(err, this._appName,
-                                                 name);
+      name);
   }
 
   // Clean up the context map.
@@ -703,14 +714,15 @@
       traceResponse: traceResponse
     });
     this._proxy.sendRequest(hexVom.encode(responseData, undefined,
-                                          this._typeEncoder),
-                            Outgoing.RESPONSE,
-                            null, messageId);
+        this._typeEncoder),
+      Outgoing.RESPONSE,
+      null, messageId);
   }
 };
 
 /**
- * Serves the server under the given name
+ * Instructs WSPR to create a server and start listening for calls on
+ * behalf of the given JavaScript server.
  * @private
  * @param {string} name Name to serve under
  * @param {Vanadium.Server} server The server who will handle the requests for
@@ -720,8 +732,8 @@
  * was any.
  * @return {Promise} Promise to be called when serve completes or fails.
  */
-Router.prototype.serve = function(name, server, cb) {
-  vlog.logger.info('Serving under the name: ', name);
+Router.prototype.newServer = function(name, server, cb) {
+  vlog.logger.info('New server under the name: ', name);
   this._servers[server.id] = server;
   // If using a leaf dispatcher, set the IsLeaf ServerOption.
   var isLeaf = server.dispatcher && server.dispatcher._isLeaf;
@@ -729,7 +741,8 @@
     server.serverOption._opts.isLeaf = true;
   }
   var rpcOpts = server.serverOption._toRpcServerOption();
-  return this._controller.serve(this._rootCtx, name, server.id, rpcOpts, cb);
+  return this._controller.newServer(this._rootCtx, name, server.id,
+    rpcOpts, cb);
 };
 
 /**
@@ -809,4 +822,4 @@
   });
 };
 
-module.exports = Router;
+module.exports = Router;
\ No newline at end of file
diff --git a/src/rpc/server.js b/src/rpc/server.js
index ca75941..617df77 100644
--- a/src/rpc/server.js
+++ b/src/rpc/server.js
@@ -2,27 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-/**
- *  @fileoverview Server allows creation of services that can be invoked
- *  remotely via RPCs.
- *
- *  Usage:
- *  var videoService = {
- *    play: {
- *      // Play video
- *    }
- *  };
- *
- *  var s = new server(proxyConnection);
- *  s.serve('mymedia/video', videoService);
- *  @private
- */
-
 var Deferred = require('./../lib/deferred');
 var Promise = require('./../lib/promise');
 var asyncCall = require('../lib/async-call');
 var InspectableFunction = require('../lib/inspectable-function');
-var leafDispatcher = require('./leaf-dispatcher');
 var vlog = require('./../lib/vlog');
 var inspector = require('./../lib/arg-inspector');
 var Invoker = require('./../invocation/invoker');
@@ -38,12 +21,15 @@
  * Server defines the interface for managing a collection of services.
  * @description
  * <p>Private Constructor, use
- * [Runtime#newServer]{@link module:vanadium~Runtime#newServer}.</p>
+ * [Runtime#newServer]{@link module:vanadium~Runtime#newServer} or
+ * [Runtime#newServerDispatchingServer]
+ * {@link module:vanadium~Runtime#newServerDispatchingServer}
+ * </p>
  * @inner
  * @constructor
  * @memberof module:vanadium.rpc
  */
-function Server(router, serverOption) {
+function Server(router) {
   if (!(this instanceof Server)) {
     return new Server(router);
   }
@@ -54,177 +40,8 @@
   this.id = nextServerID++;
   this.dispatcher = null;
   this.serviceObjectHandles = {};
-  this.serverOption = serverOption || new ServerOption();
 }
 
-// TODO(aghassemi) the serviceObject example needs to point to a "Guides" page
-// on the website when we have it. https://github.com/vanadium/issues/issues/444
-/* jshint ignore:start */
-/**
- * ServeOptions is a set of options that are passed to the
- * [serve]{@link module:vanadium.rpc~Server#serve}.
- * @typedef module:vanadium.rpc~Server~ServeOptions
- * @property {module:vanadium.security.Authorize} authorizer An Authorizer
- * that will handle the authorization for the method call.  If null, then the
- * default strict authorizer will be used.
- */
-
-/**
- * <p>Serve associates object with name by publishing the address
- * of this server with the mount table under the supplied name and using
- * authorizer to authorize access to it.</p>
- * <p>If name is an empty string, no attempt will made to publish that
- * name to a mount table. It is an error to call
- * {@link module:vanadium.rpc~Server#serve|serve}
- * if either {@link module:vanadium.rpc~Server#serveDispatcher|serveDispatcher}
- * or {@link module:vanadium.rpc~Server.serve|serve} has already been called.
- * To serve the same object under multiple names,
- * {@link module:vanadium.rpc~Server#addName|addName} can be used.</p>
- * <p>To serve names of the form "mymedia/*" make the calls:</p>
- * <pre>
- * serve("mymedia", serviceObject, {
- *   authorizer: serviceAuthorizer // optional authorizer
- * });
- * </pre>
- * <p>
- * serviceObject is simply a JavaScript object that implements service methods.
- * </p>
- * <p>
- * <pre>
- * var serviceObject = new MyService();
- * function MyService() {}
- * </pre>
- * <p>
- * Each service method must take [ctx]{@link module:vanadium.context.Context}
- * and [serverCall]{@link module:vanadium.rpc~ServerCall} as the
- * first two parameters.
- * </p>
- * <p>
- * The output arguments can be given in several forms - through direct return,
- * return of a promise or calling a callback that is optionally the
- * last parameter.
- * </p>
- * <pre>
- * // Sync method that echoes the input text immediately.
- * MyService.prototype.echo = function(ctx, serverCall, text) {
- *   return 'Echo: ' + text;
- * };
- * </pre>
- * <pre>
- * // Async method that echoes the input text after 1 second, using Promises.
- * MyService.prototype.delayedEcho = function(ctx, serverCall, text) {
- *   return new Promise(function(resolve, reject) {
- *     setTimeout(function() {
- *       resolve('Echo: ' + text);
- *     }, 1000);
- *   });
- * };
- *</pre>
- *<pre>
- * // Async method that echoes the input text after 1 second, using Callbacks.
- * MyService.prototype.delayedEcho = function(ctx, serverCall, text, callback) {
- *   setTimeout(function() {
- *     // first argument to the callback is error, second argument is results
- *     callback(null, 'Echo: ' + text);
- *   }, 1000);
- * };
- *</pre>
- *
- * @public
- * @param {string} name Name to serve under.
- * @param {object} serviceObject The service object that has a set of
- * exported methods.
- * @param {module:vanadium.rpc~Server~ServeOptions} options Options config.
- * @param {module:vanadium~voidCb} [cb] If provided, the function
- * will be called on completion.
- * @return {Promise<void>} Promise to be called when serve completes or fails.
- */
-/* jshint ignore:end */
-Server.prototype.serve = function(name, serviceObject, options, cb) {
-  if (typeof options === 'function') {
-    cb = options;
-    options = undefined;
-  }
-
-  var authorizer;
-
-  if (options) {
-    authorizer = options.authorizer;
-  }
-
-  var dispatcher = leafDispatcher(serviceObject, authorizer);
-
-  return this.serveDispatcher(name, dispatcher, cb);
-};
-
-/**
- * @typedef module:vanadium.rpc~Server~DispatcherResponse
- * @type {object}
- * @property {object} service The Invoker that will handle
- * method call.
- * @property {module:vanadium.security.Authorize} authorizer An Authorizer that
- * will handle the authorization for the method call.  If null, then the default
- * authorizer will be used.
- */
-
-/**
- * A function that returns the service implementation for the object identified
- * by the given suffix.
- * @callback module:vanadium.rpc~Server~Dispatcher
- * @param {string} suffix The suffix for the call.
- * @param {module:vanadium.rpc~Server~Dispatcher-callback} cb
- * The callback to call when the dispatch is complete.
- * @return {Promise<module:vanadium.rpc~Server~DispatcherResponse>}
- * Either the DispatcherResponse object to
- * handle the method call or a Promise that will be resolved the service
- * callback.
- */
-
-/**
- * Callback passed into Dispatcher.
- * @callback module:vanadium.rpc~Server~Dispatcher-callback
- * @param {Error} err An error if one occurred.
- * @param {object} object The object that will handle the method call.
- */
-
-/**
- * <p>ServeDispatcher associates dispatcher with the portion of the mount
- * table's name space for which name is a prefix, by publishing the
- * address of this dispatcher with the mount table under the supplied name.
- * RPCs invoked on the supplied name will be delivered to the supplied
- * Dispatcher's lookup method which will in turn return the object. </p>
- *
- * <p>To serve names of the form "mymedia/*" make the calls: </p>
- *
- * <pre>
- * serve("mymedia", dispatcher);
- * </pre>
- *
- * <p>If name is an empty string, no attempt will made to publish that
- * name to a mount table. </p>
- *
- * <p>It is an error to call
- * {@link module:vanadium.rpc~Server#serveDispatcher|serveDispatcher}
- * if {@link module:vanadium.rpc~Server#serve|serve} has already been called.
- * It is also an error
- * to call serveDispatcher multiple times.</p>
- * To serve the same dispatcher under multiple names,
- * {@link module:vanadium.rpc~Server#addName|addName} can be used. </p>
- *
- * @public
- * @param {string} name Name to serve under.
- * @param {module:vanadium.rpc~Server~Dispatcher} dispatcher A function that
- * will take in the suffix and the method to be called and return the service
- * object for that suffix.
- * @param {module:vanadium~voidCb} [cb] If provided, the function
- * will be called on completion.
- * @return {Promise<void>} Promise to be called when serve completes or fails.
- */
-Server.prototype.serveDispatcher = function(name, dispatcher, cb) {
-  this.dispatcher = dispatcher;
-  return this._router.serve(name, this, cb);
-};
-
 /**
  * Stop gracefully stops all services on this Server.
  * New calls are rejected, but any in-flight calls are allowed to complete.
@@ -240,11 +57,7 @@
 
 /**
  * Adds the specified name to the mount table for the object or dispatcher
- * served by this server. It is an error to specify a name that was not
- * previously added using
- * [serve]{@link module:vanadium.rpc~Server#serve}/
- * [serveDispatcher]{@link module:vanadium.rpc~Server#serveDispatcher}
- * or [addName]{@link module:vanadium.rpc~Server#addName}.
+ * used to create this server.
  * @public
  * @param {string} name Name to publish.
  * @param {module:vanadium~voidCb} [cb] If provided, the function
@@ -257,11 +70,7 @@
 };
 
 /**
- * Removes the specified name from the mount table. It is an
- * error to specify a name that was not previously added using
- * [serve]{@link module:vanadium.rpc~Server#serve}/
- * [serveDispatcher]{@link module:vanadium.rpc~Server#serveDispatcher}
- * or [addName]{@link module:vanadium.rpc~Server#addName}.
+ * Removes the specified name from the mount table.
  * @public
  * @param {string} name Name to remove.
  * @param {function} [cb] If provided, the function will be called on
@@ -273,12 +82,25 @@
   return this._router.removeName(name, this, cb);
 };
 
+/*
+ * Initializes the JavaScript server by creating a server object on
+ * the WSPR side.
+ * @private
+ */
+Server.prototype._init = function(name, dispatcher,
+  serverOption, cb) {
+
+  this.serverOption = serverOption || new ServerOption();
+  this.dispatcher = dispatcher;
+  return this._router.newServer(name, this, cb);
+};
+
 /**
  * @private
  * @param {Number} handle The handle for the service.
  * @return {Object} The invoker corresponding to the provided error.
  */
-Server.prototype.getInvokerForHandle = function(handle) {
+Server.prototype._getInvokerForHandle = function(handle) {
   var result = this.serviceObjectHandles[handle];
   delete this.serviceObjectHandles[handle];
 
@@ -294,7 +116,7 @@
  * @param {module:vanadium.security~SecurityCall} call The security call.
  * @return {Promise} A promise that will be fulfilled with the result.
  */
-Server.prototype.handleAuthorization = function(handle, ctx, call) {
+Server.prototype._handleAuthorization = function(handle, ctx, call) {
   var handler = this.serviceObjectHandles[handle];
   var authorizer = defaultAuthorizer;
   if (handler && handler.authorizer) {
@@ -305,12 +127,12 @@
   var inspectableAuthorizer = new InspectableFunction(authorizer);
   asyncCall(ctx, null, inspectableAuthorizer, [], [ctx, call],
     function(err) {
-    if (err) {
-      def.reject(err);
-      return;
-    }
-    def.resolve();
-  });
+      if (err) {
+        def.reject(err);
+        return;
+      }
+      def.resolve();
+    });
   return def.promise;
 };
 
@@ -329,7 +151,7 @@
   object._handle = this._handle;
   try {
     object.invoker = new Invoker(object.service);
-  } catch(e) {
+  } catch (e) {
     vlog.logger.error('lookup failed', e);
     return e;
   }
@@ -338,10 +160,9 @@
   return null;
 };
 
-
-
 /*
  * Perform the lookup call to the user code on the suffix and method passed in.
+ * @private
  */
 Server.prototype._handleLookup = function(suffix) {
   var self = this;
@@ -382,7 +203,7 @@
   function handleResult(v) {
     var err = self._handleLookupResult(v);
     if (err) {
-     return Promise.reject(err);
+      return Promise.reject(err);
     }
     return Promise.resolve(v);
   }
@@ -393,4 +214,4 @@
 /**
  * Export the module
  */
-module.exports = Server;
+module.exports = Server;
\ No newline at end of file
diff --git a/src/runtime/index.js b/src/runtime/index.js
index 7b7df1f..714760d 100644
--- a/src/runtime/index.js
+++ b/src/runtime/index.js
@@ -13,6 +13,7 @@
 var Server = require('../rpc/server');
 var ServerRouter = require('../rpc/server-router');
 var GranterRouter = require('../rpc/granter-router');
+var leafDispatcher = require('../rpc/leaf-dispatcher');
 var Client = require('../rpc/client');
 var Namespace = require('../naming/namespace');
 var CaveatValidatorRegistry = require('../security/caveat-validator-registry');
@@ -112,8 +113,8 @@
 
   this.accountName = options.accountName;
   this._wspr = options.wspr;
-  var client = this.newClient();
-  this._controller = client.bindWithSignature(
+  this._client = new Client(this._getProxyConnection());
+  this._controller = this._client.bindWithSignature(
     '__controller', [Controller.prototype._serviceDescription]);
   this.principal = new Principal(this.getContext(), this._controller);
   this._name = options.appName;
@@ -145,31 +146,206 @@
   var router = this._getRouter();
   var proxy = this._getProxyConnection();
   return router.cleanup().then(function() {
-      return proxy.close(cb);
+    return proxy.close(cb);
   });
 };
 
+/* jshint ignore:start */
 /**
- * Creates a new [Server]{@link module:vanadium.rpc~Server} instance.<br>
- * Server allows one to create, publish and stop Vanadium services.
- * @param {module:vanadium.rpc~Server~ServerOption} [serverOption] Optional
- * server option that can be specified when creating a new server. serverOption
- * can be created with the
+ * NewServerOptionalArgs is a set of options that are passed to the
+ * [serve]{@link module:vanadium~Runtime#newServer}.
+ * @typedef module:vanadium.rpc~Server~NewServerOptionalArgs
+ * @property {module:vanadium.security.Authorize} authorizer An Authorizer
+ * that will handle the authorization for the method call.  If null, then the
+ * default strict authorizer will be used.
+ * @property {module:vanadium.rpc~Server~ServerOption} serverOption Optional
+ * server configuration such as whether the server is a mount table or
+ * represents a leaf server. serverOption can be created with the
  * [vanadium.rpc.serverOption(opts)]{@link module:vanadium.rpc#serverOption}
  * method.
- * @return {module:vanadium.rpc~Server} A server instance.
  */
-Runtime.prototype.newServer = function(serverOption) {
-  return new Server(this._getRouter(), serverOption);
+
+/**
+ * Callback passed into NewServer and NewDispatchingServer
+ * @callback module:vanadium.rpc~Server~NewServer-callback
+ * @param {Error} err An error if one occurred.
+ * @param {module:vanadium.rpc~Server} server The server object.
+ */
+
+// TODO(aghassemi) the serviceObject example needs to point to a "Guides" page
+// on the website when we have it. https://github.com/vanadium/issues/issues/444
+/**
+ * <p>Asynchronously creates a server and associates object with name by
+ * publishing the address of the server with the mount table under the supplied
+ * name and using authorizer to authorize access to it.</p>
+ * <p>If name is an empty string, no attempt will made to publish that
+ * name to a mount table.
+ * To publish the same object under multiple names,
+ * {@link module:vanadium.rpc~Server#addName|addName} can be used.</p>
+ * <p>Simple usage:</p>
+ * <pre>
+ * rt.newServer('service/name', serviceObject, {
+ *   authorizer: serviceAuthorizer
+ * }, function(server) {
+ *   // server is now active and listening for RPC calls.
+ * });
+ * </pre>
+ * <p>
+ * serviceObject is simply a JavaScript object that implements service methods.
+ * </p>
+ * <p>
+ * <pre>
+ * var serviceObject = new MyService();
+ * function MyService() {}
+ * </pre>
+ * <p>
+ * Each service method must take [ctx]{@link module:vanadium.context.Context}
+ * and [serverCall]{@link module:vanadium.rpc~ServerCall} as the
+ * first two parameters.
+ * </p>
+ * <p>
+ * The output arguments can be given in several forms - through direct return,
+ * return of a promise or calling a callback that is optionally the
+ * last parameter.
+ * </p>
+ * <pre>
+ * // Sync method that echoes the input text immediately.
+ * MyService.prototype.echo = function(ctx, serverCall, text) {
+ *   return 'Echo: ' + text;
+ * };
+ * </pre>
+ * <pre>
+ * // Async method that echoes the input text after 1 second, using Promises.
+ * MyService.prototype.delayedEcho = function(ctx, serverCall, text) {
+ *   return new Promise(function(resolve, reject) {
+ *     setTimeout(function() {
+ *       resolve('Echo: ' + text);
+ *     }, 1000);
+ *   });
+ * };
+ *</pre>
+ *<pre>
+ * // Async method that echoes the input text after 1 second, using Callbacks.
+ * MyService.prototype.delayedEcho = function(ctx, serverCall, text, callback) {
+ *   setTimeout(function() {
+ *     // first argument to the callback is error, second argument is results
+ *     callback(null, 'Echo: ' + text);
+ *   }, 1000);
+ * };
+ *</pre>
+ *
+ * @public
+ * @param {string} name Name to publish under.
+ * @param {object} serviceObject The service object that has a set of
+ * exported methods.
+ * @param {module:vanadium.rpc~Server~NewServerOptionalArgs} [optionalArgs]
+ * Optional arguments for newServer such as 'authorizer' or 'serverOptions'.
+ * @param {module:vanadium.rpc~Server~NewServer-callback} [cb] If provided,
+ * the function will be called when server is ready and listening for RPC calls.
+ * @return {Promise<module:vanadium.rpc~Server>} Promise to be called when
+ * server is ready and listening for RPC calls.
+ */
+/* jshint ignore:end */
+Runtime.prototype.newServer = function(name, serviceObject, optionalArgs, cb) {
+  if (typeof optionalArgs === 'function') {
+    cb = optionalArgs;
+    optionalArgs = undefined;
+  }
+  optionalArgs = optionalArgs || {};
+  var dispatcher = leafDispatcher(serviceObject, optionalArgs.authorizer);
+  return this.newDispatchingServer(name, dispatcher,
+    optionalArgs.serverOption, cb);
 };
 
 /**
- * Creates a new [Client]{@link module:vanadium.rpc~Client} instance.<br>
+ * @typedef module:vanadium.rpc~Server~ServerDispatcherResponse
+ * @type {object}
+ * @property {object} service The Invoker that will handle
+ * method call.
+ * @property {module:vanadium.security.Authorize} authorizer An Authorizer that
+ * will handle the authorization for the method call.  If null, then the default
+ * authorizer will be used.
+ */
+
+/**
+ * A function that returns the service implementation for the object identified
+ * by the given suffix.
+ * @callback module:vanadium.rpc~Server~ServerDispatcher
+ * @param {string} suffix The suffix for the call.
+ * @param {module:vanadium.rpc~Server~ServerDispatcher-callback} cb
+ * The callback to call when the dispatch is complete.
+ * @return {Promise<module:vanadium.rpc~Server~ServerDispatcherResponse>}
+ * Either the DispatcherResponse object to
+ * handle the method call or a Promise that will be resolved the service
+ * callback.
+ */
+
+/**
+ * Callback passed into Dispatcher.
+ * @callback module:vanadium.rpc~Server~ServerDispatcher-callback
+ * @param {Error} err An error if one occurred.
+ * @param {object} object The object that will handle the method call.
+ */
+
+/**
+ * <p>Asynchronously creates a server and associates dispatcher with the
+ * portion of the mount table's name space for which name is a prefix, by
+ * publishing the address of this dispatcher with the mount table under the
+ * supplied name.
+ * RPCs invoked on the supplied name will be delivered to the supplied
+ * Dispatcher's lookup method which will in turn return the object. </p>
+ * <p>Simple usage:</p>
+ * <pre>
+ * rt.newDispatchingServer('service/name', dispatcher, function(server) {
+ *   // server is now active and listening for RPC calls.
+ * });
+ * </pre>
+ *
+ * <p>If name is an empty string, no attempt will made to publish that
+ * name to a mount table.
+ * To publish the same object under multiple names,
+ * {@link module:vanadium.rpc~Server#addName|addName} can be used.</p>
+ *
+ * @public
+ * @param {string} name Name to publish under.
+ * @param {module:vanadium.rpc~Server~ServerDispatcher} dispatcher A function
+ * that will take in the suffix and the method to be called and return the
+ * service object for that suffix.
+ * @property {module:vanadium.rpc~Server~ServerOption} [serverOption] Optional
+ * server configuration such as whether the server is a mount table or
+ * represents a leaf server. serverOption can be created with the
+ * [vanadium.rpc.serverOption(opts)]{@link module:vanadium.rpc#serverOption}
+ * method.
+ * @param {module:vanadium.rpc~Server~NewServer-callback} [cb] If provided,
+ * the function will be called when server is ready and listening for RPC calls.
+ * @return {Promise<module:vanadium.rpc~Server>} Promise to be called when
+ * server is ready and listening for RPC calls.
+ */
+Runtime.prototype.newDispatchingServer = function(name, dispatcher,
+  serverOption, cb) {
+
+  if (typeof serverOption === 'function') {
+    cb = serverOption;
+    serverOption = undefined;
+  }
+
+  var def = new Deferred(cb);
+  var server = new Server(this._getRouter());
+
+  server._init(name, dispatcher, serverOption).then(function() {
+    def.resolve(server);
+  }).catch(def.reject);
+
+  return def.promise;
+};
+
+/**
+ * Returns a [Client]{@link module:vanadium.rpc~Client} instance.<br>
  * Client allows one to bind to Vanadium names and call methods on them.
  * @return {module:vanadium.rpc~Client} A Client instance.
  */
-Runtime.prototype.newClient = function() {
-  return new Client(this._getProxyConnection());
+Runtime.prototype.getClient = function() {
+  return this._client;
 };
 
 /**
@@ -205,8 +381,8 @@
  * </p>
  * @return {module:vanadium.naming~Namespace} A namespace client instance.
  */
-Runtime.prototype.namespace = function() {
-  this._ns = this._ns || new Namespace(this.newClient(),
+Runtime.prototype.getNamespace = function() {
+  this._ns = this._ns || new Namespace(this.getClient(),
     this.getContext());
   return this._ns;
 };
@@ -273,4 +449,4 @@
       this.blessingsCache);
   }
   return this._granterRouter;
-};
+};
\ No newline at end of file
diff --git a/test/integration/get-service.js b/test/integration/get-service.js
index 840bb0d..55a0752 100644
--- a/test/integration/get-service.js
+++ b/test/integration/get-service.js
@@ -31,7 +31,7 @@
     }
 
     var ctx = runtime.getContext();
-    runtime.newClient().bindTo(ctx, name, function(err, service) {
+    runtime.getClient().bindTo(ctx, name, function(err, service) {
       callback(err, ctx, service, end, runtime);
     });
 
diff --git a/test/integration/serve.js b/test/integration/serve.js
index 9d67350..9418c28 100644
--- a/test/integration/serve.js
+++ b/test/integration/serve.js
@@ -69,67 +69,70 @@
       return callback(err, basicRes);
     }
 
-    var server = runtime.newServer(serverOption);
-    server.serveDispatcher(name, dispatcher, function(err) {
-      if (err) {
-        return callback(err, basicRes);
-      }
+    runtime.newDispatchingServer(name, dispatcher, serverOption,
+      function(err, server) {
 
-      var ctx = runtime.getContext();
+        if (err) {
+          return callback(err, basicRes);
+        }
 
-      waitUntilResolve();
+        var ctx = runtime.getContext();
 
-      // The server is not gauranteed to be mounted by the time the serve
-      // call finishes.  We should wait until the name resolves before calling
-      // the callback.  As a side a benefit, this also speeds up the browser
-      // tests, because browspr is quicker than wspr and so it is more likely
-      // to return before the server is mounted.  The normal backoff for bindTo
-      // starts at 100ms, but this code only waits a few milliseconds.
-      function waitUntilResolve() {
-        var ns = runtime.namespace();
-        var count = 0;
-        runResolve();
-        function runResolve() {
-          ns.resolve(ctx, name, function(err, s) {
-            if (err || s.length === 0) {
-              count++;
-              if (count === 10) {
-                return callback(
-                  new Error(
-                    'Timed out waiting for resolve in serve.js: ' + err),
-                  basicRes);
+        waitUntilResolve();
+
+        // The server is not gauranteed to be mounted by the time the serve
+        // call finishes.  We should wait until the name resolves before calling
+        // the callback.  As a side a benefit, this also speeds up the browser
+        // tests, because browspr is quicker than wspr and so it is more likely
+        // to return before the server is mounted.  The normal backoff for
+        // bindTo starts at 100ms, but this code only waits a few milliseconds.
+        function waitUntilResolve() {
+          var ns = runtime.getNamespace();
+          var count = 0;
+          runResolve();
+
+          function runResolve() {
+            ns.resolve(ctx, name, function(err, s) {
+              if (err || s.length === 0) {
+                count++;
+                if (count === 10) {
+                  return callback(
+                    new Error(
+                      'Timed out waiting for resolve in serve.js: ' + err),
+                    basicRes);
+                }
+                return setTimeout(runResolve, 10);
               }
-              return setTimeout(runResolve, 10);
-            }
-            completeServe();
-          });
-        }
-      }
-      function completeServe() {
-        var res = {
-          runtime: runtime,
-          config: config,
-          close: close,
-          end: end,
-          server: server
-        };
-
-        if (options.autoBind === false) {
-          return callback(err, res, end);
+              completeServe();
+            });
+          }
         }
 
-        function onBind(err, service) {
-          if (err) {
-            return callback(err, basicRes);
+        function completeServe() {
+          var res = {
+            runtime: runtime,
+            config: config,
+            close: close,
+            end: end,
+            server: server
+          };
+
+          if (options.autoBind === false) {
+            return callback(err, res, end);
           }
 
-          res.service = service;
-          callback(err, res, end);
+          function onBind(err, service) {
+            if (err) {
+              return callback(err, basicRes);
+            }
+
+            res.service = service;
+            callback(err, res, end);
+          }
+          var client = runtime.getClient();
+          client.bindTo(ctx, name, onBind);
         }
-        var client = runtime.newClient();
-        client.bindTo(ctx, name, onBind);
-      }
-    });
+      });
 
     function close(callback) {
       return runtime.close(callback);
@@ -137,7 +140,7 @@
 
     // hoisted and passed as the last argument to the callback argument.
     function end(assert, errorMsg) {
-      if (!! assert.end && typeof assert.end === 'function') {
+      if (!!assert.end && typeof assert.end === 'function') {
         return close(function(err) {
           assert.error(err, 'should not error on runtime.close(...)');
           assert.end(errorMsg);
@@ -148,4 +151,4 @@
       }
     }
   });
-}
+}
\ No newline at end of file
diff --git a/test/integration/test-authorizer.js b/test/integration/test-authorizer.js
index b8ff575..f88ea69 100644
--- a/test/integration/test-authorizer.js
+++ b/test/integration/test-authorizer.js
@@ -52,7 +52,7 @@
     if (err) {
       return assert.end(err);
     }
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'authorizerTestService/auth').then(function(service) {
       service.call(ctx, 'foo').then(function(value) {
@@ -116,7 +116,7 @@
     if (err) {
       return assert.end(err);
     }
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'authorizerTestService/auth').then(function(service) {
       return service.call(ctx, 'foo');
diff --git a/test/integration/test-bless.js b/test/integration/test-bless.js
index 7fc6de9..2ce1ba1 100644
--- a/test/integration/test-bless.js
+++ b/test/integration/test-bless.js
@@ -153,7 +153,7 @@
         return;
       }
 
-      var client = res.runtime.newClient();
+      var client = res.runtime.getClient();
       var fiveSecondsInFuture = new Date(Date.now() + 5000);
       var granterCalled = false;
       var granterOption = client.callOption({
diff --git a/test/integration/test-caveat-validation.js b/test/integration/test-caveat-validation.js
index cc57626..bfa1b27 100644
--- a/test/integration/test-caveat-validation.js
+++ b/test/integration/test-caveat-validation.js
@@ -60,7 +60,7 @@
       caveatValidator);
 
     // Bind to the go process that will invoke aMethod.
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     client.bindTo(res.runtime.getContext(), invokerName, function(err, stub) {
       if (err) {
         res.end(t, 'error in bindTo: ' + err);
diff --git a/test/integration/test-client-bind-to.js b/test/integration/test-client-bind-to.js
index c36ddf1..630f422 100644
--- a/test/integration/test-client-bind-to.js
+++ b/test/integration/test-client-bind-to.js
@@ -17,7 +17,7 @@
     assert.error(err);
 
     rt = runtime;
-    var client = rt.newClient();
+    var client = rt.getClient();
     var ctx = rt.getContext();
     client.bindTo(ctx, 'test_service/cache', onbind);
   }
@@ -39,7 +39,7 @@
 
   function bindTo(runtime) {
     var ctx = runtime.getContext();
-    return runtime.newClient()
+    return runtime.getClient()
     .bindTo(ctx, 'test_service/cache')
     .then(function(service) {
       assert.ok(service);
@@ -53,7 +53,7 @@
   vanadium.init(config, function(err, runtime) {
     assert.error(err);
 
-    var client = runtime.newClient();
+    var client = runtime.getClient();
     var ctx = runtime.getContext().withTimeout(100);
     client.bindTo(ctx, 'does-not/exist', function(err, service) {
       assert.ok(err instanceof Error);
@@ -71,7 +71,7 @@
   .init(config)
   .then(function(runtime) {
     rt = runtime;
-    var client = rt.newClient();
+    var client = rt.getClient();
     var ctx = runtime.getContext().withTimeout(100);
     return client.bindTo(ctx, 'does-not/exist');
   })
@@ -98,7 +98,7 @@
 
   function onruntime(err, runtime) {
     assert.notOk(err);
-    var client = runtime.newClient();
+    var client = runtime.getClient();
     client.bindTo(runtime.getContext(), 'test_service/cache', function(err) {
       assert.ok(err instanceof Error);
       runtime.close();
@@ -121,7 +121,7 @@
     assert.end();
   }).then(function(runtime) {
     rt = runtime;
-    var client = rt.newClient();
+    var client = rt.getClient();
     return client.bindTo(runtime.getContext(), 'test_service/cache');
   }).then(function() {
     rt.close();
diff --git a/test/integration/test-client-call-opts.js b/test/integration/test-client-call-opts.js
index 3f83f05..6414cc8 100644
--- a/test/integration/test-client-call-opts.js
+++ b/test/integration/test-client-call-opts.js
@@ -18,7 +18,7 @@
       return t.end(err);
     }
 
-    var client = rt.newClient();
+    var client = rt.getClient();
 
     var opts = client.callOption({ });
     t.ok(opts, 'with no options should succeed');
@@ -38,7 +38,7 @@
       return t.end(err);
     }
 
-    var client = rt.newClient();
+    var client = rt.getClient();
 
     t.throws(function() {
       client.callOption({
@@ -69,7 +69,7 @@
     }
 
     var ctx = rt.getContext();
-    var client = rt.newClient();
+    var client = rt.getClient();
 
     client.bindTo(ctx, 'test_service/cache', function(err, cache) {
       if (err) {
@@ -95,7 +95,7 @@
     }
 
     var ctx = rt.getContext();
-    var client = rt.newClient();
+    var client = rt.getClient();
 
     client.bindTo(ctx, 'test_service/cache', function(err, cache) {
       if (err) {
diff --git a/test/integration/test-dispatcher.js b/test/integration/test-dispatcher.js
index 961fad4..3aecb05 100644
--- a/test/integration/test-dispatcher.js
+++ b/test/integration/test-dispatcher.js
@@ -17,7 +17,7 @@
       return assert.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'dispatcherServiceName/echo/bar',
       function(err, service) {
@@ -48,7 +48,7 @@
       return assert.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'dispatcherServiceName/count/bar',
       function(err, service) {
@@ -78,7 +78,7 @@
       return assert.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     var promises = [
       client.bindTo(ctx, 'dispatcherServiceName/count/bar')
@@ -114,7 +114,7 @@
       return assert.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'dispatcherServiceName/unknown',
       function(err, service) {
@@ -138,7 +138,7 @@
 
     var ctx = res.runtime.getContext();
     var name = 'dispatcherServiceName/promise/whatever';
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     client.bindTo(ctx, name, function(err, service) {
       if (err) {
         return assert.end(err);
@@ -165,7 +165,7 @@
       return assert.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'dispatcherServiceName/promise/fail',
       function(err, service) {
@@ -190,7 +190,7 @@
     var ctx = res.runtime.getContext();
 
     var name = 'dispatcherServiceName/callback/whatever';
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     client.bindTo(ctx, name, function(err, service) {
       if (err) {
         return assert.end(err);
@@ -217,7 +217,7 @@
       return assert.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'dispatcherServiceName/callback/fail',
       function(err, service) {
diff --git a/test/integration/test-namespace.js b/test/integration/test-namespace.js
index 2da55ca..2cab811 100644
--- a/test/integration/test-namespace.js
+++ b/test/integration/test-namespace.js
@@ -23,7 +23,7 @@
 
   init(config).then(function glob(rt) {
     runtime = rt;
-    var namespace = rt.namespace();
+    var namespace = rt.getNamespace();
     var ctx = runtime.getContext();
     var rpc = namespace.glob(ctx, PREFIX + '*');
     rpc.catch(end);
@@ -56,7 +56,7 @@
       return end(err);
     }
 
-    var namespace = runtime.namespace();
+    var namespace = runtime.getNamespace();
     var context = runtime.getContext();
     var promise = namespace.glob(context, '*');
     var stream = promise.stream;
@@ -110,7 +110,7 @@
 
     init(config).then(function glob(rt) {
       runtime = rt;
-      var namespace = rt.namespace();
+      var namespace = rt.getNamespace();
       var ctx = runtime.getContext();
       var rpc = namespace.glob(ctx, PREFIX + 'cottage/*/*/*');
       rpc.catch(end);
@@ -143,7 +143,7 @@
 
     init(config).then(function glob(rt) {
       runtime = rt;
-      var namespace = rt.namespace();
+      var namespace = rt.getNamespace();
       var ctx = runtime.getContext();
       var rpc = namespace.glob(ctx, PREFIX + 'does/not/exist');
       rpc.catch(end);
@@ -171,7 +171,7 @@
 
     init(config).then(function glob(rt) {
       runtime = rt;
-      var namespace = rt.namespace();
+      var namespace = rt.getNamespace();
       var ctx = runtime.getContext();
       return namespace.glob(ctx, PREFIX + '*');
     }).then(function(finalResult) {
@@ -197,7 +197,7 @@
 
     init(config).then(function glob(rt) {
       runtime = rt;
-      var namespace = rt.namespace();
+      var namespace = rt.getNamespace();
       var ctx = runtime.getContext();
       namespace.glob(ctx, PREFIX + '*', function(err, finalResult) {
         assert.error(err);
@@ -228,7 +228,7 @@
     var runtime;
     vanadium.init(config).then(function glob(rt) {
       runtime = rt;
-      var namespace = rt.namespace();
+      var namespace = rt.getNamespace();
       // Note: Glob will always timeout after 30s
       // see v.io/x/ref/runtime/internal/naming/namespace/parallelstartcall.go
       // This means we'll get a timeout error on the glob stream before
@@ -286,13 +286,11 @@
     var secondaryName = PREFIX + 'new/name';
 
     var ctx;
-    var server;
     vanadium.init(config).then(function createServer(rt) {
         runtime = rt;
-        namespace = rt.namespace();
+        namespace = rt.getNamespace();
         ctx = rt.getContext();
-        server = rt.newServer();
-        return server.serve(initialName, {});
+        return rt.newServer(initialName, {});
       })
       .then(function() {
         return waitForPublish(initialName, runtime);
@@ -340,7 +338,7 @@
     init(config).then(function resolveToMountTable(rt) {
       runtime = rt;
       ctx = runtime.getContext();
-      var namespace = rt.namespace();
+      var namespace = rt.getNamespace();
       return namespace.resolveToMounttable(ctx, PREFIX + 'cottage');
     }).then(function validate(mounttableNames) {
       assert.equals(mounttableNames.length, 1);
@@ -368,7 +366,7 @@
 
     init(config).then(function flushCacheEntry(rt) {
       runtime = rt;
-      namespace = rt.namespace();
+      namespace = rt.getNamespace();
       return namespace.flushCacheEntry(name);
     }).then(function validate() {
       // We don't check the return result of flushCachEntry since there is no
@@ -400,7 +398,7 @@
   init(config).then(function disableCache(rt) {
     runtime = rt;
     ctx = rt.getContext();
-    namespace = rt.namespace();
+    namespace = rt.getNamespace();
     return namespace.disableCache(true);
   }).then(function resolveButItShouldNotGetCached(rt) {
     return namespace.resolve(ctx, name);
@@ -430,7 +428,7 @@
 
     init(config).then(function setRoots(rt) {
       runtime = rt;
-      namespace = rt.namespace();
+      namespace = rt.getNamespace();
       ctx = rt.getContext();
       // Set the roots to a valid root, we expect normal glob results.
       return namespace.setRoots(namespaceRoot);
@@ -472,14 +470,14 @@
     var ctx;
     vanadium.init(config).then(function setRoots(rt) {
       runtime = rt;
-      namespace = rt.namespace();
+      namespace = rt.getNamespace();
       ctx = rt.getContext();
       // Set the roots to a invalid roots, then we don't expect resolution.
       return namespace.setRoots(['/bad-root-1.tld:80', '/bad-root-2.tld:1234']);
     }).then(function bind() {
       // Since setRoots changes runtimes Namespace roots, binding to any name
       // should now fail
-      var client = runtime.newClient();
+      var client = runtime.getClient();
       ctx = ctx.withTimeout(timeouts.short);
       return client.bindTo(ctx, PREFIX + 'house/kitchen/lights')
         .then(function() {
@@ -507,7 +505,7 @@
 
   init(config).then(function roots(rt) {
     runtime = rt;
-    var namespace = rt.namespace();
+    var namespace = rt.getNamespace();
     return namespace.roots();
   }).then(function validate(roots) {
     assert.equals(roots.length, 1);
@@ -536,7 +534,7 @@
     function onInit(err, rt) {
       assert.error(err);
       runtime = rt;
-      namespace = rt.namespace();
+      namespace = rt.getNamespace();
       namespace.setRoots('/root1:80', '/root2:1234', onSetRoots);
     }
 
@@ -562,7 +560,7 @@
     }
 
     var ctx = rt.getContext();
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var name = 'non/existant/name';
 
     ns.getPermissions(ctx, name, function(err) {
@@ -581,7 +579,7 @@
       }
 
       var ctx = rt.getContext();
-      var ns = rt.namespace();
+      var ns = rt.getNamespace();
       // Note: we use a random name here so we can run the test multiple times
       // with the same mounttable without getting locked out of a name.
       var name = 'path/to/some/name/' + random.hex();
@@ -642,7 +640,7 @@
     }
 
     var ctx = rt.getContext();
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var name = 'non/existant/name';
 
     ns.delete(ctx, name, true, function(err) {
@@ -660,7 +658,7 @@
     }
 
     var ctx = rt.getContext();
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var name = 'name/that/will/be/deleted';
     var ep = '/@6@ws@2.2.2.2:2222@@e8972f90fe028674f78a164f001d07c5@s@@';
 
@@ -702,7 +700,7 @@
     }
 
     var ctx = rt.getContext();
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var name = 'path/to/name/with/no/children';
 
     var perms = new access.Permissions(new Map([
@@ -733,7 +731,7 @@
     }
 
     var ctx = rt.getContext();
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var name = 'path/to/name/with/children';
     var childName1 = vanadium.naming.join(name, 'child1');
     var childName2 = vanadium.naming.join(name, 'node/child2');
@@ -828,14 +826,12 @@
 
 function init(config) {
   var runtime;
-  var server;
   return vanadium.init(config)
     .then(function serveEmptyService(rt) {
       runtime = rt;
-      server = rt.newServer();
-      return server.serve('', {});
+      return rt.newServer('', {});
     })
-    .then(function publishUnderMultipleNames() {
+    .then(function publishUnderMultipleNames(server) {
       var addNamesRequests = SAMPLE_NAMESPACE.map(function(name) {
         return server.addName(PREFIX + name);
       });
@@ -867,7 +863,7 @@
   var WAIT_TIME = 100;
   var MAX_TRIES = 50;
   return new Promise(function(resolve, reject) {
-    var ns = runtime.namespace();
+    var ns = runtime.getNamespace();
     var count = 0;
     runResolve();
 
diff --git a/test/integration/test-new-server.js b/test/integration/test-new-server.js
index e601f2a..70d6a61 100644
--- a/test/integration/test-new-server.js
+++ b/test/integration/test-new-server.js
@@ -5,11 +5,20 @@
 var test = require('prova');
 var vanadium = require('../../');
 var Promise = require('../../src/lib/promise');
+var Deferred = require('../../src/lib/deferred');
 var config = require('./default-config');
 var timeouts = require('./timeouts');
+var isBrowser = require('is-browser');
+var promiseWhile = require('../../src/lib/async-helper').promiseWhile;
 
 var NAME_PREFIX = 'new-server-testing-چשઑᜰ/';
 
+var service = {
+  changeChannel: function(ctx, serverCall) {
+    throw new Error('NotImplemented');
+  }
+};
+
 var fooService = {
   foo: function(ctx, serverCall) {
     return 'foo result';
@@ -22,6 +31,135 @@
   }
 };
 
+test('Test creating a JS service named livingroom/tv - ' +
+  'rt.newServer(name, service, callback)', function(assert) {
+  vanadium.init(config, function(err, runtime) {
+    assert.error(err);
+
+    runtime.newServer('livingroom/tv', service, function(err) {
+      assert.error(err);
+      runtime.close(assert.end);
+    });
+  });
+});
+
+test('Test creating a JS service named livingroom/tv - ' +
+  'var promise = rt.newServer(name, service)', function(assert) {
+  vanadium.init(config, function(err, runtime) {
+    assert.error(err);
+
+    runtime.newServer('livingroom/tv', service)
+    .then(function() {
+      runtime.close(assert.end);
+    })
+    .catch(function(err) {
+      assert.error(err);
+      runtime.close(assert.end);
+    });
+  });
+});
+
+test('Test creating a JS service when proxy Url is invalid - '+
+  'rt.newServer(name, service, callback)', function(t) {
+  if (isBrowser) {
+    return t.end();
+  }
+
+  vanadium.init({ wspr: 'http://bad-address.tld' }, function(err, runtime) {
+    t.notOk(err, 'no error expected on init() since wspr isn\'t ' +
+      'contacted');
+    runtime.newServer('should/fail', service, function(err) {
+      t.ok(err, 'should get error after attempting to serve with bad proxy');
+      runtime.close(t.end);
+    });
+  });
+});
+
+test('Test creating a JS service when proxy Url is invalid - '+
+  'var promise = runtime.newServer(name, service)', function(t) {
+  if (isBrowser) {
+    return t.end();
+  }
+
+  vanadium.init({ wspr: 'http://bad-address.tld' }, function(err, runtime) {
+    t.notOk(err, 'no error expected on init() since wspr isn\'t ' +
+      'contacted');
+    runtime.newServer('should/fail', service).then(function() {
+      t.fail('serve expected to fail but succeeded');
+      runtime.close(t.end);
+    }).catch(function(err) {
+      t.ok(err, 'should get error after attempting to serve with bad proxy');
+      runtime.close(t.end);
+    });
+  });
+});
+
+test('Test creating a JS service under multiple names - ' +
+  'runtime.addName(name), runtime.removeName(name)', function(assert) {
+  var ctx;
+
+  vanadium.init(config, function(err, runtime) {
+    assert.error(err);
+
+    var client = runtime.getClient();
+    ctx = runtime.getContext();
+    var server;
+    runtime.newServer('livingroom/tv', service)
+    .then(function addSecondName(s) {
+      server = s;
+      return server.addName('bedroom/tv');
+    })
+    .then(function bindToSecondName() {
+      return client.bindTo(ctx, 'bedroom/tv');
+    })
+    .then(function verifySecondName(newObject){
+      assert.ok(newObject && newObject.changeChannel, 'new name works');
+    })
+    .then(function removeSecondName() {
+      return server.removeName('bedroom/tv');
+    })
+    .then(function waitForNameToBeRemoved() {
+      var numTries = 0;
+      function tryBindTo() {
+        numTries++;
+        if (numTries > 5) {
+          return Promise.resolve(false);
+        }
+        var shortCtx = runtime.getContext().withTimeout(200);
+        return runtime.getNamespace().resolve(shortCtx, 'bedroom/tv')
+        .then(function() {
+          return true;
+        }).catch(function(err) {
+          return false;
+        });
+      }
+      // Resolve every 100ms until the name is removed, or 5 tries are
+      // attempted.
+      return promiseWhile(tryBindTo, function() {
+        var def = new Deferred();
+        setTimeout(function() {
+          def.resolve();
+        }, 100);
+        return def.promise;
+      });
+    }).then(function bindToRemovedSecondName() {
+      var shortCtx = runtime.getContext().withTimeout(100);
+      client.bindTo(shortCtx, 'bedroom/tv')
+      .then(function verifyRemovedSecondName(a) {
+        assert.fail('should not be able to bind to a removed name');
+        runtime.close(assert.end);
+      }, function verifyRemovedSecondName(err) {
+        assert.ok(err instanceof Error, 'should fail');
+        runtime.close(assert.end);
+      });
+    })
+    .catch(function(err) {
+      assert.error(err);
+      runtime.close(assert.end);
+    });
+  });
+});
+
 test('Test running several JS servers concurrently and under multiple ' +
   'names', function(assert) {
   var ctx;
@@ -39,18 +177,16 @@
   return vanadium.init(config)
   .then(function createTwoServers(rt) {
     runtime = rt;
-    client = rt.newClient();
+    client = rt.getClient();
     ctx = rt.getContext();
-    fooServer = rt.newServer();
-    barServer = rt.newServer();
-  })
-  .then(function serveFooAndBarServices(){
     return Promise.all([
-      fooServer.serve(NAME_PREFIX + 'foo', fooService ),
-      barServer.serve(NAME_PREFIX + 'bar', barService )
+      rt.newServer(NAME_PREFIX + 'foo', fooService ),
+      rt.newServer(NAME_PREFIX + 'bar', barService )
     ]);
   })
-  .then(function publishFooAndBarUnderAdditionalNames() {
+  .then(function publishFooAndBarUnderAdditionalNames(servers) {
+    fooServer = servers[0];
+    barServer = servers[1];
     return Promise.all([
       fooServer.addName(NAME_PREFIX + 'foo-fighter'),
       barServer.addName(NAME_PREFIX + 'bar-baz')
diff --git a/test/integration/test-remote-blessings.js b/test/integration/test-remote-blessings.js
index 4c3548b..e179a5a 100644
--- a/test/integration/test-remote-blessings.js
+++ b/test/integration/test-remote-blessings.js
@@ -32,7 +32,7 @@
       return t.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
 
     client.remoteBlessings(ctx, serverName, function(err, blessings) {
@@ -55,7 +55,7 @@
       return t.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
 
     client.remoteBlessings(ctx, serverName, 'bar', function(err, blessings) {
@@ -78,7 +78,7 @@
       return t.end(err);
     }
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
 
     client.remoteBlessings(ctx, serverName, 'baz', function(err, blessings) {
@@ -100,7 +100,7 @@
     if (err) {
       return t.end(err);
     }
-    var client = rt.newClient();
+    var client = rt.getClient();
     var ctx = rt.getContext();
 
     client.remoteBlessings(ctx, 'unknown', function(err, blessings) {
diff --git a/test/integration/test-runtime-close.js b/test/integration/test-runtime-close.js
index ea3d468..b96a2c7 100644
--- a/test/integration/test-runtime-close.js
+++ b/test/integration/test-runtime-close.js
@@ -14,7 +14,7 @@
     rt = runtime;
     var ctx = runtime.getContext();
     assert.error(err);
-    var client = runtime.newClient();
+    var client = runtime.getClient();
     client.bindTo(ctx, 'test_service/cache', onbind);
   }
 
@@ -36,7 +36,7 @@
 
   function bindTo(runtime) {
     rt = runtime;
-    var client = runtime.newClient();
+    var client = runtime.getClient();
     var ctx = runtime.getContext();
     return client.bindTo(ctx, 'test_service/cache');
   }
diff --git a/test/integration/test-server-call.js b/test/integration/test-server-call.js
index a89c8f5..b1a5ae4 100644
--- a/test/integration/test-server-call.js
+++ b/test/integration/test-server-call.js
@@ -74,7 +74,7 @@
 test('Test non-empty suffix is available in context', function(assert) {
   serve('a/b', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'a/b/foo', function(err, service) {
       assert.error(err, 'should not error on runtime.bindTo(...)');
@@ -91,7 +91,7 @@
 test('Test Unicode suffix is available in context', function(assert) {
   serve('a/b', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'a/b/چשઑᜰ', function(err, service) {
       assert.error(err, 'should not error on runtime.bindTo(...)');
@@ -109,7 +109,7 @@
   serve('a/b', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'a/b', function(err, service) {
       assert.error(err, 'should not error on runtime.bindTo(...)');
@@ -126,7 +126,7 @@
 test('Test nested suffix /parent/suffix ', function(assert) {
   serve('a/b', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'a/b/parent/suf', function(err, service) {
       assert.error(err, 'should not error on runtime.bindTo(...)');
@@ -144,7 +144,7 @@
   serve('a/b', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'a/b/suf', function(err, service) {
       assert.error(err, 'should not error on runtime.bindTo(...)');
@@ -163,7 +163,7 @@
   serve('a/b', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
 
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, 'a/b/suf', function(err, service) {
       assert.error(err, 'should not error on runtime.bindTo(...)');
diff --git a/test/integration/test-server-context.js b/test/integration/test-server-context.js
index d84a9d3..762a4d5 100644
--- a/test/integration/test-server-context.js
+++ b/test/integration/test-server-context.js
@@ -18,7 +18,7 @@
 test('Test language in context', function(assert) {
   serve('context', dispatcher, function(err, res, end) {
     assert.error(err, 'should not error on serve(...)');
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext().withValue(LANG_KEY, 'my-lang');
     client.bindTo(ctx, 'context').then(function(service) {
       return service.test(ctx);
diff --git a/test/integration/test-server-glob.js b/test/integration/test-server-glob.js
index cca52c5..f91bcc9 100644
--- a/test/integration/test-server-glob.js
+++ b/test/integration/test-server-glob.js
@@ -116,7 +116,7 @@
       return assert.end(err);
     }
 
-    var namespace = res.runtime.namespace();
+    var namespace = res.runtime.getNamespace();
     var ctx = res.runtime.getContext();
     var globRPC = namespace.glob(ctx, pattern);
     var stream = globRPC.stream;
diff --git a/test/integration/test-server-option.js b/test/integration/test-server-option.js
index fc726de..af7c947 100644
--- a/test/integration/test-server-option.js
+++ b/test/integration/test-server-option.js
@@ -33,7 +33,7 @@
     t.error(err);
 
     var rt = res.runtime;
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var stream = ns.glob(rt.getContext(), name).stream;
     stream.on('data', function(mp) {
       t.error(err);
@@ -62,7 +62,7 @@
     t.error(err);
 
     var rt = res.runtime;
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var stream = ns.glob(rt.getContext(), name).stream;
     stream.on('data', function(mp) {
       t.error(err);
@@ -91,7 +91,7 @@
     t.error(err);
 
     var rt = res.runtime;
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var stream = ns.glob(rt.getContext(), name).stream;
     stream.on('data', function(mp) {
       t.error(err);
@@ -120,7 +120,7 @@
     t.error(err);
 
     var rt = res.runtime;
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var stream = ns.glob(rt.getContext(), name).stream;
     stream.on('data', function(mp) {
       t.error(err);
@@ -151,7 +151,7 @@
       t.error(err);
 
       var rt = res.runtime;
-      var ns = rt.namespace();
+      var ns = rt.getNamespace();
       var stream = ns.glob(rt.getContext(), name).stream;
       stream.on('data', function(mp) {
         t.error(err);
diff --git a/test/integration/test-server-serve.js b/test/integration/test-server-serve.js
deleted file mode 100644
index 703efab..0000000
--- a/test/integration/test-server-serve.js
+++ /dev/null
@@ -1,208 +0,0 @@
-// Copyright 2015 The Vanadium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-var isBrowser = require('is-browser');
-var test = require('prova');
-var vanadium = require('../../');
-var config = require('./default-config');
-var Deferred = require('../../src/lib/deferred');
-var promiseWhile = require('../../src/lib/async-helper').promiseWhile;
-var service = {
-  changeChannel: function(ctx, serverCall) {
-    throw new Error('NotImplemented');
-  }
-};
-
-test('Test serving a JS service named livingroom/tv - ' +
-  'server.serve(name, service, callback)', function(assert) {
-  vanadium.init(config, function(err, runtime) {
-    assert.error(err);
-
-    var server = runtime.newServer();
-    server.serve('livingroom/tv', service, function(err) {
-      assert.error(err);
-      runtime.close(assert.end);
-    });
-  });
-});
-
-test('Test serving a JS service named livingroom/tv - ' +
-  'var promise = server.serve(name, service)', function(assert) {
-  vanadium.init(config, function(err, runtime) {
-    assert.error(err);
-
-    var server = runtime.newServer();
-    server
-    .serve('livingroom/tv', service)
-    .then(function() {
-      runtime.close(assert.end);
-    })
-    .catch(function(err) {
-      assert.error(err);
-      runtime.close(assert.end);
-    });
-  });
-});
-
-test('Test serving a JS service when proxy Url is invalid - '+
-  'server.serve(name, service, callback)', function(t) {
-  if (isBrowser) {
-    return t.end();
-  }
-
-  vanadium.init({ wspr: 'http://bad-address.tld' }, function(err, runtime) {
-    t.notOk(err, 'no error expected on init() since wspr isn\'t ' +
-      'contacted');
-    var server = runtime.newServer();
-    server.serve('should/fail', service, function(err) {
-      t.ok(err, 'should get error after attempting to serve with bad proxy');
-      runtime.close(t.end);
-    });
-  });
-});
-
-test('Test serving a JS service when proxy Url is invalid - '+
-  'var promise = server.serve(name, service)', function(t) {
-  if (isBrowser) {
-    return t.end();
-  }
-
-  vanadium.init({ wspr: 'http://bad-address.tld' }, function(err, runtime) {
-    t.notOk(err, 'no error expected on init() since wspr isn\'t ' +
-      'contacted');
-    var server = runtime.newServer();
-    server.serve('should/fail', service).then(function() {
-      t.fail('serve expected to fail but succeeded');
-      runtime.close(t.end);
-    }).catch(function(err) {
-      t.ok(err, 'should get error after attempting to serve with bad proxy');
-      runtime.close(t.end);
-    });
-  });
-});
-
-test('Test serving a JS service multiple times should fail - ' +
-  'server.serve(name, service)', function(assert) {
-  vanadium.init(config, function(err, runtime) {
-    assert.error(err);
-
-    if(err) {
-      assert.end();
-      return;
-    }
-
-    var server = runtime.newServer();
-    server.serve('livingroom/tv', service, function(err, firstEndpoint) {
-      assert.error(err);
-
-      server.serve('bedroom/tv', service, function(err) {
-        assert.ok(err instanceof Error, 'should not be able to serve twice');
-        runtime.close(assert.end);
-      });
-    });
-  });
-});
-
-test('Test serving a JS service multiple times should fail - ' +
-  'var promise = server.serve(name, service)', function(assert) {
-  vanadium.init(config, function(err, runtime) {
-    assert.error(err);
-
-    var server = runtime.newServer();
-    server
-    .serve('livingroom/tv', service)
-    .then(function() {
-      return server.serve('bedroom/tv', service).then(function() {
-        assert.fail('should not be able to serve twice');
-        runtime.close(assert.end);
-      }, function(err) {
-        assert.ok(err instanceof Error, 'should not be able to serve twice');
-        runtime.close(assert.end);
-      });
-    })
-    .catch(function(err) {
-      assert.error(err);
-      runtime.close(assert.end);
-    });
-  });
-});
-
-test('Test serving a JS service under multiple names - ' +
-  'runtime.addName(name), runtime.removeName(name)', function(assert) {
-  var ctx;
-
-  vanadium.init(config, function(err, runtime) {
-    assert.error(err);
-
-    var server = runtime.newServer();
-    var client = runtime.newClient();
-    ctx = runtime.getContext();
-    server
-    .serve('livingroom/tv', service)
-    .then(function addSecondName() {
-      return server.addName('bedroom/tv');
-    })
-    .then(function bindToSecondName() {
-      return client.bindTo(ctx, 'bedroom/tv');
-    })
-    .then(function verifySecondName(newObject){
-      assert.ok(newObject && newObject.changeChannel, 'new name works');
-    })
-    .then(function removeSecondName() {
-      return server.removeName('bedroom/tv');
-    })
-    .then(function waitForNameToBeRemoved() {
-      var numTries = 0;
-      function tryBindTo() {
-        numTries++;
-        if (numTries > 5) {
-          return Promise.resolve(false);
-        }
-        var shortCtx = runtime.getContext().withTimeout(200);
-        return runtime.namespace().resolve(shortCtx, 'bedroom/tv')
-        .then(function() {
-          return true;
-        }).catch(function(err) {
-          return false;
-        });
-      }
-      // Resolve every 100ms until the name is removed, or 5 tries are
-      // attempted.
-      return promiseWhile(tryBindTo, function() {
-        var def = new Deferred();
-        setTimeout(function() {
-          def.resolve();
-        }, 100);
-        return def.promise;
-      });
-    }).then(function bindToRemovedSecondName() {
-      var shortCtx = runtime.getContext().withTimeout(100);
-      client.bindTo(shortCtx, 'bedroom/tv')
-      .then(function verifyRemovedSecondName(a) {
-        assert.fail('should not be able to bind to a removed name');
-        runtime.close(assert.end);
-      }, function verifyRemovedSecondName(err) {
-        assert.ok(err instanceof Error, 'should fail');
-        runtime.close(assert.end);
-      });
-    })
-    .catch(function(err) {
-      assert.error(err);
-      runtime.close(assert.end);
-    });
-  });
-});
-
-test('Test adding additional names before serving a JS service should fail - ' +
-  'runtime.addName(name, cb) - before server.serve()', function(assert) {
-  vanadium.init(config, function(err, runtime) {
-    assert.error(err);
-
-    var server = runtime.newServer();
-    server.addName('bedroom/tv', function(err) {
-      assert.ok(err instanceof Error, 'should fail');
-      runtime.close(assert.end);
-    });
-  });
-});
diff --git a/test/integration/test-server-stop.js b/test/integration/test-server-stop.js
index f652150..118ffd6 100644
--- a/test/integration/test-server-stop.js
+++ b/test/integration/test-server-stop.js
@@ -54,64 +54,6 @@
   });
 });
 
-test('Test re-serving a stopped JS service - ' +
-  'server.stop(callback), runtime.serve(callback)', function(assert) {
-  serve(name, dispatcher, function(err, res) {
-    assert.error(err);
-
-    var server = res.server;
-    var client = res.runtime.newClient();
-    var ctx = res.runtime.getContext();
-    server.stop(function(err) {
-      assert.error(err);
-
-      server.serveDispatcher(name, dispatcher, function(err) {
-        assert.error(err);
-
-        client.bindTo(ctx, name, function(err, service) {
-          assert.error(err);
-
-          service.foo(ctx, function(err, result) {
-            assert.error(err);
-
-            assert.equal(result, 'bar');
-            res.end(assert);
-          });
-        });
-      });
-    });
-  });
-});
-
-test('Test re-serving a stopped JS service - ' +
-  'var promise = server.stop(), runtime.serve()', function(assert) {
-  serve(name, dispatcher, function(err, res) {
-    assert.error(err);
-
-    var server = res.server;
-    var client = res.runtime.newClient();
-    var ctx = res.runtime.getContext();
-    server.stop()
-    .then(function() {
-      return server.serveDispatcher(name, dispatcher);
-    })
-    .then(function() {
-      return client.bindTo(ctx, name);
-    })
-    .then(function(service) {
-      return service.foo(ctx);
-    })
-    .then(function(result) {
-      assert.equal(result, 'bar');
-      res.end(assert);
-    })
-    .catch(function(err) {
-      assert.error(err);
-      res.end(assert);
-    });
-  });
-});
-
 test('Test stopping a JS service twice - ' +
   'server.stop(callback)', function(assert) {
   serve(name, dispatcher, function(err, res) {
diff --git a/test/integration/test-service-cache.js b/test/integration/test-service-cache.js
index 0ade094..de12003 100644
--- a/test/integration/test-service-cache.js
+++ b/test/integration/test-service-cache.js
@@ -219,7 +219,7 @@
   vanadium.init(config)
   .then(function(runtime) {
     var ctx = runtime.getContext();
-    var client = runtime.newClient();
+    var client = runtime.getClient();
     client.signature(ctx, 'test_service/cache')
     .then(function(sigs) {
       assert.ok(sigs, 'received something');
@@ -240,7 +240,7 @@
     }
 
     var ctx = runtime.getContext();
-    var client = runtime.newClient();
+    var client = runtime.getClient();
     client.signature(ctx, 'test_service/cache', function(err, sigs) {
       assert.error(err);
       assert.ok(sigs, 'received something');
diff --git a/test/integration/test-vanadium-init.js b/test/integration/test-vanadium-init.js
index d117956..23c6509 100644
--- a/test/integration/test-vanadium-init.js
+++ b/test/integration/test-vanadium-init.js
@@ -128,7 +128,7 @@
       return t.end();
     }
 
-    rt.namespace().roots(function(err, gotRoots) {
+    rt.getNamespace().roots(function(err, gotRoots) {
       if (err) {
         t.error(err);
         return rt.close(t.end);
@@ -149,7 +149,7 @@
     if (err) {
       return cb(err);
     }
-    var ns = rt.namespace();
+    var ns = rt.getNamespace();
     var ctx = rt.getContext().withTimeout(5000);
 
     ns.resolve(ctx, from, function(err, servers) {
@@ -201,13 +201,12 @@
           return 'pong';
         }
       };
-      var server = rt.newServer();
-      server.serve(serverName, service, function(err) {
+      rt.newServer(serverName, service, function(err) {
         if (err) {
           return end(err);
         }
 
-        var client = rt.newClient();
+        var client = rt.getClient();
         var ctx = rt.getContext().withTimeout(5000);
         client.bindTo(ctx, serverName, function(err, pingpong) {
           if (err) {
diff --git a/test/load/test-echo.js b/test/load/test-echo.js
index 9dbbace..2928052 100644
--- a/test/load/test-echo.js
+++ b/test/load/test-echo.js
@@ -87,7 +87,7 @@
     // In order to run a performance test where we have a go client send
     // a bunch of tests to the server, we tell the stressd server to run
     // a peformance test against the server we just started.
-    var client = res.runtime.newClient();
+    var client = res.runtime.getClient();
     var ctx = res.runtime.getContext();
     client.bindTo(ctx, '/localhost:8141').then(function(stub) {
       ctx = ctx.withTimeout(DURATION * 2);
diff --git a/test/unit/test-server-router.js b/test/unit/test-server-router.js
index 57e43d1..9bcbd04 100644
--- a/test/unit/test-server-router.js
+++ b/test/unit/test-server-router.js
@@ -13,6 +13,7 @@
 var vdl = require('../../src/vdl');
 var hexVom = require('../../src/lib/hex-vom');
 var context = require('../../src/context');
+var leafDispatcher = require('../../src/rpc/leaf-dispatcher');
 
 test('Server Router Signature Lookup', function(t) {
   var inputName = 'aName';
@@ -78,7 +79,7 @@
     nextId: function() { return inputMessageId; }
   };
   var mockController = {
-    serve: function(){}
+    newServer: function(){}
   };
   var mockRuntime = {
     newContext: function() {
@@ -88,10 +89,9 @@
   var router = new Router(mockProxy, 'TestAppName',
                           mockRuntime, mockController);
   var server = new Server(router);
-  var options = {
-    authorizer: function(){}
-  };
-  server.serve(inputName, inputService, options, function(){});
+  var authorizer = function(){};
+  var dispatcher = leafDispatcher(inputService, authorizer);
+  server._init(inputName, dispatcher, null, function(){});
 
   var request = {
     serverId: server.id,