Fix namespace regression.

Re-factoring removed ability to pass global namespace to constructor.
Add this capability back into the library.
Fixes #39.
diff --git a/lib/base_operation.js b/lib/base_operation.js
index 238a011..f0a09b4 100644
--- a/lib/base_operation.js
+++ b/lib/base_operation.js
@@ -28,6 +28,10 @@
       return encodeURIComponent(options.namespace)
     }
 
+    if (this.client.options && typeof this.client.options.namespace === 'string') {
+      return encodeURIComponent(this.client.options.namespace)
+    }
+
     return encodeURIComponent(names.default_namespace())
   }
 
diff --git a/lib/client.js b/lib/client.js
index 6f65c4c..6f467bd 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -23,7 +23,7 @@
       throw new Error(`${messages.INVALID_OPTIONS_ERROR} Missing either api or apihost parameters.`)
     }
 
-    return {api_key, api, ignore_certs}
+    return {api_key, api, ignore_certs, namespace: options.namespace}
   }
 
   url_from_apihost (apihost) {
diff --git a/test/unit/base_operation.test.js b/test/unit/base_operation.test.js
index fdf079d..063c5d0 100644
--- a/test/unit/base_operation.test.js
+++ b/test/unit/base_operation.test.js
@@ -8,7 +8,7 @@
   const namespace = '_'
   const resource = 'resource_id'
   const method = 'GET'
-  const client = {request:  (_method, _path) => {
+  const client = {request: (_method, _path) => {
     t.is(_method, method)
     t.is(_path, `namespaces/${namespace}/${resource}`)
   }}
@@ -24,7 +24,7 @@
   const resource = 'resource_id'
   const method = 'GET'
   const id = '12345'
-  const client = {request:  (_method, _path) => {
+  const client = {request: (_method, _path) => {
     t.is(_method, method)
     t.is(_path, `namespaces/${namespace}/${resource}/${id}`)
   }}
@@ -41,7 +41,7 @@
   const method = 'GET'
   const id = '12345'
   const options = {qs: {hello: 'world'}, body: {hello: 'world'}}
-  const client = {request:  (_method, _path, _options) => {
+  const client = {request: (_method, _path, _options) => {
     t.is(_method, method)
     t.is(_path, `namespaces/${namespace}/${resource}/${id}`)
     t.deepEqual(_options, {qs: {hello: 'world'}, body: {hello: 'world'}})
@@ -63,6 +63,14 @@
 test('should return appropriate namespace', t => {
   let base_operation = new BaseOperation()
   t.is(base_operation.namespace({namespace: 'provided'}), 'provided')
+
+  // using global ns
+  base_operation = new BaseOperation({ options: { namespace: 'global_ns' }})
+  t.is(base_operation.namespace({namespace: 'provided'}), 'provided')
+  base_operation = new BaseOperation({ options: { namespace: 'global_ns' }})
+  t.is(base_operation.namespace({}), 'global_ns')
+  t.is(base_operation.namespace(), 'global_ns')
+
   base_operation = new BaseOperation('default')
   t.is(base_operation.namespace({namespace: 'provided'}), 'provided')
   t.is(base_operation.namespace(), '_')
diff --git a/test/unit/client.test.js b/test/unit/client.test.js
index 44127d3..3a79265 100644
--- a/test/unit/client.test.js
+++ b/test/unit/client.test.js
@@ -8,12 +8,14 @@
   t.false(client.options.ignore_certs)
   t.is(client.options.api_key, 'aaa')
   t.is(client.options.api, 'https://my_host/api/v1/')
+  t.falsy(client.options.namespace)
 })
 
 test('should support explicit constructor options', t => {
-  const client = new Client({ignore_certs: true, api_key: 'aaa', api: 'my_host'})
+  const client = new Client({namespace: 'ns', ignore_certs: true, api_key: 'aaa', api: 'my_host'})
   t.is(client.options.api, 'my_host')
   t.true(client.options.ignore_certs)
+  t.is(client.options.namespace, 'ns')
 })
 
 test('should use environment parameters for options if not set explicitly.', t => {
@@ -90,7 +92,6 @@
   t.is(client.params(METHOD, PATH).url, 'https://api.com/api/v1/some/path/to/resource')
 })
 
-
 test('should generate auth header from API key', t => {
   const api_key = 'some sample api key'
   const client = new Client({api: true, api_key: api_key})