You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by gl...@apache.org on 2018/08/16 15:01:11 UTC

[couchdb-nano] 02/08: first stab at standard js

This is an automated email from the ASF dual-hosted git repository.

glynnbird pushed a commit to branch standard
in repository https://gitbox.apache.org/repos/asf/couchdb-nano.git

commit 0c8764b51b6e8bba26147bd062e1a95bd3f473b1
Author: Glynn Bird <gl...@gmail.com>
AuthorDate: Tue Aug 14 14:28:51 2018 +0100

    first stab at standard js
---
 .jshintrc                                        |   14 -
 examples/bulk_transform.js                       |   56 +-
 examples/express.js                              |   31 +-
 examples/lazy_creation_of_views.js               |  165 +-
 examples/lazy_db_creation_and_replication.js     |   81 +-
 examples/pipe.js                                 |   20 +-
 lib/logger.js                                    |   24 +-
 lib/nano.js                                      |  695 ++++---
 package-lock.json                                | 2297 ++++++++++++++--------
 package.json                                     |   13 +-
 tests/helpers/index.js                           |   43 +-
 tests/helpers/integration.js                     |  271 ++-
 tests/helpers/unit.js                            |  191 +-
 tests/integration/attachment/destroy.js          |   62 +-
 tests/integration/attachment/get.js              |   57 +-
 tests/integration/attachment/insert.js           |   26 +-
 tests/integration/attachment/pipe.js             |   84 +-
 tests/integration/attachment/update.js           |   59 +-
 tests/integration/database/changes.js            |   64 +-
 tests/integration/database/compact.js            |   82 +-
 tests/integration/database/create-and-destroy.js |   54 +-
 tests/integration/database/follow.js             |   50 +-
 tests/integration/database/get.js                |   47 +-
 tests/integration/database/list.js               |   50 +-
 tests/integration/database/replicate.js          |  113 +-
 tests/integration/database/replicator.js         |  212 +-
 tests/integration/design/atomic.js               |  103 +-
 tests/integration/design/compact.js              |   36 +-
 tests/integration/design/list.js                 |   34 +-
 tests/integration/design/multiple.js             |   82 +-
 tests/integration/design/query.js                |   71 +-
 tests/integration/design/search.js               |   50 +-
 tests/integration/design/show.js                 |  120 +-
 tests/integration/document/bulk.js               |   40 +-
 tests/integration/document/copy.js               |   96 +-
 tests/integration/document/create_index.js       |   34 +-
 tests/integration/document/destroy.js            |   72 +-
 tests/integration/document/fetch.js              |   84 +-
 tests/integration/document/fetch_revs.js         |   92 +-
 tests/integration/document/find.js               |   52 +-
 tests/integration/document/get.js                |   38 +-
 tests/integration/document/head.js               |   46 +-
 tests/integration/document/insert.js             |  111 +-
 tests/integration/document/list.js               |  196 +-
 tests/integration/document/update.js             |   58 +-
 tests/integration/multipart/get.js               |   56 +-
 tests/integration/multipart/insert.js            |   96 +-
 tests/integration/shared/config.js               |  104 +-
 tests/integration/shared/cookie.js               |   69 +-
 tests/integration/shared/error.js                |   66 +-
 tests/integration/shared/headers.js              |   54 +-
 tests/integration/shared/log.js                  |   26 +-
 tests/integration/util/uuid.js                   |   62 +-
 tests/intercept/design/search.js                 |  426 ++--
 tests/unit/attachment/destroy.js                 |    6 +-
 tests/unit/attachment/get.js                     |    8 +-
 tests/unit/attachment/insert.js                  |   14 +-
 tests/unit/database/changes.js                   |    8 +-
 tests/unit/database/compact.js                   |    6 +-
 tests/unit/database/create.js                    |    8 +-
 tests/unit/database/destroy.js                   |    6 +-
 tests/unit/database/follow.js                    |    6 +-
 tests/unit/database/get.js                       |    6 +-
 tests/unit/database/list.js                      |    6 +-
 tests/unit/database/replicate.js                 |    8 +-
 tests/unit/database/replicator.js                |    8 +-
 tests/unit/database/updates.js                   |    8 +-
 tests/unit/design/atomic.js                      |   12 +-
 tests/unit/design/compact.js                     |    6 +-
 tests/unit/design/find.js                        |    6 +-
 tests/unit/design/list.js                        |   16 +-
 tests/unit/design/search.js                      |    6 +-
 tests/unit/design/show.js                        |    6 +-
 tests/unit/design/spatial.js                     |    6 +-
 tests/unit/design/view.js                        |   10 +-
 tests/unit/document/bulk.js                      |    8 +-
 tests/unit/document/copy.js                      |   10 +-
 tests/unit/document/get.js                       |   48 +-
 tests/unit/multipart/get.js                      |    6 +-
 tests/unit/multipart/insert.js                   |   14 +-
 tests/unit/shared/error.js                       |   76 +-
 tests/unit/shared/follow-updates.js              |    8 +-
 tests/unit/shared/jar.js                         |   30 +-
 83 files changed, 4095 insertions(+), 3506 deletions(-)

diff --git a/.jshintrc b/.jshintrc
deleted file mode 100644
index 39c95e6..0000000
--- a/.jshintrc
+++ /dev/null
@@ -1,14 +0,0 @@
-{
-  "boss":      true,
-  "node":      true,
-  "strict":    true,
-  "smarttabs": true,
-  "maxlen":    100,
-  "newcap":    false,
-  "undef":     true,
-  "unused":    true,
-  "onecase":   true,
-  "indent":    2,
-  "sub":       true,
-  "esnext":    true
-}
diff --git a/examples/bulk_transform.js b/examples/bulk_transform.js
index ba61348..18558ed 100644
--- a/examples/bulk_transform.js
+++ b/examples/bulk_transform.js
@@ -10,39 +10,37 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-var db    = require('nano')('http://localhost:5984/emails')
-  , async = require('async')
-  ;
+const db = require('nano')('http://localhost:5984/emails')
+const async = require('async')
 
-function update_row(row,cb) {
-  var doc = row.doc;
-  delete doc.subject;
+function updateRow (row, cb) {
+  var doc = row.doc
+  delete doc.subject
   db.insert(doc, doc._id, function (err, data) {
-    if(err)  { console.log('err at ' + doc._id);  cb(err); }
-    else     { console.log('updated ' + doc._id); cb(); }
-  });
+    if (err) { console.log('err at ' + doc._id); cb(err) } else { console.log('updated ' + doc._id); cb() }
+  })
 }
 
-function list(offset) {
-  var ended = false;
-  offset = offset || 0;
-  db.list({include_docs: true, limit: 10, skip: offset}, 
-    function(err, data) {
-      var total, offset, rows;
-      if(err) { console.log('fuuuu: ' + err.message); rows = []; return; }
-      total  = data.total_rows;
-      offset = data.offset;
-      rows   = data.rows;
-      if(offset === total) { 
-        ended = true;
-        return; 
+function list (offset) {
+  var ended = false
+  offset = offset || 0
+  db.list({include_docs: true, limit: 10, skip: offset},
+    function (err, data) {
+      var total, offset, rows
+      if (err) { console.log('fuuuu: ' + err.message); rows = []; return }
+      total = data.total_rows
+      offset = data.offset
+      rows = data.rows
+      if (offset === total) {
+        ended = true
+        return
       }
-      async.forEach(rows, update_row, function (err) {
-        if(err) { console.log('something failed, check logs'); }
-        if(ended) { return; }
-        list(offset+10);
-      });
-  });
+      async.forEach(rows, updateRow, function (err) {
+        if (err) { console.log('something failed, check logs') }
+        if (ended) { return }
+        list(offset + 10)
+      })
+    })
 }
 
-list();
\ No newline at end of file
+list()
diff --git a/examples/express.js b/examples/express.js
index b49ba1d..06767a3 100644
--- a/examples/express.js
+++ b/examples/express.js
@@ -10,21 +10,20 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-var express = require('express')
-   , db    = require('nano')('http://localhost:5984/my_couch')
-   , app     = module.exports = express()
-   ;
+const express = require('express')
+const db = require('nano')('http://localhost:5984/my_couch')
+const app = module.exports = express()
 
-app.get('/', function(req, res) {
-   db.get('foo', function (error, body, headers) {
-      if(error) {
-         res.status(error.statusCode);
-         return res.send(error.message); 
-      }
-      res.status(200);
-      res.send(body);
-   });
-});
+app.get('/', function (req, res) {
+  db.get('foo', function (error, body, headers) {
+    if (error) {
+      res.status(error.statusCode)
+      return res.send(error.message)
+    }
+    res.status(200)
+    res.send(body)
+  })
+})
 
-app.listen(3333);
-console.log('server is running. check expressjs.com for more cool tricks');
+app.listen(3333)
+console.log('server is running. check expressjs.com for more cool tricks')
diff --git a/examples/lazy_creation_of_views.js b/examples/lazy_creation_of_views.js
index 75df363..1765aa5 100644
--- a/examples/lazy_creation_of_views.js
+++ b/examples/lazy_creation_of_views.js
@@ -10,105 +10,104 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-module.exports = function() {
-var nano       = require('nano')('http://localhost:5984')
-  , users      = nano.use('users')
-  , VIEWS      = { by_twitter_id: 
-    { "map": "function(doc) { emit(doc.twitter.screen_name, doc); }" } }
-  ;
+module.exports = function () {
+  const nano = require('nano')('http://localhost:5984')
+  const users = nano.use('users')
+  const VIEWS = { by_twitter_id:
+    { 'map': 'function(doc) { emit(doc.twitter.screen_name, doc); }' } }
 
-/*****************************************************************************
+  /*****************************************************************************
  * user.get()
  ****************************************************************************/
-function user_get(id, callback){
-  return users.get(id, callback);
-}
+  function userGet (id, callback) {
+    return users.get(id, callback)
+  }
 
-/*****************************************************************************
+  /*****************************************************************************
  * user.new()
  ****************************************************************************/
-function user_new(id, body, callback) {
-  return users.insert(body, id, callback);
-}
+  function userNew (id, body, callback) {
+    return users.insert(body, id, callback)
+  }
 
-/*****************************************************************************
+  /*****************************************************************************
  * user.create()
  ****************************************************************************/
-function create_users_database(email_address,secret,name,retries) {
-  nano.db.create('users', function (e,b,h) {
-    user_create(email_address,secret,name,retries+1);
-  });
-}
+  function createUsersDatabase (emailAddress, secret, name, retries) {
+    nano.db.create('users', function (e, b, h) {
+      userCreate(emailAddress, secret, name, retries + 1)
+    })
+  }
 
-function user_create(email_address,secret,name,retries) {
-  if (!retries) {
-   retries = 0;
+  function userCreate (emailAddress, secret, name, retries) {
+    if (!retries) {
+      retries = 0
+    }
+    users.insert({emailAddress: emailAddress, secret: secret, name: name}, secret,
+      function (e, b, h) {
+        if (e && e.message === 'no_db_file' && retries < 1) {
+          return createUsersDatabase(emailAddress, secret, name, retries)
+        }
+        (function () { })(e, b, h)
+      })
   }
-  users.insert( {email_address: email_address, secret: secret, name: name}, secret,
-    function (e,b,h) {
-      if(e && e.message === 'no_db_file'  && retries < 1) {
-        return create_users_database(email_address,secret,name,retries);
-      }
-      (function() { return ; })(e,b,h);
-  });
-}
 
-/*****************************************************************************
+  /*****************************************************************************
  * user.find()
  ****************************************************************************/
- // 
- // some more logic needed
- // what if design document exists but view doesnt, we cant just overwrite it
- //
- // we need a way to fectch and build on
- // and thats the reason why im not doing this at 5am
+  //
+  // some more logic needed
+  // what if design document exists but view doesnt, we cant just overwrite it
+  //
+  // we need a way to fectch and build on
+  // and thats the reason why im not doing this at 5am
 
-function user_find(view, id, opts, tried, callback) {
-  if(typeof tried === 'function') {
-    callback = tried;
-    tried = {tried:0, max_retries:2};
-  }
-  users.view('users', view, opts, function (e,b,h) {
-    if(e) { 
-      var current_view = VIEWS[view];
-      if(!current_view) { 
-        e.message = 'View is not available';
-        return callback(e,b,h); 
-      }
-      if(tried.tried < tried.max_retries) {
-        if(e.message === 'missing' || e.message === 'deleted') { // create design document
-          var design_doc = {views: {}};
-          design_doc.views[view] = current_view;
-          return users.insert(design_doc, '_design/users', function () {
-            tried.tried += 1;
-            user_find(view,id,opts,tried,callback);
-          });
-        }
-        if(e.message === 'missing_named_view') {
-          users.get('_design/users', function (e,b,h) { // create view
-            tried.tried += 1;
-            if(e) { return user_find(view,id,opts,tried,callback); }
-            b.views[view] = current_view;
-            users.insert(b, '_design/users', function (e,b,h) {
-              return user_find(view,id,opts,tried,callback);
-            });
-          });
-          return;
+  function userFind (view, id, opts, tried, callback) {
+    if (typeof tried === 'function') {
+      callback = tried
+      tried = {tried: 0, max_retries: 2}
+    }
+    users.view('users', view, opts, function (e, b, h) {
+      if (e) {
+        var currentView = VIEWS[view]
+        if (!currentView) {
+          e.message = 'View is not available'
+          return callback(e, b, h)
         }
+        if (tried.tried < tried.max_retries) {
+          if (e.message === 'missing' || e.message === 'deleted') { // create design document
+            var designDoc = {views: {}}
+            designDoc.views[view] = currentView
+            return users.insert(designDoc, '_design/users', function () {
+              tried.tried += 1
+              userFind(view, id, opts, tried, callback)
+            })
+          }
+          if (e.message === 'missing_named_view') {
+            users.get('_design/users', function (e, b, h) { // create view
+              tried.tried += 1
+              if (e) { return userFind(view, id, opts, tried, callback) }
+              b.views[view] = currentView
+              users.insert(b, '_design/users', function (e, b, h) {
+                return userFind(view, id, opts, tried, callback)
+              })
+            })
+            return
+          }
+        } else { return callback(e, b, h) }
       }
-      else { return callback(e,b,h); } 
-    }
-    return callback(null,b,h);
-  });
-}
+      return callback(null, b, h)
+    })
+  }
 
-function user_first(view, id, callback) {
-  return user_find(view, id, {startkey: ('"' + id + '"'), limit: 1}, callback);
-}
+  function userFirst (view, id, callback) {
+    return userFind(view, id, {startkey: ('"' + id + '"'), limit: 1}, callback)
+  }
 
-return { new: user_new
-       , get: user_get
-       , create: user_create
-       , first: user_first
-       };
-};
\ No newline at end of file
+  return {
+    new: userNew,
+    get: userGet,
+    create: userCreate,
+    first: userFirst
+  }
+}
diff --git a/examples/lazy_db_creation_and_replication.js b/examples/lazy_db_creation_and_replication.js
index b54eb08..58cb2b3 100644
--- a/examples/lazy_db_creation_and_replication.js
+++ b/examples/lazy_db_creation_and_replication.js
@@ -10,56 +10,55 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-var nano    = require('nano')
-  , couch   = 
-    { "master"  : "http://localhost:5984/landing_m"
-    , "replica" : "http://localhost:5984/landing_r"
+const nano = require('nano')
+const couch =
+    { 'master': 'http://localhost:5984/landing_m',
+      'replica': 'http://localhost:5984/landing_r'
     }
-  ;
 
-function insert_with_retry(db, email, retries, callback) {
+function insertWithRetry (db, email, retries, callback) {
   if (typeof retries === 'function') {
-   callback = retries;
-   retries  = 0;
+    callback = retries
+    retries = 0
   }
-  callback = callback || function(){};
-  db.insert(email, function(err, resp, head) {
-    if(err) { 
-      if(err.message === 'no_db_file'  && retries < 1) {
-        var db_name = db.config.db
-          , server  = nano(db.config.url)
-          ;
-        server.db.create(db_name, function (err2,resp2,head2) {
-          if(err2) { return callback(err2,resp2,head2); }
-          insert_with_retry(db,email,retries+1,callback);
-        });
-      } else { return callback(err,resp,head); }
+  callback = callback || function () {}
+  db.insert(email, function (err, resp, head) {
+    if (err) {
+      if (err.message === 'no_db_file' && retries < 1) {
+        const dbName = db.config.db
+        const server = nano(db.config.url)
+
+        server.db.create(dbName, function (err2, resp2, head2) {
+          if (err2) { return callback(err2, resp2, head2) }
+          insertWithRetry(db, email, retries + 1, callback)
+        })
+      } else { return callback(err, resp, head) }
     }
-    callback(err, resp, head);
-  });
+    callback(err, resp, head)
+  })
 }
 
-function replicate_with_retry(master_uri, replica_uri, retries, callback) {
+function replicateWithRetry (masterUri, replicaUri, retries, callback) {
   if (typeof retries === 'function') {
-    callback = retries;
-    retries  = 0;
+    callback = retries
+    retries = 0
   }
-  callback   = callback || function(){};
-  retries    = retries  || 0;
-  var master = nano(couch.master);
-  master.replicate(couch.replica, function(err, resp, head) {
-    if(err && err['error'] === 'db_not_found' && retries < 1) {
-      var replica = nano(couch.replica)
-        , db_name = replica.config.db
-        , server  = nano(replica.config.url)
-        ;
-      server.db.create(db_name, function (err2, resp2, head2) {
-        if(err2) { return callback(err2,resp2,head2); }
-        replicate_with_retry(master_uri, replica_uri, retries+1, callback);
-      });
+  callback = callback || function () {}
+  retries = retries || 0
+  var master = nano(couch.master)
+  master.replicate(couch.replica, function (err, resp, head) {
+    if (err && err['error'] === 'db_not_found' && retries < 1) {
+      const replica = nano(couch.replica)
+      const dbName = replica.config.db
+      const server = nano(replica.config.url)
+
+      server.db.create(dbName, function (err2, resp2, head2) {
+        if (err2) { return callback(err2, resp2, head2) }
+        replicateWithRetry(masterUri, replicaUri, retries + 1, callback)
+      })
     }
-    callback(err, resp, head);
-  });
+    callback(err, resp, head)
+  })
 }
 
-module.exports = {insert: insert_with_retry, replicate: replicate_with_retry};
\ No newline at end of file
+module.exports = {insert: insertWithRetry, replicate: replicateWithRetry}
diff --git a/examples/pipe.js b/examples/pipe.js
index 04d23ec..54ea484 100644
--- a/examples/pipe.js
+++ b/examples/pipe.js
@@ -10,14 +10,16 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-var express = require('express')
-  , nano    = require('nano')('http://localhost:5984')
-  , app     = module.exports = express.createServer()
-  , db_name = "test"
-  , db      = nano.use(db_name);
+const express = require('express')
+const nano = require('nano')('http://localhost:5984')
+const app = express.createServer()
+const dbName = 'test'
+const db = nano.use(dbName)
 
-app.get("/", function(request,response) {
-  db.attachment.get("new", "logo.png").pipe(response);
-});
+app.get('/', function (request, response) {
+  db.attachment.get('new', 'logo.png').pipe(response)
+})
 
-app.listen(3333);
\ No newline at end of file
+app.listen(3333)
+
+module.exports = app
diff --git a/lib/logger.js b/lib/logger.js
index 8d74bb0..9f73271 100644
--- a/lib/logger.js
+++ b/lib/logger.js
@@ -10,19 +10,19 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const debug = require('debug')('nano/logger');
+const debug = require('debug')('nano/logger')
 
-module.exports = function logging(cfg) {
-  const log = cfg && cfg.log;
-  const logStrategy = typeof log === 'function' ? log : debug;
+module.exports = function logging (cfg) {
+  const log = cfg && cfg.log
+  const logStrategy = typeof log === 'function' ? log : debug
 
-  return function logEvent(prefix) {
+  return function logEvent (prefix) {
     const eventId = (prefix ? prefix + '-' : '') +
-      (~~(Math.random() * 1e9)).toString(36);
-    return function log() {
-      logStrategy.call(this, eventId, [].slice.call(arguments, 0));
-    };
-  };
-};
+      (~~(Math.random() * 1e9)).toString(36)
+    return function log () {
+      logStrategy.call(this, eventId, [].slice.call(arguments, 0))
+    }
+  }
+}
diff --git a/lib/nano.js b/lib/nano.js
index 6f1cf29..a434393 100644
--- a/lib/nano.js
+++ b/lib/nano.js
@@ -10,138 +10,135 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const u = require('url');
-const assert = require('assert');
-const querystring = require('querystring');
-const request = require('request');
-const errs = require('errs');
-const isEmpty = require('lodash.isempty');
-const follow = require('cloudant-follow');
-const logger = require('./logger');
-
-let nano;
+const u = require('url')
+const assert = require('assert')
+const querystring = require('querystring')
+const request = require('request')
+const errs = require('errs')
+const isEmpty = require('lodash.isempty')
+const follow = require('cloudant-follow')
+const logger = require('./logger')
 
 function getCallback (opts, callback) {
   if (typeof opts === 'function') {
-    callback = opts;
-    opts = {};
+    callback = opts
+    opts = {}
   }
-  opts = opts || {};
+  opts = opts || {}
   return {
     opts,
     callback
-  };
+  }
 }
 
-module.exports = exports = nano = function dbScope(cfg) {
-  let serverScope = {};
+module.exports = exports = function dbScope (cfg) {
+  let serverScope = {}
 
   if (typeof cfg === 'string') {
-    cfg = {url: cfg};
+    cfg = {url: cfg}
   }
 
   assert.equal(typeof cfg, 'object',
-    'You must specify the endpoint url when invoking this module');
-  assert.ok(/^https?:/.test(cfg.url), 'url is not valid');
+    'You must specify the endpoint url when invoking this module')
+  assert.ok(/^https?:/.test(cfg.url), 'url is not valid')
 
-  cfg = Object.assign({}, cfg);
+  cfg = Object.assign({}, cfg)
 
-  serverScope.config = cfg;
-  cfg.requestDefaults = cfg.requestDefaults || {jar: true};
+  serverScope.config = cfg
+  cfg.requestDefaults = cfg.requestDefaults || {jar: true}
 
-  const httpAgent = (typeof cfg.request === 'function') ? cfg.request :
-    request.defaults(cfg.requestDefaults);
-  const followAgent = (typeof cfg.follow === 'function') ? cfg.follow : follow;
-  const log = typeof cfg.log === 'function' ? cfg.log : logger(cfg);
-  const parseUrl = 'parseUrl' in cfg ? cfg.parseUrl : true;
+  const httpAgent = (typeof cfg.request === 'function') ? cfg.request
+    : request.defaults(cfg.requestDefaults)
+  const followAgent = (typeof cfg.follow === 'function') ? cfg.follow : follow
+  const log = typeof cfg.log === 'function' ? cfg.log : logger(cfg)
+  const parseUrl = 'parseUrl' in cfg ? cfg.parseUrl : true
 
-  function maybeExtractDatabaseComponent() {
+  function maybeExtractDatabaseComponent () {
     if (!parseUrl) {
-      return;
+      return
     }
 
-    const path = u.parse(cfg.url);
-    let pathArray = path.pathname.split('/').filter(function(e) { return e; });
-    const db = pathArray.pop();
-    const rootPath = path.pathname.replace(/\/?$/, '/..');
+    const path = u.parse(cfg.url)
+    let pathArray = path.pathname.split('/').filter(function (e) { return e })
+    const db = pathArray.pop()
+    const rootPath = path.pathname.replace(/\/?$/, '/..')
 
     if (db) {
-      cfg.url = urlResolveFix(cfg.url, rootPath).replace(/\/?$/, '');
-      return db;
+      cfg.url = urlResolveFix(cfg.url, rootPath).replace(/\/?$/, '')
+      return db
     }
   }
 
-  function scrub(str) {
+  function scrub (str) {
     if (str) {
-      str = str.replace(/\/\/(.*)@/,"//XXXXXX:XXXXXX@");
+      str = str.replace(/\/\/(.*)@/, '//XXXXXX:XXXXXX@')
     }
-    return str;
+    return str
   }
-  const responseHandler = function(req, opts, resolve, reject, callback) {
-    
-    return function(err, response = { statusCode: 500 }, body = '') {
-      let parsed;
+  const responseHandler = function (req, opts, resolve, reject, callback) {
+    return function (err, response = { statusCode: 500 }, body = '') {
+      let parsed
       const responseHeaders = Object.assign({
         uri: req.uri,
         statusCode: response.statusCode
-      }, response.headers);
+      }, response.headers)
       if (err) {
-        log({err: 'socket', body: body, headers: responseHeaders});
+        log({err: 'socket', body: body, headers: responseHeaders})
         const returnError = errs.merge(err, {
           message: 'error happened in your connection',
           scope: 'socket',
           errid: 'request'
-        });
+        })
         if (reject) {
-          reject(returnError);
-        } 
+          reject(returnError)
+        }
         if (callback) {
-          callback(returnError);
+          callback(returnError)
         }
-        return ;
+        return
       }
 
-      delete responseHeaders.server;
-      delete responseHeaders['content-length'];
+      delete responseHeaders.server
+      delete responseHeaders['content-length']
 
       if (opts.dontParse) {
-        parsed = body;
+        parsed = body
       } else {
-        try { parsed = JSON.parse(body); } catch (err) { parsed = body; }
+        try { parsed = JSON.parse(body) } catch (err) { parsed = body }
       }
 
       if (responseHeaders.statusCode >= 200 && responseHeaders.statusCode < 400) {
-        log({err: null, body: parsed, headers: responseHeaders});
+        log({err: null, body: parsed, headers: responseHeaders})
         if (resolve) {
-          resolve(parsed);
-        } 
+          resolve(parsed)
+        }
         if (callback) {
-          callback(null, parsed, responseHeaders);
+          callback(null, parsed, responseHeaders)
         }
-        return;
+        return
       }
 
-      log({err: 'couch', body: parsed, headers: responseHeaders});
+      log({err: 'couch', body: parsed, headers: responseHeaders})
 
       // cloudant stacktrace
       if (typeof parsed === 'string') {
-        parsed = {message: parsed};
+        parsed = {message: parsed}
       }
 
       if (!parsed.message && (parsed.reason || parsed.error)) {
-        parsed.message = (parsed.reason || parsed.error);
+        parsed.message = (parsed.reason || parsed.error)
       }
 
       // fix cloudant issues where they give an erlang stacktrace as js
-      delete parsed.stack;
+      delete parsed.stack
 
       // scrub credentials
-      req.uri = scrub(req.uri);
-      responseHeaders.uri = scrub(responseHeaders.uri);
+      req.uri = scrub(req.uri)
+      responseHeaders.uri = scrub(responseHeaders.uri)
       if (req.headers.cookie) {
-        req.headers.cookie = "XXXXXXX";
+        req.headers.cookie = 'XXXXXXX'
       }
 
       let errors = errs.merge({
@@ -151,155 +148,153 @@ module.exports = exports = nano = function dbScope(cfg) {
         request: req,
         headers: responseHeaders,
         errid: 'non_200'
-      }, errs.create(parsed));
-
+      }, errs.create(parsed))
 
       if (reject) {
-        reject(errors);
-      } 
+        reject(errors)
+      }
       if (callback) {
-        callback(errors);
+        callback(errors)
       }
-    };
-
-  };
+    }
+  }
 
-  function relax(opts, callback) {
+  function relax (opts, callback) {
     if (typeof opts === 'function') {
-      callback = opts;
-      opts = {path: ''};
+      callback = opts
+      opts = {path: ''}
     }
 
     if (typeof opts === 'string') {
-      opts = {path: opts};
+      opts = {path: opts}
     }
 
     if (!opts) {
-      opts = {path: ''};
-      callback = null;
+      opts = {path: ''}
+      callback = null
     }
 
-    const qs = Object.assign({}, opts.qs);
+    const qs = Object.assign({}, opts.qs)
 
     const headers = {
       'content-type': 'application/json',
       accept: 'application/json'
-    };
+    }
 
     const req = {
       method: (opts.method || 'GET'),
       headers: headers,
       uri: cfg.url
-    };
+    }
 
     // https://github.com/mikeal/request#requestjar
-    const isJar = opts.jar || cfg.jar;
+    const isJar = opts.jar || cfg.jar
 
     if (isJar) {
-      req.jar = isJar;
+      req.jar = isJar
     }
 
     // http://wiki.apache.org/couchdb/HTTP_database_API#Naming_and_Addressing
     if (opts.db) {
-      req.uri = urlResolveFix(req.uri, encodeURIComponent(opts.db));
+      req.uri = urlResolveFix(req.uri, encodeURIComponent(opts.db))
     }
 
     if (opts.multipart) {
-      req.multipart = opts.multipart;
+      req.multipart = opts.multipart
     }
 
-    req.headers = Object.assign(req.headers, opts.headers, cfg.defaultHeaders);
+    req.headers = Object.assign(req.headers, opts.headers, cfg.defaultHeaders)
 
     if (opts.path) {
-      req.uri += '/' + opts.path;
+      req.uri += '/' + opts.path
     } else if (opts.doc) {
       if (!/^_design/.test(opts.doc)) {
         // http://wiki.apache.org/couchdb/HTTP_Document_API#Naming.2FAddressing
-        req.uri += '/' + encodeURIComponent(opts.doc);
+        req.uri += '/' + encodeURIComponent(opts.doc)
       } else {
         // http://wiki.apache.org/couchdb/HTTP_Document_API#Document_IDs
-        req.uri += '/' + opts.doc;
+        req.uri += '/' + opts.doc
       }
 
       // http://wiki.apache.org/couchdb/HTTP_Document_API#Attachments
       if (opts.att) {
-        req.uri += '/' + opts.att;
+        req.uri += '/' + opts.att
       }
     }
 
     // prevent bugs where people set encoding when piping
     if (opts.encoding !== undefined && callback) {
-      req.encoding = opts.encoding;
-      delete req.headers['content-type'];
-      delete req.headers.accept;
+      req.encoding = opts.encoding
+      delete req.headers['content-type']
+      delete req.headers.accept
     }
 
     if (opts.contentType) {
-      req.headers['content-type'] = opts.contentType;
-      delete req.headers.accept;
+      req.headers['content-type'] = opts.contentType
+      delete req.headers.accept
     }
 
-    if(opts.accept) {
-      req.headers['accept'] = opts.accept;
+    if (opts.accept) {
+      req.headers['accept'] = opts.accept
     }
 
     // http://guide.couchdb.org/draft/security.html#cookies
     if (cfg.cookie) {
-      req.headers['X-CouchDB-WWW-Authenticate'] = 'Cookie';
-      req.headers.cookie = cfg.cookie;
+      req.headers['X-CouchDB-WWW-Authenticate'] = 'Cookie'
+      req.headers.cookie = cfg.cookie
     }
 
     // http://wiki.apache.org/couchdb/HTTP_view_API#Querying_Options
     if (typeof opts.qs === 'object' && !isEmpty(opts.qs)) {
-      ['startkey', 'endkey', 'key', 'keys', 'start_key', 'end_key'].forEach(function(key) {
+      ['startkey', 'endkey', 'key', 'keys', 'start_key', 'end_key'].forEach(function (key) {
         if (key in opts.qs) {
-          qs[key] = JSON.stringify(opts.qs[key]);
+          qs[key] = JSON.stringify(opts.qs[key])
         }
-      });
-      req.qs = qs;
+      })
+      req.qs = qs
     }
 
     if (opts.body) {
       if (Buffer.isBuffer(opts.body) || opts.dontStringify) {
-        req.body = opts.body;
+        req.body = opts.body
       } else {
-        req.body = JSON.stringify(opts.body, function(key, value) {
+        req.body = JSON.stringify(opts.body, function (key, value) {
           // don't encode functions
-          if (typeof(value) === 'function') {
-            return value.toString();
+          if (typeof (value) === 'function') {
+            return value.toString()
           } else {
-            return value;
+            return value
           }
-        });
+        })
       }
     }
 
     if (opts.form) {
       req.headers['content-type'] =
-        'application/x-www-form-urlencoded; charset=utf-8';
-      req.body = querystring.stringify(opts.form).toString('utf8');
+        'application/x-www-form-urlencoded; charset=utf-8'
+      req.body = querystring.stringify(opts.form).toString('utf8')
     }
 
-    log(req);
+    log(req)
 
     if (opts.stream) {
       // return the Request object for streaming
-      return httpAgent(req, responseHandler(req, opts, null, null, callback));
+      return httpAgent(req, responseHandler(req, opts, null, null, callback))
     } else {
       if (typeof callback === 'function') {
         // return nothing - feedback via the callback function
-        httpAgent(req, responseHandler(req, opts, null, null, callback));
+        httpAgent(req, responseHandler(req, opts, null, null, callback))
       } else {
         // return a Promise
-        return new Promise( function(resolve, reject) {
-          httpAgent(req, responseHandler(req, opts, resolve, reject));
-        });
+        return new Promise(function (resolve, reject) {
+          httpAgent(req, responseHandler(req, opts, resolve, reject))
+        })
       }
     }
   }
 
   // http://docs.couchdb.org/en/latest/api/server/authn.html#cookie-authentication
-  function auth(username, password, callback) {
+  function auth (username, password, callback) {
     return relax({
       method: 'POST',
       db: '_session',
@@ -307,270 +302,267 @@ module.exports = exports = nano = function dbScope(cfg) {
         name: username,
         password: password
       }
-    }, callback);
+    }, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/server/authn.html#post--_session
-  function session(callback) {
-    return relax({db: '_session'}, callback);
+  function session (callback) {
+    return relax({db: '_session'}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/server/common.html#get--_db_updates
-  function updates(qs0, callback0) {
-    const {opts, callback} = getCallback(qs0, callback0);
+  function updates (qs0, callback0) {
+    const {opts, callback} = getCallback(qs0, callback0)
     return relax({
       db: '_db_updates',
       qs: opts
-    }, callback);
+    }, callback)
   }
 
-  function followUpdates(qs, callback) {
-    return followDb('_db_updates', qs, callback);
+  function followUpdates (qs, callback) {
+    return followDb('_db_updates', qs, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/database/common.html#put--db
-  function createDb(dbName, callback) {
-    return relax({db: dbName, method: 'PUT'}, callback);
+  function createDb (dbName, callback) {
+    return relax({db: dbName, method: 'PUT'}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/database/common.html#delete--db
-  function destroyDb(dbName, callback) {
-    return relax({db: dbName, method: 'DELETE'}, callback);
+  function destroyDb (dbName, callback) {
+    return relax({db: dbName, method: 'DELETE'}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/database/common.html#get--db
-  function getDb(dbName, callback) {
-    return relax({db: dbName}, callback);
+  function getDb (dbName, callback) {
+    return relax({db: dbName}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/server/common.html#get--_all_dbs
-  function listDbs(callback) {
-    return relax({db: '_all_dbs'}, callback);
+  function listDbs (callback) {
+    return relax({db: '_all_dbs'}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/server/common.html#get--_all_dbs
-  function listDbsAsStream(callback) {
-    return relax({db: '_all_dbs', stream: true}, callback);
+  function listDbsAsStream (callback) {
+    return relax({db: '_all_dbs', stream: true}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/database/compact.html#post--db-_compact
-  function compactDb(dbName, ddoc, callback) {
+  function compactDb (dbName, ddoc, callback) {
     if (typeof ddoc === 'function') {
-      callback = ddoc;
-      ddoc = null;
+      callback = ddoc
+      ddoc = null
     }
     return relax({
       db: dbName,
       doc: '_compact',
       att: ddoc,
       method: 'POST'
-    }, callback);
+    }, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/database/changes.html#get--db-_changes
-  function changesDb(dbName, qs0, callback0) {
-    const {opts, callback} = getCallback(qs0, callback0);
-    return relax({db: dbName, path: '_changes', qs: opts}, callback);
+  function changesDb (dbName, qs0, callback0) {
+    const {opts, callback} = getCallback(qs0, callback0)
+    return relax({db: dbName, path: '_changes', qs: opts}, callback)
   }
 
-  function changesDbAsStream(dbName, qs0, callback0) {
-    const {opts, callback} = getCallback(qs0, callback0);
-    return relax({db: dbName, path: '_changes', stream: true, qs: opts}, callback);
+  function changesDbAsStream (dbName, qs0, callback0) {
+    const {opts, callback} = getCallback(qs0, callback0)
+    return relax({db: dbName, path: '_changes', stream: true, qs: opts}, callback)
   }
 
-  function followDb(dbName, qs0, callback0) {
-    const {opts, callback} = getCallback(qs0, callback0);
-    opts.db = urlResolveFix(cfg.url, encodeURIComponent(dbName));
+  function followDb (dbName, qs0, callback0) {
+    const {opts, callback} = getCallback(qs0, callback0)
+    opts.db = urlResolveFix(cfg.url, encodeURIComponent(dbName))
     if (typeof callback === 'function') {
-      return followAgent(opts, callback);
+      return followAgent(opts, callback)
     } else {
-      return new followAgent.Feed(opts);
+      return new followAgent.Feed(opts)
     }
   }
 
-  function _serializeAsUrl(db) {
+  function _serializeAsUrl (db) {
     if (typeof db === 'object' && db.config && db.config.url && db.config.db) {
-      return urlResolveFix(db.config.url, encodeURIComponent(db.config.db));
+      return urlResolveFix(db.config.url, encodeURIComponent(db.config.db))
     } else {
-      return db;
+      return db
     }
   }
 
   // http://docs.couchdb.org/en/latest/api/server/common.html#post--_replicate
-  function replicateDb(source, target, opts0, callback0) {
-    const {opts, callback} = getCallback(opts0, callback0);
+  function replicateDb (source, target, opts0, callback0) {
+    const {opts, callback} = getCallback(opts0, callback0)
 
     // _replicate
-    opts.source = _serializeAsUrl(source);
-    opts.target = _serializeAsUrl(target);
+    opts.source = _serializeAsUrl(source)
+    opts.target = _serializeAsUrl(target)
 
-    return relax({db: '_replicate', body: opts, method: 'POST'}, callback);
+    return relax({db: '_replicate', body: opts, method: 'POST'}, callback)
   }
 
   // http://docs.couchdb.org/en/latest/api/server/common.html#uuids
-  function uuids(count, callback) {
+  function uuids (count, callback) {
     if (typeof count === 'function') {
-      callback = count;
-      count = 1;
+      callback = count
+      count = 1
     }
-    return relax({ method: 'GET', path: '_uuids', qs: {count: count}}, callback);
+    return relax({method: 'GET', path: '_uuids', qs: {count: count}}, callback)
   }
 
   // http://guide.couchdb.org/draft/replication.html
-  function enableReplication(source, target, opts0, callback0) {
-    const {opts, callback} = getCallback(opts0, callback0);
+  function enableReplication (source, target, opts0, callback0) {
+    const {opts, callback} = getCallback(opts0, callback0)
 
     // _replicator
-    opts.source = _serializeAsUrl(source);
-    opts.target = _serializeAsUrl(target);
+    opts.source = _serializeAsUrl(source)
+    opts.target = _serializeAsUrl(target)
 
-    return relax({db: '_replicator', body: opts, method: 'POST'}, callback);
+    return relax({db: '_replicator', body: opts, method: 'POST'}, callback)
   }
 
   // http://guide.couchdb.org/draft/replication.html
-  function queryReplication(id, opts0, callback0) {
-    const {opts, callback} = getCallback(opts0, callback0);
-    return relax({db: '_replicator', method: 'GET', path: id, qs: opts}, callback);
+  function queryReplication (id, opts0, callback0) {
+    const {opts, callback} = getCallback(opts0, callback0)
+    return relax({db: '_replicator', method: 'GET', path: id, qs: opts}, callback)
   }
 
   // http://guide.couchdb.org/draft/replication.html
-  function disableReplication(id, rev, opts0, callback0) {
-    const {opts, callback} = getCallback(opts0, callback0);
+  function disableReplication (id, rev, opts0, callback0) {
+    const {opts, callback} = getCallback(opts0, callback0)
     const req = {
-      db: '_replicator', 
-      method: 'DELETE', 
-      path: id, 
+      db: '_replicator',
+      method: 'DELETE',
+      path: id,
       qs: Object.assign(opts, {rev: rev})
-    };
-    return relax(req, callback);
+    }
+    return relax(req, callback)
   }
 
-  function docModule(dbName) {
-    let docScope = {};
-    dbName = decodeURIComponent(dbName);
+  function docModule (dbName) {
+    let docScope = {}
+    dbName = decodeURIComponent(dbName)
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#put--db-docid
     // http://docs.couchdb.org/en/latest/api/database/common.html#post--db
-    function insertDoc(doc, qs0, callback0) {
-      const req = {db: dbName, body: doc, method: 'POST'};
+    function insertDoc (doc, qs0, callback0) {
+      const req = {db: dbName, body: doc, method: 'POST'}
 
-      let {opts, callback} = getCallback(qs0, callback0);
+      let {opts, callback} = getCallback(qs0, callback0)
 
       if (typeof opts === 'string') {
-        opts = {docName: opts};
+        opts = {docName: opts}
       }
 
       if (opts) {
         if (opts.docName) {
-          req.doc = opts.docName;
-          req.method = 'PUT';
-          delete opts.docName;
+          req.doc = opts.docName
+          req.method = 'PUT'
+          delete opts.docName
         }
-        req.qs = opts;
+        req.qs = opts
       }
 
-      return relax(req, callback);
+      return relax(req, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#delete--db-docid
-    function destroyDoc(docName, rev, callback) {
-      if(!docName) {
-        const msg = 'Invalid doc id';
-        if(callback) {
-          callback(msg, null);
+    function destroyDoc (docName, rev, callback) {
+      if (!docName) {
+        const msg = 'Invalid doc id'
+        if (callback) {
+          callback(msg, null)
         } else {
-          return Promise.reject(msg);
+          return Promise.reject(msg)
         }
-      }
-      else {
+      } else {
         return relax({
           db: dbName,
           doc: docName,
           method: 'DELETE',
           qs: {rev: rev}
-        }, callback);
+        }, callback)
       }
     }
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#get--db-docid
-    function getDoc(docName, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function getDoc (docName, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
 
-      if(!docName) {
-        if(callback)
-          callback("Invalid doc id", null);
-      }
-      else {
-        return relax({db: dbName, doc: docName, qs: opts}, callback);
+      if (!docName) {
+        if (callback) { callback(new Error('Invalid doc id'), null) }
+      } else {
+        return relax({db: dbName, doc: docName, qs: opts}, callback)
       }
     }
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#head--db-docid
-    function headDoc(docName, callback) {
+    function headDoc (docName, callback) {
       // this function doesn't pass on the Promise from relax because it needs
       // to return the headers when resolving the Promise
-      return new Promise(function(resolve, reject) {
+      return new Promise(function (resolve, reject) {
         relax({
           db: dbName,
           doc: docName,
           method: 'HEAD',
           qs: {}
-        }, function(err, body, headers) {
+        }, function (err, body, headers) {
           if (callback) {
-            callback(err, body, headers);
-          } 
+            callback(err, body, headers)
+          }
           if (err) {
-            reject(err);
+            reject(err)
           } else {
-            resolve(headers);
+            resolve(headers)
           }
-        });
-      });
+        })
+      })
     }
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#copy--db-docid
-    function copyDoc(docSrc, docDest, opts0, callback0) {
-      const {opts, callback} = getCallback(opts0, callback0);
+    function copyDoc (docSrc, docDest, opts0, callback0) {
+      const {opts, callback} = getCallback(opts0, callback0)
 
       const qs = {
         db: dbName,
         doc: docSrc,
         method: 'COPY',
         headers: {'Destination': docDest}
-      };
+      }
 
       if (opts.overwrite) {
-        return headDoc(docDest, function(e, b, h) {
+        return headDoc(docDest, function (e, b, h) {
           if (e && e.statusCode !== 404) {
-            return callback(e);
+            return callback(e)
           }
           if (h.etag) {
             qs.headers.Destination += '?rev=' +
-              h.etag.substring(1, h.etag.length - 1);
+              h.etag.substring(1, h.etag.length - 1)
           }
-          return relax(qs, callback);
-        });
+          return relax(qs, callback)
+        })
       } else {
-        return relax(qs, callback);
+        return relax(qs, callback)
       }
     }
 
     // http://docs.couchdb.org/en/latest/api/database/bulk-api.html#get--db-_all_docs
-    function listDoc(qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
-      return relax({db: dbName, path: '_all_docs', qs: opts}, callback);
+    function listDoc (qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
+      return relax({db: dbName, path: '_all_docs', qs: opts}, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/database/bulk-api.html#get--db-_all_docs
-    function listDocAsStream(qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
-      return relax({db: dbName, path: '_all_docs', qs: opts, stream: true}, callback);
+    function listDocAsStream (qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
+      return relax({db: dbName, path: '_all_docs', qs: opts, stream: true}, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_all_docs
-    function fetchDocs(docNames, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
-      opts['include_docs'] = true;
+    function fetchDocs (docNames, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
+      opts['include_docs'] = true
 
       return relax({
         db: dbName,
@@ -578,55 +570,53 @@ module.exports = exports = nano = function dbScope(cfg) {
         method: 'POST',
         qs: opts,
         body: docNames
-      }, callback);
+      }, callback)
     }
 
-    function fetchRevs(docNames, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function fetchRevs (docNames, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
       return relax({
         db: dbName,
         path: '_all_docs',
         method: 'POST',
         qs: opts,
         body: docNames
-      }, callback);
+      }, callback)
     }
 
-    function view(ddoc, viewName, meta, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function view (ddoc, viewName, meta, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
 
       if (typeof meta.stream !== 'boolean') {
-        meta.stream = false;
+        meta.stream = false
       }
 
       // prevent mutation of the client qs object by using a clone
-      const qs1 = Object.assign({}, opts);
+      const qs1 = Object.assign({}, opts)
 
-      const viewPath = '_design/' + ddoc + '/_' + meta.type + '/'  + viewName;
+      const viewPath = '_design/' + ddoc + '/_' + meta.type + '/' + viewName
 
       // Several search parameters must be JSON-encoded; but since this is an
       // object API, several parameters need JSON endoding.
-      const paramsToEncode = ['counts', 'drilldown', 'group_sort', 'ranges', 'sort'];
-      paramsToEncode.forEach(function(param) {
+      const paramsToEncode = ['counts', 'drilldown', 'group_sort', 'ranges', 'sort']
+      paramsToEncode.forEach(function (param) {
         if (param in qs1) {
           if (typeof qs1[param] !== 'string') {
-            qs1[param] = JSON.stringify(qs1[param]);
+            qs1[param] = JSON.stringify(qs1[param])
           } else {
             // if the parameter is not already encoded, encode it
             try {
-              JSON.parse(qs1[param]);
-            } catch(e) {
-              qs1[param] = JSON.stringify(qs1[param]);
+              JSON.parse(qs1[param])
+            } catch (e) {
+              qs1[param] = JSON.stringify(qs1[param])
             }
           }
         }
-      });
-
-
+      })
 
       if (qs1 && qs1.keys) {
-        const body = {keys: qs1.keys};
-        delete qs1.keys;
+        const body = {keys: qs1.keys}
+        delete qs1.keys
         return relax({
           db: dbName,
           path: viewPath,
@@ -634,17 +624,17 @@ module.exports = exports = nano = function dbScope(cfg) {
           qs: qs1,
           body: body,
           stream: meta.stream
-        }, callback);
+        }, callback)
       } else if (qs1 && qs1.queries) {
-        const body = {queries: qs1.queries};
-        delete qs1.queries;
+        const body = {queries: qs1.queries}
+        delete qs1.queries
         return relax({
           db: dbName,
           path: viewPath,
           method: 'POST',
           qs: qs1,
           body: body
-        }, callback);
+        }, callback)
       } else {
         const req = {
           db: dbName,
@@ -652,107 +642,106 @@ module.exports = exports = nano = function dbScope(cfg) {
           path: viewPath,
           qs: qs1,
           stream: meta.stream
-        };
+        }
 
         if (meta.body) {
-          req.body = meta.body;
+          req.body = meta.body
         }
 
-        return relax(req, callback);
+        return relax(req, callback)
       }
     }
 
     // http://docs.couchdb.org/en/latest/api/ddoc/views.html#post--db-_design-ddoc-_view-view
-    function viewDocs(ddoc, viewName, qs, callback) {
-      return view(ddoc, viewName, {type: 'view'}, qs, callback);
+    function viewDocs (ddoc, viewName, qs, callback) {
+      return view(ddoc, viewName, {type: 'view'}, qs, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/ddoc/views.html#post--db-_design-ddoc-_view-view
-    function viewDocsAsStream(ddoc, viewName, qs, callback) {
-      return view(ddoc, viewName, {type: 'view', stream: true}, qs, callback);
+    function viewDocsAsStream (ddoc, viewName, qs, callback) {
+      return view(ddoc, viewName, {type: 'view', stream: true}, qs, callback)
     }
-    
 
     // geocouch
-    function viewSpatial(ddoc, viewName, qs, callback) {
-      return view(ddoc, viewName, {type: 'spatial'}, qs, callback);
+    function viewSpatial (ddoc, viewName, qs, callback) {
+      return view(ddoc, viewName, {type: 'spatial'}, qs, callback)
     }
 
     // cloudant
-    function viewSearch(ddoc, viewName, qs, callback) {
-      return view(ddoc, viewName, {type: 'search'}, qs, callback);
+    function viewSearch (ddoc, viewName, qs, callback) {
+      return view(ddoc, viewName, {type: 'search'}, qs, callback)
     }
 
     // cloudant
-    function viewSearchAsStream(ddoc, viewName, qs, callback) {
-      return view(ddoc, viewName, {type: 'search', stream: true}, qs, callback);
+    function viewSearchAsStream (ddoc, viewName, qs, callback) {
+      return view(ddoc, viewName, {type: 'search', stream: true}, qs, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/ddoc/render.html#get--db-_design-ddoc-_show-func
-    function showDoc(ddoc, viewName, docName, qs, callback) {
-      return view(ddoc, viewName + '/' + docName, {type: 'show'}, qs, callback);
+    function showDoc (ddoc, viewName, docName, qs, callback) {
+      return view(ddoc, viewName + '/' + docName, {type: 'show'}, qs, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/ddoc/render.html#put--db-_design-ddoc-_update-func-docid
-    function updateWithHandler(ddoc, viewName, docName, body, callback) {
+    function updateWithHandler (ddoc, viewName, docName, body, callback) {
       if (typeof body === 'function') {
-          callback = body;
-          body = undefined;
+        callback = body
+        body = undefined
       }
       return view(ddoc, viewName + '/' + encodeURIComponent(docName), {
         type: 'update',
         method: 'PUT',
         body: body
-      }, callback);
+      }, callback)
     }
 
-    function viewWithList(ddoc, viewName, listName, qs, callback) {
+    function viewWithList (ddoc, viewName, listName, qs, callback) {
       return view(ddoc, listName + '/' + viewName, {
         type: 'list'
-      }, qs, callback);
+      }, qs, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/database/bulk-api.html#post--db-_bulksDoc
-    function bulksDoc(docs, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function bulksDoc (docs, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
       return relax({
         db: dbName,
         path: '_bulk_docs',
         body: docs,
         method: 'POST',
         qs: opts
-      }, callback);
+      }, callback)
     }
 
     // http://docs.couchdb.org/en/latest/api/document/common.html#creating-multiple-attachments
-    function insertMultipart(doc, attachments, qs, callback) {
+    function insertMultipart (doc, attachments, qs, callback) {
       if (typeof qs === 'string') {
-        qs = {docName: qs};
+        qs = {docName: qs}
       }
-      qs = qs || {};
+      qs = qs || {}
 
-      const docName = qs.docName;
-      delete qs.docName;
+      const docName = qs.docName
+      delete qs.docName
 
-      doc = Object.assign({_attachments: {}}, doc);
+      doc = Object.assign({_attachments: {}}, doc)
 
-      const multipart = [];
+      const multipart = []
 
-      attachments.forEach(function(att) {
+      attachments.forEach(function (att) {
         doc._attachments[att.name] = {
           follows: true,
-          length: Buffer.isBuffer(att.data) ?
-            att.data.length : Buffer.byteLength(att.data),
+          length: Buffer.isBuffer(att.data)
+            ? att.data.length : Buffer.byteLength(att.data),
           /* jscs:disable requireCamelCaseOrUpperCaseIdentifiers */
           'content_type': att.content_type
-        };
-        multipart.push({body: att.data});
-      });
+        }
+        multipart.push({body: att.data})
+      })
 
       multipart.unshift({
         'content-type': 'application/json',
         body: JSON.stringify(doc)
-      });
+      })
 
       return relax({
         db: dbName,
@@ -761,12 +750,12 @@ module.exports = exports = nano = function dbScope(cfg) {
         doc: docName,
         qs: qs,
         multipart: multipart
-      }, callback);
+      }, callback)
     }
 
-    function getMultipart(docName, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
-      opts.attachments = true;
+    function getMultipart (docName, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
+      opts.attachments = true
 
       return relax({
         db: dbName,
@@ -774,11 +763,11 @@ module.exports = exports = nano = function dbScope(cfg) {
         encoding: null,
         accept: 'multipart/related',
         qs: opts
-      }, callback);
+      }, callback)
     }
 
-    function insertAtt(docName, attName, att, contentType, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function insertAtt (docName, attName, att, contentType, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
       return relax({
         db: dbName,
         att: attName,
@@ -788,11 +777,11 @@ module.exports = exports = nano = function dbScope(cfg) {
         qs: opts,
         body: att,
         dontStringify: true
-      }, callback);
+      }, callback)
     }
 
-    function insertAttAsStream(docName, attName, att, contentType, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function insertAttAsStream (docName, attName, att, contentType, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
       return relax({
         db: dbName,
         att: attName,
@@ -803,11 +792,11 @@ module.exports = exports = nano = function dbScope(cfg) {
         body: att,
         stream: true,
         dontStringify: true
-      }, callback);
+      }, callback)
     }
 
-    function getAtt(docName, attName, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function getAtt (docName, attName, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
       return relax({
         db: dbName,
         att: attName,
@@ -815,11 +804,11 @@ module.exports = exports = nano = function dbScope(cfg) {
         qs: opts,
         encoding: null,
         dontParse: true
-      }, callback);
+      }, callback)
     }
 
-    function getAttAsStream(docName, attName, qs0, callback0) {
-      const {opts, callback} = getCallback(qs0, callback0);
+    function getAttAsStream (docName, attName, qs0, callback0) {
+      const {opts, callback} = getCallback(qs0, callback0)
       return relax({
         db: dbName,
         att: attName,
@@ -828,17 +817,17 @@ module.exports = exports = nano = function dbScope(cfg) {
         stream: true,
         encoding: null,
         dontParse: true
-      }, callback);
+      }, callback)
     }
 
-    function destroyAtt(docName, attName, qs, callback) {
+    function destroyAtt (docName, attName, qs, callback) {
       return relax({
         db: dbName,
         att: attName,
         method: 'DELETE',
         doc: docName,
         qs: qs
-      }, callback);
+      }, callback)
     }
 
     function find (selector, callback) {
@@ -847,7 +836,7 @@ module.exports = exports = nano = function dbScope(cfg) {
         path: '_find',
         method: 'POST',
         body: selector
-      }, callback);
+      }, callback)
     }
 
     function findAsStream (selector, callback) {
@@ -857,37 +846,37 @@ module.exports = exports = nano = function dbScope(cfg) {
         method: 'POST',
         body: selector,
         stream: true
-      }, callback);
+      }, callback)
     }
 
-    function createIndex(indexDef, callback) {
+    function createIndex (indexDef, callback) {
       return relax({
         db: dbName,
         path: '_index',
         method: 'POST',
         body: indexDef
-      }, callback);
+      }, callback)
     }
 
     // db level exports
     docScope = {
-      info: function(cb) {
-        return getDb(dbName, cb);
+      info: function (cb) {
+        return getDb(dbName, cb)
       },
-      replicate: function(target, opts, cb) {
-        return replicateDb(dbName, target, opts, cb);
+      replicate: function (target, opts, cb) {
+        return replicateDb(dbName, target, opts, cb)
       },
-      compact: function(cb) {
-        return compactDb(dbName, cb);
+      compact: function (cb) {
+        return compactDb(dbName, cb)
       },
-      changes: function(qs, cb) {
-        return changesDb(dbName, qs, cb);
+      changes: function (qs, cb) {
+        return changesDb(dbName, qs, cb)
       },
-      changesAsStream: function(qs, cb) {
-        return changesDbAsStream(dbName, qs, cb);
+      changesAsStream: function (qs, cb) {
+        return changesDbAsStream(dbName, qs, cb)
       },
-      follow: function(qs, cb) {
-        return followDb(dbName, qs, cb);
+      follow: function (qs, cb) {
+        return followDb(dbName, qs, cb)
       },
       auth: auth,
       session: session,
@@ -927,23 +916,23 @@ module.exports = exports = nano = function dbScope(cfg) {
       viewWithList: viewWithList,
       server: serverScope,
       replication: {
-        enable: function(target, opts, cb) {
-          return enableReplication(dbName, target, opts, cb);
+        enable: function (target, opts, cb) {
+          return enableReplication(dbName, target, opts, cb)
         },
-        disable: function(id, revision, opts, cb) {
-          return disableReplication(id, revision, opts, cb);
+        disable: function (id, revision, opts, cb) {
+          return disableReplication(id, revision, opts, cb)
         },
-        query: function(id, opts, cb) {
-          return queryReplication(id, opts, cb);
+        query: function (id, opts, cb) {
+          return queryReplication(id, opts, cb)
         }
       }
-    };
+    }
 
-    docScope.view.compact = function(ddoc, cb) {
-      return compactDb(dbName, ddoc, cb);
-    };
+    docScope.view.compact = function (ddoc, cb) {
+      return compactDb(dbName, ddoc, cb)
+    }
 
-    return docScope;
+    return docScope
   }
 
   // server level exports
@@ -978,12 +967,12 @@ module.exports = exports = nano = function dbScope(cfg) {
     updates: updates,
     followUpdates: followUpdates,
     uuids: uuids
-  });
+  })
 
-  const db = maybeExtractDatabaseComponent();
+  const db = maybeExtractDatabaseComponent()
 
-  return db ? docModule(db) : serverScope;
-};
+  return db ? docModule(db) : serverScope
+}
 
 /*
  * and now an ascii dinosaur
@@ -996,9 +985,9 @@ module.exports = exports = nano = function dbScope(cfg) {
  * thanks for visiting! come again!
  */
 
-function urlResolveFix(couchUrl, dbName) {
-  if (/[^\/]$/.test(couchUrl)) {
-    couchUrl += '/';
+function urlResolveFix (couchUrl, dbName) {
+  if (/[^/]$/.test(couchUrl)) {
+    couchUrl += '/'
   }
-  return u.resolve(couchUrl, dbName);
+  return u.resolve(couchUrl, dbName)
 }
diff --git a/package-lock.json b/package-lock.json
index 8e34d07..c791f11 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -18,9 +18,9 @@
       }
     },
     "@types/node": {
-      "version": "10.3.5",
-      "resolved": "https://registry.npmjs.org/@types/node/-/node-10.3.5.tgz",
-      "integrity": "sha512-6lRwZN0Y3TuglwaaZN2XPocobmzLlhxcqDjKFjNYSsXG/TFAGYkCqkzZh4+ms8iTHHQE6gJXLHPV7TziVGeWhg=="
+      "version": "10.7.0",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-10.7.0.tgz",
+      "integrity": "sha512-dmYIvoQEZWnyQfgrwPCoxztv/93NYQGEiOoQhuI56rJahv9de6Q2apZl3bufV46YJ0OAXdaktIuw4RIRl4DTeA=="
     },
     "@types/request": {
       "version": "2.47.1",
@@ -38,18 +38,35 @@
       "resolved": "https://registry.npmjs.org/@types/tough-cookie/-/tough-cookie-2.3.3.tgz",
       "integrity": "sha512-MDQLxNFRLasqS4UlkWMSACMKeSm1x4Q3TxzUC7KQUsh6RK1ZrQ0VEyE3yzXcBu+K8ejVj4wuX32eUG02yNp+YQ=="
     },
-    "JSV": {
-      "version": "4.0.2",
-      "resolved": "https://registry.npmjs.org/JSV/-/JSV-4.0.2.tgz",
-      "integrity": "sha1-0Hf2glVx+CEy+d/67Vh7QCn+/1c=",
-      "dev": true
-    },
     "abbrev": {
       "version": "1.0.9",
       "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz",
       "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=",
       "dev": true
     },
+    "acorn": {
+      "version": "5.7.1",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz",
+      "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==",
+      "dev": true
+    },
+    "acorn-jsx": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz",
+      "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=",
+      "dev": true,
+      "requires": {
+        "acorn": "^3.0.4"
+      },
+      "dependencies": {
+        "acorn": {
+          "version": "3.3.0",
+          "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz",
+          "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=",
+          "dev": true
+        }
+      }
+    },
     "ajv": {
       "version": "5.5.2",
       "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz",
@@ -61,6 +78,12 @@
         "json-schema-traverse": "^0.3.0"
       }
     },
+    "ajv-keywords": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz",
+      "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=",
+      "dev": true
+    },
     "align-text": {
       "version": "0.1.4",
       "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
@@ -78,6 +101,12 @@
       "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=",
       "dev": true
     },
+    "ansi-escapes": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz",
+      "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==",
+      "dev": true
+    },
     "ansi-regex": {
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
@@ -99,10 +128,44 @@
         "sprintf-js": "~1.0.2"
       }
     },
+    "array-includes": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz",
+      "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=",
+      "dev": true,
+      "requires": {
+        "define-properties": "^1.1.2",
+        "es-abstract": "^1.7.0"
+      }
+    },
+    "array-union": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz",
+      "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=",
+      "dev": true,
+      "requires": {
+        "array-uniq": "^1.0.1"
+      }
+    },
+    "array-uniq": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz",
+      "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=",
+      "dev": true
+    },
+    "arrify": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz",
+      "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=",
+      "dev": true
+    },
     "asn1": {
-      "version": "0.2.3",
-      "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
-      "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y="
+      "version": "0.2.4",
+      "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz",
+      "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==",
+      "requires": {
+        "safer-buffer": "~2.1.0"
+      }
     },
     "assert-plus": {
       "version": "1.0.0",
@@ -116,12 +179,12 @@
       "dev": true
     },
     "async": {
-      "version": "2.6.0",
-      "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz",
-      "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==",
+      "version": "2.6.1",
+      "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz",
+      "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==",
       "dev": true,
       "requires": {
-        "lodash": "^4.14.0"
+        "lodash": "^4.17.10"
       }
     },
     "asynckit": {
@@ -135,26 +198,51 @@
       "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg="
     },
     "aws4": {
-      "version": "1.7.0",
-      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz",
-      "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w=="
+      "version": "1.8.0",
+      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz",
+      "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ=="
     },
-    "babel-runtime": {
+    "babel-code-frame": {
       "version": "6.26.0",
-      "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
-      "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
+      "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
+      "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
       "dev": true,
       "requires": {
-        "core-js": "^2.4.0",
-        "regenerator-runtime": "^0.11.0"
+        "chalk": "^1.1.3",
+        "esutils": "^2.0.2",
+        "js-tokens": "^3.0.2"
+      },
+      "dependencies": {
+        "chalk": {
+          "version": "1.1.3",
+          "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
+          "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+          "dev": true,
+          "requires": {
+            "ansi-styles": "^2.2.1",
+            "escape-string-regexp": "^1.0.2",
+            "has-ansi": "^2.0.0",
+            "strip-ansi": "^3.0.0",
+            "supports-color": "^2.0.0"
+          }
+        },
+        "strip-ansi": {
+          "version": "3.0.1",
+          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+          "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+          "dev": true,
+          "requires": {
+            "ansi-regex": "^2.0.0"
+          }
+        },
+        "supports-color": {
+          "version": "2.0.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
+          "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+          "dev": true
+        }
       }
     },
-    "babylon": {
-      "version": "6.18.0",
-      "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz",
-      "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==",
-      "dev": true
-    },
     "balanced-match": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
@@ -162,22 +250,14 @@
       "dev": true
     },
     "bcrypt-pbkdf": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz",
-      "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=",
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
+      "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=",
       "optional": true,
       "requires": {
         "tweetnacl": "^0.14.3"
       }
     },
-    "boom": {
-      "version": "4.3.1",
-      "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz",
-      "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=",
-      "requires": {
-        "hoek": "4.x.x"
-      }
-    },
     "brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -193,6 +273,33 @@
       "resolved": "https://registry.npmjs.org/browser-request/-/browser-request-0.3.3.tgz",
       "integrity": "sha1-ns5bWsqJopkyJC4Yv5M975h2zBc="
     },
+    "buffer-from": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
+      "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
+      "dev": true
+    },
+    "builtin-modules": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+      "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+      "dev": true
+    },
+    "caller-path": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
+      "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=",
+      "dev": true,
+      "requires": {
+        "callsites": "^0.2.0"
+      }
+    },
+    "callsites": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz",
+      "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=",
+      "dev": true
+    },
     "camelcase": {
       "version": "1.2.1",
       "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
@@ -228,78 +335,78 @@
         "get-func-name": "^2.0.0",
         "pathval": "^1.0.0",
         "type-detect": "^4.0.0"
-      },
-      "dependencies": {
-        "pathval": {
-          "version": "1.1.0",
-          "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
-          "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
-          "dev": true
-        }
       }
     },
     "chalk": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
-      "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
+      "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz",
+      "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==",
       "dev": true,
       "requires": {
-        "ansi-styles": "^2.2.1",
-        "escape-string-regexp": "^1.0.2",
-        "has-ansi": "^2.0.0",
-        "strip-ansi": "^3.0.0",
-        "supports-color": "^2.0.0"
+        "ansi-styles": "^3.2.1",
+        "escape-string-regexp": "^1.0.5",
+        "supports-color": "^5.3.0"
       },
       "dependencies": {
-        "supports-color": {
-          "version": "2.0.0",
-          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
-          "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
+        "ansi-styles": {
+          "version": "3.2.1",
+          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+          "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+          "dev": true,
+          "requires": {
+            "color-convert": "^1.9.0"
+          }
+        },
+        "has-flag": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+          "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
           "dev": true
+        },
+        "supports-color": {
+          "version": "5.4.0",
+          "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz",
+          "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
+          "dev": true,
+          "requires": {
+            "has-flag": "^3.0.0"
+          }
         }
       }
     },
+    "chardet": {
+      "version": "0.4.2",
+      "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz",
+      "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=",
+      "dev": true
+    },
     "check-error": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
       "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
       "dev": true
     },
-    "cli": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/cli/-/cli-1.0.1.tgz",
-      "integrity": "sha1-IoF1NPJL+klQw01TLUjsvGIbjBQ=",
-      "dev": true,
-      "requires": {
-        "exit": "0.1.2",
-        "glob": "^7.1.1"
-      },
-      "dependencies": {
-        "glob": {
-          "version": "7.1.2",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
-          "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
-          "dev": true,
-          "requires": {
-            "fs.realpath": "^1.0.0",
-            "inflight": "^1.0.4",
-            "inherits": "2",
-            "minimatch": "^3.0.4",
-            "once": "^1.3.0",
-            "path-is-absolute": "^1.0.0"
-          }
-        }
-      }
+    "circular-json": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz",
+      "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==",
+      "dev": true
     },
-    "cli-table": {
-      "version": "0.3.1",
-      "resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz",
-      "integrity": "sha1-9TsFJmqLGguTSz0IIebi3FkUriM=",
+    "cli-cursor": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+      "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
       "dev": true,
       "requires": {
-        "colors": "1.0.3"
+        "restore-cursor": "^2.0.0"
       }
     },
+    "cli-width": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz",
+      "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=",
+      "dev": true
+    },
     "cliui": {
       "version": "2.1.0",
       "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
@@ -346,10 +453,19 @@
       "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
       "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
     },
-    "colors": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
-      "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
+    "color-convert": {
+      "version": "1.9.2",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz",
+      "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==",
+      "dev": true,
+      "requires": {
+        "color-name": "1.1.1"
+      }
+    },
+    "color-name": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz",
+      "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=",
       "dev": true
     },
     "combined-stream": {
@@ -360,75 +476,28 @@
         "delayed-stream": "~1.0.0"
       }
     },
-    "commander": {
-      "version": "2.9.0",
-      "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
-      "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
-      "dev": true,
-      "requires": {
-        "graceful-readlink": ">= 1.0.0"
-      }
-    },
-    "comment-parser": {
-      "version": "0.3.2",
-      "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.3.2.tgz",
-      "integrity": "sha1-PAPwd2uGo239mgosl8YwfzMggv4=",
-      "dev": true,
-      "requires": {
-        "readable-stream": "^2.0.4"
-      },
-      "dependencies": {
-        "isarray": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
-          "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
-          "dev": true
-        },
-        "readable-stream": {
-          "version": "2.3.6",
-          "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
-          "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
-          "dev": true,
-          "requires": {
-            "core-util-is": "~1.0.0",
-            "inherits": "~2.0.3",
-            "isarray": "~1.0.0",
-            "process-nextick-args": "~2.0.0",
-            "safe-buffer": "~5.1.1",
-            "string_decoder": "~1.1.1",
-            "util-deprecate": "~1.0.1"
-          }
-        },
-        "string_decoder": {
-          "version": "1.1.1",
-          "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
-          "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
-          "dev": true,
-          "requires": {
-            "safe-buffer": "~5.1.0"
-          }
-        }
-      }
-    },
     "concat-map": {
       "version": "0.0.1",
       "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
       "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
       "dev": true
     },
-    "console-browserify": {
-      "version": "1.1.0",
-      "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz",
-      "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=",
+    "concat-stream": {
+      "version": "1.6.2",
+      "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
+      "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
       "dev": true,
       "requires": {
-        "date-now": "^0.1.4"
+        "buffer-from": "^1.0.0",
+        "inherits": "^2.0.3",
+        "readable-stream": "^2.2.2",
+        "typedarray": "^0.0.6"
       }
     },
-    "core-js": {
-      "version": "2.5.6",
-      "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz",
-      "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==",
+    "contains-path": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
+      "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=",
       "dev": true
     },
     "core-util-is": {
@@ -436,41 +505,17 @@
       "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
       "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac="
     },
-    "cryptiles": {
-      "version": "3.1.2",
-      "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz",
-      "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=",
-      "requires": {
-        "boom": "5.x.x"
-      },
-      "dependencies": {
-        "boom": {
-          "version": "5.2.0",
-          "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz",
-          "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==",
-          "requires": {
-            "hoek": "4.x.x"
-          }
-        }
-      }
-    },
-    "cst": {
-      "version": "0.4.10",
-      "resolved": "https://registry.npmjs.org/cst/-/cst-0.4.10.tgz",
-      "integrity": "sha512-U5ETe1IOjq2h56ZcBE3oe9rT7XryCH6IKgPMv0L7sSk6w29yR3p5egCK0T3BDNHHV95OoUBgXsqiVG+3a900Ag==",
+    "cross-spawn": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz",
+      "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=",
       "dev": true,
       "requires": {
-        "babel-runtime": "^6.9.2",
-        "babylon": "^6.8.1",
-        "source-map-support": "^0.4.0"
+        "lru-cache": "^4.0.1",
+        "shebang-command": "^1.2.0",
+        "which": "^1.2.9"
       }
     },
-    "cycle": {
-      "version": "1.0.3",
-      "resolved": "https://registry.npmjs.org/cycle/-/cycle-1.0.3.tgz",
-      "integrity": "sha1-IegLK+hYD5i0aPN5QwZisEbDStI=",
-      "dev": true
-    },
     "dashdash": {
       "version": "1.14.1",
       "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
@@ -479,12 +524,6 @@
         "assert-plus": "^1.0.0"
       }
     },
-    "date-now": {
-      "version": "0.1.4",
-      "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
-      "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=",
-      "dev": true
-    },
     "debug": {
       "version": "2.6.9",
       "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -493,6 +532,12 @@
         "ms": "2.0.0"
       }
     },
+    "debug-log": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/debug-log/-/debug-log-1.0.1.tgz",
+      "integrity": "sha1-IwdjLUwEOCuN+KMvcLiVBG1SdF8=",
+      "dev": true
+    },
     "decamelize": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
@@ -537,67 +582,73 @@
       "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=",
       "dev": true
     },
-    "delayed-stream": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
-      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
-    },
-    "dom-serializer": {
-      "version": "0.1.0",
-      "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz",
-      "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=",
+    "deglob": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/deglob/-/deglob-2.1.1.tgz",
+      "integrity": "sha512-2kjwuGGonL7gWE1XU4Fv79+vVzpoQCl0V+boMwWtOQJV2AGDabCwez++nB1Nli/8BabAfZQ/UuHPlp6AymKdWw==",
       "dev": true,
       "requires": {
-        "domelementtype": "~1.1.1",
-        "entities": "~1.1.1"
+        "find-root": "^1.0.0",
+        "glob": "^7.0.5",
+        "ignore": "^3.0.9",
+        "pkg-config": "^1.1.0",
+        "run-parallel": "^1.1.2",
+        "uniq": "^1.0.1"
       },
       "dependencies": {
-        "domelementtype": {
-          "version": "1.1.3",
-          "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz",
-          "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=",
-          "dev": true
-        },
-        "entities": {
-          "version": "1.1.1",
-          "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz",
-          "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=",
-          "dev": true
+        "glob": {
+          "version": "7.1.2",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
+          "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+          "dev": true,
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^3.0.4",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
         }
       }
     },
-    "domelementtype": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz",
-      "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=",
-      "dev": true
-    },
-    "domhandler": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.3.0.tgz",
-      "integrity": "sha1-LeWaCCLVAn+r/28DLCsloqir5zg=",
+    "del": {
+      "version": "2.2.2",
+      "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz",
+      "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=",
       "dev": true,
       "requires": {
-        "domelementtype": "1"
+        "globby": "^5.0.0",
+        "is-path-cwd": "^1.0.0",
+        "is-path-in-cwd": "^1.0.0",
+        "object-assign": "^4.0.1",
+        "pify": "^2.0.0",
+        "pinkie-promise": "^2.0.0",
+        "rimraf": "^2.2.8"
       }
     },
-    "domutils": {
-      "version": "1.5.1",
-      "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz",
-      "integrity": "sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8=",
+    "delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+      "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
+    },
+    "doctrine": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
+      "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
       "dev": true,
       "requires": {
-        "dom-serializer": "0",
-        "domelementtype": "1"
+        "esutils": "^2.0.2"
       }
     },
     "ecc-jsbn": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
-      "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=",
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+      "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=",
       "optional": true,
       "requires": {
-        "jsbn": "~0.1.0"
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.1.0"
       }
     },
     "endswith": {
@@ -606,11 +657,14 @@
       "integrity": "sha1-DG4TM+51/vTUDV5SZx+9wWUBzsw=",
       "dev": true
     },
-    "entities": {
-      "version": "1.0.0",
-      "resolved": "https://registry.npmjs.org/entities/-/entities-1.0.0.tgz",
-      "integrity": "sha1-sph6o4ITR/zeZCsk/fyeT7cSvyY=",
-      "dev": true
+    "error-ex": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
+      "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
+      "dev": true,
+      "requires": {
+        "is-arrayish": "^0.2.1"
+      }
     },
     "errs": {
       "version": "0.3.2",
@@ -618,9 +672,9 @@
       "integrity": "sha1-eYCZstvTfKK8dJ5TinwTB9C1BJk="
     },
     "es-abstract": {
-      "version": "1.11.0",
-      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz",
-      "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==",
+      "version": "1.12.0",
+      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz",
+      "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==",
       "dev": true,
       "requires": {
         "es-to-primitive": "^1.1.1",
@@ -660,16 +714,274 @@
         "source-map": "~0.2.0"
       }
     },
-    "esprima": {
-      "version": "2.7.3",
-      "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
-      "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
+    "eslint": {
+      "version": "4.18.2",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.2.tgz",
+      "integrity": "sha512-qy4i3wODqKMYfz9LUI8N2qYDkHkoieTbiHpMrYUI/WbjhXJQr7lI4VngixTgaG+yHX+NBCv7nW4hA0ShbvaNKw==",
+      "dev": true,
+      "requires": {
+        "ajv": "^5.3.0",
+        "babel-code-frame": "^6.22.0",
+        "chalk": "^2.1.0",
+        "concat-stream": "^1.6.0",
+        "cross-spawn": "^5.1.0",
+        "debug": "^3.1.0",
+        "doctrine": "^2.1.0",
+        "eslint-scope": "^3.7.1",
+        "eslint-visitor-keys": "^1.0.0",
+        "espree": "^3.5.2",
+        "esquery": "^1.0.0",
+        "esutils": "^2.0.2",
+        "file-entry-cache": "^2.0.0",
+        "functional-red-black-tree": "^1.0.1",
+        "glob": "^7.1.2",
+        "globals": "^11.0.1",
+        "ignore": "^3.3.3",
+        "imurmurhash": "^0.1.4",
+        "inquirer": "^3.0.6",
+        "is-resolvable": "^1.0.0",
+        "js-yaml": "^3.9.1",
+        "json-stable-stringify-without-jsonify": "^1.0.1",
+        "levn": "^0.3.0",
+        "lodash": "^4.17.4",
+        "minimatch": "^3.0.2",
+        "mkdirp": "^0.5.1",
+        "natural-compare": "^1.4.0",
+        "optionator": "^0.8.2",
+        "path-is-inside": "^1.0.2",
+        "pluralize": "^7.0.0",
+        "progress": "^2.0.0",
+        "require-uncached": "^1.0.3",
+        "semver": "^5.3.0",
+        "strip-ansi": "^4.0.0",
+        "strip-json-comments": "~2.0.1",
+        "table": "4.0.2",
+        "text-table": "~0.2.0"
+      },
+      "dependencies": {
+        "debug": {
+          "version": "3.1.0",
+          "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
+          "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
+          "dev": true,
+          "requires": {
+            "ms": "2.0.0"
+          }
+        },
+        "glob": {
+          "version": "7.1.2",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
+          "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+          "dev": true,
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^3.0.4",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
+        }
+      }
+    },
+    "eslint-config-standard": {
+      "version": "11.0.0",
+      "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz",
+      "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==",
       "dev": true
     },
-    "estraverse": {
-      "version": "1.9.3",
-      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz",
-      "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=",
+    "eslint-config-standard-jsx": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/eslint-config-standard-jsx/-/eslint-config-standard-jsx-5.0.0.tgz",
+      "integrity": "sha512-rLToPAEqLMPBfWnYTu6xRhm2OWziS2n40QFqJ8jAM8NSVzeVKTa3nclhsU4DpPJQRY60F34Oo1wi/71PN/eITg==",
+      "dev": true
+    },
+    "eslint-import-resolver-node": {
+      "version": "0.3.2",
+      "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz",
+      "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==",
+      "dev": true,
+      "requires": {
+        "debug": "^2.6.9",
+        "resolve": "^1.5.0"
+      },
+      "dependencies": {
+        "resolve": {
+          "version": "1.8.1",
+          "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
+          "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
+          "dev": true,
+          "requires": {
+            "path-parse": "^1.0.5"
+          }
+        }
+      }
+    },
+    "eslint-module-utils": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz",
+      "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=",
+      "dev": true,
+      "requires": {
+        "debug": "^2.6.8",
+        "pkg-dir": "^1.0.0"
+      }
+    },
+    "eslint-plugin-import": {
+      "version": "2.9.0",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz",
+      "integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=",
+      "dev": true,
+      "requires": {
+        "builtin-modules": "^1.1.1",
+        "contains-path": "^0.1.0",
+        "debug": "^2.6.8",
+        "doctrine": "1.5.0",
+        "eslint-import-resolver-node": "^0.3.1",
+        "eslint-module-utils": "^2.1.1",
+        "has": "^1.0.1",
+        "lodash": "^4.17.4",
+        "minimatch": "^3.0.3",
+        "read-pkg-up": "^2.0.0"
+      },
+      "dependencies": {
+        "doctrine": {
+          "version": "1.5.0",
+          "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz",
+          "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=",
+          "dev": true,
+          "requires": {
+            "esutils": "^2.0.2",
+            "isarray": "^1.0.0"
+          }
+        }
+      }
+    },
+    "eslint-plugin-node": {
+      "version": "6.0.1",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz",
+      "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==",
+      "dev": true,
+      "requires": {
+        "ignore": "^3.3.6",
+        "minimatch": "^3.0.4",
+        "resolve": "^1.3.3",
+        "semver": "^5.4.1"
+      },
+      "dependencies": {
+        "resolve": {
+          "version": "1.8.1",
+          "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz",
+          "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==",
+          "dev": true,
+          "requires": {
+            "path-parse": "^1.0.5"
+          }
+        }
+      }
+    },
+    "eslint-plugin-promise": {
+      "version": "3.7.0",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz",
+      "integrity": "sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg==",
+      "dev": true
+    },
+    "eslint-plugin-react": {
+      "version": "7.7.0",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz",
+      "integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==",
+      "dev": true,
+      "requires": {
+        "doctrine": "^2.0.2",
+        "has": "^1.0.1",
+        "jsx-ast-utils": "^2.0.1",
+        "prop-types": "^15.6.0"
+      }
+    },
+    "eslint-plugin-standard": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.0.1.tgz",
+      "integrity": "sha1-NNDJFbRe3G8BA5PH7vOCOwhWXPI=",
+      "dev": true
+    },
+    "eslint-scope": {
+      "version": "3.7.3",
+      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.3.tgz",
+      "integrity": "sha512-W+B0SvF4gamyCTmUc+uITPY0989iXVfKvhwtmJocTaYoc/3khEHmEmvfY/Gn9HA9VV75jrQECsHizkNw1b68FA==",
+      "dev": true,
+      "requires": {
+        "esrecurse": "^4.1.0",
+        "estraverse": "^4.1.1"
+      },
+      "dependencies": {
+        "estraverse": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+          "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+          "dev": true
+        }
+      }
+    },
+    "eslint-visitor-keys": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",
+      "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==",
+      "dev": true
+    },
+    "espree": {
+      "version": "3.5.4",
+      "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz",
+      "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==",
+      "dev": true,
+      "requires": {
+        "acorn": "^5.5.0",
+        "acorn-jsx": "^3.0.0"
+      }
+    },
+    "esprima": {
+      "version": "2.7.3",
+      "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz",
+      "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=",
+      "dev": true
+    },
+    "esquery": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz",
+      "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==",
+      "dev": true,
+      "requires": {
+        "estraverse": "^4.0.0"
+      },
+      "dependencies": {
+        "estraverse": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+          "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+          "dev": true
+        }
+      }
+    },
+    "esrecurse": {
+      "version": "4.2.1",
+      "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
+      "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==",
+      "dev": true,
+      "requires": {
+        "estraverse": "^4.1.0"
+      },
+      "dependencies": {
+        "estraverse": {
+          "version": "4.2.0",
+          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
+          "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
+          "dev": true
+        }
+      }
+    },
+    "estraverse": {
+      "version": "1.9.3",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz",
+      "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=",
       "dev": true
     },
     "esutils": {
@@ -678,28 +990,27 @@
       "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
       "dev": true
     },
-    "exit": {
-      "version": "0.1.2",
-      "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
-      "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=",
-      "dev": true
-    },
     "extend": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
-      "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ="
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+      "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="
+    },
+    "external-editor": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz",
+      "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==",
+      "dev": true,
+      "requires": {
+        "chardet": "^0.4.0",
+        "iconv-lite": "^0.4.17",
+        "tmp": "^0.0.33"
+      }
     },
     "extsprintf": {
       "version": "1.3.0",
       "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
       "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU="
     },
-    "eyes": {
-      "version": "0.1.8",
-      "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz",
-      "integrity": "sha1-Ys8SAjTGg3hdkCNIqADvPgzCC8A=",
-      "dev": true
-    },
     "fast-deep-equal": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz",
@@ -716,13 +1027,60 @@
       "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=",
       "dev": true
     },
+    "figures": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
+      "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
+      "dev": true,
+      "requires": {
+        "escape-string-regexp": "^1.0.5"
+      }
+    },
+    "file-entry-cache": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz",
+      "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=",
+      "dev": true,
+      "requires": {
+        "flat-cache": "^1.2.1",
+        "object-assign": "^4.0.1"
+      }
+    },
+    "find-root": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz",
+      "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==",
+      "dev": true
+    },
+    "find-up": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
+      "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
+      "dev": true,
+      "requires": {
+        "path-exists": "^2.0.0",
+        "pinkie-promise": "^2.0.0"
+      }
+    },
+    "flat-cache": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz",
+      "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=",
+      "dev": true,
+      "requires": {
+        "circular-json": "^0.3.1",
+        "del": "^2.0.2",
+        "graceful-fs": "^4.1.2",
+        "write": "^0.2.1"
+      }
+    },
     "for-each": {
-      "version": "0.3.2",
-      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.2.tgz",
-      "integrity": "sha1-LEBFC5NI6X8oEyJZO6lnBLmr1NQ=",
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
+      "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
       "dev": true,
       "requires": {
-        "is-function": "~1.0.0"
+        "is-callable": "^1.1.3"
       }
     },
     "foreach": {
@@ -758,12 +1116,24 @@
       "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
       "dev": true
     },
+    "functional-red-black-tree": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+      "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
+      "dev": true
+    },
     "get-func-name": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
       "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
       "dev": true
     },
+    "get-stdin": {
+      "version": "6.0.0",
+      "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz",
+      "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==",
+      "dev": true
+    },
     "getpass": {
       "version": "0.1.7",
       "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
@@ -785,10 +1155,46 @@
         "path-is-absolute": "^1.0.0"
       }
     },
-    "graceful-readlink": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
-      "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
+    "globals": {
+      "version": "11.7.0",
+      "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz",
+      "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==",
+      "dev": true
+    },
+    "globby": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz",
+      "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=",
+      "dev": true,
+      "requires": {
+        "array-union": "^1.0.1",
+        "arrify": "^1.0.0",
+        "glob": "^7.0.3",
+        "object-assign": "^4.0.1",
+        "pify": "^2.0.0",
+        "pinkie-promise": "^2.0.0"
+      },
+      "dependencies": {
+        "glob": {
+          "version": "7.1.2",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
+          "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
+          "dev": true,
+          "requires": {
+            "fs.realpath": "^1.0.0",
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "^3.0.4",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
+        }
+      }
+    },
+    "graceful-fs": {
+      "version": "4.1.11",
+      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
+      "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=",
       "dev": true
     },
     "handlebars": {
@@ -826,21 +1232,21 @@
       "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI="
     },
     "har-validator": {
-      "version": "5.0.3",
-      "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz",
-      "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=",
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz",
+      "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==",
       "requires": {
-        "ajv": "^5.1.0",
+        "ajv": "^5.3.0",
         "har-schema": "^2.0.0"
       }
     },
     "has": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz",
-      "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=",
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+      "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
       "dev": true,
       "requires": {
-        "function-bind": "^1.0.2"
+        "function-bind": "^1.1.1"
       }
     },
     "has-ansi": {
@@ -852,46 +1258,17 @@
         "ansi-regex": "^2.0.0"
       }
     },
-    "has-color": {
-      "version": "0.1.7",
-      "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz",
-      "integrity": "sha1-ZxRKUmDDT8PMpnfQQdr1L+e3iy8=",
-      "dev": true
-    },
     "has-flag": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
       "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=",
       "dev": true
     },
-    "hawk": {
-      "version": "6.0.2",
-      "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz",
-      "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==",
-      "requires": {
-        "boom": "4.x.x",
-        "cryptiles": "3.x.x",
-        "hoek": "4.x.x",
-        "sntp": "2.x.x"
-      }
-    },
-    "hoek": {
-      "version": "4.2.1",
-      "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz",
-      "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA=="
-    },
-    "htmlparser2": {
-      "version": "3.8.3",
-      "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.8.3.tgz",
-      "integrity": "sha1-mWwosZFRaovoZQGn15dX5ccMEGg=",
-      "dev": true,
-      "requires": {
-        "domelementtype": "1",
-        "domhandler": "2.3",
-        "domutils": "1.5",
-        "entities": "1.0",
-        "readable-stream": "1.1"
-      }
+    "hosted-git-info": {
+      "version": "2.7.1",
+      "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
+      "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==",
+      "dev": true
     },
     "http-signature": {
       "version": "1.2.0",
@@ -903,10 +1280,25 @@
         "sshpk": "^1.7.0"
       }
     },
-    "i": {
-      "version": "0.3.6",
-      "resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz",
-      "integrity": "sha1-2WyScyB28HJxG2sQ/X1PZa2O4j0=",
+    "iconv-lite": {
+      "version": "0.4.23",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
+      "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
+      "dev": true,
+      "requires": {
+        "safer-buffer": ">= 2.1.2 < 3"
+      }
+    },
+    "ignore": {
+      "version": "3.3.10",
+      "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.10.tgz",
+      "integrity": "sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==",
+      "dev": true
+    },
+    "imurmurhash": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+      "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
       "dev": true
     },
     "inflight": {
@@ -919,28 +1311,59 @@
         "wrappy": "1"
       }
     },
-    "inherit": {
-      "version": "2.2.6",
-      "resolved": "https://registry.npmjs.org/inherit/-/inherit-2.2.6.tgz",
-      "integrity": "sha1-8WFLBshUToEo5CKchjR9tzrZeI0=",
-      "dev": true
-    },
     "inherits": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
       "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
       "dev": true
     },
+    "inquirer": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
+      "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==",
+      "dev": true,
+      "requires": {
+        "ansi-escapes": "^3.0.0",
+        "chalk": "^2.0.0",
+        "cli-cursor": "^2.1.0",
+        "cli-width": "^2.0.0",
+        "external-editor": "^2.0.4",
+        "figures": "^2.0.0",
+        "lodash": "^4.3.0",
+        "mute-stream": "0.0.7",
+        "run-async": "^2.2.0",
+        "rx-lite": "^4.0.8",
+        "rx-lite-aggregates": "^4.0.8",
+        "string-width": "^2.1.0",
+        "strip-ansi": "^4.0.0",
+        "through": "^2.3.6"
+      }
+    },
+    "is-arrayish": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+      "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=",
+      "dev": true
+    },
     "is-buffer": {
       "version": "1.1.6",
       "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
       "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
       "dev": true
     },
+    "is-builtin-module": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
+      "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
+      "dev": true,
+      "requires": {
+        "builtin-modules": "^1.0.0"
+      }
+    },
     "is-callable": {
-      "version": "1.1.3",
-      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz",
-      "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=",
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz",
+      "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==",
       "dev": true
     },
     "is-date-object": {
@@ -949,10 +1372,40 @@
       "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
       "dev": true
     },
-    "is-function": {
+    "is-fullwidth-code-point": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+      "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
+      "dev": true
+    },
+    "is-path-cwd": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz",
+      "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=",
+      "dev": true
+    },
+    "is-path-in-cwd": {
       "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.1.tgz",
-      "integrity": "sha1-Es+5i2W1fdPRk6MSH19uL0N2ArU=",
+      "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz",
+      "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==",
+      "dev": true,
+      "requires": {
+        "is-path-inside": "^1.0.0"
+      }
+    },
+    "is-path-inside": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz",
+      "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=",
+      "dev": true,
+      "requires": {
+        "path-is-inside": "^1.0.1"
+      }
+    },
+    "is-promise": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz",
+      "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
       "dev": true
     },
     "is-regex": {
@@ -964,6 +1417,12 @@
         "has": "^1.0.1"
       }
     },
+    "is-resolvable": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
+      "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
+      "dev": true
+    },
     "is-symbol": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz",
@@ -975,16 +1434,10 @@
       "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
       "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
     },
-    "is-utf8": {
-      "version": "0.2.1",
-      "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
-      "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
-      "dev": true
-    },
     "isarray": {
-      "version": "0.0.1",
-      "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
-      "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
       "dev": true
     },
     "isexe": {
@@ -1028,10 +1481,16 @@
         }
       }
     },
+    "js-tokens": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz",
+      "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
+      "dev": true
+    },
     "js-yaml": {
-      "version": "3.11.0",
-      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz",
-      "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==",
+      "version": "3.12.0",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
+      "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
       "dev": true,
       "requires": {
         "argparse": "^1.0.7",
@@ -1039,9 +1498,9 @@
       },
       "dependencies": {
         "esprima": {
-          "version": "4.0.0",
-          "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
-          "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
+          "version": "4.0.1",
+          "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+          "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
           "dev": true
         }
       }
@@ -1052,122 +1511,12 @@
       "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=",
       "optional": true
     },
-    "jscs": {
-      "version": "3.0.7",
-      "resolved": "https://registry.npmjs.org/jscs/-/jscs-3.0.7.tgz",
-      "integrity": "sha1-cUG03/W4bjLQ6Z12S4NnZ8MNIBo=",
-      "dev": true,
-      "requires": {
-        "chalk": "~1.1.0",
-        "cli-table": "~0.3.1",
-        "commander": "~2.9.0",
-        "cst": "^0.4.3",
-        "estraverse": "^4.1.0",
-        "exit": "~0.1.2",
-        "glob": "^5.0.1",
-        "htmlparser2": "3.8.3",
-        "js-yaml": "~3.4.0",
-        "jscs-jsdoc": "^2.0.0",
-        "jscs-preset-wikimedia": "~1.0.0",
-        "jsonlint": "~1.6.2",
-        "lodash": "~3.10.0",
-        "minimatch": "~3.0.0",
-        "natural-compare": "~1.2.2",
-        "pathval": "~0.1.1",
-        "prompt": "~0.2.14",
-        "reserved-words": "^0.1.1",
-        "resolve": "^1.1.6",
-        "strip-bom": "^2.0.0",
-        "strip-json-comments": "~1.0.2",
-        "to-double-quotes": "^2.0.0",
-        "to-single-quotes": "^2.0.0",
-        "vow": "~0.4.8",
-        "vow-fs": "~0.3.4",
-        "xmlbuilder": "^3.1.0"
-      },
-      "dependencies": {
-        "estraverse": {
-          "version": "4.2.0",
-          "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz",
-          "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=",
-          "dev": true
-        },
-        "js-yaml": {
-          "version": "3.4.6",
-          "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.4.6.tgz",
-          "integrity": "sha1-a+GyP2JJ9T0pM3D9TRqqY84bTrA=",
-          "dev": true,
-          "requires": {
-            "argparse": "^1.0.2",
-            "esprima": "^2.6.0",
-            "inherit": "^2.2.2"
-          }
-        },
-        "lodash": {
-          "version": "3.10.1",
-          "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
-          "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
-          "dev": true
-        }
-      }
-    },
-    "jscs-jsdoc": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/jscs-jsdoc/-/jscs-jsdoc-2.0.0.tgz",
-      "integrity": "sha1-9T684CmqMSW9iCkLpQ1k1FEKSHE=",
-      "dev": true,
-      "requires": {
-        "comment-parser": "^0.3.1",
-        "jsdoctypeparser": "~1.2.0"
-      }
-    },
-    "jscs-preset-wikimedia": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/jscs-preset-wikimedia/-/jscs-preset-wikimedia-1.0.1.tgz",
-      "integrity": "sha512-RWqu6IYSUlnYuCRCF0obCOHjJV0vhpLcvKbauwxmLQoZ0PiXDTWBYlfpsEfdhg7pmREAEwrARfDRz5qWD6qknA==",
+    "json-parse-better-errors": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+      "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
       "dev": true
     },
-    "jsdoctypeparser": {
-      "version": "1.2.0",
-      "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-1.2.0.tgz",
-      "integrity": "sha1-597cFToRhJ/8UUEUSuhqfvDCU5I=",
-      "dev": true,
-      "requires": {
-        "lodash": "^3.7.0"
-      },
-      "dependencies": {
-        "lodash": {
-          "version": "3.10.1",
-          "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
-          "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
-          "dev": true
-        }
-      }
-    },
-    "jshint": {
-      "version": "2.9.5",
-      "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.9.5.tgz",
-      "integrity": "sha1-HnJSkVzmgbQIJ+4UJIxG006apiw=",
-      "dev": true,
-      "requires": {
-        "cli": "~1.0.0",
-        "console-browserify": "1.1.x",
-        "exit": "0.1.x",
-        "htmlparser2": "3.8.x",
-        "lodash": "3.7.x",
-        "minimatch": "~3.0.2",
-        "shelljs": "0.3.x",
-        "strip-json-comments": "1.0.x"
-      },
-      "dependencies": {
-        "lodash": {
-          "version": "3.7.0",
-          "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.7.0.tgz",
-          "integrity": "sha1-Nni9irmVBXwHreg27S7wh9qBHUU=",
-          "dev": true
-        }
-      }
-    },
     "json-schema": {
       "version": "0.2.3",
       "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
@@ -1178,21 +1527,17 @@
       "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz",
       "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A="
     },
+    "json-stable-stringify-without-jsonify": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+      "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=",
+      "dev": true
+    },
     "json-stringify-safe": {
       "version": "5.0.1",
       "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
       "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus="
     },
-    "jsonlint": {
-      "version": "1.6.3",
-      "resolved": "https://registry.npmjs.org/jsonlint/-/jsonlint-1.6.3.tgz",
-      "integrity": "sha512-jMVTMzP+7gU/IyC6hvKyWpUU8tmTkK5b3BPNuMI9U8Sit+YAWLlZwB6Y6YrdCxfg2kNz05p3XY3Bmm4m26Nv3A==",
-      "dev": true,
-      "requires": {
-        "JSV": "^4.0.x",
-        "nomnom": "^1.5.x"
-      }
-    },
     "jsprim": {
       "version": "1.4.1",
       "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
@@ -1204,6 +1549,15 @@
         "verror": "1.10.0"
       }
     },
+    "jsx-ast-utils": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz",
+      "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=",
+      "dev": true,
+      "requires": {
+        "array-includes": "^3.0.3"
+      }
+    },
     "kind-of": {
       "version": "3.2.2",
       "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
@@ -1230,6 +1584,36 @@
         "type-check": "~0.3.2"
       }
     },
+    "load-json-file": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
+      "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
+      "dev": true,
+      "requires": {
+        "graceful-fs": "^4.1.2",
+        "parse-json": "^2.2.0",
+        "pify": "^2.0.0",
+        "strip-bom": "^3.0.0"
+      }
+    },
+    "locate-path": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz",
+      "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=",
+      "dev": true,
+      "requires": {
+        "p-locate": "^2.0.0",
+        "path-exists": "^3.0.0"
+      },
+      "dependencies": {
+        "path-exists": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+          "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
+          "dev": true
+        }
+      }
+    },
     "lodash": {
       "version": "4.17.10",
       "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
@@ -1247,25 +1631,44 @@
       "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=",
       "dev": true
     },
+    "loose-envify": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+      "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+      "dev": true,
+      "requires": {
+        "js-tokens": "^3.0.0 || ^4.0.0"
+      }
+    },
     "lru-cache": {
-      "version": "2.7.3",
-      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
-      "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=",
-      "dev": true
+      "version": "4.1.3",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz",
+      "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==",
+      "dev": true,
+      "requires": {
+        "pseudomap": "^1.0.2",
+        "yallist": "^2.1.2"
+      }
     },
     "mime-db": {
-      "version": "1.33.0",
-      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
-      "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ=="
+      "version": "1.35.0",
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz",
+      "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg=="
     },
     "mime-types": {
-      "version": "2.1.18",
-      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
-      "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
+      "version": "2.1.19",
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz",
+      "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==",
       "requires": {
-        "mime-db": "~1.33.0"
+        "mime-db": "~1.35.0"
       }
     },
+    "mimic-fn": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+      "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+      "dev": true
+    },
     "minimatch": {
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@@ -1310,21 +1713,15 @@
       "dev": true
     },
     "natural-compare": {
-      "version": "1.2.2",
-      "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.2.2.tgz",
-      "integrity": "sha1-H5bWDjFBysG20FZTzg2urHY69qo=",
-      "dev": true
-    },
-    "ncp": {
-      "version": "0.4.2",
-      "resolved": "https://registry.npmjs.org/ncp/-/ncp-0.4.2.tgz",
-      "integrity": "sha1-q8xsvT7C7Spyn/bnwfqPAXhKhXQ=",
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+      "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=",
       "dev": true
     },
     "nock": {
-      "version": "9.2.5",
-      "resolved": "https://registry.npmjs.org/nock/-/nock-9.2.5.tgz",
-      "integrity": "sha512-ciCpyEq72Ws6/yhdayDfd0mAb3eQ7/533xKmFlBQZ5CDwrL0/bddtSicfL7R07oyvPAuegQrR+9ctrlPEp0EjQ==",
+      "version": "9.6.1",
+      "resolved": "https://registry.npmjs.org/nock/-/nock-9.6.1.tgz",
+      "integrity": "sha512-EDgl/WgNQ0C1BZZlASOQkQdE6tAWXJi8QQlugqzN64JJkvZ7ILijZuG24r4vCC7yOfnm6HKpne5AGExLGCeBWg==",
       "dev": true,
       "requires": {
         "chai": "^4.1.2",
@@ -1349,41 +1746,6 @@
         }
       }
     },
-    "nomnom": {
-      "version": "1.8.1",
-      "resolved": "https://registry.npmjs.org/nomnom/-/nomnom-1.8.1.tgz",
-      "integrity": "sha1-IVH3Ikcrp55Qp2/BJbuMjy5Nwqc=",
-      "dev": true,
-      "requires": {
-        "chalk": "~0.4.0",
-        "underscore": "~1.6.0"
-      },
-      "dependencies": {
-        "ansi-styles": {
-          "version": "1.0.0",
-          "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-1.0.0.tgz",
-          "integrity": "sha1-yxAt8cVvUSPquLZ817mAJ6AnkXg=",
-          "dev": true
-        },
-        "chalk": {
-          "version": "0.4.0",
-          "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.4.0.tgz",
-          "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=",
-          "dev": true,
-          "requires": {
-            "ansi-styles": "~1.0.0",
-            "has-color": "~0.1.0",
-            "strip-ansi": "~0.1.0"
-          }
-        },
-        "strip-ansi": {
-          "version": "0.1.1",
-          "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.1.1.tgz",
-          "integrity": "sha1-OeipjQRNFQZgq+SmgIrPcLt7yZE=",
-          "dev": true
-        }
-      }
-    },
     "nopt": {
       "version": "3.0.6",
       "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz",
@@ -1393,21 +1755,39 @@
         "abbrev": "1"
       }
     },
+    "normalize-package-data": {
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
+      "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
+      "dev": true,
+      "requires": {
+        "hosted-git-info": "^2.1.4",
+        "is-builtin-module": "^1.0.0",
+        "semver": "2 || 3 || 4 || 5",
+        "validate-npm-package-license": "^3.0.1"
+      }
+    },
     "oauth-sign": {
-      "version": "0.8.2",
-      "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
-      "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM="
+      "version": "0.9.0",
+      "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+      "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ=="
+    },
+    "object-assign": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+      "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
+      "dev": true
     },
     "object-inspect": {
-      "version": "1.5.0",
-      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.5.0.tgz",
-      "integrity": "sha512-UmOFbHbwvv+XHj7BerrhVq+knjceBdkvU5AriwLMvhv2qi+e7DJzxfBeFpILEjVzCp+xA+W/pIf06RGPWlZNfw==",
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz",
+      "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==",
       "dev": true
     },
     "object-keys": {
-      "version": "1.0.11",
-      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz",
-      "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=",
+      "version": "1.0.12",
+      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz",
+      "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==",
       "dev": true
     },
     "once": {
@@ -1419,6 +1799,15 @@
         "wrappy": "1"
       }
     },
+    "onetime": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
+      "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
+      "dev": true,
+      "requires": {
+        "mimic-fn": "^1.0.0"
+      }
+    },
     "optimist": {
       "version": "0.6.1",
       "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
@@ -1437,47 +1826,200 @@
         }
       }
     },
-    "optionator": {
-      "version": "0.8.2",
-      "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
-      "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
+    "optionator": {
+      "version": "0.8.2",
+      "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
+      "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=",
+      "dev": true,
+      "requires": {
+        "deep-is": "~0.1.3",
+        "fast-levenshtein": "~2.0.4",
+        "levn": "~0.3.0",
+        "prelude-ls": "~1.1.2",
+        "type-check": "~0.3.2",
+        "wordwrap": "~1.0.0"
+      }
+    },
+    "os-tmpdir": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+      "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
+      "dev": true
+    },
+    "p-limit": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz",
+      "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==",
+      "dev": true,
+      "requires": {
+        "p-try": "^1.0.0"
+      }
+    },
+    "p-locate": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz",
+      "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=",
+      "dev": true,
+      "requires": {
+        "p-limit": "^1.1.0"
+      }
+    },
+    "p-try": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz",
+      "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=",
+      "dev": true
+    },
+    "parse-json": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
+      "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
+      "dev": true,
+      "requires": {
+        "error-ex": "^1.2.0"
+      }
+    },
+    "path-exists": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
+      "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
+      "dev": true,
+      "requires": {
+        "pinkie-promise": "^2.0.0"
+      }
+    },
+    "path-is-absolute": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
+      "dev": true
+    },
+    "path-is-inside": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
+      "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=",
+      "dev": true
+    },
+    "path-parse": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz",
+      "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
+      "dev": true
+    },
+    "path-type": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
+      "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
+      "dev": true,
+      "requires": {
+        "pify": "^2.0.0"
+      }
+    },
+    "pathval": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
+      "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
+      "dev": true
+    },
+    "performance-now": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+    },
+    "pify": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+      "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
+      "dev": true
+    },
+    "pinkie": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+      "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=",
+      "dev": true
+    },
+    "pinkie-promise": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+      "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
+      "dev": true,
+      "requires": {
+        "pinkie": "^2.0.0"
+      }
+    },
+    "pkg-conf": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-2.1.0.tgz",
+      "integrity": "sha1-ISZRTKbyq/69FoWW3xi6V4Z/AFg=",
+      "dev": true,
+      "requires": {
+        "find-up": "^2.0.0",
+        "load-json-file": "^4.0.0"
+      },
+      "dependencies": {
+        "find-up": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
+          "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+          "dev": true,
+          "requires": {
+            "locate-path": "^2.0.0"
+          }
+        },
+        "load-json-file": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+          "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=",
+          "dev": true,
+          "requires": {
+            "graceful-fs": "^4.1.2",
+            "parse-json": "^4.0.0",
+            "pify": "^3.0.0",
+            "strip-bom": "^3.0.0"
+          }
+        },
+        "parse-json": {
+          "version": "4.0.0",
+          "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+          "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=",
+          "dev": true,
+          "requires": {
+            "error-ex": "^1.3.1",
+            "json-parse-better-errors": "^1.0.1"
+          }
+        },
+        "pify": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+          "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=",
+          "dev": true
+        }
+      }
+    },
+    "pkg-config": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/pkg-config/-/pkg-config-1.1.1.tgz",
+      "integrity": "sha1-VX7yLXPaPIg3EHdmxS6tq94pj+Q=",
       "dev": true,
       "requires": {
-        "deep-is": "~0.1.3",
-        "fast-levenshtein": "~2.0.4",
-        "levn": "~0.3.0",
-        "prelude-ls": "~1.1.2",
-        "type-check": "~0.3.2",
-        "wordwrap": "~1.0.0"
+        "debug-log": "^1.0.0",
+        "find-root": "^1.0.0",
+        "xtend": "^4.0.1"
       }
     },
-    "path-is-absolute": {
-      "version": "1.0.1",
-      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
-      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
-      "dev": true
-    },
-    "path-parse": {
-      "version": "1.0.5",
-      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz",
-      "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=",
-      "dev": true
-    },
-    "pathval": {
-      "version": "0.1.1",
-      "resolved": "https://registry.npmjs.org/pathval/-/pathval-0.1.1.tgz",
-      "integrity": "sha1-CPkRzcqczllCiA2ngXvAtyO2bYI=",
-      "dev": true
-    },
-    "performance-now": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
-      "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
+    "pkg-dir": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz",
+      "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=",
+      "dev": true,
+      "requires": {
+        "find-up": "^1.0.0"
+      }
     },
-    "pkginfo": {
-      "version": "0.4.1",
-      "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.4.1.tgz",
-      "integrity": "sha1-tUGO8EOd5UJfxJlQQtztFPsqhP8=",
+    "pluralize": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz",
+      "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==",
       "dev": true
     },
     "prelude-ls": {
@@ -1492,17 +2034,20 @@
       "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
       "dev": true
     },
-    "prompt": {
-      "version": "0.2.14",
-      "resolved": "https://registry.npmjs.org/prompt/-/prompt-0.2.14.tgz",
-      "integrity": "sha1-V3VPZPVD/XsIRXB8gY7OYY8F/9w=",
+    "progress": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz",
+      "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=",
+      "dev": true
+    },
+    "prop-types": {
+      "version": "15.6.2",
+      "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
+      "integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==",
       "dev": true,
       "requires": {
-        "pkginfo": "0.x.x",
-        "read": "1.0.x",
-        "revalidator": "0.1.x",
-        "utile": "0.2.x",
-        "winston": "0.8.x"
+        "loose-envify": "^1.3.1",
+        "object-assign": "^4.1.1"
       }
     },
     "propagate": {
@@ -1511,6 +2056,17 @@
       "integrity": "sha1-AMLa7t2iDofjeCs0Stuhzd1q1wk=",
       "dev": true
     },
+    "pseudomap": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
+      "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
+      "dev": true
+    },
+    "psl": {
+      "version": "1.1.29",
+      "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz",
+      "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ=="
+    },
     "punycode": {
       "version": "1.4.1",
       "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
@@ -1521,33 +2077,53 @@
       "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
       "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
     },
-    "read": {
-      "version": "1.0.7",
-      "resolved": "https://registry.npmjs.org/read/-/read-1.0.7.tgz",
-      "integrity": "sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ=",
+    "read-pkg": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
+      "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
+      "dev": true,
+      "requires": {
+        "load-json-file": "^2.0.0",
+        "normalize-package-data": "^2.3.2",
+        "path-type": "^2.0.0"
+      }
+    },
+    "read-pkg-up": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
+      "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
       "dev": true,
       "requires": {
-        "mute-stream": "~0.0.4"
+        "find-up": "^2.0.0",
+        "read-pkg": "^2.0.0"
+      },
+      "dependencies": {
+        "find-up": {
+          "version": "2.1.0",
+          "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
+          "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
+          "dev": true,
+          "requires": {
+            "locate-path": "^2.0.0"
+          }
+        }
       }
     },
     "readable-stream": {
-      "version": "1.1.14",
-      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
-      "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=",
+      "version": "2.3.6",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+      "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
       "dev": true,
       "requires": {
         "core-util-is": "~1.0.0",
-        "inherits": "~2.0.1",
-        "isarray": "0.0.1",
-        "string_decoder": "~0.10.x"
+        "inherits": "~2.0.3",
+        "isarray": "~1.0.0",
+        "process-nextick-args": "~2.0.0",
+        "safe-buffer": "~5.1.1",
+        "string_decoder": "~1.1.1",
+        "util-deprecate": "~1.0.1"
       }
     },
-    "regenerator-runtime": {
-      "version": "0.11.1",
-      "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
-      "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==",
-      "dev": true
-    },
     "repeat-string": {
       "version": "1.6.1",
       "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
@@ -1555,39 +2131,41 @@
       "dev": true
     },
     "request": {
-      "version": "2.85.0",
-      "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz",
-      "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==",
+      "version": "2.88.0",
+      "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz",
+      "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==",
       "requires": {
         "aws-sign2": "~0.7.0",
-        "aws4": "^1.6.0",
+        "aws4": "^1.8.0",
         "caseless": "~0.12.0",
-        "combined-stream": "~1.0.5",
-        "extend": "~3.0.1",
+        "combined-stream": "~1.0.6",
+        "extend": "~3.0.2",
         "forever-agent": "~0.6.1",
-        "form-data": "~2.3.1",
-        "har-validator": "~5.0.3",
-        "hawk": "~6.0.2",
+        "form-data": "~2.3.2",
+        "har-validator": "~5.1.0",
         "http-signature": "~1.2.0",
         "is-typedarray": "~1.0.0",
         "isstream": "~0.1.2",
         "json-stringify-safe": "~5.0.1",
-        "mime-types": "~2.1.17",
-        "oauth-sign": "~0.8.2",
+        "mime-types": "~2.1.19",
+        "oauth-sign": "~0.9.0",
         "performance-now": "^2.1.0",
-        "qs": "~6.5.1",
-        "safe-buffer": "^5.1.1",
-        "stringstream": "~0.0.5",
-        "tough-cookie": "~2.3.3",
+        "qs": "~6.5.2",
+        "safe-buffer": "^5.1.2",
+        "tough-cookie": "~2.4.3",
         "tunnel-agent": "^0.6.0",
-        "uuid": "^3.1.0"
+        "uuid": "^3.3.2"
       }
     },
-    "reserved-words": {
-      "version": "0.1.2",
-      "resolved": "https://registry.npmjs.org/reserved-words/-/reserved-words-0.1.2.tgz",
-      "integrity": "sha1-AKCUD5jNUBrqqsMWQR2a3FKzGrE=",
-      "dev": true
+    "require-uncached": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz",
+      "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=",
+      "dev": true,
+      "requires": {
+        "caller-path": "^0.1.0",
+        "resolve-from": "^1.0.0"
+      }
     },
     "resolve": {
       "version": "1.1.7",
@@ -1595,6 +2173,22 @@
       "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=",
       "dev": true
     },
+    "resolve-from": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz",
+      "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=",
+      "dev": true
+    },
+    "restore-cursor": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
+      "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
+      "dev": true,
+      "requires": {
+        "onetime": "^2.0.0",
+        "signal-exit": "^3.0.2"
+      }
+    },
     "resumer": {
       "version": "0.0.0",
       "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz",
@@ -1604,12 +2198,6 @@
         "through": "~2.3.4"
       }
     },
-    "revalidator": {
-      "version": "0.1.8",
-      "resolved": "https://registry.npmjs.org/revalidator/-/revalidator-0.1.8.tgz",
-      "integrity": "sha1-/s5hv6DBtSoga9axgZgYS91SOjs=",
-      "dev": true
-    },
     "right-align": {
       "version": "0.1.3",
       "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
@@ -1645,21 +2233,65 @@
         }
       }
     },
+    "run-async": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz",
+      "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=",
+      "dev": true,
+      "requires": {
+        "is-promise": "^2.1.0"
+      }
+    },
+    "run-parallel": {
+      "version": "1.1.9",
+      "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz",
+      "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==",
+      "dev": true
+    },
+    "rx-lite": {
+      "version": "4.0.8",
+      "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz",
+      "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=",
+      "dev": true
+    },
+    "rx-lite-aggregates": {
+      "version": "4.0.8",
+      "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz",
+      "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=",
+      "dev": true,
+      "requires": {
+        "rx-lite": "*"
+      }
+    },
     "safe-buffer": {
       "version": "5.1.2",
       "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
       "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
     },
+    "safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
+    },
     "semver": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
       "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
       "dev": true
     },
-    "shelljs": {
-      "version": "0.3.0",
-      "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.3.0.tgz",
-      "integrity": "sha1-NZbmMHp4FUT1kfN9phg2DzHbV7E=",
+    "shebang-command": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+      "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
+      "dev": true,
+      "requires": {
+        "shebang-regex": "^1.0.0"
+      }
+    },
+    "shebang-regex": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+      "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
       "dev": true
     },
     "sigmund": {
@@ -1668,12 +2300,19 @@
       "integrity": "sha1-P/IfGYytIXX587eBhT/ZTQ0ZtZA=",
       "dev": true
     },
-    "sntp": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz",
-      "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==",
+    "signal-exit": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
+      "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
+      "dev": true
+    },
+    "slice-ansi": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz",
+      "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==",
+      "dev": true,
       "requires": {
-        "hoek": "4.x.x"
+        "is-fullwidth-code-point": "^2.0.0"
       }
     },
     "source-map": {
@@ -1686,23 +2325,38 @@
         "amdefine": ">=0.0.4"
       }
     },
-    "source-map-support": {
-      "version": "0.4.18",
-      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.4.18.tgz",
-      "integrity": "sha512-try0/JqxPLF9nOjvSta7tVondkP5dwgyLDjVoyMDlmjugT2lRZ1OfsrYTkCd2hkDnJTKRbO/Rl3orm8vlsUzbA==",
+    "spdx-correct": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
+      "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
       "dev": true,
       "requires": {
-        "source-map": "^0.5.6"
-      },
-      "dependencies": {
-        "source-map": {
-          "version": "0.5.7",
-          "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
-          "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=",
-          "dev": true
-        }
+        "spdx-expression-parse": "^3.0.0",
+        "spdx-license-ids": "^3.0.0"
+      }
+    },
+    "spdx-exceptions": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz",
+      "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==",
+      "dev": true
+    },
+    "spdx-expression-parse": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
+      "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
+      "dev": true,
+      "requires": {
+        "spdx-exceptions": "^2.1.0",
+        "spdx-license-ids": "^3.0.0"
       }
     },
+    "spdx-license-ids": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz",
+      "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==",
+      "dev": true
+    },
     "sprintf-js": {
       "version": "1.0.3",
       "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
@@ -1710,9 +2364,9 @@
       "dev": true
     },
     "sshpk": {
-      "version": "1.14.1",
-      "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz",
-      "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=",
+      "version": "1.14.2",
+      "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz",
+      "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=",
       "requires": {
         "asn1": "~0.2.3",
         "assert-plus": "^1.0.0",
@@ -1721,14 +2375,56 @@
         "ecc-jsbn": "~0.1.1",
         "getpass": "^0.1.1",
         "jsbn": "~0.1.0",
+        "safer-buffer": "^2.0.2",
         "tweetnacl": "~0.14.0"
       }
     },
-    "stack-trace": {
-      "version": "0.0.10",
-      "resolved": "https://registry.npmjs.org/stack-trace/-/stack-trace-0.0.10.tgz",
-      "integrity": "sha1-VHxws0fo0ytOEI6hoqFZ5f3eGcA=",
-      "dev": true
+    "standard": {
+      "version": "11.0.1",
+      "resolved": "https://registry.npmjs.org/standard/-/standard-11.0.1.tgz",
+      "integrity": "sha512-nu0jAcHiSc8H+gJCXeiziMVZNDYi8MuqrYJKxTgjP4xKXZMKm311boqQIzDrYI/ktosltxt2CbDjYQs9ANC8IA==",
+      "dev": true,
+      "requires": {
+        "eslint": "~4.18.0",
+        "eslint-config-standard": "11.0.0",
+        "eslint-config-standard-jsx": "5.0.0",
+        "eslint-plugin-import": "~2.9.0",
+        "eslint-plugin-node": "~6.0.0",
+        "eslint-plugin-promise": "~3.7.0",
+        "eslint-plugin-react": "~7.7.0",
+        "eslint-plugin-standard": "~3.0.1",
+        "standard-engine": "~8.0.0"
+      }
+    },
+    "standard-engine": {
+      "version": "8.0.1",
+      "resolved": "https://registry.npmjs.org/standard-engine/-/standard-engine-8.0.1.tgz",
+      "integrity": "sha512-LA531C3+nljom/XRvdW/hGPXwmilRkaRkENhO3FAGF1Vtq/WtCXzgmnc5S6vUHHsgv534MRy02C1ikMwZXC+tw==",
+      "dev": true,
+      "requires": {
+        "deglob": "^2.1.0",
+        "get-stdin": "^6.0.0",
+        "minimist": "^1.1.0",
+        "pkg-conf": "^2.0.0"
+      },
+      "dependencies": {
+        "minimist": {
+          "version": "1.2.0",
+          "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
+          "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
+          "dev": true
+        }
+      }
+    },
+    "string-width": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+      "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+      "dev": true,
+      "requires": {
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^4.0.0"
+      }
     },
     "string.prototype.trim": {
       "version": "1.1.2",
@@ -1742,38 +2438,41 @@
       }
     },
     "string_decoder": {
-      "version": "0.10.31",
-      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
-      "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
-      "dev": true
-    },
-    "stringstream": {
-      "version": "0.0.6",
-      "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz",
-      "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA=="
-    },
-    "strip-ansi": {
-      "version": "3.0.1",
-      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
-      "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
       "dev": true,
       "requires": {
-        "ansi-regex": "^2.0.0"
+        "safe-buffer": "~5.1.0"
       }
     },
-    "strip-bom": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
-      "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
+    "strip-ansi": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+      "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
       "dev": true,
       "requires": {
-        "is-utf8": "^0.2.0"
+        "ansi-regex": "^3.0.0"
+      },
+      "dependencies": {
+        "ansi-regex": {
+          "version": "3.0.0",
+          "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+          "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+          "dev": true
+        }
       }
     },
+    "strip-bom": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+      "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
+      "dev": true
+    },
     "strip-json-comments": {
-      "version": "1.0.4",
-      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-1.0.4.tgz",
-      "integrity": "sha1-HhX7ysl9Pumb8tc7TGVrCCu6+5E=",
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+      "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
       "dev": true
     },
     "supports-color": {
@@ -1785,22 +2484,36 @@
         "has-flag": "^1.0.0"
       }
     },
+    "table": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",
+      "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==",
+      "dev": true,
+      "requires": {
+        "ajv": "^5.2.3",
+        "ajv-keywords": "^2.1.0",
+        "chalk": "^2.1.0",
+        "lodash": "^4.17.4",
+        "slice-ansi": "1.0.0",
+        "string-width": "^2.1.1"
+      }
+    },
     "tape": {
-      "version": "4.9.0",
-      "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.0.tgz",
-      "integrity": "sha512-j0jO9BiScfqtPBb9QmPLL0qvxXMz98xjkMb7x8lKipFlJZwNJkqkWPou+NU4V6T9RnVh1kuSthLE8gLrN8bBfw==",
+      "version": "4.9.1",
+      "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz",
+      "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==",
       "dev": true,
       "requires": {
         "deep-equal": "~1.0.1",
         "defined": "~1.0.0",
-        "for-each": "~0.3.2",
+        "for-each": "~0.3.3",
         "function-bind": "~1.1.1",
         "glob": "~7.1.2",
-        "has": "~1.0.1",
+        "has": "~1.0.3",
         "inherits": "~2.0.3",
         "minimist": "~1.2.0",
-        "object-inspect": "~1.5.0",
-        "resolve": "~1.5.0",
+        "object-inspect": "~1.6.0",
+        "resolve": "~1.7.1",
         "resumer": "~0.0.0",
         "string.prototype.trim": "~1.1.2",
         "through": "~2.3.8"
@@ -1827,9 +2540,9 @@
           "dev": true
         },
         "resolve": {
-          "version": "1.5.0",
-          "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.5.0.tgz",
-          "integrity": "sha512-hgoSGrc3pjzAPHNBg+KnFcK2HwlHTs/YrAGUr6qgTVUZmXv1UEXXl0bZNBKMA9fud6lRYFdPGz0xXxycPzmmiw==",
+          "version": "1.7.1",
+          "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz",
+          "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==",
           "dev": true,
           "requires": {
             "path-parse": "^1.0.5"
@@ -1868,6 +2581,12 @@
             "minimatch": "0.3"
           }
         },
+        "lru-cache": {
+          "version": "2.7.3",
+          "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
+          "integrity": "sha1-bUUk6LlV+V1PW1iFHOId1y+06VI=",
+          "dev": true
+        },
         "minimatch": {
           "version": "0.3.0",
           "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz",
@@ -1901,29 +2620,33 @@
         }
       }
     },
+    "text-table": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+      "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=",
+      "dev": true
+    },
     "through": {
       "version": "2.3.8",
       "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
       "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=",
       "dev": true
     },
-    "to-double-quotes": {
-      "version": "2.0.0",
-      "resolved": "https://registry.npmjs.org/to-double-quotes/-/to-double-quotes-2.0.0.tgz",
-      "integrity": "sha1-qvIx1vqUiUn4GTAburRITYWI5Kc=",
-      "dev": true
-    },
-    "to-single-quotes": {
-      "version": "2.0.1",
-      "resolved": "https://registry.npmjs.org/to-single-quotes/-/to-single-quotes-2.0.1.tgz",
-      "integrity": "sha1-fMKRUfD18sQZRvEZ9ZMv5VQXASU=",
-      "dev": true
+    "tmp": {
+      "version": "0.0.33",
+      "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
+      "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
+      "dev": true,
+      "requires": {
+        "os-tmpdir": "~1.0.2"
+      }
     },
     "tough-cookie": {
-      "version": "2.3.4",
-      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz",
-      "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==",
+      "version": "2.4.3",
+      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz",
+      "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==",
       "requires": {
+        "psl": "^1.1.24",
         "punycode": "^1.4.1"
       }
     },
@@ -1956,6 +2679,12 @@
       "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
       "dev": true
     },
+    "typedarray": {
+      "version": "0.0.6",
+      "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
+      "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=",
+      "dev": true
+    },
     "uglify-js": {
       "version": "2.8.29",
       "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
@@ -1984,10 +2713,10 @@
       "dev": true,
       "optional": true
     },
-    "underscore": {
-      "version": "1.6.0",
-      "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz",
-      "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=",
+    "uniq": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz",
+      "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=",
       "dev": true
     },
     "util-deprecate": {
@@ -1996,33 +2725,21 @@
       "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
       "dev": true
     },
-    "utile": {
-      "version": "0.2.1",
-      "resolved": "https://registry.npmjs.org/utile/-/utile-0.2.1.tgz",
-      "integrity": "sha1-kwyI6ZCY1iIINMNWy9mncFItkNc=",
+    "uuid": {
+      "version": "3.3.2",
+      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
+      "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
+    },
+    "validate-npm-package-license": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+      "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
       "dev": true,
       "requires": {
-        "async": "~0.2.9",
-        "deep-equal": "*",
-        "i": "0.3.x",
-        "mkdirp": "0.x.x",
-        "ncp": "0.4.x",
-        "rimraf": "2.x.x"
-      },
-      "dependencies": {
-        "async": {
-          "version": "0.2.10",
-          "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
-          "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=",
-          "dev": true
-        }
+        "spdx-correct": "^3.0.0",
+        "spdx-expression-parse": "^3.0.0"
       }
     },
-    "uuid": {
-      "version": "3.2.1",
-      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz",
-      "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA=="
-    },
     "verror": {
       "version": "1.10.0",
       "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
@@ -2033,59 +2750,10 @@
         "extsprintf": "^1.2.0"
       }
     },
-    "vow": {
-      "version": "0.4.17",
-      "resolved": "https://registry.npmjs.org/vow/-/vow-0.4.17.tgz",
-      "integrity": "sha512-A3/9bWFqf6gT0jLR4/+bT+IPTe1mQf+tdsW6+WI5geP9smAp8Kbbu4R6QQCDKZN/8TSCqTlXVQm12QliB4rHfg==",
-      "dev": true
-    },
-    "vow-fs": {
-      "version": "0.3.6",
-      "resolved": "https://registry.npmjs.org/vow-fs/-/vow-fs-0.3.6.tgz",
-      "integrity": "sha1-LUxZviLivyYY3fWXq0uqkjvnIA0=",
-      "dev": true,
-      "requires": {
-        "glob": "^7.0.5",
-        "uuid": "^2.0.2",
-        "vow": "^0.4.7",
-        "vow-queue": "^0.4.1"
-      },
-      "dependencies": {
-        "glob": {
-          "version": "7.1.2",
-          "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
-          "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
-          "dev": true,
-          "requires": {
-            "fs.realpath": "^1.0.0",
-            "inflight": "^1.0.4",
-            "inherits": "2",
-            "minimatch": "^3.0.4",
-            "once": "^1.3.0",
-            "path-is-absolute": "^1.0.0"
-          }
-        },
-        "uuid": {
-          "version": "2.0.3",
-          "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz",
-          "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=",
-          "dev": true
-        }
-      }
-    },
-    "vow-queue": {
-      "version": "0.4.3",
-      "resolved": "https://registry.npmjs.org/vow-queue/-/vow-queue-0.4.3.tgz",
-      "integrity": "sha512-/poAKDTFL3zYbeQg7cl4BGcfP4sGgXKrHnRFSKj97dteUFu8oyXMwIcdwu8NSx/RmPGIuYx1Bik/y5vU4H/VKw==",
-      "dev": true,
-      "requires": {
-        "vow": "^0.4.17"
-      }
-    },
     "which": {
-      "version": "1.3.0",
-      "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
-      "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==",
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+      "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
       "dev": true,
       "requires": {
         "isexe": "^2.0.0"
@@ -2098,41 +2766,6 @@
       "dev": true,
       "optional": true
     },
-    "winston": {
-      "version": "0.8.3",
-      "resolved": "https://registry.npmjs.org/winston/-/winston-0.8.3.tgz",
-      "integrity": "sha1-ZLar9M0Brcrv1QCTk7HY6L7BnbA=",
-      "dev": true,
-      "requires": {
-        "async": "0.2.x",
-        "colors": "0.6.x",
-        "cycle": "1.0.x",
-        "eyes": "0.1.x",
-        "isstream": "0.1.x",
-        "pkginfo": "0.3.x",
-        "stack-trace": "0.0.x"
-      },
-      "dependencies": {
-        "async": {
-          "version": "0.2.10",
-          "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz",
-          "integrity": "sha1-trvgsGdLnXGXCMo43owjfLUmw9E=",
-          "dev": true
-        },
-        "colors": {
-          "version": "0.6.2",
-          "resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
-          "integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=",
-          "dev": true
-        },
-        "pkginfo": {
-          "version": "0.3.1",
-          "resolved": "https://registry.npmjs.org/pkginfo/-/pkginfo-0.3.1.tgz",
-          "integrity": "sha1-Wyn2qB9wcXFC4J52W76rl7T4HiE=",
-          "dev": true
-        }
-      }
-    },
     "wordwrap": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
@@ -2145,23 +2778,27 @@
       "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
       "dev": true
     },
-    "xmlbuilder": {
-      "version": "3.1.0",
-      "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-3.1.0.tgz",
-      "integrity": "sha1-LIaIjy1OrehQ+jjKf3Ij9yCVFuE=",
+    "write": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz",
+      "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=",
       "dev": true,
       "requires": {
-        "lodash": "^3.5.0"
-      },
-      "dependencies": {
-        "lodash": {
-          "version": "3.10.1",
-          "resolved": "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz",
-          "integrity": "sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=",
-          "dev": true
-        }
+        "mkdirp": "^0.5.1"
       }
     },
+    "xtend": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
+      "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=",
+      "dev": true
+    },
+    "yallist": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
+      "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
+      "dev": true
+    },
     "yargs": {
       "version": "3.10.0",
       "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
diff --git a/package.json b/package.json
index f8f1cd2..f2d9cd8 100644
--- a/package.json
+++ b/package.json
@@ -28,19 +28,16 @@
     "async": "^2.1.2",
     "tape": "^4.6.2",
     "istanbul": "^0.4.5",
-    "jshint": "^2.9.4",
-    "jscs": "^3.0.7",
     "nock": "^9.0.0",
     "endswith": "^0.0.0",
-    "tape-it": "^0.3.1"
+    "tape-it": "^0.3.1",
+    "standard": "^11.0.1"
   },
   "scripts": {
-    "test": "bash scripts/run_couchdb_on_travis.sh; npm run mocha; bash scripts/stop_couchdb_on_travis.sh",
-    "mocha": "DEBUG=* NOCK_OFF=true istanbul cover tape tests/*/*/*.js",
+    "test": "standard; bash scripts/run_couchdb_on_travis.sh; npm run mocha; bash scripts/stop_couchdb_on_travis.sh",
+    "mocha": "NOCK_OFF=true istanbul cover tape tests/*/*/*.js",
     "unmocked": "NOCK_OFF=true tape tests/*/*/*.js",
     "mocked": "tape tests/*/*/*.js",
-    "jshint": "jshint tests/*/*/*.js lib/*.js",
-    "codestyle": "jscs -p google tests/*/*/*.js lib/*.js",
     "coverage": "open coverage/lcov-report/index.html",
     "checkcoverage": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100"
   },
@@ -50,8 +47,6 @@
     "node": ">=6"
   },
   "pre-commit": [
-    "jshint",
-    "codestyle",
     "mocked",
     "test",
     "checkcoverage"
diff --git a/tests/helpers/index.js b/tests/helpers/index.js
index 8cbebdc..0072502 100644
--- a/tests/helpers/index.js
+++ b/tests/helpers/index.js
@@ -10,32 +10,31 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const path = require('path');
-const fs = require('fs');
-const url = require('url');
-const nano = require('../../lib/nano');
+const path = require('path')
+const fs = require('fs')
+const url = require('url')
+const nano = require('../../lib/nano')
 
-const helpers = exports;
-const cfg = helpers.cfg = require('../fixtures/cfg');
-const auth = url.parse(cfg.admin).auth.split(':');
+const helpers = exports
+const cfg = helpers.cfg = require('../fixtures/cfg')
+const auth = url.parse(cfg.admin).auth.split(':')
 
-helpers.noopTest = function(t){ t.end(); };
-helpers.timeout = cfg.timeout;
-helpers.nano = nano(cfg.couch);
-helpers.Nano = nano;
-helpers.couch = cfg.couch;
-helpers.admin = cfg.admin;
+helpers.noopTest = function (t) { t.end() }
+helpers.timeout = cfg.timeout
+helpers.nano = nano(cfg.couch)
+helpers.Nano = nano
+helpers.couch = cfg.couch
+helpers.admin = cfg.admin
 helpers.pixel = 'Qk06AAAAAAAAADYAAAAoAAAAAQAAAP////8BABgAAAAA' +
-  'AAAAAAATCwAAEwsAAAAAAAAAAAAAWm2CAA==';
+  'AAAAAAATCwAAEwsAAAAAAAAAAAAAWm2CAA=='
 
-helpers.username = auth[0];
-helpers.password = auth[1];
+helpers.username = auth[0]
+helpers.password = auth[1]
 
-helpers.loadFixture = function helpersLoadFixture(filename, json) {
+helpers.loadFixture = function helpersLoadFixture (filename, json) {
   const contents = fs.readFileSync(
-    path.join(__dirname, '..', 'fixtures', filename), (json ? 'ascii' : null));
-  return json ? JSON.parse(contents) : contents;
-};
-
+    path.join(__dirname, '..', 'fixtures', filename), (json ? 'ascii' : null))
+  return json ? JSON.parse(contents) : contents
+}
diff --git a/tests/helpers/integration.js b/tests/helpers/integration.js
index 340c72f..7fc4999 100644
--- a/tests/helpers/integration.js
+++ b/tests/helpers/integration.js
@@ -10,111 +10,111 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
-
-const async = require('async');
-const debug = require('debug');
-const path = require('path');
-const harness = require('tape-it');
-const endsWith = require('endswith');
-const cfg = require('../fixtures/cfg');
-const nano = require('../../lib/nano');
-const helpers = require('./');
-
-helpers.setup = function() {
-  const self = this;
-  const args = Array.prototype.slice.call(arguments);
-
-  return function(assert) {
-    args.push(function(err) {
-      assert.equal(err, null, 'create database');
-      assert.end();
-    });
-
-    self.nano.db.create.apply(this, args);
-  };
-};
-
-helpers.teardown = function() {
-  const self = this;
-  const args = Array.prototype.slice.call(arguments);
-
-  return function(assert) {
-    args.push(function(err) {
-      assert.equal(err, null, 'destroy database');
-      assert.ok(self.mock.isDone(), 'mocks didn\'t run');
-      assert.end();
-    });
-
-    self.nano.db.destroy.apply(this, args);
-  };
-};
-
-helpers.harness = function(name, setup, teardown) {
-  const parent = name || module.parent.filename;
-  const fileName = path.basename(parent).split('.')[0];
+'use strict'
+
+const async = require('async')
+const debug = require('debug')
+const path = require('path')
+const harness = require('tape-it')
+const endsWith = require('endswith')
+const cfg = require('../fixtures/cfg')
+const nano = require('../../lib/nano')
+const helpers = require('./')
+
+helpers.setup = function () {
+  const self = this
+  const args = Array.prototype.slice.call(arguments)
+
+  return function (assert) {
+    args.push(function (err) {
+      assert.equal(err, null, 'create database')
+      assert.end()
+    })
+
+    self.nano.db.create.apply(this, args)
+  }
+}
+
+helpers.teardown = function () {
+  const self = this
+  const args = Array.prototype.slice.call(arguments)
+
+  return function (assert) {
+    args.push(function (err) {
+      assert.equal(err, null, 'destroy database')
+      assert.ok(self.mock.isDone(), 'mocks didn\'t run')
+      assert.end()
+    })
+
+    self.nano.db.destroy.apply(this, args)
+  }
+}
+
+helpers.harness = function (name, setup, teardown) {
+  const parent = name || module.parent.filename
+  const fileName = path.basename(parent).split('.')[0]
   const parentDir = path.dirname(parent)
-    .split(path.sep).reverse()[0];
-  const shortPath = path.join(parentDir, fileName);
-  const log = debug(path.join('nano', 'tests', 'integration', shortPath));
-  const dbName = shortPath.replace('/', '_');
+    .split(path.sep).reverse()[0]
+  const shortPath = path.join(parentDir, fileName)
+  const log = debug(path.join('nano', 'tests', 'integration', shortPath))
+  const dbName = shortPath.replace('/', '_')
   const nanoLog = nano({
     url: cfg.couch,
     log: log
-  });
+  })
 
-  const mock = helpers.nock(helpers.couch, shortPath, log);
-  const db   = nanoLog.use(dbName);
+  const mock = helpers.nock(helpers.couch, shortPath, log)
+  const db = nanoLog.use(dbName)
   const locals = {
     mock: mock,
     db: db,
     nano: nanoLog
-  };
+  }
 
   return harness({
     id: shortPath,
     timeout: helpers.timeout,
     checkLeaks: !!process.env.LEAKS,
     locals: locals,
-    setup: setup ? setup : helpers.setup.call(locals, dbName),
-    teardown: teardown ? teardown : helpers.teardown.call(locals, dbName)
-  });
-};
-
-helpers.nock = function helpersNock(url, fixture, log) {
-  const nock = require('nock');
-  const nockDefs = require('../fixtures/' + fixture + '.json');
-
-  nockDefs.forEach(function(n) {
-    let headers = n.headers || {};
-    const response = n.buffer ? endsWith(n.buffer, '.png') ?
-        helpers.loadFixture(n.buffer) : new Buffer(n.buffer, 'base64') :
-        n.response || '';
-        const body = n.base64 ? new Buffer(n.base64, 'base64').toString() :
-        n.body || '';
+    setup: setup || helpers.setup.call(locals, dbName),
+    teardown: teardown || helpers.teardown.call(locals, dbName)
+  })
+}
+
+helpers.nock = function helpersNock (url, fixture, log) {
+  const nock = require('nock')
+  const nockDefs = require('../fixtures/' + fixture + '.json')
+
+  nockDefs.forEach(function (n) {
+    let headers = n.headers || {}
+    const response = n.buffer ? endsWith(n.buffer, '.png')
+      ? helpers.loadFixture(n.buffer) : Buffer.from(n.buffer, 'base64')
+      : n.response || ''
+    const body = n.base64 ? Buffer.from(n.base64, 'base64').toString()
+      : n.body || ''
 
     if (typeof headers === 'string' && endsWith(headers, '.json')) {
-      headers = require(path.join(fixture, headers));
+      headers = require(path.join(fixture, headers))
     }
 
-    n.method = n.method || 'get';
-    n.options = {log: log};
-    n.scope = url;
-    n.headers = headers;
-    n.response = response;
-    n.body = body;
+    n.method = n.method || 'get'
+    n.options = {log: log}
+    n.scope = url
+    n.headers = headers
+    n.response = response
+    n.body = body
 
-    return n;
-  });
+    return n
+  })
 
-  nock.define(nockDefs);
+  nock.define(nockDefs)
 
-  return nock(url);
-};
+  return nock(url)
+}
 
-helpers.prepareAView = function(assert, search, db) {
-  search = search || '';
-  db = db || this.db;
+helpers.prepareAView = function (assert, search, db) {
+  search = search || ''
+  db = db || this.db
 
   db.insert({
     views: {
@@ -125,72 +125,71 @@ helpers.prepareAView = function(assert, search, db) {
     lists: {
       'my_list': 'function(head, req) { send(\'Hello\'); }'
     }
-  }, '_design/people' + search, function(error, response) {
-    assert.equal(error, null, 'should create view');
-    assert.equal(response.ok, true, 'response is good');
+  }, '_design/people' + search, function (error, response) {
+    assert.equal(error, null, 'should create view')
+    assert.equal(response.ok, true, 'response is good')
     async.parallel([
-      function(cb) {
+      function (cb) {
         db.insert({
           name: 'Derek',
           city: 'San Francisco'
-        }, 'p_derek', cb);
-      }, function(cb) {
+        }, 'p_derek', cb)
+      }, function (cb) {
         db.insert({
           name: 'Randall',
           city: 'San Francisco'
-        }, 'p_randall', cb);
-      }, function(cb) {
+        }, 'p_randall', cb)
+      }, function (cb) {
         db.insert({
           name: 'Nuno',
           city: 'London'
-        }, 'p_nuno', cb);
+        }, 'p_nuno', cb)
       }
-    ], function(error) {
-      assert.equal(error, null, 'store the peeps');
-      assert.end();
-    });
-  });
-};
-
-helpers.viewDerek = function viewDerek(db, assert, opts, next, method) {
-  method = method || 'view';
-  db[method]('people','by_name_and_city', opts, function(error, view) {
-    assert.equal(error, null, 'no errors');
-    assert.equal(view.rows.length,1);
-    assert.equal(view.rows.length,1);
-    assert.equal(view.rows[0].id,'p_derek');
-    assert.equal(view.rows[0].key[0],'Derek');
-    assert.equal(view.rows[0].key[1],'San Francisco');
-    next(error);
-  });
-};
-
-helpers.insertOne = function insertThree(assert) {
-  const db = this.db;
-  db.insert({'foo': 'baz'}, 'foobaz', function(err) {
-    assert.equal(err, null, 'should store docs');
-    assert.end();
-  });
-};
-
-helpers.insertThree = function insertThree(assert) {
-  const db = this.db;
+    ], function (error) {
+      assert.equal(error, null, 'store the peeps')
+      assert.end()
+    })
+  })
+}
+
+helpers.viewDerek = function viewDerek (db, assert, opts, next, method) {
+  method = method || 'view'
+  db[method]('people', 'by_name_and_city', opts, function (error, view) {
+    assert.equal(error, null, 'no errors')
+    assert.equal(view.rows.length, 1)
+    assert.equal(view.rows.length, 1)
+    assert.equal(view.rows[0].id, 'p_derek')
+    assert.equal(view.rows[0].key[0], 'Derek')
+    assert.equal(view.rows[0].key[1], 'San Francisco')
+    next(error)
+  })
+}
+
+helpers.insertOne = function insertThree (assert) {
+  const db = this.db
+  db.insert({'foo': 'baz'}, 'foobaz', function (err) {
+    assert.equal(err, null, 'should store docs')
+    assert.end()
+  })
+}
+
+helpers.insertThree = function insertThree (assert) {
+  const db = this.db
   async.parallel([
-    function(cb) { db.insert({'foo': 'bar'}, 'foobar', cb); },
-    function(cb) { db.insert({'bar': 'foo'}, 'barfoo', cb); },
-    function(cb) { db.insert({'foo': 'baz'}, 'foobaz', cb); }
-  ], function(error) {
-    assert.equal(error, null, 'should store docs');
-    assert.end();
-  });
-};
-
-helpers.unmocked = (process.env.NOCK_OFF === 'true');
-helpers.mocked = !helpers.unmocked;
-
-helpers.isPromise = function(p) {
-  return (p && typeof p === 'object' && typeof p.then === 'function') 
+    function (cb) { db.insert({'foo': 'bar'}, 'foobar', cb) },
+    function (cb) { db.insert({'bar': 'foo'}, 'barfoo', cb) },
+    function (cb) { db.insert({'foo': 'baz'}, 'foobaz', cb) }
+  ], function (error) {
+    assert.equal(error, null, 'should store docs')
+    assert.end()
+  })
 }
 
-module.exports = helpers;
+helpers.unmocked = (process.env.NOCK_OFF === 'true')
+helpers.mocked = !helpers.unmocked
+
+helpers.isPromise = function (p) {
+  return (p && typeof p === 'object' && typeof p.then === 'function')
+}
 
+module.exports = helpers
diff --git a/tests/helpers/unit.js b/tests/helpers/unit.js
index a15dfc6..57441fe 100644
--- a/tests/helpers/unit.js
+++ b/tests/helpers/unit.js
@@ -10,52 +10,51 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('./');
-const Client = require('../../lib/nano');
-const test  = require('tape');
-const _ = require('underscore');
+const helpers = require('./')
+const Client = require('../../lib/nano')
+const test = require('tape')
 
-helpers.unit = function(method, error) {
-  const unitName = 'nano/tests/unit/' + method.join('/');
-  const debug = require('debug')(unitName);
+helpers.unit = function (method, error) {
+  const unitName = 'nano/tests/unit/' + method.join('/')
+  const debug = require('debug')(unitName)
 
-  function log(data) {
-    debug({ got: data.body });
+  function log (data) {
+    debug({ got: data.body })
   }
 
-  let cli = helpers.mockClientOk(log, error);
+  let cli = helpers.mockClientOk(log, error)
 
   //
   // allow database creation and other server stuff
   //
-  if(method[1].match(/follow/)) {
-    if(method[0] === 'database') {
-      cli.server = helpers.mockClientFollow(log, error);
+  if (method[1].match(/follow/)) {
+    if (method[0] === 'database') {
+      cli.server = helpers.mockClientFollow(log, error)
     } else {
-      cli = helpers.mockClientFollow(log, error);
+      cli = helpers.mockClientFollow(log, error)
     }
   } else {
-    cli.server = helpers.mockClientDb(log, error);
+    cli.server = helpers.mockClientDb(log, error)
   }
 
-  let testNr = 1;
+  let testNr = 1
 
-  return function() {
-    const args = Array.prototype.slice.call(arguments);
-    const stub = args.pop();
+  return function () {
+    const args = Array.prototype.slice.call(arguments)
+    const stub = args.pop()
 
     test(unitName + ':' + testNr++,
-    function(assert) {
-      let f;
-      assert.ok(typeof stub, 'object');
-
-      //
-      // document functions and database functions
-      // are at the top level in nano
-      //
-      if(method[0] === 'database') {
+      function (assert) {
+        let f
+        assert.ok(typeof stub, 'object')
+
+        //
+        // document functions and database functions
+        // are at the top level in nano
+        //
+        if (method[0] === 'database') {
         //
         // Due to the way this harness is designed we cannot differentiate between different methods
         // when those methods are embedded on an object.
@@ -63,98 +62,98 @@ helpers.unit = function(method, error) {
         // can differentiate between methods embedded on an object.
         // I go the hardcoded route for now.
         //
-        if (method[1] === 'replicator') {
-          f = cli.server.db.replication.enable;
-        } else {
-          f = cli.server.db[method[1]];
-        }
-      } else if(method[0] === 'view' && method[1] === 'compact') {
-        f = cli.view.compact;
-      } else if(!~['multipart', 'attachment'].indexOf(method[0])) {
-        f = cli[method[1]];
-      } else {
-        f = cli[method[0]][method[1]];
-      }
-      assert.ok(typeof f, 'function');
-
-      args.push(function(err, req, response) {
-        if (error) {
-          assert.ok(err);
-          return assert.end();
-        }
-
-        assert.equal(response.statusCode, 200);
-        if(stub.uri) {
-          stub.uri = helpers.couch + stub.uri;
+          if (method[1] === 'replicator') {
+            f = cli.server.db.replication.enable
+          } else {
+            f = cli.server.db[method[1]]
+          }
+        } else if (method[0] === 'view' && method[1] === 'compact') {
+          f = cli.view.compact
+        } else if (!~['multipart', 'attachment'].indexOf(method[0])) {
+          f = cli[method[1]]
         } else {
-          stub.db = helpers.couch + stub.db;
+          f = cli[method[0]][method[1]]
         }
+        assert.ok(typeof f, 'function')
+
+        args.push(function (err, req, response) {
+          if (error) {
+            assert.ok(err)
+            return assert.end()
+          }
+
+          assert.equal(response.statusCode, 200)
+          if (stub.uri) {
+            stub.uri = helpers.couch + stub.uri
+          } else {
+            stub.db = helpers.couch + stub.db
+          }
+
+          assert.deepEqual(req, stub)
+          assert.end()
+        })
+        f.apply(null, args)
+      })
+  }
+}
 
-        assert.deepEqual(req, stub);
-        assert.end();
-      });
-      f.apply(null, args);
-    });
-  };
-};
-
-function mockClient(code, path, extra) {
-  return function(debug, error) {
-    extra = extra || {};
-    const opts = _.extend(extra, {
+function mockClient (code, path, extra) {
+  return function (debug, error) {
+    extra = extra || {}
+    const opts = Object.assign(extra, {
       url: helpers.couch + path,
       log: debug,
-      request: function(req, cb) {
-        if(error) {
-          return cb(error);
+      request: function (req, cb) {
+        if (error) {
+          return cb(error)
         }
-        if(code === 500) {
-          cb(new Error('omg connection failed'));
+        if (code === 500) {
+          cb(new Error('omg connection failed'))
         } else {
           cb(null, {
             statusCode: code,
             headers: {}
-          }, req); }
+          }, req)
         }
-    });
+      }
+    })
 
-    return Client(opts);
-  };
+    return Client(opts)
+  }
 }
 
-function mockClientUnparsedError() {
-  return function(debug, body) {
+function mockClientUnparsedError () {
+  return function (debug, body) {
     return Client({
       url: helpers.couch,
       log: debug,
-      request: function(_, cb) {
-        return cb(null, {statusCode: 500}, body || '<b> Error happened </b>');
+      request: function (_, cb) {
+        return cb(null, {statusCode: 500}, body || '<b> Error happened </b>')
       }
-    });
-  };
+    })
+  }
 }
 
-function mockClientFollow() {
-  return function(debug, error) {
+function mockClientFollow () {
+  return function (debug, error) {
     return Client({
       url: helpers.couch,
       log: debug,
-      follow: function(qs, cb) {
-        if(error) {
-          return cb(error);
+      follow: function (qs, cb) {
+        if (error) {
+          return cb(error)
         }
 
-        return cb(null, qs,  {statusCode: 200});
+        return cb(null, qs, {statusCode: 200})
       }
-    });
-  };
+    })
+  }
 }
 
-
-helpers.mockClientFollow = mockClientFollow();
-helpers.mockClientUnparsedError = mockClientUnparsedError();
-helpers.mockClientDb = mockClient(200, '');
-helpers.mockClientOk = mockClient(200, '/mock');
-helpers.mockClientFail = mockClient(500, '');
-helpers.mockClientJar = mockClient(300, '', {jar: 'is set'});
-module.exports = helpers;
+helpers.mockClientFollow = mockClientFollow()
+helpers.mockClientUnparsedError = mockClientUnparsedError()
+helpers.mockClientDb = mockClient(200, '')
+helpers.mockClientOk = mockClient(200, '/mock')
+helpers.mockClientFail = mockClient(500, '')
+helpers.mockClientJar = mockClient(300, '', {jar: 'is set'})
+module.exports = helpers
diff --git a/tests/integration/attachment/destroy.js b/tests/integration/attachment/destroy.js
index 6baff5d..d607da5 100644
--- a/tests/integration/attachment/destroy.js
+++ b/tests/integration/attachment/destroy.js
@@ -10,37 +10,37 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should be able to insert a new plain text attachment', function(assert) {
-  const p = db.attachment.insert('new', 'att', 'Hello World!', 'text/plain');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.equal(att.ok, true, 'response ok');
-    assert.ok(att.rev, 'have a revision number');
-    return db.attachment.destroy('new', 'att', {rev: att.rev});
-  }).then(function(response) {
-    assert.equal(response.ok, true, 'response ok');
-    assert.equal(response.id, 'new', '`id` should be `new`');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to insert a new plain text attachment', function (assert) {
+  const p = db.attachment.insert('new', 'att', 'Hello World!', 'text/plain')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.equal(response.ok, true, 'response ok')
+    assert.ok(response.rev, 'have a revision number')
+    return db.attachment.destroy('new', 'att', {rev: response.rev})
+  }).then(function (response) {
+    assert.equal(response.ok, true, 'response ok')
+    assert.equal(response.id, 'new', '`id` should be `new`')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should fail destroying with a bad filename', function(assert) {
-  const p = db.attachment.destroy('new', false, true);
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(false, 'Promise is resolved');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-    assert.end();
-  });
-});
+it('should fail destroying with a bad filename', function (assert) {
+  const p = db.attachment.destroy('new', false, true)
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(false, 'Promise is resolved')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+    assert.end()
+  })
+})
diff --git a/tests/integration/attachment/get.js b/tests/integration/attachment/get.js
index 9cc3a0d..75ed2ce 100644
--- a/tests/integration/attachment/get.js
+++ b/tests/integration/attachment/get.js
@@ -10,36 +10,35 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should be able to fetch an attachment', function(assert) {
-  let p = db.attachment.insert('new_string', 'att', 'Hello', 'text/plain');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(hello) {
-    assert.equal(hello.ok, true, 'response ok');
-    assert.ok(hello.rev, 'should have a revision number');
+it('should be able to fetch an attachment', function (assert) {
+  let p = db.attachment.insert('new_string', 'att', 'Hello', 'text/plain')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (hello) {
+    assert.equal(hello.ok, true, 'response ok')
+    assert.ok(hello.rev, 'should have a revision number')
     return db.attachment.get('new_string', 'att')
-  }).then(function(helloWorld) {
-    assert.equal('Hello', helloWorld.toString(), 'string is reflexive');
-    assert.end();
-  });
-});
+  }).then(function (helloWorld) {
+    assert.equal('Hello', helloWorld.toString(), 'string is reflexive')
+    assert.end()
+  })
+})
 
-it('should insert and fetch a binary file', function(assert) {
-  let p = db.attachment.insert('new_binary', 'att', new Buffer('123'), 'text/plain')
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(hello) {
-    assert.equal(hello.ok, true, 'response ok');
-    assert.ok(hello.rev, 'should have a revision number');
-    return  db.attachment.get('new_binary', 'att');
-  }).then(function(binaryData) {
-    assert.equal(error, null, 'should get the binary data');
-    assert.equal('123', binaryData.toString(), 'binary data is reflexive');
-    assert.end();
-  });
-});
+it('should insert and fetch a binary file', function (assert) {
+  let p = db.attachment.insert('new_binary', 'att', Buffer.from('123'), 'text/plain')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (hello) {
+    assert.equal(hello.ok, true, 'response ok')
+    assert.ok(hello.rev, 'should have a revision number')
+    return db.attachment.get('new_binary', 'att')
+  }).then(function (binaryData) {
+    assert.equal('123', binaryData.toString(), 'binary data is reflexive')
+    assert.end()
+  })
+})
diff --git a/tests/integration/attachment/insert.js b/tests/integration/attachment/insert.js
index 360a33a..a2b09e5 100644
--- a/tests/integration/attachment/insert.js
+++ b/tests/integration/attachment/insert.js
@@ -10,19 +10,19 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should be able to insert a simple attachment', function(assert) {
+it('should be able to insert a simple attachment', function (assert) {
   const p = db.attachment.insert('new', 'att', 'Hello World!', 'text/plain')
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(att) {
-    assert.equal(att.ok, true, 'response ok');
-    assert.ok(att.rev, 'should have a revision');
-    assert.end();
-  });
-});
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (att) {
+    assert.equal(att.ok, true, 'response ok')
+    assert.ok(att.rev, 'should have a revision')
+    assert.end()
+  })
+})
diff --git a/tests/integration/attachment/pipe.js b/tests/integration/attachment/pipe.js
index d44c3d7..7f0de3a 100644
--- a/tests/integration/attachment/pipe.js
+++ b/tests/integration/attachment/pipe.js
@@ -10,57 +10,57 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const fs = require('fs');
-const path = require('path');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
-const pixel = helpers.pixel;
+const fs = require('fs')
+const path = require('path')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
+const pixel = helpers.pixel
 
-it('should be able to pipe to a writeStream', function(assert) {
-  const buffer = new Buffer(pixel, 'base64');
-  const filename = path.join(__dirname, '.temp.bmp');
-  const ws = fs.createWriteStream(filename);
+it('should be able to pipe to a writeStream', function (assert) {
+  const buffer = Buffer.from(pixel, 'base64')
+  const filename = path.join(__dirname, '.temp.bmp')
+  const ws = fs.createWriteStream(filename)
 
-  ws.on('close', function() {
-    assert.equal(fs.readFileSync(filename).toString('base64'), pixel);
-    fs.unlinkSync(filename);
-    assert.end();
-  });
+  ws.on('close', function () {
+    assert.equal(fs.readFileSync(filename).toString('base64'), pixel)
+    fs.unlinkSync(filename)
+    assert.end()
+  })
 
   db.attachment.insert('new', 'att', buffer, 'image/bmp')
-    .then(function(bmp) {
-      db.attachment.getAsStream('new', 'att', {rev: bmp.rev}).pipe(ws);
-    });
-});
+    .then(function (bmp) {
+      db.attachment.getAsStream('new', 'att', {rev: bmp.rev}).pipe(ws)
+    })
+})
 
-it('should be able to pipe to a writeStream', function(assert) {
-  const ws = fs.createWriteStream('/dev/null');
-  db.attachment.getAsStream('new', 'att', function() {})
+it('should be able to pipe to a writeStream', function (assert) {
+  const ws = fs.createWriteStream('/dev/null')
+  db.attachment.getAsStream('new', 'att', function () {})
     .pipe(ws)
-    .on('end', function() {
-      assert.end();
-    });
-});
+    .on('end', function () {
+      assert.end()
+    })
+})
 
-it('should be able to pipe from a readStream', function(assert) {
-  const logo = path.join(__dirname, '..', '..', 'fixtures', 'logo.png');
-  const rs = fs.createReadStream(logo);
-  const is = db.attachment.insertAsStream('nodejs', 'logo.png', null, 'image/png', function() {
-  });
+it('should be able to pipe from a readStream', function (assert) {
+  const logo = path.join(__dirname, '..', '..', 'fixtures', 'logo.png')
+  const rs = fs.createReadStream(logo)
+  const is = db.attachment.insertAsStream('nodejs', 'logo.png', null, 'image/png', function () {
+  })
 
-  is.on('end', function() {
-    db.attachment.get('nodejs', 'logo.png', function(err, buffer) {
-      assert.equal(err, null, 'should get the logo');
+  is.on('end', function () {
+    db.attachment.get('nodejs', 'logo.png', function (err, buffer) {
+      assert.equal(err, null, 'should get the logo')
       assert.equal(
         fs.readFileSync(logo).toString('base64'), buffer.toString('base64'),
-        'logo should remain unchanged');
-      assert.end();
-    });
-  });
+        'logo should remain unchanged')
+      assert.end()
+    })
+  })
 
-  rs.pipe(is);
-});
+  rs.pipe(is)
+})
diff --git a/tests/integration/attachment/update.js b/tests/integration/attachment/update.js
index 348173f..f6e30ab 100644
--- a/tests/integration/attachment/update.js
+++ b/tests/integration/attachment/update.js
@@ -10,37 +10,34 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const pixel = helpers.pixel;
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const pixel = helpers.pixel
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-let rev;
+it('should be able to insert and update attachments', function (assert) {
+  const buffer = Buffer.from(pixel, 'base64')
+  const p = db.attachment.insert('new', 'att', 'Hello', 'text/plain')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (hello) {
+    assert.equal(hello.ok, true, 'response ok')
+    assert.ok(hello.rev, 'should have a revision')
+    return db.attachment.insert('new', 'att', buffer, 'image/bmp', {rev: hello.rev})
+  }).then(function (bmp) {
+    assert.ok(bmp.rev, 'should store a revision')
+    assert.end()
+  })
+})
 
-it('should be able to insert and update attachments', function(assert) {
-  const buffer = new Buffer(pixel, 'base64');
-  const p = db.attachment.insert('new', 'att', 'Hello', 'text/plain');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(hello) {
-    assert.equal(hello.ok, true, 'response ok');
-    assert.ok(hello.rev, 'should have a revision');
-    return db.attachment.insert('new', 'att', buffer, 'image/bmp',{rev: hello.rev});
-  }).then(function(bmp) {
-    assert.ok(bmp.rev, 'should store a revision');
-    rev = bmp.rev;
-    assert.end();
-  });
-});
-
-it('should be able to fetch the updated pixel', function(assert) {
-  db.get('new').then(function(newDoc) {
-    newDoc.works = true;
-    return db.insert(newDoc, 'new');
-  }).then(function(response) {
-    assert.equal(response.ok, true, 'response ok');
-    assert.end();
-  });
-});
+it('should be able to fetch the updated pixel', function (assert) {
+  db.get('new').then(function (newDoc) {
+    newDoc.works = true
+    return db.insert(newDoc, 'new')
+  }).then(function (response) {
+    assert.equal(response.ok, true, 'response ok')
+    assert.end()
+  })
+})
diff --git a/tests/integration/database/changes.js b/tests/integration/database/changes.js
index 49e03bd..14d93a6 100644
--- a/tests/integration/database/changes.js
+++ b/tests/integration/database/changes.js
@@ -10,41 +10,41 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should be able to insert three documents', helpers.insertThree);
+it('should be able to insert three documents', helpers.insertThree)
 
-it('should be able to receive changes since seq:0', function(assert) {
-  const p = db.changes({since:0});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.equal(response.results.length, 3, 'gets three results');
+it('should be able to receive changes since seq:0', function (assert) {
+  const p = db.changes({since: 0})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.equal(response.results.length, 3, 'gets three results')
     assert.end()
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to receive changes since seq:0 as stream', function(assert) {
-  const p = db.changesAsStream({since:0}, function(error, response) {
-    assert.equal(error, null, 'gets response from changes');
-    assert.equal(response.results.length, 3, 'gets three results');
-    assert.end();
-  });
-  assert.ok(!helpers.isPromise(p), 'returns Promise');
-  assert.equal(p.constructor.name, 'Request', 'returns a Request');
-});
+it('should be able to receive changes since seq:0 as stream', function (assert) {
+  const p = db.changesAsStream({since: 0}, function (error, response) {
+    assert.equal(error, null, 'gets response from changes')
+    assert.equal(response.results.length, 3, 'gets three results')
+    assert.end()
+  })
+  assert.ok(!helpers.isPromise(p), 'returns Promise')
+  assert.equal(p.constructor.name, 'Request', 'returns a Request')
+})
 
-it('should be able to receive changes - no params - stream', function(assert) {
-  const p = db.changesAsStream(function(error) {
-    assert.equal(error, null, 'gets response from changes');
-    assert.end();
-  });
-  assert.ok(!helpers.isPromise(p), 'returns Promise');
-  assert.equal(p.constructor.name, 'Request', 'returns a Request');
-});
+it('should be able to receive changes - no params - stream', function (assert) {
+  const p = db.changesAsStream(function (error) {
+    assert.equal(error, null, 'gets response from changes')
+    assert.end()
+  })
+  assert.ok(!helpers.isPromise(p), 'returns Promise')
+  assert.equal(p.constructor.name, 'Request', 'returns a Request')
+})
diff --git a/tests/integration/database/compact.js b/tests/integration/database/compact.js
index 03bb04b..dc021b3 100644
--- a/tests/integration/database/compact.js
+++ b/tests/integration/database/compact.js
@@ -10,54 +10,54 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should store and delete `goofy`', function(assert) {
-  let p = db.insert({'foo': 'baz'}, 'goofy');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.equal(foo.ok, true, 'response should be ok');
-    return db.destroy('goofy', foo.rev);
-  }).then(function(response) {
-    assert.equal(response.ok, true, 'response ok');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should store and delete `goofy`', function (assert) {
+  let p = db.insert({'foo': 'baz'}, 'goofy')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.equal(foo.ok, true, 'response should be ok')
+    return db.destroy('goofy', foo.rev)
+  }).then(function (response) {
+    assert.equal(response.ok, true, 'response ok')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should have run the compaction', function(assert) {
-  const p = db.compact();
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    return  db.info();
-  }).then(function(info) {
-    assert.equal(info['doc_count'], 0, 'document count is not 3');
-    assert.equal(info['doc_del_count'], 1, 'document should be deleted');
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should have run the compaction', function (assert) {
+  const p = db.compact()
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    return db.info()
+  }).then(function (info) {
+    assert.equal(info['doc_count'], 0, 'document count is not 3')
+    assert.equal(info['doc_del_count'], 1, 'document should be deleted')
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should finish compaction before ending', function(assert) {
-  function nextWhenFinished() {
-    db.info(function(err, info) {
+it('should finish compaction before ending', function (assert) {
+  function nextWhenFinished () {
+    db.info(function (err, info) {
       if (err) {
-        return;
+        return
       }
       if (info['compact_running']) {
-        return;
+        return
       }
-      clearTimeout(task);
-      assert.pass('compaction is complete');
-      assert.end();
-    });
+      clearTimeout(task)
+      assert.pass('compaction is complete')
+      assert.end()
+    })
   }
 
-  const task = setInterval(nextWhenFinished, 100);
-});
+  const task = setInterval(nextWhenFinished, 100)
+})
diff --git a/tests/integration/database/create-and-destroy.js b/tests/integration/database/create-and-destroy.js
index 3c36aa1..16817db 100644
--- a/tests/integration/database/create-and-destroy.js
+++ b/tests/integration/database/create-and-destroy.js
@@ -10,35 +10,35 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const nano = harness.locals.nano;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const nano = harness.locals.nano
 
-it('should be able to create `az09_$()+-/` database', function(assert) {
-  nano.db.create('az09_$()+-/').then(function(err) {
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to create `az09_$()+-/` database', function (assert) {
+  nano.db.create('az09_$()+-/').then(function () {
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
 it('should be able to use config from a nano object to create a db',
-function(assert) {
-  const config = helpers.Nano(
-    helpers.couch + '/' + encodeURIComponent('with/slash')).config;
-  helpers.Nano(config.url).db.create(config.db, function(err) {
-    assert.equal(err, null, 'should create database');
-    assert.end();
-  });
-});
+  function (assert) {
+    const config = helpers.Nano(
+      helpers.couch + '/' + encodeURIComponent('with/slash')).config
+    helpers.Nano(config.url).db.create(config.db, function (err) {
+      assert.equal(err, null, 'should create database')
+      assert.end()
+    })
+  })
 
-it('must destroy the databases we created', function(assert) {
-  async.forEach(['az09_$()+-/', 'with/slash'], nano.db.destroy, function(err) {
-    assert.equal(err, null, 'should destroy all dbs');
-    assert.end();
-  });
-});
+it('must destroy the databases we created', function (assert) {
+  async.forEach(['az09_$()+-/', 'with/slash'], nano.db.destroy, function (err) {
+    assert.equal(err, null, 'should destroy all dbs')
+    assert.end()
+  })
+})
diff --git a/tests/integration/database/follow.js b/tests/integration/database/follow.js
index 42ce686..79bde16 100644
--- a/tests/integration/database/follow.js
+++ b/tests/integration/database/follow.js
@@ -10,41 +10,41 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
 if (helpers.unmocked) {
-  it('should insert a bunch of items', helpers.insertThree);
+  it('should insert a bunch of items', helpers.insertThree)
 
-  let feed1;
+  let feed1
 
-  it('should be able to get the changes feed', function(assert) {
-    let i = 3;
+  it('should be able to get the changes feed', function (assert) {
+    let i = 3
 
-    feed1 = db.follow({since: '0'});
+    feed1 = db.follow({since: '0'})
 
-    feed1.on('change', function(change) {
-      assert.ok(change, 'change existed');
-      //assert.equal(change.seq, i + 1, 'seq is set correctly');
-      ++i;
+    feed1.on('change', function (change) {
+      assert.ok(change, 'change existed')
+      // assert.equal(change.seq, i + 1, 'seq is set correctly');
+      ++i
       if (i === 4) {
-        assert.end();
+        assert.end()
       }
-    });
+    })
 
-    feed1.follow();
+    feed1.follow()
 
-    setTimeout(function() {
-      db.insert({'bar': 'baz'}, 'barbaz');
-    }, 100);
-  });
+    setTimeout(function () {
+      db.insert({'bar': 'baz'}, 'barbaz')
+    }, 100)
+  })
 
-  it('should clear changes feed', function(assert) {
-    feed1.die();
-    assert.end();
-  });
+  it('should clear changes feed', function (assert) {
+    feed1.die()
+    assert.end()
+  })
 }
diff --git a/tests/integration/database/get.js b/tests/integration/database/get.js
index 07db8a3..7adaa91 100644
--- a/tests/integration/database/get.js
+++ b/tests/integration/database/get.js
@@ -10,39 +10,38 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const nano = harness.locals.nano;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const nano = harness.locals.nano
 
-it('should be able to fetch the database', function(assert) {
+it('should be able to fetch the database', function (assert) {
+  const p = nano.db.get('database_get')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.equal(response['doc_count'], 0, 'should be empty')
+    assert.equal(response['db_name'], 'database_get', 'name')
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-  const p = nano.db.get('database_get');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.equal(response['doc_count'], 0, 'should be empty');
-    assert.equal(response['db_name'], 'database_get', 'name');
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
-
-it('resolves db URL correctly for http://app.com/_couchdb', function(assert) {
-  const nano = require('../../../lib/nano');
+it('resolves db URL correctly for http://app.com/_couchdb', function (assert) {
+  const nano = require('../../../lib/nano')
 
   const couch = nano({
     url: 'http://app.com/_couchdb/',
     parseUrl: false,
-    request: function(options) {
+    request: function (options) {
       assert.equal(
         options.uri,
         'http://app.com/_couchdb/mydb/mydoc',
         'should get doc at prefixed path'
-      );
-      assert.end();
+      )
+      assert.end()
     }
-  });
-  couch.use('mydb').get('mydoc');
-});
+  })
+  couch.use('mydb').get('mydoc')
+})
diff --git a/tests/integration/database/list.js b/tests/integration/database/list.js
index 74ab1cd..c44a2b2 100644
--- a/tests/integration/database/list.js
+++ b/tests/integration/database/list.js
@@ -10,33 +10,33 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const nano = harness.locals.nano;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const nano = harness.locals.nano
 
-it('should ensure _replicator and _users are created', function(assert) {
-  nano.db.create('_replicator').then(function() {
-    return nano.db.destroy('_users');
-  }).then(function() {
-    return nano.db.create('_users'); 
-  }).then(function() {
-    assert.end();
-  });
-});
+it('should ensure _replicator and _users are created', function (assert) {
+  nano.db.create('_replicator').then(function () {
+    return nano.db.destroy('_users')
+  }).then(function () {
+    return nano.db.create('_users')
+  }).then(function () {
+    assert.end()
+  })
+})
 
-it('should list the correct databases', function(assert) {
+it('should list the correct databases', function (assert) {
   const p = nano.db.list()
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(list) {
-    const filtered = list.filter(function(e) {
-      return e === 'database_list' || e === '_replicator' || e === '_users';
-    });
-    assert.equal(filtered.length, 3, 'should have exactly 3 dbs');
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (list) {
+    const filtered = list.filter(function (e) {
+      return e === 'database_list' || e === '_replicator' || e === '_users'
+    })
+    assert.equal(filtered.length, 3, 'should have exactly 3 dbs')
     assert.end()
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/database/replicate.js b/tests/integration/database/replicate.js
index 49dba1b..36d1f21 100644
--- a/tests/integration/database/replicate.js
+++ b/tests/integration/database/replicate.js
@@ -10,71 +10,70 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
-const nano = harness.locals.nano;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
+const nano = harness.locals.nano
 
-let replica;
-let replica2;
+let replica
+let replica2
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('creates a bunch of database replicas', function(assert) {
+it('creates a bunch of database replicas', function (assert) {
   async.forEach(['database_replica', 'database_replica2'],
-  nano.db.create, function(error) {
-    assert.equal(error, null, 'created database(s)');
-    assert.end();
-  });
-});
+    nano.db.create, function (error) {
+      assert.equal(error, null, 'created database(s)')
+      assert.end()
+    })
+})
 
-it('should be able to replicate three docs', function(assert) {
-  replica = nano.use('database_replica');
+it('should be able to replicate three docs', function (assert) {
+  replica = nano.use('database_replica')
   const p = db.replicate('database_replica')
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    return replica.list();
-  }).then(function(list) {
-    assert.equal(list['total_rows'], 3, 'and have three documents');
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    return replica.list()
+  }).then(function (list) {
+    assert.equal(list['total_rows'], 3, 'and have three documents')
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to replicate to a `nano` object', function(assert) {
-  replica2 = nano.use('database_replica2');
-  let p = nano.db.replicate(db, replica2);
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    return replica2.list();
-  }).then(function(list) {
-    assert.equal(list['total_rows'], 3, 'and have three documents');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-  
-});
+it('should be able to replicate to a `nano` object', function (assert) {
+  replica2 = nano.use('database_replica2')
+  let p = nano.db.replicate(db, replica2)
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    return replica2.list()
+  }).then(function (list) {
+    assert.equal(list['total_rows'], 3, 'and have three documents')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to replicate with params', function(assert) {
-  const p = db.replicate('database_replica', {});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(true, 'Promise is resolved');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to replicate with params', function (assert) {
+  const p = db.replicate('database_replica', {})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(true, 'Promise is resolved')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should destroy the extra databases', function(assert) {
+it('should destroy the extra databases', function (assert) {
   async.forEach(['database_replica', 'database_replica2'],
-  nano.db.destroy, function(error) {
-    assert.equal(error, null, 'deleted databases');
-    assert.end();
-  });
-});
+    nano.db.destroy, function (error) {
+      assert.equal(error, null, 'deleted databases')
+      assert.end()
+    })
+})
diff --git a/tests/integration/database/replicator.js b/tests/integration/database/replicator.js
index 0585292..f22c595 100644
--- a/tests/integration/database/replicator.js
+++ b/tests/integration/database/replicator.js
@@ -10,120 +10,126 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
-const nano = harness.locals.nano;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
+const nano = harness.locals.nano
 
-let replica;
-let replica2;
-let replica3;
+let replica
+let replica2
+let replica3
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('creates a bunch of database replicas', function(assert) {
-    async.forEach(['database_replica', 'database_replica2', 'database_replica3'],
-    nano.db.create, function(error) {
-        assert.equal(error, null, 'created database(s)');
-        assert.end();
-    });
-});
+it('creates a bunch of database replicas', function (assert) {
+  async.forEach(['database_replica', 'database_replica2', 'database_replica3'],
+    nano.db.create, function (error) {
+      assert.equal(error, null, 'created database(s)')
+      assert.end()
+    })
+})
 
-it('should be able to replicate (replicator) three docs', function(assert) {
-  replica = nano.use('database_replica');
-  db.replication.enable('database_replica', function(error, data) {
-    assert.equal(error, null, 'replication should not fail');
-    assert.true(data, 'replication should be scheduled');
-    assert.true(data.ok, 'replication should be scheduled');
-    assert.true(data.id, 'replication should return the id to query back');
-    function waitForReplication() {
-      setTimeout(function() {
-        db.replication.query(data.id, function(error, reply) {
-          assert.equal(reply.target, 'database_replica', 'target db should match');
-          assert.equal(reply._replication_state, 'triggered', 'replication should have triggered');
-          replica.list(function(error, list) {
-            assert.equal(error, null, 'should be able to invoke list');
-            assert.equal(list['total_rows'], 3, 'and have three documents');
-            db.replication.disable(reply._id, reply._rev, function(error, disabled) {
-              assert.true(disabled, 'should not be null');
-              assert.true(disabled.ok, 'should have stopped the replication');
-              assert.end();
-            });
-          });
-        });
+it('should be able to replicate (replicator) three docs', function (assert) {
+  replica = nano.use('database_replica')
+  db.replication.enable('database_replica', function (error, data) {
+    assert.equal(error, null, 'replication should not fail')
+    assert.true(data, 'replication should be scheduled')
+    assert.true(data.ok, 'replication should be scheduled')
+    assert.true(data.id, 'replication should return the id to query back')
+    function waitForReplication () {
+      setTimeout(function () {
+        db.replication.query(data.id, function (error, reply) {
+          assert.equal(error, null, 'replication should not fail')
+          assert.equal(reply.target, 'database_replica', 'target db should match')
+          assert.equal(reply._replication_state, 'triggered', 'replication should have triggered')
+          replica.list(function (error, list) {
+            assert.equal(error, null, 'should be able to invoke list')
+            assert.equal(list['total_rows'], 3, 'and have three documents')
+            db.replication.disable(reply._id, reply._rev, function (error, disabled) {
+              assert.equal(error, null, 'replication should not fail')
+              assert.true(disabled, 'should not be null')
+              assert.true(disabled.ok, 'should have stopped the replication')
+              assert.end()
+            })
+          })
+        })
       },
-      3000);
+      3000)
     }
-    waitForReplication();
-  });
-});
+    waitForReplication()
+  })
+})
 
-it('should be able to replicate (replicator) to a `nano` object', function(assert) {
-  replica2 = nano.use('database_replica2');
-  nano.db.replication.enable(db, 'database_replica2', function(error, data) {
-    assert.equal(error, null, 'replication should not fail');
-    assert.true(data, 'replication should be scheduled');
-    assert.true(data.ok, 'replication should be scheduled');
-    assert.true(data.id, 'replication should return the id to query back');
-    function waitForReplication() {
-      setTimeout(function() {
-        nano.db.replication.query(data.id, function(error, reply) {
-          assert.equal(reply.target, 'database_replica2', 'target db should match');
-          assert.equal(reply._replication_state, 'triggered', 'replication should have triggered');
-          replica2.list(function(error, list) {
-            assert.equal(error, null, 'should be able to invoke list');
-            assert.equal(list['total_rows'], 3, 'and have three documents');
-            nano.db.replication.disable(reply._id, reply._rev, function(error, disabled) {
-              assert.true(disabled, 'should not be null');
-              assert.true(disabled.ok, 'should have stopped the replication');
-              assert.end();
-            });
-          });
-        });
+it('should be able to replicate (replicator) to a `nano` object', function (assert) {
+  replica2 = nano.use('database_replica2')
+  nano.db.replication.enable(db, 'database_replica2', function (error, data) {
+    assert.equal(error, null, 'replication should not fail')
+    assert.true(data, 'replication should be scheduled')
+    assert.true(data.ok, 'replication should be scheduled')
+    assert.true(data.id, 'replication should return the id to query back')
+    function waitForReplication () {
+      setTimeout(function () {
+        nano.db.replication.query(data.id, function (error, reply) {
+          assert.equal(error, null, 'replication should not fail')
+          assert.equal(reply.target, 'database_replica2', 'target db should match')
+          assert.equal(reply._replication_state, 'triggered', 'replication should have triggered')
+          replica2.list(function (error, list) {
+            assert.equal(error, null, 'should be able to invoke list')
+            assert.equal(list['total_rows'], 3, 'and have three documents')
+            nano.db.replication.disable(reply._id, reply._rev, function (error, disabled) {
+              assert.equal(error, null, 'replication should not fail')
+              assert.true(disabled, 'should not be null')
+              assert.true(disabled.ok, 'should have stopped the replication')
+              assert.end()
+            })
+          })
+        })
       },
-      3000);
+      3000)
     }
-    waitForReplication();
-  });
-});
+    waitForReplication()
+  })
+})
 
-it('should be able to replicate (replicator) with params', function(assert) {
-  replica3 = nano.use('database_replica3');
-  db.replication.enable('database_replica3', {}, function(error, data) {
-    assert.equal(error, null, 'replication should not fail');
-    assert.true(data, 'replication should be scheduled');
-    assert.true(data.ok, 'replication should be scheduled');
-    assert.true(data.id, 'replication should return the id to query back');
-    function waitForReplication() {
-      setTimeout(function() {
-        db.replication.query(data.id, function(error, reply) {
-          assert.equal(reply.target, 'database_replica3', 'target db should match');
-          assert.equal(reply._replication_state, 'triggered', 'replication should have triggered');
-          replica3.list(function(error, list) {
-            assert.equal(error, null, 'should be able to invoke list');
-            assert.equal(list['total_rows'], 3, 'and have three documents');
-            db.replication.disable(reply._id, reply._rev, function(error, disabled) {
-              assert.true(disabled, 'should not be null');
-              assert.true(disabled.ok, 'should have stopped the replication');
-              assert.end();
-            });
-          });
-        });
+it('should be able to replicate (replicator) with params', function (assert) {
+  replica3 = nano.use('database_replica3')
+  db.replication.enable('database_replica3', {}, function (error, data) {
+    assert.equal(error, null, 'replication should not fail')
+    assert.true(data, 'replication should be scheduled')
+    assert.true(data.ok, 'replication should be scheduled')
+    assert.true(data.id, 'replication should return the id to query back')
+    function waitForReplication () {
+      setTimeout(function () {
+        db.replication.query(data.id, function (error, reply) {
+          assert.equal(error, null, 'replication should not fail')
+          assert.equal(reply.target, 'database_replica3', 'target db should match')
+          assert.equal(reply._replication_state, 'triggered', 'replication should have triggered')
+          replica3.list(function (error, list) {
+            assert.equal(error, null, 'should be able to invoke list')
+            assert.equal(list['total_rows'], 3, 'and have three documents')
+            db.replication.disable(reply._id, reply._rev, function (error, disabled) {
+              assert.equal(error, null, 'replication should not fail')
+              assert.true(disabled, 'should not be null')
+              assert.true(disabled.ok, 'should have stopped the replication')
+              assert.end()
+            })
+          })
+        })
       },
-      3000);
+      3000)
     }
-    waitForReplication();
-  });
-});
+    waitForReplication()
+  })
+})
 
-it('should destroy the extra databases', function(assert) {
- async.forEach(['database_replica', 'database_replica2', 'database_replica3'],
- nano.db.destroy, function(error) {
-   assert.equal(error, null, 'deleted databases');
-   assert.end();
- });
-});
+it('should destroy the extra databases', function (assert) {
+  async.forEach(['database_replica', 'database_replica2', 'database_replica3'],
+    nano.db.destroy, function (error) {
+      assert.equal(error, null, 'deleted databases')
+      assert.end()
+    })
+})
diff --git a/tests/integration/design/atomic.js b/tests/integration/design/atomic.js
index 2c18848..d685934 100644
--- a/tests/integration/design/atomic.js
+++ b/tests/integration/design/atomic.js
@@ -10,76 +10,73 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-let rev;
-
-it('should be able to insert an atomic design doc', function(assert) {
+it('should be able to insert an atomic design doc', function (assert) {
   const p = db.insert({
     updates: {
-      inplace: function(doc, req) {
-        const body = JSON.parse(req.body);
-        doc[body.field] = body.value;
-        return [doc, JSON.stringify(doc)];
+      inplace: function (doc, req) {
+        const body = JSON.parse(req.body)
+        doc[body.field] = body.value
+        return [doc, JSON.stringify(doc)]
       },
       addbaz: function (doc) {
-        doc.baz = "biz";
-        return [doc, JSON.stringify(doc)];
+        doc.baz = 'biz'
+        return [doc, JSON.stringify(doc)]
       }
     }
-  }, '_design/update', function(err) {
-    assert.equal(err, null, 'should be no problems officer');
-    db.insert({'foo': 'baz'}, 'foobar', function(error, foo) {
-      assert.equal(error, null, 'stores teh foo');
-      assert.equal(foo.ok, true, 'does not have an attitude');
-      assert.ok(foo.rev, 'got the revisions');
-      rev = foo.rev;
-      assert.end();
-    });
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-});
+  }, '_design/update', function (err) {
+    assert.equal(err, null, 'should be no problems officer')
+    db.insert({'foo': 'baz'}, 'foobar', function (error, foo) {
+      assert.equal(error, null, 'stores teh foo')
+      assert.equal(foo.ok, true, 'does not have an attitude')
+      assert.ok(foo.rev, 'got the revisions')
+      assert.end()
+    })
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+})
 
-it('should be able to insert atomically', function(assert) {
+it('should be able to insert atomically', function (assert) {
   const p = db.atomic('update', 'inplace', 'foobar', {
     field: 'foo',
     value: 'bar'
-  }, function(error, response) {
-    assert.equal(error, null, 'should be able to update');
-    assert.equal(response.foo, 'bar', 'and the right value was set');
-    assert.end();
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-});
+  }, function (error, response) {
+    assert.equal(error, null, 'should be able to update')
+    assert.equal(response.foo, 'bar', 'and the right value was set')
+    assert.end()
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+})
 
 it('should be able to update atomically without a body', function (assert) {
   const p = db.insert({}, 'baz', function () {
     db.atomic('update', 'addbaz', 'baz', function (error, response) {
-      assert.equal(error, null, 'should be able to update');
-      assert.equal(response.baz, 'biz', 'and the new field is present');
-      assert.end();
-    });
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-});
+      assert.equal(error, null, 'should be able to update')
+      assert.equal(response.baz, 'biz', 'and the new field is present')
+      assert.end()
+    })
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+})
 
-it('should be able to update with slashes on the id', function(assert) {
-  const p = db.insert({'wat': 'wat'}, 'wat/wat', function(error, foo) {
-    assert.equal(error, null, 'stores `wat`');
-    assert.equal(foo.ok, true, 'response ok');
+it('should be able to update with slashes on the id', function (assert) {
+  const p = db.insert({'wat': 'wat'}, 'wat/wat', function (error, foo) {
+    assert.equal(error, null, 'stores `wat`')
+    assert.equal(foo.ok, true, 'response ok')
     db.atomic('update', 'inplace', 'wat/wat', {
       field: 'wat',
       value: 'dawg'
-    }, function(error, response) {
-      assert.equal(error, null, 'should update');
-      assert.equal(response.wat, 'dawg', 'with the right copy');
-      assert.end();
-    });
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-});
+    }, function (error, response) {
+      assert.equal(error, null, 'should update')
+      assert.equal(response.wat, 'dawg', 'with the right copy')
+      assert.end()
+    })
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+})
diff --git a/tests/integration/design/compact.js b/tests/integration/design/compact.js
index fbcdfe4..9f5415d 100644
--- a/tests/integration/design/compact.js
+++ b/tests/integration/design/compact.js
@@ -10,33 +10,33 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should insert `alice` the design doc', function(assert) {
+it('should insert `alice` the design doc', function (assert) {
   async.waterfall([
-    function(next) {
+    function (next) {
       db.insert({
         views: {
           'by_id': {
             map: 'function(doc) { emit(doc._id, doc); }'
           }
         }
-      }, '_design/alice', next);
+      }, '_design/alice', next)
     },
-    function(data, _, next) {
-      db.insert({'foo': 'baz'}, 'foobaz', next);
+    function (data, _, next) {
+      db.insert({'foo': 'baz'}, 'foobaz', next)
     },
-    function(foo, _, next) {
-      db.destroy('foobaz', foo.rev, next);
+    function (foo, _, next) {
+      db.destroy('foobaz', foo.rev, next)
     }
-  ], function(err) {
-    assert.equal(err, null, 'it should destroy the foo');
-    assert.end();
-  });
-});
+  ], function (err) {
+    assert.equal(err, null, 'it should destroy the foo')
+    assert.end()
+  })
+})
diff --git a/tests/integration/design/list.js b/tests/integration/design/list.js
index 10009fd..5195dbd 100644
--- a/tests/integration/design/list.js
+++ b/tests/integration/design/list.js
@@ -10,28 +10,28 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should create a ddoc and insert some docs', helpers.prepareAView);
+it('should create a ddoc and insert some docs', helpers.prepareAView)
 
-it('should get the people by running the ddoc', function(assert) {
+it('should get the people by running the ddoc', function (assert) {
   const p = db.viewWithList('people', 'by_name_and_city', 'my_list', {
     key: [
       'Derek',
       'San Francisco'
     ]
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(list) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(list, 'Hello', 'and list should be `hello`');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (list) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(list, 'Hello', 'and list should be `hello`')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/design/multiple.js b/tests/integration/design/multiple.js
index 70ff440..9082eef 100644
--- a/tests/integration/design/multiple.js
+++ b/tests/integration/design/multiple.js
@@ -10,61 +10,61 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should be able to insert docs and design doc', function(assert) {
+it('should be able to insert docs and design doc', function (assert) {
   const p = db.insert({
     views: {
       'by_id': {
         map: 'function(doc) { emit(doc._id, doc); }'
       }
     }
-  }, '_design/alice');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(response.ok, true, 'response ok');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }, '_design/alice')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(response.ok, true, 'response ok')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('get multiple docs with a composed key', function(assert) {
+it('get multiple docs with a composed key', function (assert) {
   const p = db.view('alice', 'by_id', {
     keys: ['foobar', 'barfoo'],
     'include_docs': true
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(view) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(view.rows.length, 2, 'has more or less than two rows');
-    assert.equal(view.rows[0].id, 'foobar', 'foo is not the first id');
-    assert.equal(view.rows[1].id, 'barfoo', 'bar is not the second id');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (view) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(view.rows.length, 2, 'has more or less than two rows')
+    assert.equal(view.rows[0].id, 'foobar', 'foo is not the first id')
+    assert.equal(view.rows[1].id, 'barfoo', 'bar is not the second id')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('get multiple docs with a composed key as a stream', function(assert) {
+it('get multiple docs with a composed key as a stream', function (assert) {
   const p = db.viewAsStream('alice', 'by_id', {
     keys: ['foobar', 'barfoo'],
     'include_docs': true
-  }, function(err, view) {
-    assert.equal(err, null, 'should response');
-    assert.equal(view.rows.length, 2, 'has more or less than two rows');
-    assert.equal(view.rows[0].id, 'foobar', 'foo is not the first id');
-    assert.equal(view.rows[1].id, 'barfoo', 'bar is not the second id');
-    assert.end();
-  });
-  assert.ok(!helpers.isPromise(p), 'does not returns Promise');
-  assert.equal(p.constructor.name, 'Request', 'returns a Request');
-});
+  }, function (err, view) {
+    assert.equal(err, null, 'should response')
+    assert.equal(view.rows.length, 2, 'has more or less than two rows')
+    assert.equal(view.rows[0].id, 'foobar', 'foo is not the first id')
+    assert.equal(view.rows[1].id, 'barfoo', 'bar is not the second id')
+    assert.end()
+  })
+  assert.ok(!helpers.isPromise(p), 'does not returns Promise')
+  assert.equal(p.constructor.name, 'Request', 'returns a Request')
+})
diff --git a/tests/integration/design/query.js b/tests/integration/design/query.js
index 7f95ec1..2ead03b 100644
--- a/tests/integration/design/query.js
+++ b/tests/integration/design/query.js
@@ -10,44 +10,44 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
-const viewDerek = helpers.viewDerek;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
+const viewDerek = helpers.viewDerek
 
-const opts = {key: ['Derek', 'San Francisco']};
+const opts = {key: ['Derek', 'San Francisco']}
 
-it('should create a ddoc and insert some docs', helpers.prepareAView);
+it('should create a ddoc and insert some docs', helpers.prepareAView)
 
-it('should respond with derek when asked for derek', function(assert) {
-  viewDerek(db, assert, opts, assert.end);
-});
+it('should respond with derek when asked for derek', function (assert) {
+  viewDerek(db, assert, opts, assert.end)
+})
 
-it('should have no cloning issues when doing queries', function(assert) {
+it('should have no cloning issues when doing queries', function (assert) {
   async.waterfall([
-    function(next) { viewDerek(db, assert, opts, next); },
-    function(next) { viewDerek(db, assert, opts, next); }
-  ], function(err) {
-    assert.equal(err, null, 'no errors');
-    assert.ok(Array.isArray(opts.key));
-    assert.equal(opts.key[0], 'Derek');
-    assert.equal(opts.key[1], 'San Francisco');
-    assert.end();
-  });
-});
+    function (next) { viewDerek(db, assert, opts, next) },
+    function (next) { viewDerek(db, assert, opts, next) }
+  ], function (err) {
+    assert.equal(err, null, 'no errors')
+    assert.ok(Array.isArray(opts.key))
+    assert.equal(opts.key[0], 'Derek')
+    assert.equal(opts.key[1], 'San Francisco')
+    assert.end()
+  })
+})
 
 var multipleQueryOpts = {
   queries: [
     {
       keys: [
-        ['Derek','San Francisco'],
-        ['Nuno','London']
+        ['Derek', 'San Francisco'],
+        ['Nuno', 'London']
       ]
-    }, 
+    },
     {
       skip: 2,
       limit: 1
@@ -55,20 +55,19 @@ var multipleQueryOpts = {
   ]
 }
 
-var expectedResults = 
+var expectedResults =
   [
-    {total_rows:3,offset:0,rows:[{id:"p_derek",key:["Derek","San Francisco"],value:"p_derek"},{id:"p_nuno",key:["Nuno","London"],value:"p_nuno"}]},
-    {total_rows:3,offset:2,rows:[{id:"p_randall",key:["Randall","San Francisco"],value:"p_randall"}]}
+    {total_rows: 3, offset: 0, rows: [{id: 'p_derek', key: ['Derek', 'San Francisco'], value: 'p_derek'}, {id: 'p_nuno', key: ['Nuno', 'London'], value: 'p_nuno'}]},
+    {total_rows: 3, offset: 2, rows: [{id: 'p_randall', key: ['Randall', 'San Francisco'], value: 'p_randall'}]}
   ]
 
-
-it('should support multiple view queries', function(assert) {
-  db.view('people','by_name_and_city', multipleQueryOpts, function(error, response) {
-    assert.equal(error, null, 'no errors');
+it('should support multiple view queries', function (assert) {
+  db.view('people', 'by_name_and_city', multipleQueryOpts, function (error, response) {
+    assert.equal(error, null, 'no errors')
     assert.ok(response.results, 'should return query results')
-    assert.ok(Array.isArray(response.results), 'query results should be array');
+    assert.ok(Array.isArray(response.results), 'query results should be array')
     assert.equal(response.results.length, 2, 'should return results to both queries')
     assert.deepEqual(response.results, expectedResults, 'should be expected query results')
     assert.end()
-  });
-});
+  })
+})
diff --git a/tests/integration/design/search.js b/tests/integration/design/search.js
index 94c37a5..f6b1114 100644
--- a/tests/integration/design/search.js
+++ b/tests/integration/design/search.js
@@ -10,40 +10,40 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
-const viewDerek = helpers.viewDerek;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
+const viewDerek = helpers.viewDerek
 
 //
 // these are cloudant only
 // tests do no run without mocks
 //
 if (helpers.mocked) {
-  const opts = {key: ['Derek', 'San Francisco']};
+  const opts = {key: ['Derek', 'San Francisco']}
 
-  it('should create a ddoc and insert some docs', function(assert) {
-    helpers.prepareAView(assert, '/_search', db);
-  });
+  it('should create a ddoc and insert some docs', function (assert) {
+    helpers.prepareAView(assert, '/_search', db)
+  })
 
-  it('should respond with derek when asked for derek', function(assert) {
-    viewDerek(db, assert, opts, assert.end, 'search');
-  });
+  it('should respond with derek when asked for derek', function (assert) {
+    viewDerek(db, assert, opts, assert.end, 'search')
+  })
 
-  it('should have no cloning issues when doing queries', function(assert) {
+  it('should have no cloning issues when doing queries', function (assert) {
     async.waterfall([
-      function(next) { viewDerek(db, assert, opts, next, 'search'); },
-      function(next) { viewDerek(db, assert, opts, next, 'search'); }
-    ], function(err) {
-      assert.equal(err, null, 'no errors');
-      assert.ok(Array.isArray(opts.key));
-      assert.equal(opts.key[0], 'Derek');
-      assert.equal(opts.key[1], 'San Francisco');
-      assert.end();
-    });
-  });
+      function (next) { viewDerek(db, assert, opts, next, 'search') },
+      function (next) { viewDerek(db, assert, opts, next, 'search') }
+    ], function (err) {
+      assert.equal(err, null, 'no errors')
+      assert.ok(Array.isArray(opts.key))
+      assert.equal(opts.key[0], 'Derek')
+      assert.equal(opts.key[1], 'San Francisco')
+      assert.end()
+    })
+  })
 }
diff --git a/tests/integration/design/show.js b/tests/integration/design/show.js
index c6b5acd..7e4e2ef 100644
--- a/tests/integration/design/show.js
+++ b/tests/integration/design/show.js
@@ -10,18 +10,18 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const async = require('async');
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const async = require('async')
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should insert a show ddoc', function(assert) {
+it('should insert a show ddoc', function (assert) {
   db.insert({
     shows: {
-      singleDoc: function(doc, req) {
+      singleDoc: function (doc, req) {
         if (req.query.format === 'json' || !req.query.format) {
           return {
             body: JSON.stringify({
@@ -32,7 +32,7 @@ it('should insert a show ddoc', function(assert) {
             headers: {
               'Content-Type': 'application/json'
             }
-          };
+          }
         }
         if (req.query.format === 'html') {
           return {
@@ -40,60 +40,60 @@ it('should insert a show ddoc', function(assert) {
             headers: {
               'Content-Type': 'text/html'
             }
-          };
+          }
         }
       }
     }
-  }, '_design/people', function(error, response) {
-      assert.equal(error, null, 'should start the show');
-      assert.equal(response.ok, true, 'response ok');
-      async.parallel([
-        function(cb) {
-          db.insert({
-            name: 'Clemens',
-            city: 'Dresden'
-          }, 'p_clemens', cb);
-        },
-        function(cb) {
-          db.insert({
-              name: 'Randall',
-              city: 'San Francisco'
-            }, 'p_randall', cb);
-        }, function(cb) {
-          db.insert({
-            name: 'Nuno',
-            city: 'New York'
-          }, 'p_nuno', cb);
-        }
-      ], function(error) {
-        assert.equal(error, null, 'stores docs');
-        assert.end();
-      });
-    });
-});
+  }, '_design/people', function (error, response) {
+    assert.equal(error, null, 'should start the show')
+    assert.equal(response.ok, true, 'response ok')
+    async.parallel([
+      function (cb) {
+        db.insert({
+          name: 'Clemens',
+          city: 'Dresden'
+        }, 'p_clemens', cb)
+      },
+      function (cb) {
+        db.insert({
+          name: 'Randall',
+          city: 'San Francisco'
+        }, 'p_randall', cb)
+      }, function (cb) {
+        db.insert({
+          name: 'Nuno',
+          city: 'New York'
+        }, 'p_nuno', cb)
+      }
+    ], function (error) {
+      assert.equal(error, null, 'stores docs')
+      assert.end()
+    })
+  })
+})
 
-it('should show the amazing clemens in json', function(assert) {
-  const p = db.show('people', 'singleDoc', 'p_clemens');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(doc) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(doc.name, 'Clemens');
-    assert.equal(doc.city, 'Dresden');
-    assert.equal(doc.format, 'json');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should show the amazing clemens in json', function (assert) {
+  const p = db.show('people', 'singleDoc', 'p_clemens')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (doc) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(doc.name, 'Clemens')
+    assert.equal(doc.city, 'Dresden')
+    assert.equal(doc.format, 'json')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should show the amazing clemens in html', function(assert) {
+it('should show the amazing clemens in html', function (assert) {
   db.show('people', 'singleDoc', 'p_clemens', {format: 'html'},
-  function(error, doc, rh) {
-    assert.equal(error, null, 'should work');
-    if (helpers.unmocked) {
-      assert.equal(rh['content-type'], 'text/html');
-    }
-    assert.equal(doc, 'Hello Clemens!');
-    assert.end();
-  });
-});
+    function (error, doc, rh) {
+      assert.equal(error, null, 'should work')
+      if (helpers.unmocked) {
+        assert.equal(rh['content-type'], 'text/html')
+      }
+      assert.equal(doc, 'Hello Clemens!')
+      assert.end()
+    })
+})
diff --git a/tests/integration/document/bulk.js b/tests/integration/document/bulk.js
index 61b0958..a855c14 100644
--- a/tests/integration/document/bulk.js
+++ b/tests/integration/document/bulk.js
@@ -10,28 +10,28 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('should be able to bulk insert two docs', function(assert) {
+it('should be able to bulk insert two docs', function (assert) {
   const p = db.bulk({
     'docs': [
-      {'key':'baz', 'name':'bazzel'},
-      {'key':'bar', 'name':'barry'}
+      {'key': 'baz', 'name': 'bazzel'},
+      {'key': 'bar', 'name': 'barry'}
     ]
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(response.length, 2, 'has two docs');
-    assert.ok(response[0].id, 'first got id');
-    assert.ok(response[1].id, 'other also got id');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(response.length, 2, 'has two docs')
+    assert.ok(response[0].id, 'first got id')
+    assert.ok(response[1].id, 'other also got id')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/copy.js b/tests/integration/document/copy.js
index ab775c6..59fff27 100644
--- a/tests/integration/document/copy.js
+++ b/tests/integration/document/copy.js
@@ -10,57 +10,57 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-it('must insert two docs before the tests start', function(assert) {
-  db.insert({'foo': 'baz'}, 'foo_src', function(error, src) {
-    assert.equal(error, null, 'stores src');
-    assert.equal(src.ok, true, 'response ok');
-    assert.ok(src.rev, 'haz rev');
-    db.insert({'bar': 'qux'}, 'foo_dest', function(error, dest) {
-      assert.equal(error, null, 'stores dest');
-      assert.equal(dest.ok, true, 'oki doki');
-      assert.ok(dest.rev, 'response has rev');
-      assert.end();
-    });
-  });
-});
+it('must insert two docs before the tests start', function (assert) {
+  db.insert({'foo': 'baz'}, 'foo_src', function (error, src) {
+    assert.equal(error, null, 'stores src')
+    assert.equal(src.ok, true, 'response ok')
+    assert.ok(src.rev, 'haz rev')
+    db.insert({'bar': 'qux'}, 'foo_dest', function (error, dest) {
+      assert.equal(error, null, 'stores dest')
+      assert.equal(dest.ok, true, 'oki doki')
+      assert.ok(dest.rev, 'response has rev')
+      assert.end()
+    })
+  })
+})
 
-it('should be able to copy and overwrite a document', function(assert) {
-  const p = db.copy('foo_src', 'foo_dest', {overwrite: true});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(true, 'Promise is resolved');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to copy and overwrite a document', function (assert) {
+  const p = db.copy('foo_src', 'foo_dest', {overwrite: true})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(true, 'Promise is resolved')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
 it('copy without overwrite should return conflict for exists docs',
-function(assert) {
-  const p = db.copy('foo_src', 'foo_dest');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(false, 'Promise is resolved');
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-    assert.end();
-  });
-});
+  function (assert) {
+    const p = db.copy('foo_src', 'foo_dest')
+    assert.ok(helpers.isPromise(p), 'returns Promise')
+    p.then(function () {
+      assert.ok(false, 'Promise is resolved')
+    }).catch(function () {
+      assert.ok(true, 'Promise is rejected')
+      assert.end()
+    })
+  })
 
-it('copy to a new destination should work', function(assert) {
-  const p = db.copy('foo_src', 'baz_dest');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(true, 'Promise is resolved');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('copy to a new destination should work', function (assert) {
+  const p = db.copy('foo_src', 'baz_dest')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(true, 'Promise is resolved')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/create_index.js b/tests/integration/document/create_index.js
index 1e7f022..4327463 100644
--- a/tests/integration/document/create_index.js
+++ b/tests/integration/document/create_index.js
@@ -10,26 +10,26 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should insert a one item', helpers.insertOne);
+it('should insert a one item', helpers.insertOne)
 
-it ('Should create one simple index', function(assert) {
+it('Should create one simple index', function (assert) {
   const p = db.createIndex({
     name: 'fooindex',
     index: { fields: ['foo'] }
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.equal(foo.result, 'created', 'index should be created');
-    assert.equal(foo.name, 'fooindex', 'index should have correct name');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.equal(foo.result, 'created', 'index should be created')
+    assert.equal(foo.name, 'fooindex', 'index should have correct name')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/destroy.js b/tests/integration/document/destroy.js
index 78247f1..185ae3a 100644
--- a/tests/integration/document/destroy.js
+++ b/tests/integration/document/destroy.js
@@ -10,44 +10,44 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
-const db = harness.locals.db;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
+const db = harness.locals.db
 
-let rev;
+let rev
 
-it('should insert a document', function(assert) {
-  db.insert({'foo': 'baz'}, 'foobaz', function(error, foo) {
-    assert.equal(error, null, 'stores foo');
-    assert.equal(foo.ok, true, 'ok response');
-    assert.ok(foo.rev, 'response with rev');
-    rev = foo.rev;
-    assert.end();
-  });
-});
+it('should insert a document', function (assert) {
+  db.insert({'foo': 'baz'}, 'foobaz', function (error, foo) {
+    assert.equal(error, null, 'stores foo')
+    assert.equal(foo.ok, true, 'ok response')
+    assert.ok(foo.rev, 'response with rev')
+    rev = foo.rev
+    assert.end()
+  })
+})
 
-it('should not delete a db', function(assert) {
-  const p = db.destroy(undefined, undefined);
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(false, 'Promise is resolved');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
+it('should not delete a db', function (assert) {
+  const p = db.destroy(undefined, undefined)
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(false, 'Promise is resolved')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
 
-it('should delete a document', function(assert) {
-  const p = db.destroy('foobaz', rev);
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(response.ok, true, 'ok!');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should delete a document', function (assert) {
+  const p = db.destroy('foobaz', rev)
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(response.ok, true, 'ok!')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/fetch.js b/tests/integration/document/fetch.js
index 5035fb0..7bd3868 100644
--- a/tests/integration/document/fetch.js
+++ b/tests/integration/document/fetch.js
@@ -10,50 +10,50 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('should be able to fetch with one key', function(assert) {
-  const p = db.fetch({keys:['foobar']});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs.rows.length, 1, 'and get one row');
-    assert.equal(docs['total_rows'], 3, 'out of 3');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to fetch with one key', function (assert) {
+  const p = db.fetch({keys: ['foobar']})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs.rows.length, 1, 'and get one row')
+    assert.equal(docs['total_rows'], 3, 'out of 3')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to fetch with multiple keys', function(assert) {
-  const p = db.fetch({keys:['foobar', 'barfoo']});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs.rows.length, 2, 'two rows');
-    assert.equal(docs['total_rows'], 3, 'out of 3');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to fetch with multiple keys', function (assert) {
+  const p = db.fetch({keys: ['foobar', 'barfoo']})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs.rows.length, 2, 'two rows')
+    assert.equal(docs['total_rows'], 3, 'out of 3')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to fetch with params', function(assert) {
-  const p = db.fetch({keys:['foobar']}, {not: 'important'});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs.rows.length, 1, 'and get one row');
-    assert.equal(docs['total_rows'], 3, 'out of 3');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to fetch with params', function (assert) {
+  const p = db.fetch({keys: ['foobar']}, {not: 'important'})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs.rows.length, 1, 'and get one row')
+    assert.equal(docs['total_rows'], 3, 'out of 3')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/fetch_revs.js b/tests/integration/document/fetch_revs.js
index 1350415..5862306 100644
--- a/tests/integration/document/fetch_revs.js
+++ b/tests/integration/document/fetch_revs.js
@@ -10,54 +10,54 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('should be able to fetch with one key', function(assert) {
-  const p = db.fetchRevs({keys:['foobar']});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs.rows.length, 1, 'and get one row');
-    assert.equal(docs['total_rows'], 3, 'out of 3');
-    assert.equal(docs.rows[0].doc, undefined, 'rev should not return key');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to fetch with one key', function (assert) {
+  const p = db.fetchRevs({keys: ['foobar']})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs.rows.length, 1, 'and get one row')
+    assert.equal(docs['total_rows'], 3, 'out of 3')
+    assert.equal(docs.rows[0].doc, undefined, 'rev should not return key')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to fetch with multiple keys', function(assert) {
-  const p = db.fetchRevs({keys:['foobar', 'barfoo']});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs.rows.length, 2, 'two rows');
-    assert.equal(docs['total_rows'], 3, 'out of 3');
-    assert.equal(docs.rows[0].doc, undefined, 'no doc in 1');
-    assert.equal(docs.rows[1].doc, undefined, 'no doc in 2');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to fetch with multiple keys', function (assert) {
+  const p = db.fetchRevs({keys: ['foobar', 'barfoo']})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs.rows.length, 2, 'two rows')
+    assert.equal(docs['total_rows'], 3, 'out of 3')
+    assert.equal(docs.rows[0].doc, undefined, 'no doc in 1')
+    assert.equal(docs.rows[1].doc, undefined, 'no doc in 2')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to fetch with params', function(assert) {
-  const p = db.fetchRevs({keys:['foobar']}, {still: 'no'});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs.rows.length, 1, 'and get one row');
-    assert.equal(docs['total_rows'], 3, 'out of 3');
-    assert.equal(docs.rows[0].doc, undefined, 'rev should not return key');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to fetch with params', function (assert) {
+  const p = db.fetchRevs({keys: ['foobar']}, {still: 'no'})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs.rows.length, 1, 'and get one row')
+    assert.equal(docs['total_rows'], 3, 'out of 3')
+    assert.equal(docs.rows[0].doc, undefined, 'rev should not return key')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/find.js b/tests/integration/document/find.js
index 0e59bf4..39f61ab 100644
--- a/tests/integration/document/find.js
+++ b/tests/integration/document/find.js
@@ -10,33 +10,33 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('should be to do a mango query', function(assert) {
-  const p = db.find({ selector: { foo: 'baz'}});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(response.docs.length, 1, 'and get one row');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be to do a mango query', function (assert) {
+  const p = db.find({selector: {foo: 'baz'}})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(response.docs.length, 1, 'and get one row')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be to do a mango query with streams', function(assert) {
-  const p = db.findAsStream({ selector: { foo: 'baz'}}, function(error, response) {
-    assert.equal(error, null, 'should work');
-    assert.equal(response.docs.length, 1, 'and get one row');
-    assert.end();
-  });
-  assert.ok(!helpers.isPromise(p), 'does not return Promise');
-  assert.equal(p.constructor.name, 'Request', 'returns a Request');
-});
+it('should be to do a mango query with streams', function (assert) {
+  const p = db.findAsStream({selector: {foo: 'baz'}}, function (error, response) {
+    assert.equal(error, null, 'should work')
+    assert.equal(response.docs.length, 1, 'and get one row')
+    assert.end()
+  })
+  assert.ok(!helpers.isPromise(p), 'does not return Promise')
+  assert.equal(p.constructor.name, 'Request', 'returns a Request')
+})
diff --git a/tests/integration/document/get.js b/tests/integration/document/get.js
index 5dfabe2..daa8f4e 100644
--- a/tests/integration/document/get.js
+++ b/tests/integration/document/get.js
@@ -10,25 +10,25 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should insert a one item', helpers.insertOne);
+it('should insert a one item', helpers.insertOne)
 
-it('should get the document', function(assert) {
-  const p = db.get('foobaz', {'revs_info': true});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foobaz) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(foobaz['_revs_info'], 'got revs info');
-    assert.equal(foobaz._id, 'foobaz', 'id is food');
-    assert.equal(foobaz.foo, 'baz', 'baz is in foo');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should get the document', function (assert) {
+  const p = db.get('foobaz', {'revs_info': true})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foobaz) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(foobaz['_revs_info'], 'got revs info')
+    assert.equal(foobaz._id, 'foobaz', 'id is food')
+    assert.equal(foobaz.foo, 'baz', 'baz is in foo')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/head.js b/tests/integration/document/head.js
index 319e180..51eb0d0 100644
--- a/tests/integration/document/head.js
+++ b/tests/integration/document/head.js
@@ -10,30 +10,30 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should insert a one item', helpers.insertOne);
+it('should insert a one item', helpers.insertOne)
 
-it('should get a status code when you do head - promises', function(assert) {
-  const p = db.head('foobaz');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs['statusCode'], 200, 'and is ok');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should get a status code when you do head - promises', function (assert) {
+  const p = db.head('foobaz')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs['statusCode'], 200, 'and is ok')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should get a status code when you do head - callbacks', function(assert) {
-  db.head('foobaz', function(error, body, headers) {
-    assert.equal(error, null, 'should get the head of foobaz');
-    assert.equal(headers['statusCode'], 200, 'and is ok');
-  });
-});
+it('should get a status code when you do head - callbacks', function (assert) {
+  db.head('foobaz', function (error, body, headers) {
+    assert.equal(error, null, 'should get the head of foobaz')
+    assert.equal(headers['statusCode'], 200, 'and is ok')
+  })
+})
diff --git a/tests/integration/document/insert.js b/tests/integration/document/insert.js
index a2fe162..3e1d9a6 100644
--- a/tests/integration/document/insert.js
+++ b/tests/integration/document/insert.js
@@ -10,73 +10,72 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-let rev;
+let rev
 
-it('should insert one simple document', function(assert) {
-  const p = db.insert({'foo': 'baz'}, 'foobaz');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(foo.ok, true, 'response should be ok');
-    assert.ok(foo.rev, 'response should have rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should insert one simple document', function (assert) {
+  const p = db.insert({'foo': 'baz'}, 'foobaz')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(foo.ok, true, 'response should be ok')
+    assert.ok(foo.rev, 'response should have rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should fail to insert again since it already exists', function(assert) {
-  const p = db.insert({}, 'foobaz');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(false, 'Promise is resolved');
-  }).catch(function(error) {
-    assert.ok(true, 'Promise is rejected');
-    assert.equal(error.scope, 'couch', 'scope is couch');
-    assert.equal(error.error, 'conflict', 'type is conflict');
-    assert.end();
-  });
-});
+it('should fail to insert again since it already exists', function (assert) {
+  const p = db.insert({}, 'foobaz')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(false, 'Promise is resolved')
+  }).catch(function (error) {
+    assert.ok(true, 'Promise is rejected')
+    assert.equal(error.scope, 'couch', 'scope is couch')
+    assert.equal(error.error, 'conflict', 'type is conflict')
+    assert.end()
+  })
+})
 
-it('should be able to use custom params in insert', function(assert) {
+it('should be able to use custom params in insert', function (assert) {
   const p = db.insert({
     foo: 'baz',
     _rev: rev
   }, {
     docName: 'foobaz',
     'new_edits': false
-  });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(foo.ok, true, 'response should be ok');
-    assert.ok(foo.rev, 'response should have rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(foo.ok, true, 'response should be ok')
+    assert.ok(foo.rev, 'response should have rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to insert functions in docs', function(assert) {
+it('should be able to insert functions in docs', function (assert) {
   db.insert({
-    fn: function() { return true; },
+    fn: function () { return true },
     fn2: 'function () { return true; }'
-  }).then(function(fns) {
-
-    assert.equal(fns.ok, true, 'response should be ok');
-    assert.ok(fns.rev, 'response should have rev');
-    return db.get(fns.id);
-  }).then(function(fns) {
-    assert.equal(fns.fn, fns.fn2, 'fn matches fn2');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }).then(function (fns) {
+    assert.equal(fns.ok, true, 'response should be ok')
+    assert.ok(fns.rev, 'response should have rev')
+    return db.get(fns.id)
+  }).then(function (fns) {
+    assert.equal(fns.fn, fns.fn2, 'fn matches fn2')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/document/list.js b/tests/integration/document/list.js
index e47e158..db1687e 100644
--- a/tests/integration/document/list.js
+++ b/tests/integration/document/list.js
@@ -10,116 +10,116 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const nano = harness.locals.nano;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const nano = harness.locals.nano
+const it = harness.it
 
-it('should insert a bunch of items', helpers.insertThree);
+it('should insert a bunch of items', helpers.insertThree)
 
-it('should list the three documents', function(assert) {
-  const p = db.list();
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(docs['total_rows'], 3, 'with total three rows');
-    assert.ok(docs.rows, 'and the rows themselves');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should list the three documents', function (assert) {
+  const p = db.list()
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(docs['total_rows'], 3, 'with total three rows')
+    assert.ok(docs.rows, 'and the rows themselves')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to list using the `relax` function', function(assert) {
+it('should be able to list using the `relax` function', function (assert) {
   nano.relax({
     db: 'document_list',
     doc: '_all_docs',
     method: 'GET',
     qs: {limit: 1}
-  }, function(error, docs) {
-    assert.equal(error, null, 'not relaxed');
-    assert.ok(docs.rows, 'got meh rows');
-    assert.equal(docs.rows.length, 1, 'but its only one #sadpanda');
-    assert.equal(docs['total_rows'], 3, 'out of three');
-    assert.end();
-  });
-});
+  }, function (error, docs) {
+    assert.equal(error, null, 'not relaxed')
+    assert.ok(docs.rows, 'got meh rows')
+    assert.equal(docs.rows.length, 1, 'but its only one #sadpanda')
+    assert.equal(docs['total_rows'], 3, 'out of three')
+    assert.end()
+  })
+})
 
-it('should be able to list with a start_key', function(assert) {
-  const p = db.list({start_key: 'c'});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(docs.rows, 'get the rows');
-    assert.equal(docs.rows.length, 2, 'starts in row two');
-    assert.equal(docs['total_rows'], 3, 'out of three rows');
-    assert.equal(docs.offset, 1, 'offset is 1');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to list with a start_key', function (assert) {
+  const p = db.list({start_key: 'c'})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(docs.rows, 'get the rows')
+    assert.equal(docs.rows.length, 2, 'starts in row two')
+    assert.equal(docs['total_rows'], 3, 'out of three rows')
+    assert.equal(docs.offset, 1, 'offset is 1')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to list with a startkey', function(assert) {
-  const p = db.list({startkey: 'c'});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(docs.rows, 'get the rows');
-    assert.equal(docs.rows.length, 2, 'starts in row two');
-    assert.equal(docs['total_rows'], 3, 'out of three rows');
-    assert.equal(docs.offset, 1, 'offset is 1');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to list with a startkey', function (assert) {
+  const p = db.list({startkey: 'c'})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(docs.rows, 'get the rows')
+    assert.equal(docs.rows.length, 2, 'starts in row two')
+    assert.equal(docs['total_rows'], 3, 'out of three rows')
+    assert.equal(docs.offset, 1, 'offset is 1')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to list with a endkey', function(assert) {
-  const p = db.list({endkey: 's'});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(docs.rows, 'get the rows');
-    assert.equal(docs.rows.length, 2, 'starts in row two');
-    assert.equal(docs['total_rows'], 3, 'out of three rows');
-    assert.equal(docs.offset, 1, 'offset is 1');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to list with a endkey', function (assert) {
+  const p = db.list({endkey: 's'})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(docs.rows, 'get the rows')
+    assert.equal(docs.rows.length, 2, 'starts in row two')
+    assert.equal(docs['total_rows'], 3, 'out of three rows')
+    assert.equal(docs.offset, 1, 'offset is 1')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to list with a end_key', function(assert) {
-  const p = db.list({end_key: 's'});
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(docs) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(docs.rows, 'get the rows');
-    assert.equal(docs.rows.length, 2, 'starts in row two');
-    assert.equal(docs['total_rows'], 3, 'out of three rows');
-    assert.equal(docs.offset, 1, 'offset is 1');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should be able to list with a end_key', function (assert) {
+  const p = db.list({end_key: 's'})
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (docs) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(docs.rows, 'get the rows')
+    assert.equal(docs.rows.length, 2, 'starts in row two')
+    assert.equal(docs['total_rows'], 3, 'out of three rows')
+    assert.equal(docs.offset, 1, 'offset is 1')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to list as a stream', function(assert) {
-  const p = db.listAsStream(function(error) {
-    assert.equal(error, null, 'should work');
-  });
-  assert.ok(!helpers.isPromise(p), 'does not return Promise');
-  assert.equal(p.constructor.name, 'Request', 'returns a Request');
-});
+it('should be able to list as a stream', function (assert) {
+  const p = db.listAsStream(function (error) {
+    assert.equal(error, null, 'should work')
+  })
+  assert.ok(!helpers.isPromise(p), 'does not return Promise')
+  assert.equal(p.constructor.name, 'Request', 'returns a Request')
+})
 
-it('should be able to list with params as a stream', function(assert) {
-  const p = db.listAsStream({end_key: 's'}, function(error) {
-    assert.equal(error, null, 'should work');
-  });
-  assert.ok(!helpers.isPromise(p), 'does not return Promise');
-  assert.equal(p.constructor.name, 'Request', 'returns a Request');
-});
\ No newline at end of file
+it('should be able to list with params as a stream', function (assert) {
+  const p = db.listAsStream({end_key: 's'}, function (error) {
+    assert.equal(error, null, 'should work')
+  })
+  assert.ok(!helpers.isPromise(p), 'does not return Promise')
+  assert.equal(p.constructor.name, 'Request', 'returns a Request')
+})
diff --git a/tests/integration/document/update.js b/tests/integration/document/update.js
index 8374947..0a2510a 100644
--- a/tests/integration/document/update.js
+++ b/tests/integration/document/update.js
@@ -10,36 +10,36 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-let rev;
+let rev
 
-it('should insert one doc', function(assert) {
-  const p = db.insert({'foo': 'baz'}, 'foobar');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(foo.ok, true, 'response ok');
-    assert.ok(foo.rev, 'withs rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should insert one doc', function (assert) {
+  const p = db.insert({'foo': 'baz'}, 'foobar')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(foo.ok, true, 'response ok')
+    assert.ok(foo.rev, 'withs rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should update the document', function(assert) {
-  const p = db.insert({foo: 'bar', '_rev': rev}, 'foobar');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(response.ok, true, 'response should be ok');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+it('should update the document', function (assert) {
+  const p = db.insert({foo: 'bar', '_rev': rev}, 'foobar')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(response.ok, true, 'response should be ok')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/multipart/get.js b/tests/integration/multipart/get.js
index 7f280ce..c24142c 100644
--- a/tests/integration/multipart/get.js
+++ b/tests/integration/multipart/get.js
@@ -10,41 +10,39 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-let rev;
-
-it('should be able to insert a doc with att', function(assert) {
+it('should be able to insert a doc with att', function (assert) {
   const att = {
     name: 'att',
     data: 'Hello World!',
     'content_type': 'text/plain'
-  };
-  const p = db.multipart.insert({'foo': 'baz'}, [att], 'foobaz');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(foo.ok, true, 'response should be ok');
-    assert.equal(foo.id, 'foobaz', 'id is foobaz');
-    assert.ok(foo.rev, 'has rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }
+  const p = db.multipart.insert({'foo': 'baz'}, [att], 'foobaz')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(foo.ok, true, 'response should be ok')
+    assert.equal(foo.id, 'foobaz', 'id is foobaz')
+    assert.ok(foo.rev, 'has rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to get the document with the attachment', function(assert) {
-  db.multipart.get('foobaz', function(error, foobaz, headers) {
-    assert.equal(error, null, 'should get foobaz');
+it('should be able to get the document with the attachment', function (assert) {
+  db.multipart.get('foobaz', function (error, foobaz, headers) {
+    assert.equal(error, null, 'should get foobaz')
     if (helpers.unmocked) {
-      assert.ok(headers['content-type'], 'should have content type');
-      assert.equal(headers['content-type'].split(';')[0], 'multipart/related');
+      assert.ok(headers['content-type'], 'should have content type')
+      assert.equal(headers['content-type'].split(';')[0], 'multipart/related')
     }
-    assert.equal(typeof foobaz, 'object', 'foobaz should be a buffer');
-  });
-});
+    assert.equal(typeof foobaz, 'object', 'foobaz should be a buffer')
+  })
+})
diff --git a/tests/integration/multipart/insert.js b/tests/integration/multipart/insert.js
index cc303c9..0d7e87e 100644
--- a/tests/integration/multipart/insert.js
+++ b/tests/integration/multipart/insert.js
@@ -10,68 +10,68 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const db = harness.locals.db
+const it = harness.it
 
-it('should handle crazy encodings', function(assert) {
+it('should handle crazy encodings', function (assert) {
   const att = {
     name: 'att',
     data: 'काचं शक्नोम्यत्तुम् । नोपहिनस्ति माम् ॥',
     'content_type': 'text/plain'
-  };
-  const p = db.multipart.insert({'foo': 'bar'}, [att], 'foobar');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(foo.ok, true, 'response should be ok');
-    assert.ok(foo.rev, 'response should have rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }
+  const p = db.multipart.insert({'foo': 'bar'}, [att], 'foobar')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(foo.ok, true, 'response should be ok')
+    assert.ok(foo.rev, 'response should have rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should test with presence of attachment', function(assert) {
+it('should test with presence of attachment', function (assert) {
   const att = {
     name: 'two',
     data: 'Hello World!',
     'content_type': 'text/plain'
-  };
+  }
 
   db.attachment.insert('mydoc', 'one', 'Hello World!', 'text/plain',
-  function(err) {
-    assert.equal(err, null, 'should have stored the thingy');
-    db.get('mydoc', function(_, doc) {
-      db.multipart.insert(doc, [att], 'mydoc', function() {
-        db.get('mydoc', function(error, two) {
-          assert.equal(error, null, 'should get the doc');
-          assert.equal(Object.keys(two._attachments).length, 2,
-            'both attachments should be present');
-          assert.end();
-        });
-      });
-    });
-  });
-});
+    function (err) {
+      assert.equal(err, null, 'should have stored the thingy')
+      db.get('mydoc', function (_, doc) {
+        db.multipart.insert(doc, [att], 'mydoc', function () {
+          db.get('mydoc', function (error, two) {
+            assert.equal(error, null, 'should get the doc')
+            assert.equal(Object.keys(two._attachments).length, 2,
+              'both attachments should be present')
+            assert.end()
+          })
+        })
+      })
+    })
+})
 
-it('should work with attachment as a buffer', function(assert) {
+it('should work with attachment as a buffer', function (assert) {
   const att = {
     name: 'att',
-    data: new Buffer('foo'),
+    data: Buffer.from('foo'),
     'content_type': 'text/plain'
-  };
-  const p = db.multipart.insert({'foo': 'bar'}, [att], 'otherdoc');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(foo) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(foo.ok, true, 'response should be ok');
-    assert.ok(foo.rev, 'response should have rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }
+  const p = db.multipart.insert({'foo': 'bar'}, [att], 'otherdoc')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (foo) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(foo.ok, true, 'response should be ok')
+    assert.ok(foo.rev, 'response should have rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
diff --git a/tests/integration/shared/config.js b/tests/integration/shared/config.js
index 542e8cd..1fe981c 100644
--- a/tests/integration/shared/config.js
+++ b/tests/integration/shared/config.js
@@ -10,76 +10,76 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
-
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const nano = harness.locals.nano;
-const Nano = helpers.Nano;
-
-const it = harness.it;
-
-it('should serve the root when no path is specified', function(assert) {
-  const p = nano.dinosaur('').then(function(response) {
-    assert.ok(response.version, 'version is defined');
-    return nano.relax();
-  }).then(function(response) {
-    assert.ok(response.version, 'had version');
-  });
-});
-
-it('should be able to parse urls', function(assert) {
-  const baseUrl = 'http://someurl.com';
+'use strict'
+
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const nano = harness.locals.nano
+const Nano = helpers.Nano
+
+const it = harness.it
+
+it('should serve the root when no path is specified', function (assert) {
+  nano.dinosaur('').then(function (response) {
+    assert.ok(response.version, 'version is defined')
+    return nano.relax()
+  }).then(function (response) {
+    assert.ok(response.version, 'had version')
+  })
+})
+
+it('should be able to parse urls', function (assert) {
+  const baseUrl = 'http://someurl.com'
   assert.equal(
     Nano(baseUrl).config.url,
     baseUrl,
-    'simple url');
+    'simple url')
 
   assert.equal(
     Nano(baseUrl + '/').config.url,
     baseUrl + '/',
-    'simple with trailing');
+    'simple with trailing')
 
   assert.equal(
     Nano('http://a:b@someurl.com:5984').config.url,
     'http://a:b@someurl.com:5984',
-    'with authentication');
+    'with authentication')
 
   assert.equal(
     Nano('http://a:b%20c%3F@someurl.com:5984/mydb').config.url,
     'http://a:b%20c%3F@someurl.com:5984',
-    'with escaped auth');
+    'with escaped auth')
 
   assert.equal(
     Nano('http://a:b%20c%3F@someurl.com:5984/my%2Fdb').config.url,
     'http://a:b%20c%3F@someurl.com:5984',
-    'with dbname containing encoded slash');
+    'with dbname containing encoded slash')
 
   assert.equal(
     Nano('http://mydb-a:b%20c%3F@someurl.com:5984/mydb').config.url,
     'http://mydb-a:b%20c%3F@someurl.com:5984',
-    'with repeating dbname');
+    'with repeating dbname')
 
   assert.equal(
     Nano('http://a:b%20c%3F@someurl.com:5984/prefix/mydb').config.url,
     'http://a:b%20c%3F@someurl.com:5984/prefix',
-    'with subdir');
+    'with subdir')
 
   assert.equal(
     Nano(baseUrl + ':5984/a').config.url,
     baseUrl + ':5984',
-    'with port');
+    'with port')
 
   assert.equal(
     Nano(baseUrl + '/a').config.url,
     baseUrl,
-    '`a` database');
+    '`a` database')
 
-  assert.end();
-});
+  assert.end()
+})
 
-it('should not parse urls when parseURL flag set to false', function(assert) {
-  const url = 'http://someurl.com/path';
+it('should not parse urls when parseURL flag set to false', function (assert) {
+  const url = 'http://someurl.com/path'
 
   assert.equal(
     Nano({
@@ -87,51 +87,51 @@ it('should not parse urls when parseURL flag set to false', function(assert) {
       parseUrl: false
     }).config.url,
     url,
-    'the untouched url');
+    'the untouched url')
 
-  assert.end();
-});
+  assert.end()
+})
 
-it('should accept and handle customer http headers', function(assert) {
+it('should accept and handle customer http headers', function (assert) {
   const nanoWithDefaultHeaders = Nano({
     url: helpers.couch,
     defaultHeaders: {
       'x-custom-header': 'custom',
       'x-second-header': 'second'
     }
-  });
+  })
 
-  const req = nanoWithDefaultHeaders.db.listAsStream(function(err) {
-    assert.equal(err, null, 'should list');
-    assert.end();
-  });
+  const req = nanoWithDefaultHeaders.db.listAsStream(function (err) {
+    assert.equal(err, null, 'should list')
+    assert.end()
+  })
 
   assert.equal(
     req.headers['x-custom-header'],
     'custom',
-    'header `x-second-header` honored');
+    'header `x-second-header` honored')
 
   assert.equal(
     req.headers['x-second-header'],
     'second',
-    'headers `x-second-header` honored');
-});
+    'headers `x-second-header` honored')
+})
 
-it('should prevent shallow object copies', function(assert) {
+it('should prevent shallow object copies', function (assert) {
   const config = {
     url: 'http://someurl.com'
-  };
+  }
 
   assert.equal(
     Nano(config).config.url,
     config.url,
-    'simple url');
+    'simple url')
 
   assert.ok(
     Nano(config).config.requestDefaults,
-    '`requestDefaults` should be set');
+    '`requestDefaults` should be set')
   assert.ok(!config.requestDefaults,
-    'should not be re-using the same object');
+    'should not be re-using the same object')
 
-  assert.end();
-});
+  assert.end()
+})
diff --git a/tests/integration/shared/cookie.js b/tests/integration/shared/cookie.js
index 6727a3d..a13c05b 100644
--- a/tests/integration/shared/cookie.js
+++ b/tests/integration/shared/cookie.js
@@ -10,20 +10,16 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const nano = harness.locals.nano;
-const Nano = helpers.Nano;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const nano = harness.locals.nano
+const it = harness.it
 
-let cookie;
-let server;
-
-it('should be able to create a user', function(assert) {
+it('should be able to create a user', function (assert) {
   nano.relax({
-    method : 'POST',
+    method: 'POST',
     path: '_users',
     body: {
       _id: 'org.couchdb.user:' + helpers.username,
@@ -32,33 +28,32 @@ it('should be able to create a user', function(assert) {
       roles: ['admin'],
       password: helpers.password
     }
-  }).then(function() {
+  }).then(function () {
     return nano.auth(helpers.username, helpers.password)
-  }).then(function(data) {
-    assert.ok(data.ok);
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
+  }).then(function (data) {
+    assert.ok(data.ok)
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
-it('should be able to insert with a cookie', function(assert) {
-  const db = nano.db.use('shared_cookie');
+it('should be able to insert with a cookie', function (assert) {
+  const db = nano.db.use('shared_cookie')
   const p = db.insert({'foo': 'baz'})
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(response) {
-    assert.equal(response.ok, true, 'response should be ok');
-    assert.ok(response.rev, 'response should have rev');
-    assert.end();
-  }).catch(function() {
-    assert.ok(false, 'Promise is rejected');
-  });
-});
-
-it('should be able to get the session', function(assert) {
-  nano.session().then(function(session) {
-    assert.equal(session.userCtx.name, helpers.username);
-    assert.end();
-  });
-});
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (response) {
+    assert.equal(response.ok, true, 'response should be ok')
+    assert.ok(response.rev, 'response should have rev')
+    assert.end()
+  }).catch(function () {
+    assert.ok(false, 'Promise is rejected')
+  })
+})
 
+it('should be able to get the session', function (assert) {
+  nano.session().then(function (session) {
+    assert.equal(session.userCtx.name, helpers.username)
+    assert.end()
+  })
+})
diff --git a/tests/integration/shared/error.js b/tests/integration/shared/error.js
index b813de4..9207ba2 100644
--- a/tests/integration/shared/error.js
+++ b/tests/integration/shared/error.js
@@ -10,46 +10,46 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const nano = harness.locals.nano;
-const Nano = helpers.Nano;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const nano = harness.locals.nano
+const Nano = helpers.Nano
+const it = harness.it
 
-it('should throw when initialize fails', function(assert) {
+it('should throw when initialize fails', function (assert) {
   try {
-    Nano('Not a url');
+    Nano('Not a url')
   } catch (err) {
-    assert.ok(err, 'should have throw');
-    assert.ok(err.message, 'with a description');
+    assert.ok(err, 'should have throw')
+    assert.ok(err.message, 'with a description')
   }
   try {
-    Nano({});
+    Nano({})
   } catch (err2) {
-    assert.ok(err2, 'should have throw');
-    assert.ok(err2.message, 'with a message');
+    assert.ok(err2, 'should have throw')
+    assert.ok(err2.message, 'with a message')
   }
-  assert.end();
-});
+  assert.end()
+})
 
-it('should be able to stream the simplest request', function(assert) {
-  const root = nano.request({stream: true});
-  root.on('end', function() {
-    assert.pass('request worked');
-    assert.end();
-  });
-});
+it('should be able to stream the simplest request', function (assert) {
+  const root = nano.request({stream: true})
+  root.on('end', function () {
+    assert.pass('request worked')
+    assert.end()
+  })
+})
 
-it('should error when destroying a db that does not exist', function(assert) {
-  const p = nano.db.destroy('say_wat_wat');
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function() {
-    assert.ok(false, 'Promise is resolved');
-  }).catch(function(error) {
-    assert.ok(true, 'Promise is rejected');
-    assert.equal(error.message, 'Database does not exist.', 'is missing');
-    assert.end();
-  });
-});
+it('should error when destroying a db that does not exist', function (assert) {
+  const p = nano.db.destroy('say_wat_wat')
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function () {
+    assert.ok(false, 'Promise is resolved')
+  }).catch(function (error) {
+    assert.ok(true, 'Promise is rejected')
+    assert.equal(error.message, 'Database does not exist.', 'is missing')
+    assert.end()
+  })
+})
diff --git a/tests/integration/shared/headers.js b/tests/integration/shared/headers.js
index 1a9880c..ba4daf6 100644
--- a/tests/integration/shared/headers.js
+++ b/tests/integration/shared/headers.js
@@ -10,36 +10,36 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const nano = harness.locals.nano;
-const db = harness.locals.db;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const nano = harness.locals.nano
+const db = harness.locals.db
+const it = harness.it
 
-it('should get headers', function(assert) {
+it('should get headers', function (assert) {
   db.attachment.insert('new', 'att', 'Hello', 'text/plain',
-  function(error, hello) {
-    assert.equal(error, null, 'should store hello');
-    assert.equal(hello.ok, true, 'response should be ok');
-    assert.ok(hello.rev, 'should have a revision number');
-    nano.request({
-      db: 'shared_headers',
-      doc: 'new',
-      headers: {'If-None-Match': JSON.stringify(hello.rev)}
-    }, function(error, helloWorld, rh) {
-      assert.equal(error, null, 'should get the hello');
-      assert.equal(rh['statusCode'], 304, 'status is not modified');
+    function (error, hello) {
+      assert.equal(error, null, 'should store hello')
+      assert.equal(hello.ok, true, 'response should be ok')
+      assert.ok(hello.rev, 'should have a revision number')
       nano.request({
         db: 'shared_headers',
         doc: 'new',
-        att: 'att'
-      }, function(error, helloWorld, rh) {
-        assert.equal(error, null, 'should get the hello');
-        assert.equal(rh['statusCode'], 200, 'status is `ok`');
-        assert.end();
-      });
-    });
-  });
-});
+        headers: {'If-None-Match': JSON.stringify(hello.rev)}
+      }, function (error, helloWorld, rh) {
+        assert.equal(error, null, 'should get the hello')
+        assert.equal(rh['statusCode'], 304, 'status is not modified')
+        nano.request({
+          db: 'shared_headers',
+          doc: 'new',
+          att: 'att'
+        }, function (error, helloWorld, rh) {
+          assert.equal(error, null, 'should get the hello')
+          assert.equal(rh['statusCode'], 200, 'status is `ok`')
+          assert.end()
+        })
+      })
+    })
+})
diff --git a/tests/integration/shared/log.js b/tests/integration/shared/log.js
index f1d07f7..4f89df6 100644
--- a/tests/integration/shared/log.js
+++ b/tests/integration/shared/log.js
@@ -10,20 +10,20 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const logger = require('../../../lib/logger');
-const helpers = require('../../helpers');
-const harness = helpers.harness(__filename);
-const it = harness.it;
+const logger = require('../../../lib/logger')
+const helpers = require('../../helpers')
+const harness = helpers.harness(__filename)
+const it = harness.it
 
-it('should be able to instantiate a log', function(assert) {
+it('should be able to instantiate a log', function (assert) {
   const log = logger({
-    log: function(id, msg) {
-      assert.equal(typeof id, 'string', 'id is set `' + id + '`');
-      assert.equal(msg[0], 'testing 1234');
-      assert.end();
+    log: function (id, msg) {
+      assert.equal(typeof id, 'string', 'id is set `' + id + '`')
+      assert.equal(msg[0], 'testing 1234')
+      assert.end()
     }
-  })();
-  log('testing 1234');
-});
+  })()
+  log('testing 1234')
+})
diff --git a/tests/integration/util/uuid.js b/tests/integration/util/uuid.js
index c575dfe..0761b51 100644
--- a/tests/integration/util/uuid.js
+++ b/tests/integration/util/uuid.js
@@ -10,37 +10,37 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const nano = helpers.nano;
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const nano = helpers.nano
+const it = harness.it
 
-it('should generate three uuids', function(assert) {
-  const p = nano.uuids(3);
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(data, 'got response');
-    assert.ok(data.uuids, 'got uuids');
-    assert.equal(data.uuids.length, 3, 'got 3');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
+it('should generate three uuids', function (assert) {
+  const p = nano.uuids(3)
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(data, 'got response')
+    assert.ok(data.uuids, 'got uuids')
+    assert.equal(data.uuids.length, 3, 'got 3')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
 
-it('should generate one uuid', function(assert) {
-  const p = nano.uuids();
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.ok(data, 'got response');
-    assert.ok(data.uuids, 'got uuid');
-    assert.equal(data.uuids.length, 1, 'got 1');    
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
+it('should generate one uuid', function (assert) {
+  const p = nano.uuids()
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.ok(data, 'got response')
+    assert.ok(data.uuids, 'got uuid')
+    assert.equal(data.uuids.length, 1, 'got 1')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
diff --git a/tests/intercept/design/search.js b/tests/intercept/design/search.js
index d59e0b2..3c8d1e8 100644
--- a/tests/intercept/design/search.js
+++ b/tests/intercept/design/search.js
@@ -10,220 +10,220 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/integration');
-const harness = helpers.harness(__filename);
-const it = harness.it;
+const helpers = require('../../helpers/integration')
+const harness = helpers.harness(__filename)
+const it = harness.it
 
-const nano = require('../../../lib/nano.js');
-const fakeRequest = function(r, callback) {
-  callback(null, { statusCode: 200 }, r);
-};
+const nano = require('../../../lib/nano.js')
+const fakeRequest = function (r, callback) {
+  callback(null, { statusCode: 200 }, r)
+}
 // by passing in a fake Request object, we can intercept the request
 // and see how Nano is pre-processing the parameters
-const n = nano({url: 'http://localhost:5984', request: fakeRequest});
-const db = n.db.use('fake');
-
-it('should allow custom request object to be supplied', function(assert) {
-  const p = db.info();
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should encode array counts parameter', function(assert) {
-  const p = db.search('fake', 'fake', { counts: ['brand','colour'] });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should not encode string counts parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { counts: JSON.stringify(['brand','colour']) });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should encode array drilldown parameter', function(assert) {
-  const p = db.search('fake', 'fake', { drilldown: ['colour','red'] });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should not encode string drilldown parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { drilldown: JSON.stringify(['colour','red']) });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should encode array group_sort parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { group_sort: ['-foo<number>','bar<string>'] });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should not encode string group_sort parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { group_sort: JSON.stringify(['-foo<number>','bar<string>']) });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should encode object ranges parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { ranges: {'price':'[0 TO 10]'} });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should not encode string ranges parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { ranges: JSON.stringify({'price':'[0 TO 10]'}) });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should encode array sort parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { sort: ['-foo<number>','bar<string>'] });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should not encode string sort parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { sort: JSON.stringify(['-foo<number>','bar<string>']) });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should encode unencoded sort parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { sort: '-foo<number>' });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should not encode encoded string sort parameter', function(assert) {
-  const p = db.search('fake', 'fake', 
-                    { sort: JSON.stringify('-foo<number>') });
-  assert.ok(helpers.isPromise(p), 'returns Promise');
-  p.then(function(data) {
-    assert.ok(true, 'Promise is resolved');
-    assert.equal(data.method, 'GET');
-    assert.equal(typeof data.headers, 'object');
-    assert.equal(typeof data.qs, 'object');
-    assert.end();
-  }).catch(function() {
-    assert.ok(true, 'Promise is rejected');
-  });
-});
-
-it('should allow search results to be streamed', function(assert) {
-  db.searchAsStream('fake', 'fake', 
-                    { q: 'foo:bar' }, 
-                    function(err, data) {
-      assert.equal(err, null);
-      assert.equal(data.method, 'GET');
-      assert.equal(typeof data.headers, 'object');
-      assert.equal(typeof data.qs, 'object');
-      assert.equal(data.qs.q, 'foo:bar');
-      assert.end();
-  });
-});
+const n = nano({url: 'http://localhost:5984', request: fakeRequest})
+const db = n.db.use('fake')
+
+it('should allow custom request object to be supplied', function (assert) {
+  const p = db.info()
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should encode array counts parameter', function (assert) {
+  const p = db.search('fake', 'fake', { counts: ['brand', 'colour'] })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should not encode string counts parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { counts: JSON.stringify(['brand', 'colour']) })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should encode array drilldown parameter', function (assert) {
+  const p = db.search('fake', 'fake', { drilldown: ['colour', 'red'] })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should not encode string drilldown parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { drilldown: JSON.stringify(['colour', 'red']) })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should encode array group_sort parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { group_sort: ['-foo<number>', 'bar<string>'] })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should not encode string group_sort parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { group_sort: JSON.stringify(['-foo<number>', 'bar<string>']) })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should encode object ranges parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { ranges: {'price': '[0 TO 10]'} })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should not encode string ranges parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { ranges: JSON.stringify({'price': '[0 TO 10]'}) })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should encode array sort parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { sort: ['-foo<number>', 'bar<string>'] })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should not encode string sort parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { sort: JSON.stringify(['-foo<number>', 'bar<string>']) })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should encode unencoded sort parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { sort: '-foo<number>' })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should not encode encoded string sort parameter', function (assert) {
+  const p = db.search('fake', 'fake',
+    { sort: JSON.stringify('-foo<number>') })
+  assert.ok(helpers.isPromise(p), 'returns Promise')
+  p.then(function (data) {
+    assert.ok(true, 'Promise is resolved')
+    assert.equal(data.method, 'GET')
+    assert.equal(typeof data.headers, 'object')
+    assert.equal(typeof data.qs, 'object')
+    assert.end()
+  }).catch(function () {
+    assert.ok(true, 'Promise is rejected')
+  })
+})
+
+it('should allow search results to be streamed', function (assert) {
+  db.searchAsStream('fake', 'fake',
+    { q: 'foo:bar' },
+    function (err, data) {
+      assert.equal(err, null)
+      assert.equal(data.method, 'GET')
+      assert.equal(typeof data.headers, 'object')
+      assert.equal(typeof data.qs, 'object')
+      assert.equal(data.qs.q, 'foo:bar')
+      assert.end()
+    })
+})
diff --git a/tests/unit/attachment/destroy.js b/tests/unit/attachment/destroy.js
index 084950f..43f8535 100644
--- a/tests/unit/attachment/destroy.js
+++ b/tests/unit/attachment/destroy.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const destroyAttachment = require('../../helpers/unit').unit([
   'attachment',
   'destroy'
-]);
+])
 
 destroyAttachment('airplane-design', 'wings.pdf', {rev: '3'}, {
   headers: {
@@ -25,4 +25,4 @@ destroyAttachment('airplane-design', 'wings.pdf', {rev: '3'}, {
   method: 'DELETE',
   qs: {rev: '3'},
   uri: '/mock/airplane-design/wings.pdf'
-});
+})
diff --git a/tests/unit/attachment/get.js b/tests/unit/attachment/get.js
index 1972363..52eb997 100644
--- a/tests/unit/attachment/get.js
+++ b/tests/unit/attachment/get.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const getAttachment = require('../../helpers/unit').unit([
   'attachment',
   'get'
-]);
+])
 
 getAttachment('airplane-design', 'wings.pdf', {rev: 'rev-3'}, {
   encoding: null,
@@ -23,11 +23,11 @@ getAttachment('airplane-design', 'wings.pdf', {rev: 'rev-3'}, {
   method: 'GET',
   qs: {rev: 'rev-3'},
   uri: '/mock/airplane-design/wings.pdf'
-});
+})
 
 getAttachment('airplane-design', 'wings.pdf', {
   encoding: null,
   headers: {},
   method: 'GET',
   uri: '/mock/airplane-design/wings.pdf'
-});
+})
diff --git a/tests/unit/attachment/insert.js b/tests/unit/attachment/insert.js
index 0ed455f..88f26cc 100644
--- a/tests/unit/attachment/insert.js
+++ b/tests/unit/attachment/insert.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
-const helpers = require('../../helpers/unit');
-const insertAttachment = helpers.unit(['attachment', 'insert']);
+const helpers = require('../../helpers/unit')
+const insertAttachment = helpers.unit(['attachment', 'insert'])
 
-const buffer = new Buffer(helpers.pixel, 'base64');
+const buffer = Buffer.from(helpers.pixel, 'base64')
 
 insertAttachment('pixels', 'pixel.bmp', buffer, 'image/bmp', {
   body: buffer,
@@ -24,7 +24,7 @@ insertAttachment('pixels', 'pixel.bmp', buffer, 'image/bmp', {
   },
   method: 'PUT',
   uri: '/mock/pixels/pixel.bmp'
-});
+})
 
 insertAttachment('pixels', 'meta.txt', 'brown', 'text/plain', {
   body: 'brown',
@@ -33,7 +33,7 @@ insertAttachment('pixels', 'meta.txt', 'brown', 'text/plain', {
   },
   method: 'PUT',
   uri: '/mock/pixels/meta.txt'
-});
+})
 
 insertAttachment('pixels', 'meta.txt', 'white', 'text/plain', {rev: '2'}, {
   body: 'white',
@@ -43,4 +43,4 @@ insertAttachment('pixels', 'meta.txt', 'white', 'text/plain', {rev: '2'}, {
   method: 'PUT',
   uri: '/mock/pixels/meta.txt',
   qs: {rev: '2'}
-});
+})
diff --git a/tests/unit/database/changes.js b/tests/unit/database/changes.js
index 8b017eb..7cbed00 100644
--- a/tests/unit/database/changes.js
+++ b/tests/unit/database/changes.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const changesDatabase = require('../../helpers/unit').unit([
   'database',
   'changes'
-]);
+])
 
 changesDatabase('mock', {since: '10'}, {
   headers: {
@@ -25,7 +25,7 @@ changesDatabase('mock', {since: '10'}, {
   method: 'GET',
   qs: {since: '10'},
   uri: '/mock/_changes'
-});
+})
 
 changesDatabase('mock', {
   headers: {
@@ -34,4 +34,4 @@ changesDatabase('mock', {
   },
   method: 'GET',
   uri: '/mock/_changes'
-});
+})
diff --git a/tests/unit/database/compact.js b/tests/unit/database/compact.js
index 0f36ba8..20f2b1b 100644
--- a/tests/unit/database/compact.js
+++ b/tests/unit/database/compact.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const compactDatabase = require('../../helpers/unit').unit([
   'database',
   'compact'
-]);
+])
 
 compactDatabase('mock', {
   headers: {
@@ -24,4 +24,4 @@ compactDatabase('mock', {
   },
   method: 'POST',
   uri: '/mock/_compact'
-});
+})
diff --git a/tests/unit/database/create.js b/tests/unit/database/create.js
index 674f702..ff0d1f7 100644
--- a/tests/unit/database/create.js
+++ b/tests/unit/database/create.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const createDatabase = require('../../helpers/unit').unit([
   'database',
   'create'
-]);
+])
 
 createDatabase('mock', {
   headers: {
@@ -24,7 +24,7 @@ createDatabase('mock', {
   },
   method: 'PUT',
   uri: '/mock'
-});
+})
 
 createDatabase('az09_$()+-/', {
   headers: {
@@ -33,4 +33,4 @@ createDatabase('az09_$()+-/', {
   },
   method: 'PUT',
   uri: '/az09_%24()%2B-%2F'
-});
+})
diff --git a/tests/unit/database/destroy.js b/tests/unit/database/destroy.js
index 6378d8b..af36d02 100644
--- a/tests/unit/database/destroy.js
+++ b/tests/unit/database/destroy.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const destroyDatabase = require('../../helpers/unit').unit([
   'database',
   'destroy'
-]);
+])
 
 destroyDatabase('mock', {
   headers: {
@@ -24,4 +24,4 @@ destroyDatabase('mock', {
   },
   method: 'DELETE',
   uri: '/mock'
-});
+})
diff --git a/tests/unit/database/follow.js b/tests/unit/database/follow.js
index 92d5cb1..48fd74e 100644
--- a/tests/unit/database/follow.js
+++ b/tests/unit/database/follow.js
@@ -10,11 +10,11 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const followDatabase = require('../../helpers/unit').unit([
   'database',
   'follow'
-]);
+])
 
-followDatabase('space', {db: '/space'});
+followDatabase('space', {db: '/space'})
diff --git a/tests/unit/database/get.js b/tests/unit/database/get.js
index 3cbae19..e478772 100644
--- a/tests/unit/database/get.js
+++ b/tests/unit/database/get.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const getDatabase = require('../../helpers/unit').unit([
   'database',
   'get'
-]);
+])
 
 getDatabase('space', {
   headers: {
@@ -24,4 +24,4 @@ getDatabase('space', {
   },
   method: 'GET',
   uri: '/space'
-});
+})
diff --git a/tests/unit/database/list.js b/tests/unit/database/list.js
index 2d4e928..b5bf435 100644
--- a/tests/unit/database/list.js
+++ b/tests/unit/database/list.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const listDatabases = require('../../helpers/unit').unit([
   'database',
   'list'
-]);
+])
 
 listDatabases({
   headers: {
@@ -24,4 +24,4 @@ listDatabases({
   },
   method: 'GET',
   uri: '/_all_dbs'
-});
+})
diff --git a/tests/unit/database/replicate.js b/tests/unit/database/replicate.js
index a55c08d..6ad47a1 100644
--- a/tests/unit/database/replicate.js
+++ b/tests/unit/database/replicate.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const replicateDatabase = require('../../helpers/unit').unit([
   'database',
   'replicate'
-]);
+])
 
 replicateDatabase('baa', 'baashep', {
   body: '{"source":"baa","target":"baashep"}',
@@ -25,7 +25,7 @@ replicateDatabase('baa', 'baashep', {
   },
   method: 'POST',
   uri: '/_replicate'
-});
+})
 
 replicateDatabase('molly', 'anne', {some: 'params'}, {
   body: '{"some":"params","source":"molly","target":"anne"}',
@@ -35,4 +35,4 @@ replicateDatabase('molly', 'anne', {some: 'params'}, {
   },
   method: 'POST',
   uri: '/_replicate'
-});
+})
diff --git a/tests/unit/database/replicator.js b/tests/unit/database/replicator.js
index 126df42..3c1da62 100644
--- a/tests/unit/database/replicator.js
+++ b/tests/unit/database/replicator.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const replicator = require('../../helpers/unit').unit([
   'database',
   'replicator'
-]);
+])
 
 replicator('baa', 'baashep', {
   body: '{"source":"baa","target":"baashep"}',
@@ -25,7 +25,7 @@ replicator('baa', 'baashep', {
   },
   method: 'POST',
   uri: '/_replicator'
-});
+})
 
 replicator('molly', 'anne', {some: 'params'}, {
   body: '{"some":"params","source":"molly","target":"anne"}',
@@ -35,4 +35,4 @@ replicator('molly', 'anne', {some: 'params'}, {
   },
   method: 'POST',
   uri: '/_replicator'
-});
+})
diff --git a/tests/unit/database/updates.js b/tests/unit/database/updates.js
index 6690018..43eb5d8 100644
--- a/tests/unit/database/updates.js
+++ b/tests/unit/database/updates.js
@@ -10,12 +10,12 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
+'use strict'
 
 const updatesDatabase = require('../../helpers/unit').unit([
   'database',
   'updates'
-]);
+])
 
 updatesDatabase({
   headers: {
@@ -24,7 +24,7 @@ updatesDatabase({
   },
   method: 'GET',
   uri: '/_db_updates'
-});
+})
 
 updatesDatabase({since: 1}, {
   headers: {
@@ -34,4 +34,4 @@ updatesDatabase({since: 1}, {
   method: 'GET',
   qs: {since: 1},
   uri: '/_db_updates'
-});
+})
diff --git a/tests/unit/design/atomic.js b/tests/unit/design/atomic.js
index a52d98e..1c926cc 100644
--- a/tests/unit/design/atomic.js
+++ b/tests/unit/design/atomic.js
@@ -10,17 +10,17 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
-'use strict';
... 569 lines suppressed ...