diff --git a/NodeAPI/index.js b/NodeAPI/index.js
index 9e489aac6301782c79ef3fef53d416ba1d1c1cba..d821d539c846fc8073b11e70c16c0df0fef0728d 100644
--- a/NodeAPI/index.js
+++ b/NodeAPI/index.js
@@ -5,6 +5,10 @@ const request = require('request');
 const app = express()
 const port = 80;
 
+// Get the mongodb url
+var MongoClient = require('mongodb').MongoClient;
+var url = "mongodb+srv://dbuser:nlp2021@clusternlp.5iof9.mongodb.net/myFirstDatabase?retryWrites=true&w=majority";
+
 app.set('view engine', 'ejs')
 
 app.use(express.static('public'));
@@ -28,9 +32,31 @@ app.post('/predict', (req,res) => {
         console.error('error:', error); // Print the error
         console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
         console.log('body:', body); // Print the data received
+        console.log(JSON.parse(body))
         console.log(JSON.parse(body).predictionText)
         // res.send(JSON.parse(JSON.parse(body).prediction)); //Display the response on the website
+
+        // Connect to the db
+        MongoClient.connect(url, function(err, db) {
+          if(err) { return console.dir(err); }
+
+          // Create collection if does not exist
+          var collection = db.db('ClusterNLP').collection('Pred_Records');
+
+          // Get the data to be stored
+          var plot = req.body.plot;
+          var prediction = JSON.parse(body).predictionText;
+
+          // Get rcord to be inserted
+          var rec = {'Plot':plot, 'Prediction': prediction};
+          
+          // Insert the record to the collection, throw error if insert unsuccessful
+          collection.insert(rec, {w:1}, function(err, result) {});
+        });
+
         res.render('predictions',{predictions:JSON.parse(JSON.parse(body).predictionText)})
+
+        
       });      
 })
 
diff --git a/NodeAPI/node_modules/.package-lock.json b/NodeAPI/node_modules/.package-lock.json
index 88206658c3cbffbee66ba6e500716915af4d1ce2..998044e5fcec98047483d15b7b1288f1c34cf07d 100644
--- a/NodeAPI/node_modules/.package-lock.json
+++ b/NodeAPI/node_modules/.package-lock.json
@@ -156,6 +156,15 @@
         "tweetnacl": "^0.14.3"
       }
     },
+    "node_modules/bl": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz",
+      "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==",
+      "dependencies": {
+        "readable-stream": "^2.3.5",
+        "safe-buffer": "^5.1.1"
+      }
+    },
     "node_modules/body-parser": {
       "version": "1.19.0",
       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@@ -185,6 +194,14 @@
         "concat-map": "0.0.1"
       }
     },
+    "node_modules/bson": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz",
+      "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==",
+      "engines": {
+        "node": ">=0.6.19"
+      }
+    },
     "node_modules/bytes": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
@@ -333,6 +350,14 @@
         "node": ">=0.4.0"
       }
     },
+    "node_modules/denque": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz",
+      "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==",
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
     "node_modules/depd": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@@ -708,6 +733,11 @@
       "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
       "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
     },
+    "node_modules/isarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+    },
     "node_modules/isstream": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
@@ -786,6 +816,12 @@
         "node": ">= 0.6"
       }
     },
+    "node_modules/memory-pager": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
+      "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
+      "optional": true
+    },
     "node_modules/merge-descriptors": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -840,6 +876,44 @@
         "node": "*"
       }
     },
+    "node_modules/mongodb": {
+      "version": "3.6.8",
+      "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz",
+      "integrity": "sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==",
+      "dependencies": {
+        "bl": "^2.2.1",
+        "bson": "^1.1.4",
+        "denque": "^1.4.1",
+        "optional-require": "^1.0.3",
+        "safe-buffer": "^5.1.2"
+      },
+      "engines": {
+        "node": ">=4"
+      },
+      "optionalDependencies": {
+        "saslprep": "^1.0.0"
+      },
+      "peerDependenciesMeta": {
+        "aws4": {
+          "optional": true
+        },
+        "bson-ext": {
+          "optional": true
+        },
+        "kerberos": {
+          "optional": true
+        },
+        "mongodb-client-encryption": {
+          "optional": true
+        },
+        "mongodb-extjson": {
+          "optional": true
+        },
+        "snappy": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/ms": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -880,6 +954,14 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/optional-require": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz",
+      "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==",
+      "engines": {
+        "node": ">=4"
+      }
+    },
     "node_modules/parseurl": {
       "version": "1.3.3",
       "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -903,6 +985,11 @@
       "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
       "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
     },
+    "node_modules/process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+    },
     "node_modules/promise": {
       "version": "7.3.1",
       "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
@@ -1078,6 +1165,20 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/readable-stream": {
+      "version": "2.3.7",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+      "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+      "dependencies": {
+        "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"
+      }
+    },
     "node_modules/request": {
       "version": "2.88.2",
       "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
@@ -1139,6 +1240,18 @@
       "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
       "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
     },
+    "node_modules/saslprep": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
+      "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
+      "optional": true,
+      "dependencies": {
+        "sparse-bitfield": "^3.0.3"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/send": {
       "version": "0.17.1",
       "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
@@ -1186,6 +1299,15 @@
       "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
       "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
     },
+    "node_modules/sparse-bitfield": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
+      "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
+      "optional": true,
+      "dependencies": {
+        "memory-pager": "^1.0.2"
+      }
+    },
     "node_modules/sshpk": {
       "version": "1.16.1",
       "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@@ -1218,6 +1340,14 @@
         "node": ">= 0.6"
       }
     },
+    "node_modules/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==",
+      "dependencies": {
+        "safe-buffer": "~5.1.0"
+      }
+    },
     "node_modules/supports-color": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@@ -1306,6 +1436,11 @@
         "punycode": "^2.1.0"
       }
     },
+    "node_modules/util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+    },
     "node_modules/utils-merge": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
diff --git a/NodeAPI/node_modules/bl/.jshintrc b/NodeAPI/node_modules/bl/.jshintrc
new file mode 100644
index 0000000000000000000000000000000000000000..be119b292bf04ac49975469e24df5fdafb85cc47
--- /dev/null
+++ b/NodeAPI/node_modules/bl/.jshintrc
@@ -0,0 +1,60 @@
+{
+    "predef": [ ]
+  , "bitwise": false
+  , "camelcase": false
+  , "curly": false
+  , "eqeqeq": false
+  , "forin": false
+  , "immed": false
+  , "latedef": false
+  , "noarg": true
+  , "noempty": true
+  , "nonew": true
+  , "plusplus": false
+  , "quotmark": true
+  , "regexp": false
+  , "undef": true
+  , "unused": true
+  , "strict": false
+  , "trailing": true
+  , "maxlen": 120
+  , "asi": true
+  , "boss": true
+  , "debug": true
+  , "eqnull": true
+  , "esnext": false
+  , "evil": true
+  , "expr": true
+  , "funcscope": false
+  , "globalstrict": false
+  , "iterator": false
+  , "lastsemic": true
+  , "laxbreak": true
+  , "laxcomma": true
+  , "loopfunc": true
+  , "multistr": false
+  , "onecase": false
+  , "proto": false
+  , "regexdash": false
+  , "scripturl": true
+  , "smarttabs": false
+  , "shadow": false
+  , "sub": true
+  , "supernew": false
+  , "validthis": true
+  , "browser": true
+  , "couch": false
+  , "devel": false
+  , "dojo": false
+  , "mootools": false
+  , "node": true
+  , "nonstandard": true
+  , "prototypejs": false
+  , "rhino": false
+  , "worker": true
+  , "wsh": false
+  , "nomen": false
+  , "onevar": false
+  , "passfail": false
+  , "esversion": 3
+}
\ No newline at end of file
diff --git a/NodeAPI/node_modules/bl/.travis.yml b/NodeAPI/node_modules/bl/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..1044a0925bb0a72941e034eaad09bd5053d2f956
--- /dev/null
+++ b/NodeAPI/node_modules/bl/.travis.yml
@@ -0,0 +1,15 @@
+sudo: false
+language: node_js
+node_js:
+  - '4'
+  - '6'
+  - '8'
+  - '9'
+  - '10'
+branches:
+  only:
+    - master
+notifications:
+  email:
+    - rod@vagg.org
+    - matteo.collina@gmail.com
diff --git a/NodeAPI/node_modules/bl/LICENSE.md b/NodeAPI/node_modules/bl/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..dea757d4547858e8991998dc2e0ff6186bbdd15a
--- /dev/null
+++ b/NodeAPI/node_modules/bl/LICENSE.md
@@ -0,0 +1,13 @@
+The MIT License (MIT)
+=====================
+
+Copyright (c) 2013-2018 bl contributors
+----------------------------------
+
+*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/NodeAPI/node_modules/bl/README.md b/NodeAPI/node_modules/bl/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..79dca35373d77a92b458090499743b19c40217a2
--- /dev/null
+++ b/NodeAPI/node_modules/bl/README.md
@@ -0,0 +1,218 @@
+# bl *(BufferList)*
+
+[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl)
+
+**A Node.js Buffer list collector, reader and streamer thingy.**
+
+[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/)
+[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/)
+
+**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
+
+The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
+
+```js
+const BufferList = require('bl')
+
+var bl = new BufferList()
+bl.append(Buffer.from('abcd'))
+bl.append(Buffer.from('efg'))
+bl.append('hi')                     // bl will also accept & convert Strings
+bl.append(Buffer.from('j'))
+bl.append(Buffer.from([ 0x3, 0x4 ]))
+
+console.log(bl.length) // 12
+
+console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
+console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
+console.log(bl.slice(3, 6).toString('ascii'))  // 'def'
+console.log(bl.slice(3, 8).toString('ascii'))  // 'defgh'
+console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
+
+console.log(bl.indexOf('def')) // 3
+console.log(bl.indexOf('asdf')) // -1
+
+// or just use toString!
+console.log(bl.toString())               // 'abcdefghij\u0003\u0004'
+console.log(bl.toString('ascii', 3, 8))  // 'defgh'
+console.log(bl.toString('ascii', 5, 10)) // 'fghij'
+
+// other standard Buffer readables
+console.log(bl.readUInt16BE(10)) // 0x0304
+console.log(bl.readUInt16LE(10)) // 0x0403
+```
+
+Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
+
+```js
+const bl = require('bl')
+    , fs = require('fs')
+
+fs.createReadStream('README.md')
+  .pipe(bl(function (err, data) { // note 'new' isn't strictly required
+    // `data` is a complete Buffer object containing the full data
+    console.log(data.toString())
+  }))
+```
+
+Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
+
+Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
+```js
+const hyperquest = require('hyperquest')
+    , bl         = require('bl')
+    , url        = 'https://raw.github.com/rvagg/bl/master/README.md'
+
+hyperquest(url).pipe(bl(function (err, data) {
+  console.log(data.toString())
+}))
+```
+
+Or, use it as a readable stream to recompose a list of Buffers to an output source:
+
+```js
+const BufferList = require('bl')
+    , fs         = require('fs')
+
+var bl = new BufferList()
+bl.append(Buffer.from('abcd'))
+bl.append(Buffer.from('efg'))
+bl.append(Buffer.from('hi'))
+bl.append(Buffer.from('j'))
+
+bl.pipe(fs.createWriteStream('gibberish.txt'))
+```
+
+## API
+
+  * <a href="#ctor"><code><b>new BufferList([ callback ])</b></code></a>
+  * <a href="#length"><code>bl.<b>length</b></code></a>
+  * <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
+  * <a href="#get"><code>bl.<b>get(index)</b></code></a>
+  * <a href="#indexOf"><code>bl.<b>indexOf(value[, byteOffset][, encoding])</b></code></a>
+  * <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
+  * <a href="#shallowSlice"><code>bl.<b>shallowSlice([ start[, end ] ])</b></code></a>
+  * <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
+  * <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
+  * <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
+  * <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
+  * <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
+  * <a href="#streams">Streams</a>
+
+--------------------------------------------------------
+<a name="ctor"></a>
+### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
+The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
+
+Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
+
+`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
+
+```js
+var bl = require('bl')
+var myinstance = bl()
+
+// equivalent to:
+
+var BufferList = require('bl')
+var myinstance = new BufferList()
+```
+
+--------------------------------------------------------
+<a name="length"></a>
+### bl.length
+Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
+
+--------------------------------------------------------
+<a name="append"></a>
+### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
+`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
+
+--------------------------------------------------------
+<a name="get"></a>
+### bl.get(index)
+`get()` will return the byte at the specified index.
+
+--------------------------------------------------------
+<a name="indexOf"></a>
+### bl.indexOf(value[, byteOffset][, encoding])
+`get()` will return the byte at the specified index.
+`indexOf()` method returns the first index at which a given element can be found in the BufferList, or -1 if it is not present.
+
+--------------------------------------------------------
+<a name="slice"></a>
+### bl.slice([ start, [ end ] ])
+`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
+
+If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
+
+--------------------------------------------------------
+<a name="shallowSlice"></a>
+### bl.shallowSlice([ start, [ end ] ])
+`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
+
+No copies will be performed. All buffers in the result share memory with the original list.
+
+--------------------------------------------------------
+<a name="copy"></a>
+### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
+`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
+
+--------------------------------------------------------
+<a name="duplicate"></a>
+### bl.duplicate()
+`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
+
+```js
+var bl = new BufferList()
+
+bl.append('hello')
+bl.append(' world')
+bl.append('\n')
+
+bl.duplicate().pipe(process.stdout, { end: false })
+
+console.log(bl.toString())
+```
+
+--------------------------------------------------------
+<a name="consume"></a>
+### bl.consume(bytes)
+`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.
+
+--------------------------------------------------------
+<a name="toString"></a>
+### bl.toString([encoding, [ start, [ end ]]])
+`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
+
+--------------------------------------------------------
+<a name="readXX"></a>
+### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
+
+All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
+
+See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
+
+--------------------------------------------------------
+<a name="streams"></a>
+### Streams
+**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
+
+--------------------------------------------------------
+
+## Contributors
+
+**bl** is brought to you by the following hackers:
+
+ * [Rod Vagg](https://github.com/rvagg)
+ * [Matteo Collina](https://github.com/mcollina)
+ * [Jarett Cruger](https://github.com/jcrugzz)
+
+=======
+
+<a name="license"></a>
+## License &amp; copyright
+
+Copyright (c) 2013-2018 bl contributors (listed above).
+
+bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.
diff --git a/NodeAPI/node_modules/bl/bl.js b/NodeAPI/node_modules/bl/bl.js
new file mode 100644
index 0000000000000000000000000000000000000000..52c374050dec4b1edf689d79fed6308f7bdbf59f
--- /dev/null
+++ b/NodeAPI/node_modules/bl/bl.js
@@ -0,0 +1,392 @@
+'use strict'
+var DuplexStream = require('readable-stream').Duplex
+  , util         = require('util')
+  , Buffer       = require('safe-buffer').Buffer
+
+function BufferList (callback) {
+  if (!(this instanceof BufferList))
+    return new BufferList(callback)
+
+  this._bufs  = []
+  this.length = 0
+
+  if (typeof callback == 'function') {
+    this._callback = callback
+
+    var piper = function piper (err) {
+      if (this._callback) {
+        this._callback(err)
+        this._callback = null
+      }
+    }.bind(this)
+
+    this.on('pipe', function onPipe (src) {
+      src.on('error', piper)
+    })
+    this.on('unpipe', function onUnpipe (src) {
+      src.removeListener('error', piper)
+    })
+  } else {
+    this.append(callback)
+  }
+
+  DuplexStream.call(this)
+}
+
+
+util.inherits(BufferList, DuplexStream)
+
+
+BufferList.prototype._offset = function _offset (offset) {
+  var tot = 0, i = 0, _t
+  if (offset === 0) return [ 0, 0 ]
+  for (; i < this._bufs.length; i++) {
+    _t = tot + this._bufs[i].length
+    if (offset < _t || i == this._bufs.length - 1) {
+      return [ i, offset - tot ]
+    }
+    tot = _t
+  }
+}
+
+BufferList.prototype._reverseOffset = function (blOffset) {
+  var bufferId = blOffset[0]
+  var offset = blOffset[1]
+  for (var i = 0; i < bufferId; i++) {
+    offset += this._bufs[i].length
+  }
+  return offset
+}
+
+BufferList.prototype.append = function append (buf) {
+  var i = 0
+
+  if (Buffer.isBuffer(buf)) {
+    this._appendBuffer(buf)
+  } else if (Array.isArray(buf)) {
+    for (; i < buf.length; i++)
+      this.append(buf[i])
+  } else if (buf instanceof BufferList) {
+    // unwrap argument into individual BufferLists
+    for (; i < buf._bufs.length; i++)
+      this.append(buf._bufs[i])
+  } else if (buf != null) {
+    // coerce number arguments to strings, since Buffer(number) does
+    // uninitialized memory allocation
+    if (typeof buf == 'number')
+      buf = buf.toString()
+
+    this._appendBuffer(Buffer.from(buf))
+  }
+
+  return this
+}
+
+
+BufferList.prototype._appendBuffer = function appendBuffer (buf) {
+  this._bufs.push(buf)
+  this.length += buf.length
+}
+
+
+BufferList.prototype._write = function _write (buf, encoding, callback) {
+  this._appendBuffer(buf)
+
+  if (typeof callback == 'function')
+    callback()
+}
+
+
+BufferList.prototype._read = function _read (size) {
+  if (!this.length)
+    return this.push(null)
+
+  size = Math.min(size, this.length)
+  this.push(this.slice(0, size))
+  this.consume(size)
+}
+
+
+BufferList.prototype.end = function end (chunk) {
+  DuplexStream.prototype.end.call(this, chunk)
+
+  if (this._callback) {
+    this._callback(null, this.slice())
+    this._callback = null
+  }
+}
+
+
+BufferList.prototype.get = function get (index) {
+  if (index > this.length || index < 0) {
+    return undefined
+  }
+  var offset = this._offset(index)
+  return this._bufs[offset[0]][offset[1]]
+}
+
+
+BufferList.prototype.slice = function slice (start, end) {
+  if (typeof start == 'number' && start < 0)
+    start += this.length
+  if (typeof end == 'number' && end < 0)
+    end += this.length
+  return this.copy(null, 0, start, end)
+}
+
+
+BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
+  if (typeof srcStart != 'number' || srcStart < 0)
+    srcStart = 0
+  if (typeof srcEnd != 'number' || srcEnd > this.length)
+    srcEnd = this.length
+  if (srcStart >= this.length)
+    return dst || Buffer.alloc(0)
+  if (srcEnd <= 0)
+    return dst || Buffer.alloc(0)
+
+  var copy   = !!dst
+    , off    = this._offset(srcStart)
+    , len    = srcEnd - srcStart
+    , bytes  = len
+    , bufoff = (copy && dstStart) || 0
+    , start  = off[1]
+    , l
+    , i
+
+  // copy/slice everything
+  if (srcStart === 0 && srcEnd == this.length) {
+    if (!copy) { // slice, but full concat if multiple buffers
+      return this._bufs.length === 1
+        ? this._bufs[0]
+        : Buffer.concat(this._bufs, this.length)
+    }
+
+    // copy, need to copy individual buffers
+    for (i = 0; i < this._bufs.length; i++) {
+      this._bufs[i].copy(dst, bufoff)
+      bufoff += this._bufs[i].length
+    }
+
+    return dst
+  }
+
+  // easy, cheap case where it's a subset of one of the buffers
+  if (bytes <= this._bufs[off[0]].length - start) {
+    return copy
+      ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
+      : this._bufs[off[0]].slice(start, start + bytes)
+  }
+
+  if (!copy) // a slice, we need something to copy in to
+    dst = Buffer.allocUnsafe(len)
+
+  for (i = off[0]; i < this._bufs.length; i++) {
+    l = this._bufs[i].length - start
+
+    if (bytes > l) {
+      this._bufs[i].copy(dst, bufoff, start)
+      bufoff += l
+    } else {
+      this._bufs[i].copy(dst, bufoff, start, start + bytes)
+      bufoff += l
+      break
+    }
+
+    bytes -= l
+
+    if (start)
+      start = 0
+  }
+
+  // safeguard so that we don't return uninitialized memory
+  if (dst.length > bufoff) return dst.slice(0, bufoff)
+
+  return dst
+}
+
+BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
+  start = start || 0
+  end = typeof end !== 'number' ? this.length : end
+
+  if (start < 0)
+    start += this.length
+  if (end < 0)
+    end += this.length
+
+  if (start === end) {
+    return new BufferList()
+  }
+  var startOffset = this._offset(start)
+    , endOffset = this._offset(end)
+    , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
+
+  if (endOffset[1] == 0)
+    buffers.pop()
+  else
+    buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])
+
+  if (startOffset[1] != 0)
+    buffers[0] = buffers[0].slice(startOffset[1])
+
+  return new BufferList(buffers)
+}
+
+BufferList.prototype.toString = function toString (encoding, start, end) {
+  return this.slice(start, end).toString(encoding)
+}
+
+BufferList.prototype.consume = function consume (bytes) {
+  // first, normalize the argument, in accordance with how Buffer does it
+  bytes = Math.trunc(bytes)
+  // do nothing if not a positive number
+  if (Number.isNaN(bytes) || bytes <= 0) return this
+
+  while (this._bufs.length) {
+    if (bytes >= this._bufs[0].length) {
+      bytes -= this._bufs[0].length
+      this.length -= this._bufs[0].length
+      this._bufs.shift()
+    } else {
+      this._bufs[0] = this._bufs[0].slice(bytes)
+      this.length -= bytes
+      break
+    }
+  }
+  return this
+}
+
+
+BufferList.prototype.duplicate = function duplicate () {
+  var i = 0
+    , copy = new BufferList()
+
+  for (; i < this._bufs.length; i++)
+    copy.append(this._bufs[i])
+
+  return copy
+}
+
+
+BufferList.prototype.destroy = function destroy () {
+  this._bufs.length = 0
+  this.length = 0
+  this.push(null)
+}
+
+
+BufferList.prototype.indexOf = function (search, offset, encoding) {
+  if (encoding === undefined && typeof offset === 'string') {
+    encoding = offset
+    offset = undefined
+  }
+  if (typeof search === 'function' || Array.isArray(search)) {
+    throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.')
+  } else if (typeof search === 'number') {
+      search = Buffer.from([search])
+  } else if (typeof search === 'string') {
+    search = Buffer.from(search, encoding)
+  } else if (search instanceof BufferList) {
+    search = search.slice()
+  } else if (!Buffer.isBuffer(search)) {
+    search = Buffer.from(search)
+  }
+
+  offset = Number(offset || 0)
+  if (isNaN(offset)) {
+    offset = 0
+  }
+
+  if (offset < 0) {
+    offset = this.length + offset
+  }
+
+  if (offset < 0) {
+    offset = 0
+  }
+
+  if (search.length === 0) {
+    return offset > this.length ? this.length : offset
+  }
+
+  var blOffset = this._offset(offset)
+  var blIndex = blOffset[0] // index of which internal buffer we're working on
+  var buffOffset = blOffset[1] // offset of the internal buffer we're working on
+
+  // scan over each buffer
+  for (blIndex; blIndex < this._bufs.length; blIndex++) {
+    var buff = this._bufs[blIndex]
+    while(buffOffset < buff.length) {
+      var availableWindow = buff.length - buffOffset
+      if (availableWindow >= search.length) {
+        var nativeSearchResult = buff.indexOf(search, buffOffset)
+        if (nativeSearchResult !== -1) {
+          return this._reverseOffset([blIndex, nativeSearchResult])
+        }
+        buffOffset = buff.length - search.length + 1 // end of native search window
+      } else {
+        var revOffset = this._reverseOffset([blIndex, buffOffset])
+        if (this._match(revOffset, search)) {
+          return revOffset
+        }
+        buffOffset++
+      }
+    }
+    buffOffset = 0
+  }
+  return -1
+}
+
+BufferList.prototype._match = function(offset, search) {
+  if (this.length - offset < search.length) {
+    return false
+  }
+  for (var searchOffset = 0; searchOffset < search.length ; searchOffset++) {
+    if(this.get(offset + searchOffset) !== search[searchOffset]){
+      return false
+    }
+  }
+  return true
+}
+
+
+;(function () {
+  var methods = {
+      'readDoubleBE' : 8
+    , 'readDoubleLE' : 8
+    , 'readFloatBE'  : 4
+    , 'readFloatLE'  : 4
+    , 'readInt32BE'  : 4
+    , 'readInt32LE'  : 4
+    , 'readUInt32BE' : 4
+    , 'readUInt32LE' : 4
+    , 'readInt16BE'  : 2
+    , 'readInt16LE'  : 2
+    , 'readUInt16BE' : 2
+    , 'readUInt16LE' : 2
+    , 'readInt8'     : 1
+    , 'readUInt8'    : 1
+    , 'readIntBE'    : null
+    , 'readIntLE'    : null
+    , 'readUIntBE'   : null
+    , 'readUIntLE'   : null
+  }
+
+  for (var m in methods) {
+    (function (m) {
+      if (methods[m] === null) {
+        BufferList.prototype[m] = function (offset, byteLength) {
+          return this.slice(offset, offset + byteLength)[m](0, byteLength)
+        }
+      }
+      else {
+        BufferList.prototype[m] = function (offset) {
+          return this.slice(offset, offset + methods[m])[m](0)
+        }
+      }
+    }(m))
+  }
+}())
+
+
+module.exports = BufferList
diff --git a/NodeAPI/node_modules/bl/package.json b/NodeAPI/node_modules/bl/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..496a72992abf3e788051cf4f268e28bdf8914ca3
--- /dev/null
+++ b/NodeAPI/node_modules/bl/package.json
@@ -0,0 +1,35 @@
+{
+  "name": "bl",
+  "version": "2.2.1",
+  "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
+  "main": "bl.js",
+  "scripts": {
+    "test": "node test/test.js | faucet"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/rvagg/bl.git"
+  },
+  "homepage": "https://github.com/rvagg/bl",
+  "authors": [
+    "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
+    "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
+    "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
+  ],
+  "keywords": [
+    "buffer",
+    "buffers",
+    "stream",
+    "awesomesauce"
+  ],
+  "license": "MIT",
+  "dependencies": {
+    "readable-stream": "^2.3.5",
+    "safe-buffer": "^5.1.1"
+  },
+  "devDependencies": {
+    "faucet": "0.0.1",
+    "hash_file": "~0.1.1",
+    "tape": "~4.9.0"
+  }
+}
diff --git a/NodeAPI/node_modules/bl/test/indexOf.js b/NodeAPI/node_modules/bl/test/indexOf.js
new file mode 100644
index 0000000000000000000000000000000000000000..68435e1ae415b10d281b33e4abca71e93155d053
--- /dev/null
+++ b/NodeAPI/node_modules/bl/test/indexOf.js
@@ -0,0 +1,463 @@
+'use strict'
+
+var tape       = require('tape')
+  , BufferList = require('../')
+  , Buffer     = require('safe-buffer').Buffer
+
+tape('indexOf single byte needle', t => {
+  const bl = new BufferList(['abcdefg', 'abcdefg', '12345'])
+  t.equal(bl.indexOf('e'), 4)
+  t.equal(bl.indexOf('e', 5), 11)
+  t.equal(bl.indexOf('e', 12), -1)
+  t.equal(bl.indexOf('5'), 18)
+  t.end()
+})
+
+tape('indexOf multiple byte needle', t => {
+  const bl = new BufferList(['abcdefg', 'abcdefg'])
+  t.equal(bl.indexOf('ef'), 4)
+  t.equal(bl.indexOf('ef', 5), 11)
+  t.end()
+})
+
+tape('indexOf multiple byte needles across buffer boundaries', t => {
+  const bl = new BufferList(['abcdefg', 'abcdefg'])
+  t.equal(bl.indexOf('fgabc'), 5)
+  t.end()
+})
+
+tape('indexOf takes a buffer list search', t => {
+  const bl = new BufferList(['abcdefg', 'abcdefg'])
+  const search = new BufferList('fgabc')
+  t.equal(bl.indexOf(search), 5)
+  t.end()
+})
+
+tape('indexOf a zero byte needle', t => {
+  const b = new BufferList('abcdef')
+  const buf_empty = Buffer.from('')
+  t.equal(b.indexOf(''), 0)
+  t.equal(b.indexOf('', 1), 1)
+  t.equal(b.indexOf('', b.length + 1), b.length)
+  t.equal(b.indexOf('', Infinity), b.length)
+  t.equal(b.indexOf(buf_empty), 0)
+  t.equal(b.indexOf(buf_empty, 1), 1)
+  t.equal(b.indexOf(buf_empty, b.length + 1), b.length)
+  t.equal(b.indexOf(buf_empty, Infinity), b.length)
+  t.end()
+})
+
+tape('indexOf buffers smaller and larger than the needle', t => {
+  const bl = new BufferList(['abcdefg', 'a', 'bcdefg', 'a', 'bcfgab'])
+  t.equal(bl.indexOf('fgabc'), 5)
+  t.equal(bl.indexOf('fgabc', 6), 12)
+  t.equal(bl.indexOf('fgabc', 13), -1)
+  t.end()
+})
+
+// only present in node 6+
+;(process.version.substr(1).split('.')[0] >= 6) && tape('indexOf latin1 and binary encoding', t => {
+  const b = new BufferList('abcdef')
+
+  // test latin1 encoding
+  t.equal(
+    new BufferList(Buffer.from(b.toString('latin1'), 'latin1'))
+      .indexOf('d', 0, 'latin1'),
+    3
+  )
+  t.equal(
+    new BufferList(Buffer.from(b.toString('latin1'), 'latin1'))
+      .indexOf(Buffer.from('d', 'latin1'), 0, 'latin1'),
+    3
+  )
+  t.equal(
+    new BufferList(Buffer.from('aa\u00e8aa', 'latin1'))
+      .indexOf('\u00e8', 'latin1'),
+    2
+  )
+  t.equal(
+    new BufferList(Buffer.from('\u00e8', 'latin1'))
+      .indexOf('\u00e8', 'latin1'),
+    0
+  )
+  t.equal(
+    new BufferList(Buffer.from('\u00e8', 'latin1'))
+      .indexOf(Buffer.from('\u00e8', 'latin1'), 'latin1'),
+    0
+  )
+
+  // test binary encoding
+  t.equal(
+    new BufferList(Buffer.from(b.toString('binary'), 'binary'))
+      .indexOf('d', 0, 'binary'),
+    3
+  )
+  t.equal(
+    new BufferList(Buffer.from(b.toString('binary'), 'binary'))
+      .indexOf(Buffer.from('d', 'binary'), 0, 'binary'),
+    3
+  )
+  t.equal(
+    new BufferList(Buffer.from('aa\u00e8aa', 'binary'))
+      .indexOf('\u00e8', 'binary'),
+    2
+  )
+  t.equal(
+    new BufferList(Buffer.from('\u00e8', 'binary'))
+      .indexOf('\u00e8', 'binary'),
+    0
+  )
+  t.equal(
+    new BufferList(Buffer.from('\u00e8', 'binary'))
+      .indexOf(Buffer.from('\u00e8', 'binary'), 'binary'),
+    0
+  )
+  t.end()
+})
+
+tape('indexOf the entire nodejs10 buffer test suite', t => {
+  const b = new BufferList('abcdef')
+  const buf_a = Buffer.from('a')
+  const buf_bc = Buffer.from('bc')
+  const buf_f = Buffer.from('f')
+  const buf_z = Buffer.from('z')
+
+  const stringComparison = 'abcdef'
+
+  t.equal(b.indexOf('a'), 0)
+  t.equal(b.indexOf('a', 1), -1)
+  t.equal(b.indexOf('a', -1), -1)
+  t.equal(b.indexOf('a', -4), -1)
+  t.equal(b.indexOf('a', -b.length), 0)
+  t.equal(b.indexOf('a', NaN), 0)
+  t.equal(b.indexOf('a', -Infinity), 0)
+  t.equal(b.indexOf('a', Infinity), -1)
+  t.equal(b.indexOf('bc'), 1)
+  t.equal(b.indexOf('bc', 2), -1)
+  t.equal(b.indexOf('bc', -1), -1)
+  t.equal(b.indexOf('bc', -3), -1)
+  t.equal(b.indexOf('bc', -5), 1)
+  t.equal(b.indexOf('bc', NaN), 1)
+  t.equal(b.indexOf('bc', -Infinity), 1)
+  t.equal(b.indexOf('bc', Infinity), -1)
+  t.equal(b.indexOf('f'), b.length - 1)
+  t.equal(b.indexOf('z'), -1)
+  // empty search tests
+  t.equal(b.indexOf(buf_a), 0)
+  t.equal(b.indexOf(buf_a, 1), -1)
+  t.equal(b.indexOf(buf_a, -1), -1)
+  t.equal(b.indexOf(buf_a, -4), -1)
+  t.equal(b.indexOf(buf_a, -b.length), 0)
+  t.equal(b.indexOf(buf_a, NaN), 0)
+  t.equal(b.indexOf(buf_a, -Infinity), 0)
+  t.equal(b.indexOf(buf_a, Infinity), -1)
+  t.equal(b.indexOf(buf_bc), 1)
+  t.equal(b.indexOf(buf_bc, 2), -1)
+  t.equal(b.indexOf(buf_bc, -1), -1)
+  t.equal(b.indexOf(buf_bc, -3), -1)
+  t.equal(b.indexOf(buf_bc, -5), 1)
+  t.equal(b.indexOf(buf_bc, NaN), 1)
+  t.equal(b.indexOf(buf_bc, -Infinity), 1)
+  t.equal(b.indexOf(buf_bc, Infinity), -1)
+  t.equal(b.indexOf(buf_f), b.length - 1)
+  t.equal(b.indexOf(buf_z), -1)
+  t.equal(b.indexOf(0x61), 0)
+  t.equal(b.indexOf(0x61, 1), -1)
+  t.equal(b.indexOf(0x61, -1), -1)
+  t.equal(b.indexOf(0x61, -4), -1)
+  t.equal(b.indexOf(0x61, -b.length), 0)
+  t.equal(b.indexOf(0x61, NaN), 0)
+  t.equal(b.indexOf(0x61, -Infinity), 0)
+  t.equal(b.indexOf(0x61, Infinity), -1)
+  t.equal(b.indexOf(0x0), -1)
+
+  // test offsets
+  t.equal(b.indexOf('d', 2), 3)
+  t.equal(b.indexOf('f', 5), 5)
+  t.equal(b.indexOf('f', -1), 5)
+  t.equal(b.indexOf('f', 6), -1)
+
+  t.equal(b.indexOf(Buffer.from('d'), 2), 3)
+  t.equal(b.indexOf(Buffer.from('f'), 5), 5)
+  t.equal(b.indexOf(Buffer.from('f'), -1), 5)
+  t.equal(b.indexOf(Buffer.from('f'), 6), -1)
+
+  t.equal(Buffer.from('ff').indexOf(Buffer.from('f'), 1, 'ucs2'), -1)
+
+  // test invalid and uppercase encoding
+  t.equal(b.indexOf('b', 'utf8'), 1)
+  t.equal(b.indexOf('b', 'UTF8'), 1)
+  t.equal(b.indexOf('62', 'HEX'), 1)
+  t.throws(() => b.indexOf('bad', 'enc'), TypeError)
+
+  // test hex encoding
+  t.equal(
+    Buffer.from(b.toString('hex'), 'hex')
+      .indexOf('64', 0, 'hex'),
+    3
+  )
+  t.equal(
+    Buffer.from(b.toString('hex'), 'hex')
+      .indexOf(Buffer.from('64', 'hex'), 0, 'hex'),
+    3
+  )
+
+  // test base64 encoding
+  t.equal(
+    Buffer.from(b.toString('base64'), 'base64')
+      .indexOf('ZA==', 0, 'base64'),
+    3
+  )
+  t.equal(
+    Buffer.from(b.toString('base64'), 'base64')
+      .indexOf(Buffer.from('ZA==', 'base64'), 0, 'base64'),
+    3
+  )
+
+  // test ascii encoding
+  t.equal(
+    Buffer.from(b.toString('ascii'), 'ascii')
+      .indexOf('d', 0, 'ascii'),
+    3
+  )
+  t.equal(
+    Buffer.from(b.toString('ascii'), 'ascii')
+      .indexOf(Buffer.from('d', 'ascii'), 0, 'ascii'),
+    3
+  )
+
+  // test optional offset with passed encoding
+  t.equal(Buffer.from('aaaa0').indexOf('30', 'hex'), 4)
+  t.equal(Buffer.from('aaaa00a').indexOf('3030', 'hex'), 4)
+
+  {
+    // test usc2 encoding
+    const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2')
+
+    t.equal(8, twoByteString.indexOf('\u0395', 4, 'ucs2'))
+    t.equal(6, twoByteString.indexOf('\u03a3', -4, 'ucs2'))
+    t.equal(4, twoByteString.indexOf('\u03a3', -6, 'ucs2'))
+    t.equal(4, twoByteString.indexOf(
+      Buffer.from('\u03a3', 'ucs2'), -6, 'ucs2'))
+    t.equal(-1, twoByteString.indexOf('\u03a3', -2, 'ucs2'))
+  }
+
+  const mixedByteStringUcs2 =
+      Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395', 'ucs2')
+  t.equal(6, mixedByteStringUcs2.indexOf('bc', 0, 'ucs2'))
+  t.equal(10, mixedByteStringUcs2.indexOf('\u03a3', 0, 'ucs2'))
+  t.equal(-1, mixedByteStringUcs2.indexOf('\u0396', 0, 'ucs2'))
+
+  t.equal(
+    6, mixedByteStringUcs2.indexOf(Buffer.from('bc', 'ucs2'), 0, 'ucs2'))
+  t.equal(
+    10, mixedByteStringUcs2.indexOf(Buffer.from('\u03a3', 'ucs2'), 0, 'ucs2'))
+  t.equal(
+    -1, mixedByteStringUcs2.indexOf(Buffer.from('\u0396', 'ucs2'), 0, 'ucs2'))
+
+  {
+    const twoByteString = Buffer.from('\u039a\u0391\u03a3\u03a3\u0395', 'ucs2')
+
+    // Test single char pattern
+    t.equal(0, twoByteString.indexOf('\u039a', 0, 'ucs2'))
+    let index = twoByteString.indexOf('\u0391', 0, 'ucs2')
+    t.equal(2, index, `Alpha - at index ${index}`)
+    index = twoByteString.indexOf('\u03a3', 0, 'ucs2')
+    t.equal(4, index, `First Sigma - at index ${index}`)
+    index = twoByteString.indexOf('\u03a3', 6, 'ucs2')
+    t.equal(6, index, `Second Sigma - at index ${index}`)
+    index = twoByteString.indexOf('\u0395', 0, 'ucs2')
+    t.equal(8, index, `Epsilon - at index ${index}`)
+    index = twoByteString.indexOf('\u0392', 0, 'ucs2')
+    t.equal(-1, index, `Not beta - at index ${index}`)
+
+    // Test multi-char pattern
+    index = twoByteString.indexOf('\u039a\u0391', 0, 'ucs2')
+    t.equal(0, index, `Lambda Alpha - at index ${index}`)
+    index = twoByteString.indexOf('\u0391\u03a3', 0, 'ucs2')
+    t.equal(2, index, `Alpha Sigma - at index ${index}`)
+    index = twoByteString.indexOf('\u03a3\u03a3', 0, 'ucs2')
+    t.equal(4, index, `Sigma Sigma - at index ${index}`)
+    index = twoByteString.indexOf('\u03a3\u0395', 0, 'ucs2')
+    t.equal(6, index, `Sigma Epsilon - at index ${index}`)
+  }
+
+  const mixedByteStringUtf8 = Buffer.from('\u039a\u0391abc\u03a3\u03a3\u0395')
+  t.equal(5, mixedByteStringUtf8.indexOf('bc'))
+  t.equal(5, mixedByteStringUtf8.indexOf('bc', 5))
+  t.equal(5, mixedByteStringUtf8.indexOf('bc', -8))
+  t.equal(7, mixedByteStringUtf8.indexOf('\u03a3'))
+  t.equal(-1, mixedByteStringUtf8.indexOf('\u0396'))
+
+
+  // Test complex string indexOf algorithms. Only trigger for long strings.
+  // Long string that isn't a simple repeat of a shorter string.
+  let longString = 'A'
+  for (let i = 66; i < 76; i++) {  // from 'B' to 'K'
+    longString = longString + String.fromCharCode(i) + longString
+  }
+
+  const longBufferString = Buffer.from(longString)
+
+  // pattern of 15 chars, repeated every 16 chars in long
+  let pattern = 'ABACABADABACABA'
+  for (let i = 0; i < longBufferString.length - pattern.length; i += 7) {
+    const index = longBufferString.indexOf(pattern, i)
+    t.equal((i + 15) & ~0xf, index,
+                      `Long ABACABA...-string at index ${i}`)
+  }
+
+  let index = longBufferString.indexOf('AJABACA')
+  t.equal(510, index, `Long AJABACA, First J - at index ${index}`)
+  index = longBufferString.indexOf('AJABACA', 511)
+  t.equal(1534, index, `Long AJABACA, Second J - at index ${index}`)
+
+  pattern = 'JABACABADABACABA'
+  index = longBufferString.indexOf(pattern)
+  t.equal(511, index, `Long JABACABA..., First J - at index ${index}`)
+  index = longBufferString.indexOf(pattern, 512)
+  t.equal(
+    1535, index, `Long JABACABA..., Second J - at index ${index}`)
+
+  // Search for a non-ASCII string in a pure ASCII string.
+  const asciiString = Buffer.from(
+    'arglebargleglopglyfarglebargleglopglyfarglebargleglopglyf')
+  t.equal(-1, asciiString.indexOf('\x2061'))
+  t.equal(3, asciiString.indexOf('leb', 0))
+
+  // Search in string containing many non-ASCII chars.
+  const allCodePoints = []
+  for (let i = 0; i < 65536; i++) allCodePoints[i] = i
+  const allCharsString = String.fromCharCode.apply(String, allCodePoints)
+  const allCharsBufferUtf8 = Buffer.from(allCharsString)
+  const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2')
+
+  // Search for string long enough to trigger complex search with ASCII pattern
+  // and UC16 subject.
+  t.equal(-1, allCharsBufferUtf8.indexOf('notfound'))
+  t.equal(-1, allCharsBufferUcs2.indexOf('notfound'))
+
+  // Needle is longer than haystack, but only because it's encoded as UTF-16
+  t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'ucs2'), -1)
+
+  t.equal(Buffer.from('aaaa').indexOf('a'.repeat(4), 'utf8'), 0)
+  t.equal(Buffer.from('aaaa').indexOf('你好', 'ucs2'), -1)
+
+  // Haystack has odd length, but the needle is UCS2.
+  t.equal(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1)
+
+  {
+    // Find substrings in Utf8.
+    const lengths = [1, 3, 15];  // Single char, simple and complex.
+    const indices = [0x5, 0x60, 0x400, 0x680, 0x7ee, 0xFF02, 0x16610, 0x2f77b]
+    for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
+      for (let i = 0; i < indices.length; i++) {
+        const index = indices[i]
+        let length = lengths[lengthIndex]
+
+        if (index + length > 0x7F) {
+          length = 2 * length
+        }
+
+        if (index + length > 0x7FF) {
+          length = 3 * length
+        }
+
+        if (index + length > 0xFFFF) {
+          length = 4 * length
+        }
+
+        const patternBufferUtf8 = allCharsBufferUtf8.slice(index, index + length)
+        t.equal(index, allCharsBufferUtf8.indexOf(patternBufferUtf8))
+
+        const patternStringUtf8 = patternBufferUtf8.toString()
+        t.equal(index, allCharsBufferUtf8.indexOf(patternStringUtf8))
+      }
+    }
+  }
+
+  {
+    // Find substrings in Usc2.
+    const lengths = [2, 4, 16];  // Single char, simple and complex.
+    const indices = [0x5, 0x65, 0x105, 0x205, 0x285, 0x2005, 0x2085, 0xfff0]
+    for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
+      for (let i = 0; i < indices.length; i++) {
+        const index = indices[i] * 2
+        const length = lengths[lengthIndex]
+
+        const patternBufferUcs2 =
+            allCharsBufferUcs2.slice(index, index + length)
+        t.equal(
+          index, allCharsBufferUcs2.indexOf(patternBufferUcs2, 0, 'ucs2'))
+
+        const patternStringUcs2 = patternBufferUcs2.toString('ucs2')
+        t.equal(
+          index, allCharsBufferUcs2.indexOf(patternStringUcs2, 0, 'ucs2'))
+      }
+    }
+  }
+
+  [
+    () => {},
+    {},
+    []
+  ].forEach(val => {
+    debugger
+    t.throws(() => b.indexOf(val), TypeError, `"${JSON.stringify(val)}" should throw`)
+  })
+
+  // Test weird offset arguments.
+  // The following offsets coerce to NaN or 0, searching the whole Buffer
+  t.equal(b.indexOf('b', undefined), 1)
+  t.equal(b.indexOf('b', {}), 1)
+  t.equal(b.indexOf('b', 0), 1)
+  t.equal(b.indexOf('b', null), 1)
+  t.equal(b.indexOf('b', []), 1)
+
+  // The following offset coerces to 2, in other words +[2] === 2
+  t.equal(b.indexOf('b', [2]), -1)
+
+  // Behavior should match String.indexOf()
+  t.equal(
+    b.indexOf('b', undefined),
+    stringComparison.indexOf('b', undefined))
+  t.equal(
+    b.indexOf('b', {}),
+    stringComparison.indexOf('b', {}))
+  t.equal(
+    b.indexOf('b', 0),
+    stringComparison.indexOf('b', 0))
+  t.equal(
+    b.indexOf('b', null),
+    stringComparison.indexOf('b', null))
+  t.equal(
+    b.indexOf('b', []),
+    stringComparison.indexOf('b', []))
+  t.equal(
+    b.indexOf('b', [2]),
+    stringComparison.indexOf('b', [2]))
+
+  // test truncation of Number arguments to uint8
+  {
+    const buf = Buffer.from('this is a test')
+    t.equal(buf.indexOf(0x6973), 3)
+    t.equal(buf.indexOf(0x697320), 4)
+    t.equal(buf.indexOf(0x69732069), 2)
+    t.equal(buf.indexOf(0x697374657374), 0)
+    t.equal(buf.indexOf(0x69737374), 0)
+    t.equal(buf.indexOf(0x69737465), 11)
+    t.equal(buf.indexOf(0x69737465), 11)
+    t.equal(buf.indexOf(-140), 0)
+    t.equal(buf.indexOf(-152), 1)
+    t.equal(buf.indexOf(0xff), -1)
+    t.equal(buf.indexOf(0xffff), -1)
+  }
+
+  // Test that Uint8Array arguments are okay.
+  {
+    const needle = new Uint8Array([ 0x66, 0x6f, 0x6f ])
+    const haystack = new BufferList(Buffer.from('a foo b foo'))
+    t.equal(haystack.indexOf(needle), 2)
+  }
+  t.end()
+})
diff --git a/NodeAPI/node_modules/bl/test/test.js b/NodeAPI/node_modules/bl/test/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..42fcad419fa317aa471329a437d58657a6f2400b
--- /dev/null
+++ b/NodeAPI/node_modules/bl/test/test.js
@@ -0,0 +1,782 @@
+'use strict'
+
+var tape       = require('tape')
+  , crypto     = require('crypto')
+  , fs         = require('fs')
+  , hash       = require('hash_file')
+  , BufferList = require('../')
+  , Buffer     = require('safe-buffer').Buffer
+
+  , encodings  =
+      ('hex utf8 utf-8 ascii binary base64'
+          + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
+
+// run the indexOf tests
+require('./indexOf')
+
+tape('single bytes from single buffer', function (t) {
+  var bl = new BufferList()
+  bl.append(Buffer.from('abcd'))
+
+  t.equal(bl.length, 4)
+  t.equal(bl.get(-1), undefined)
+  t.equal(bl.get(0), 97)
+  t.equal(bl.get(1), 98)
+  t.equal(bl.get(2), 99)
+  t.equal(bl.get(3), 100)
+  t.equal(bl.get(4), undefined)
+
+  t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+  var bl = new BufferList()
+  bl.append(Buffer.from('abcd'))
+  bl.append(Buffer.from('efg'))
+  bl.append(Buffer.from('hi'))
+  bl.append(Buffer.from('j'))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.get(0), 97)
+  t.equal(bl.get(1), 98)
+  t.equal(bl.get(2), 99)
+  t.equal(bl.get(3), 100)
+  t.equal(bl.get(4), 101)
+  t.equal(bl.get(5), 102)
+  t.equal(bl.get(6), 103)
+  t.equal(bl.get(7), 104)
+  t.equal(bl.get(8), 105)
+  t.equal(bl.get(9), 106)
+  t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+  var bl = new BufferList()
+  bl.append(Buffer.from('abcd'))
+
+  t.equal(bl.length, 4)
+
+  t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+  t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+  t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+  t.equal(bl.slice(-4, -1).toString('ascii'), 'abc')
+
+  t.end()
+})
+
+tape('multi bytes from single buffer (negative indexes)', function (t) {
+  var bl = new BufferList()
+  bl.append(Buffer.from('buffer'))
+
+  t.equal(bl.length, 6)
+
+  t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe')
+  t.equal(bl.slice(-6, -2).toString('ascii'), 'buff')
+  t.equal(bl.slice(-5, -2).toString('ascii'), 'uff')
+
+  t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+  var bl = new BufferList()
+
+  bl.append(Buffer.from('abcd'))
+  bl.append(Buffer.from('efg'))
+  bl.append(Buffer.from('hi'))
+  bl.append(Buffer.from('j'))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+  t.equal(bl.slice(-7, -4).toString('ascii'), 'def')
+
+  t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+  var bl = new BufferList()
+
+  bl.append(new BufferList([ Buffer.from('abcd'), Buffer.from('efg') ]))
+  bl.append(new BufferList([ Buffer.from('hi'), Buffer.from('j') ]))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+  t.end()
+})
+
+// same data as previous test, just using nested constructors
+tape('multiple bytes from crazy nested buffer lists', function (t) {
+  var bl = new BufferList()
+
+  bl.append(new BufferList([
+      new BufferList([
+          new BufferList(Buffer.from('abc'))
+        , Buffer.from('d')
+        , new BufferList(Buffer.from('efg'))
+      ])
+    , new BufferList([ Buffer.from('hi') ])
+    , new BufferList(Buffer.from('j'))
+  ]))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+  t.end()
+})
+
+tape('append accepts arrays of Buffers', function (t) {
+  var bl = new BufferList()
+  bl.append(Buffer.from('abc'))
+  bl.append([ Buffer.from('def') ])
+  bl.append([ Buffer.from('ghi'), Buffer.from('jkl') ])
+  bl.append([ Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz') ])
+  t.equal(bl.length, 26)
+  t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+  t.end()
+})
+
+tape('append accepts arrays of BufferLists', function (t) {
+  var bl = new BufferList()
+  bl.append(Buffer.from('abc'))
+  bl.append([ new BufferList('def') ])
+  bl.append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ]))
+  bl.append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ])
+  t.equal(bl.length, 26)
+  t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+  t.end()
+})
+
+tape('append chainable', function (t) {
+  var bl = new BufferList()
+  t.ok(bl.append(Buffer.from('abcd')) === bl)
+  t.ok(bl.append([ Buffer.from('abcd') ]) === bl)
+  t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl)
+  t.ok(bl.append([ new BufferList(Buffer.from('abcd')) ]) === bl)
+  t.end()
+})
+
+tape('append chainable (test results)', function (t) {
+  var bl = new BufferList('abc')
+    .append([ new BufferList('def') ])
+    .append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ]))
+    .append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ])
+
+  t.equal(bl.length, 26)
+  t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
+  t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+  var bl = new BufferList()
+
+  bl.append(Buffer.from('abcd'))
+  bl.append(Buffer.from('efg'))
+  bl.append(Buffer.from('hi'))
+  bl.append(Buffer.from('j'))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+  bl.consume(3)
+  t.equal(bl.length, 7)
+  t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+  bl.consume(2)
+  t.equal(bl.length, 5)
+  t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+  bl.consume(1)
+  t.equal(bl.length, 4)
+  t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+  bl.consume(1)
+  t.equal(bl.length, 3)
+  t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+  bl.consume(2)
+  t.equal(bl.length, 1)
+  t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+  t.end()
+})
+
+tape('complete consumption', function (t) {
+  var bl = new BufferList()
+
+  bl.append(Buffer.from('a'))
+  bl.append(Buffer.from('b'))
+
+  bl.consume(2)
+
+  t.equal(bl.length, 0)
+  t.equal(bl._bufs.length, 0)
+
+  t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+  var buf1 = Buffer.alloc(1)
+    , buf2 = Buffer.alloc(3)
+    , buf3 = Buffer.alloc(3)
+    , bl  = new BufferList()
+
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUInt8(2), 0x3)
+  t.equal(bl.readInt8(2), 0x3)
+  t.equal(bl.readUInt8(3), 0x4)
+  t.equal(bl.readInt8(3), 0x4)
+  t.equal(bl.readUInt8(4), 0x23)
+  t.equal(bl.readInt8(4), 0x23)
+  t.equal(bl.readUInt8(5), 0x42)
+  t.equal(bl.readInt8(5), 0x42)
+  t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+  var buf1 = Buffer.alloc(1)
+    , buf2 = Buffer.alloc(3)
+    , buf3 = Buffer.alloc(3)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUInt16BE(2), 0x0304)
+  t.equal(bl.readUInt16LE(2), 0x0403)
+  t.equal(bl.readInt16BE(2), 0x0304)
+  t.equal(bl.readInt16LE(2), 0x0403)
+  t.equal(bl.readUInt16BE(3), 0x0423)
+  t.equal(bl.readUInt16LE(3), 0x2304)
+  t.equal(bl.readInt16BE(3), 0x0423)
+  t.equal(bl.readInt16LE(3), 0x2304)
+  t.equal(bl.readUInt16BE(4), 0x2342)
+  t.equal(bl.readUInt16LE(4), 0x4223)
+  t.equal(bl.readInt16BE(4), 0x2342)
+  t.equal(bl.readInt16LE(4), 0x4223)
+  t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+  var buf1 = Buffer.alloc(1)
+    , buf2 = Buffer.alloc(3)
+    , buf3 = Buffer.alloc(3)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUInt32BE(2), 0x03042342)
+  t.equal(bl.readUInt32LE(2), 0x42230403)
+  t.equal(bl.readInt32BE(2), 0x03042342)
+  t.equal(bl.readInt32LE(2), 0x42230403)
+  t.end()
+})
+
+tape('test readUIntLE / readUIntBE / readIntLE / readIntBE', function (t) {
+  var buf1 = Buffer.alloc(1)
+    , buf2 = Buffer.alloc(3)
+    , buf3 = Buffer.alloc(3)
+    , bl   = new BufferList()
+
+  buf2[0] = 0x2
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+  buf3[2] = 0x61
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUIntBE(1, 1), 0x02)
+  t.equal(bl.readUIntBE(1, 2), 0x0203)
+  t.equal(bl.readUIntBE(1, 3), 0x020304)
+  t.equal(bl.readUIntBE(1, 4), 0x02030423)
+  t.equal(bl.readUIntBE(1, 5), 0x0203042342)
+  t.equal(bl.readUIntBE(1, 6), 0x020304234261)
+  t.equal(bl.readUIntLE(1, 1), 0x02)
+  t.equal(bl.readUIntLE(1, 2), 0x0302)
+  t.equal(bl.readUIntLE(1, 3), 0x040302)
+  t.equal(bl.readUIntLE(1, 4), 0x23040302)
+  t.equal(bl.readUIntLE(1, 5), 0x4223040302)
+  t.equal(bl.readUIntLE(1, 6), 0x614223040302)
+  t.equal(bl.readIntBE(1, 1), 0x02)
+  t.equal(bl.readIntBE(1, 2), 0x0203)
+  t.equal(bl.readIntBE(1, 3), 0x020304)
+  t.equal(bl.readIntBE(1, 4), 0x02030423)
+  t.equal(bl.readIntBE(1, 5), 0x0203042342)
+  t.equal(bl.readIntBE(1, 6), 0x020304234261)
+  t.equal(bl.readIntLE(1, 1), 0x02)
+  t.equal(bl.readIntLE(1, 2), 0x0302)
+  t.equal(bl.readIntLE(1, 3), 0x040302)
+  t.equal(bl.readIntLE(1, 4), 0x23040302)
+  t.equal(bl.readIntLE(1, 5), 0x4223040302)
+  t.equal(bl.readIntLE(1, 6), 0x614223040302)
+  t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+  var buf1 = Buffer.alloc(1)
+    , buf2 = Buffer.alloc(3)
+    , buf3 = Buffer.alloc(3)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x00
+  buf2[2] = 0x00
+  buf3[0] = 0x80
+  buf3[1] = 0x3f
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readFloatLE(2), 0x01)
+  t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+  var buf1 = Buffer.alloc(1)
+    , buf2 = Buffer.alloc(3)
+    , buf3 = Buffer.alloc(10)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x55
+  buf2[2] = 0x55
+  buf3[0] = 0x55
+  buf3[1] = 0x55
+  buf3[2] = 0x55
+  buf3[3] = 0x55
+  buf3[4] = 0xd5
+  buf3[5] = 0x3f
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+  t.end()
+})
+
+tape('test toString', function (t) {
+  var bl = new BufferList()
+
+  bl.append(Buffer.from('abcd'))
+  bl.append(Buffer.from('efg'))
+  bl.append(Buffer.from('hi'))
+  bl.append(Buffer.from('j'))
+
+  t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+  t.equal(bl.toString('ascii', 3, 10), 'defghij')
+  t.equal(bl.toString('ascii', 3, 6), 'def')
+  t.equal(bl.toString('ascii', 3, 8), 'defgh')
+  t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+  t.end()
+})
+
+tape('test toString encoding', function (t) {
+  var bl = new BufferList()
+    , b  = Buffer.from('abcdefghij\xff\x00')
+
+  bl.append(Buffer.from('abcd'))
+  bl.append(Buffer.from('efg'))
+  bl.append(Buffer.from('hi'))
+  bl.append(Buffer.from('j'))
+  bl.append(Buffer.from('\xff\x00'))
+
+  encodings.forEach(function (enc) {
+      t.equal(bl.toString(enc), b.toString(enc), enc)
+    })
+
+  t.end()
+})
+
+tape('uninitialized memory', function (t) {
+  const secret = crypto.randomBytes(256)
+  for (let i = 0; i < 1e6; i++) {
+    const clone = Buffer.from(secret)
+    const bl = new BufferList()
+    bl.append(Buffer.from('a'))
+    bl.consume(-1024)
+    const buf = bl.slice(1)
+    if (buf.indexOf(clone) !== -1) {
+      t.fail(`Match (at ${i})`)
+      break
+    }
+  }
+  t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+  var random = crypto.randomBytes(65534)
+    , rndhash = hash(random, 'md5')
+    , md5sum = crypto.createHash('md5')
+    , bl     = new BufferList(function (err, buf) {
+        t.ok(Buffer.isBuffer(buf))
+        t.ok(err === null)
+        t.equal(rndhash, hash(bl.slice(), 'md5'))
+        t.equal(rndhash, hash(buf, 'md5'))
+
+        bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+          .on('close', function () {
+            var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+            s.on('data', md5sum.update.bind(md5sum))
+            s.on('end', function() {
+              t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+              t.end()
+            })
+          })
+
+      })
+
+  fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+  fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+  var buf  = crypto.randomBytes(1024)
+    , buf2 = crypto.randomBytes(1024)
+    , b    = BufferList(buf)
+
+  t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+  b = BufferList([ buf, buf2 ])
+  t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('test String appendage', function (t) {
+  var bl = new BufferList()
+    , b  = Buffer.from('abcdefghij\xff\x00')
+
+  bl.append('abcd')
+  bl.append('efg')
+  bl.append('hi')
+  bl.append('j')
+  bl.append('\xff\x00')
+
+  encodings.forEach(function (enc) {
+      t.equal(bl.toString(enc), b.toString(enc))
+    })
+
+  t.end()
+})
+
+tape('test Number appendage', function (t) {
+  var bl = new BufferList()
+    , b  = Buffer.from('1234567890')
+
+  bl.append(1234)
+  bl.append(567)
+  bl.append(89)
+  bl.append(0)
+
+  encodings.forEach(function (enc) {
+      t.equal(bl.toString(enc), b.toString(enc))
+    })
+
+  t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+  t.plan(3)
+  BufferList(function (err, data) {
+    t.notOk(err, 'no error')
+    t.ok(Buffer.isBuffer(data), 'got a buffer')
+    t.equal(0, data.length, 'got a zero-length buffer')
+    t.end()
+  }).end()
+})
+
+tape('unicode string', function (t) {
+  t.plan(2)
+  var inp1 = '\u2600'
+    , inp2 = '\u2603'
+    , exp = inp1 + ' and ' + inp2
+    , bl = BufferList()
+  bl.write(inp1)
+  bl.write(' and ')
+  bl.write(inp2)
+  t.equal(exp, bl.toString())
+  t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+  var source = BufferList()
+    , dest = BufferList()
+
+  source.write('hello')
+  source.pipe(dest)
+
+  dest.on('finish', function () {
+    t.equal(dest.toString('utf8'), 'hello')
+    t.end()
+  })
+})
+
+tape('basic copy', function (t) {
+  var buf  = crypto.randomBytes(1024)
+    , buf2 = Buffer.alloc(1024)
+    , b    = BufferList(buf)
+
+  b.copy(buf2)
+  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy after many appends', function (t) {
+  var buf  = crypto.randomBytes(512)
+    , buf2 = Buffer.alloc(1024)
+    , b    = BufferList(buf)
+
+  b.append(buf)
+  b.copy(buf2)
+  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy at a precise position', function (t) {
+  var buf  = crypto.randomBytes(1004)
+    , buf2 = Buffer.alloc(1024)
+    , b    = BufferList(buf)
+
+  b.copy(buf2, 20)
+  t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+  var buf  = crypto.randomBytes(10)
+    , buf2 = Buffer.alloc(5)
+    , b    = BufferList(buf)
+
+  b.copy(buf2, 0, 5)
+  t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy in an interval', function (t) {
+  var rnd      = crypto.randomBytes(10)
+    , b        = BufferList(rnd) // put the random bytes there
+    , actual   = Buffer.alloc(3)
+    , expected = Buffer.alloc(3)
+
+  rnd.copy(expected, 0, 5, 8)
+  b.copy(actual, 0, 5, 8)
+
+  t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+  var buf      = crypto.randomBytes(10)
+    , buf2     = Buffer.alloc(10)
+    , b        = BufferList(buf)
+
+  b.append(buf)
+  b.copy(buf2, 0, 5, 15)
+
+  t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('shallow slice across buffer boundaries', function (t) {
+  var bl = new BufferList(['First', 'Second', 'Third'])
+
+  t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh')
+  t.end()
+})
+
+tape('shallow slice within single buffer', function (t) {
+  t.plan(2)
+  var bl = new BufferList(['First', 'Second', 'Third'])
+
+  t.equal(bl.shallowSlice(5, 10).toString(), 'Secon')
+  t.equal(bl.shallowSlice(7, 10).toString(), 'con')
+  t.end()
+})
+
+tape('shallow slice single buffer', function (t) {
+  t.plan(3)
+  var bl = new BufferList(['First', 'Second', 'Third'])
+
+  t.equal(bl.shallowSlice(0, 5).toString(), 'First')
+  t.equal(bl.shallowSlice(5, 11).toString(), 'Second')
+  t.equal(bl.shallowSlice(11, 16).toString(), 'Third')
+})
+
+tape('shallow slice with negative or omitted indices', function (t) {
+  t.plan(4)
+  var bl = new BufferList(['First', 'Second', 'Third'])
+
+  t.equal(bl.shallowSlice().toString(), 'FirstSecondThird')
+  t.equal(bl.shallowSlice(5).toString(), 'SecondThird')
+  t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh')
+  t.equal(bl.shallowSlice(-8).toString(), 'ondThird')
+})
+
+tape('shallow slice does not make a copy', function (t) {
+  t.plan(1)
+  var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
+  var bl = (new BufferList(buffers)).shallowSlice(5, -3)
+
+  buffers[1].fill('h')
+  buffers[2].fill('h')
+
+  t.equal(bl.toString(), 'hhhhhhhh')
+})
+
+tape('shallow slice with 0 length', function (t) {
+  t.plan(1)
+  var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
+  var bl = (new BufferList(buffers)).shallowSlice(0, 0)
+  t.equal(bl.length, 0)
+})
+
+tape('shallow slice with 0 length from middle', function (t) {
+  t.plan(1)
+  var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
+  var bl = (new BufferList(buffers)).shallowSlice(10, 10)
+  t.equal(bl.length, 0)
+})
+
+tape('duplicate', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList('abcdefghij\xff\x00')
+    , dup = bl.duplicate()
+
+  t.equal(bl.prototype, dup.prototype)
+  t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+  bl.destroy()
+
+  t.equal(bl._bufs.length, 0)
+  t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList()
+  fs.createReadStream(__dirname + '/test.js')
+    .pipe(bl)
+
+  bl.destroy()
+
+  t.equal(bl._bufs.length, 0)
+  t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList()
+  fs.createReadStream(__dirname + '/test.js')
+    .pipe(bl)
+
+  setTimeout(function () {
+    bl.destroy()
+    setTimeout(function () {
+      t.equal(bl._bufs.length, 0)
+      t.equal(bl.length, 0)
+    }, 500)
+  }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList()
+  fs.createReadStream(__dirname + '/test.js')
+    .on('end', onEnd)
+    .pipe(bl)
+
+  function onEnd () {
+    bl.destroy()
+
+    t.equal(bl._bufs.length, 0)
+    t.equal(bl.length, 0)
+  }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+  t.plan(4)
+
+  var bl = new BufferList()
+    , ds = new BufferList()
+
+  fs.createReadStream(__dirname + '/test.js')
+    .on('end', onEnd)
+    .pipe(bl)
+
+  function onEnd () {
+    bl.pipe(ds)
+
+    setTimeout(function () {
+      bl.destroy()
+
+      t.equals(bl._bufs.length, 0)
+      t.equals(bl.length, 0)
+
+      ds.destroy()
+
+      t.equals(bl._bufs.length, 0)
+      t.equals(bl.length, 0)
+
+    }, 100)
+  }
+})
+
+!process.browser && tape('handle error', function (t) {
+  t.plan(2)
+  fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+    t.ok(err instanceof Error, 'has error')
+    t.notOk(data, 'no data')
+  }))
+})
diff --git a/NodeAPI/node_modules/bson/HISTORY.md b/NodeAPI/node_modules/bson/HISTORY.md
new file mode 100644
index 0000000000000000000000000000000000000000..d8d5d207e747e0917506326c97730be03f6c13da
--- /dev/null
+++ b/NodeAPI/node_modules/bson/HISTORY.md
@@ -0,0 +1,301 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+### [1.1.6](https://github.com/mongodb/js-bson/compare/v1.1.5...v1.1.6) (2021-03-16)
+
+
+### Bug Fixes
+
+* Throw error on bigint usage and add helpers to Long ([#426](https://github.com/mongodb/js-bson/issues/426)) ([375f368](https://github.com/mongodb/js-bson/commit/375f368738807f2d41c7751e618fd09c8a1b94c9))
+
+### [1.1.5](https://github.com/mongodb/js-bson/compare/v1.1.4...v1.1.5) (2020-08-10)
+
+
+### Bug Fixes
+
+* **object-id:** harden the duck-typing ([b526145](https://github.com/mongodb/js-bson/commit/b5261450c3bc4abb2e2fb19b5b1a7aba27982d44))
+
+<a name="1.1.3"></a>
+## [1.1.3](https://github.com/mongodb/js-bson/compare/v1.1.2...v1.1.3) (2019-11-09)
+
+Reverts 1.1.2
+
+<a name="1.1.2"></a>
+## [1.1.2](https://github.com/mongodb/js-bson/compare/v1.1.1...v1.1.2) (2019-11-08)
+
+
+### Bug Fixes
+
+* **_bsontype:** only check bsontype if it is a prototype member. ([dd8a349](https://github.com/mongodb/js-bson/commit/dd8a349))
+
+
+
+<a name="1.1.1"></a>
+## [1.1.1](https://github.com/mongodb/js-bson/compare/v1.1.0...v1.1.1) (2019-03-08)
+
+
+### Bug Fixes
+
+* **object-id:** support 4.x->1.x interop for MinKey and ObjectId ([53419a5](https://github.com/mongodb/js-bson/commit/53419a5))
+
+
+### Features
+
+* replace new Buffer with modern versions ([24aefba](https://github.com/mongodb/js-bson/commit/24aefba))
+
+
+
+<a name="1.1.0"></a>
+# [1.1.0](https://github.com/mongodb/js-bson/compare/v1.0.9...v1.1.0) (2018-08-13)
+
+
+### Bug Fixes
+
+* **serializer:** do not use checkKeys for $clusterTime ([573e141](https://github.com/mongodb/js-bson/commit/573e141))
+
+
+
+<a name="1.0.9"></a>
+## [1.0.9](https://github.com/mongodb/js-bson/compare/v1.0.8...v1.0.9) (2018-06-07)
+
+
+### Bug Fixes
+
+* **serializer:** remove use of `const` ([5feb12f](https://github.com/mongodb/js-bson/commit/5feb12f))
+
+
+
+<a name="1.0.7"></a>
+## [1.0.7](https://github.com/mongodb/js-bson/compare/v1.0.6...v1.0.7) (2018-06-06)
+
+
+### Bug Fixes
+
+* **binary:** add type checking for buffer ([26b05b5](https://github.com/mongodb/js-bson/commit/26b05b5))
+* **bson:** fix custom inspect property ([080323b](https://github.com/mongodb/js-bson/commit/080323b))
+* **readme:** clarify documentation about deserialize methods ([20f764c](https://github.com/mongodb/js-bson/commit/20f764c))
+* **serialization:** normalize function stringification ([1320c10](https://github.com/mongodb/js-bson/commit/1320c10))
+
+
+
+<a name="1.0.6"></a>
+## [1.0.6](https://github.com/mongodb/js-bson/compare/v1.0.5...v1.0.6) (2018-03-12)
+
+
+### Features
+
+* **serialization:** support arbitrary sizes for the internal serialization buffer ([abe97bc](https://github.com/mongodb/js-bson/commit/abe97bc))
+
+
+
+<a name="1.0.5"></a>
+## 1.0.5 (2018-02-26)
+
+
+### Bug Fixes
+
+* **decimal128:** add basic guard against REDOS attacks ([bd61c45](https://github.com/mongodb/js-bson/commit/bd61c45))
+* **objectid:** if pid is 1, use random value ([e188ae6](https://github.com/mongodb/js-bson/commit/e188ae6))
+
+
+
+1.0.4 2016-01-11
+----------------
+- #204 remove Buffer.from as it's partially broken in early 4.x.x. series of node releases.
+
+1.0.3 2016-01-03
+----------------
+- Fixed toString for ObjectId so it will work with inspect.
+
+1.0.2 2016-01-02
+----------------
+- Minor optimizations for ObjectID to use Buffer.from where available.
+
+1.0.1 2016-12-06
+----------------
+- Reverse behavior for undefined to be serialized as NULL. MongoDB 3.4 does not allow for undefined comparisons.
+
+1.0.0 2016-12-06
+----------------
+- Introduced new BSON API and documentation.
+
+0.5.7 2016-11-18
+-----------------
+- NODE-848 BSON Regex flags must be alphabetically ordered.
+
+0.5.6 2016-10-19
+-----------------
+- NODE-833, Detects cyclic dependencies in documents and throws error if one is found.
+- Fix(deserializer): corrected the check for (size + index) comparison… (Issue #195, https://github.com/JoelParke).
+
+0.5.5 2016-09-15
+-----------------
+- Added DBPointer up conversion to DBRef
+
+0.5.4 2016-08-23
+-----------------
+- Added promoteValues flag (default to true) allowing user to specify if deserialization should be into wrapper classes only.
+
+0.5.3 2016-07-11
+-----------------
+- Throw error if ObjectId is not a string or a buffer.
+
+0.5.2 2016-07-11
+-----------------
+- All values encoded big-endian style for ObjectId.
+
+0.5.1 2016-07-11
+-----------------
+- Fixed encoding/decoding issue in ObjectId timestamp generation.
+- Removed BinaryParser dependency from the serializer/deserializer.
+
+0.5.0 2016-07-05
+-----------------
+- Added Decimal128 type and extended test suite to include entire bson corpus.
+
+0.4.23 2016-04-08
+-----------------
+- Allow for proper detection of ObjectId or objects that look like ObjectId, improving compatibility across third party libraries.
+- Remove one package from dependency due to having been pulled from NPM.
+
+0.4.22 2016-03-04
+-----------------
+- Fix "TypeError: data.copy is not a function" in Electron (Issue #170, https://github.com/kangas).
+- Fixed issue with undefined type on deserializing.
+
+0.4.21 2016-01-12
+-----------------
+- Minor optimizations to avoid non needed object creation.
+
+0.4.20 2015-10-15
+-----------------
+- Added bower file to repository.
+- Fixed browser pid sometimes set greater than 0xFFFF on browsers (Issue #155, https://github.com/rahatarmanahmed)
+
+0.4.19 2015-10-15
+-----------------
+- Remove all support for bson-ext.
+
+0.4.18 2015-10-15
+-----------------
+- ObjectID equality check should return boolean instead of throwing exception for invalid oid string #139
+- add option for deserializing binary into Buffer object #116
+
+0.4.17 2015-10-15
+-----------------
+- Validate regexp string for null bytes and throw if there is one.
+
+0.4.16 2015-10-07
+-----------------
+- Fixed issue with return statement in Map.js.
+
+0.4.15 2015-10-06
+-----------------
+- Exposed Map correctly via index.js file.
+
+0.4.14 2015-10-06
+-----------------
+- Exposed Map correctly via bson.js file.
+
+0.4.13 2015-10-06
+-----------------
+- Added ES6 Map type serialization as well as a polyfill for ES5.
+
+0.4.12 2015-09-18
+-----------------
+- Made ignore undefined an optional parameter.
+
+0.4.11 2015-08-06
+-----------------
+- Minor fix for invalid key checking.
+
+0.4.10 2015-08-06
+-----------------
+- NODE-38 Added new BSONRegExp type to allow direct serialization to MongoDB type.
+- Some performance improvements by in lining code.
+
+0.4.9 2015-08-06
+----------------
+- Undefined fields are omitted from serialization in objects.
+
+0.4.8 2015-07-14
+----------------
+- Fixed size validation to ensure we can deserialize from dumped files.
+
+0.4.7 2015-06-26
+----------------
+- Added ability to instruct deserializer to return raw BSON buffers for named array fields.
+- Minor deserialization optimization by moving inlined function out.
+
+0.4.6 2015-06-17
+----------------
+- Fixed serializeWithBufferAndIndex bug.
+
+0.4.5 2015-06-17
+----------------
+- Removed any references to the shared buffer to avoid non GC collectible bson instances.
+
+0.4.4 2015-06-17
+----------------
+- Fixed rethrowing of error when not RangeError.
+
+0.4.3 2015-06-17
+----------------
+- Start buffer at 64K and double as needed, meaning we keep a low memory profile until needed.
+
+0.4.2 2015-06-16
+----------------
+- More fixes for corrupt Bson
+
+0.4.1 2015-06-16
+----------------
+- More fixes for corrupt Bson
+
+0.4.0 2015-06-16
+----------------
+- New JS serializer serializing into a single buffer then copying out the new buffer. Performance is similar to current C++ parser.
+- Removed bson-ext extension dependency for now.
+
+0.3.2 2015-03-27
+----------------
+- Removed node-gyp from install script in package.json.
+
+0.3.1 2015-03-27
+----------------
+- Return pure js version on native() call if failed to initialize.
+
+0.3.0 2015-03-26
+----------------
+- Pulled out all C++ code into bson-ext and made it an optional dependency.
+
+0.2.21 2015-03-21
+-----------------
+- Updated Nan to 1.7.0 to support io.js and node 0.12.0
+
+0.2.19 2015-02-16
+-----------------
+- Updated Nan to 1.6.2 to support io.js and node 0.12.0
+
+0.2.18 2015-01-20
+-----------------
+- Updated Nan to 1.5.1 to support io.js
+
+0.2.16 2014-12-17
+-----------------
+- Made pid cycle on 0xffff to avoid weird overflows on creation of ObjectID's
+
+0.2.12 2014-08-24
+-----------------
+- Fixes for fortify review of c++ extension
+- toBSON correctly allows returns of non objects
+
+0.2.3 2013-10-01
+----------------
+- Drying of ObjectId code for generation of id (Issue #54, https://github.com/moredip)
+- Fixed issue where corrupt CString's could cause endless loop
+- Support for Node 0.11.X > (Issue #49, https://github.com/kkoopa)
+
+0.1.4 2012-09-25
+----------------
+- Added precompiled c++ native extensions for win32 ia32 and x64
diff --git a/NodeAPI/node_modules/bson/LICENSE.md b/NodeAPI/node_modules/bson/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..261eeb9e9f8b2b4b0d119366dda99c6fd7d35c64
--- /dev/null
+++ b/NodeAPI/node_modules/bson/LICENSE.md
@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
diff --git a/NodeAPI/node_modules/bson/README.md b/NodeAPI/node_modules/bson/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..0688341000f10b0c88cebeabc4b1c95ad3627820
--- /dev/null
+++ b/NodeAPI/node_modules/bson/README.md
@@ -0,0 +1,170 @@
+# BSON parser
+
+BSON is short for Bin­ary JSON and is the bin­ary-en­coded seri­al­iz­a­tion of JSON-like doc­u­ments. You can learn more about it in [the specification](http://bsonspec.org).
+
+This browser version of the BSON parser is compiled using [webpack](https://webpack.js.org/) and the current version is pre-compiled in the `browser_build` directory.
+
+This is the default BSON parser, however, there is a C++ Node.js addon version as well that does not support the browser. It can be found at [mongod-js/bson-ext](https://github.com/mongodb-js/bson-ext).
+
+## Usage
+
+To build a new version perform the following operations:
+
+```
+npm install
+npm run build
+```
+
+A simple example of how to use BSON in the browser:
+
+```html
+<script src="./browser_build/bson.js"></script>
+
+<script>
+  function start() {
+    // Get the Long type
+    var Long = BSON.Long;
+    // Create a bson parser instance
+    var bson = new BSON();
+
+    // Serialize document
+    var doc = { long: Long.fromNumber(100) }
+
+    // Serialize a document
+    var data = bson.serialize(doc)
+    // De serialize it again
+    var doc_2 = bson.deserialize(data)
+  }
+</script>
+```
+
+A simple example of how to use BSON in `Node.js`:
+
+```js
+// Get BSON parser class
+var BSON = require('bson')
+// Get the Long type
+var Long = BSON.Long;
+// Create a bson parser instance
+var bson = new BSON();
+
+// Serialize document
+var doc = { long: Long.fromNumber(100) }
+
+// Serialize a document
+var data = bson.serialize(doc)
+console.log('data:', data)
+
+// Deserialize the resulting Buffer
+var doc_2 = bson.deserialize(data)
+console.log('doc_2:', doc_2)
+```
+
+## Installation
+
+`npm install bson`
+
+## API
+
+### BSON types
+
+For all BSON types documentation, please refer to the following sources:
+  * [MongoDB BSON Type Reference](https://docs.mongodb.com/manual/reference/bson-types/)
+  * [BSON Spec](https://bsonspec.org/)
+
+### BSON serialization and deserialiation
+
+**`new BSON()`** - Creates a new BSON serializer/deserializer you can use to serialize and deserialize BSON.
+
+#### BSON.serialize
+
+The BSON `serialize` method takes a JavaScript object and an optional options object and returns a Node.js Buffer.
+
+  * `BSON.serialize(object, options)`
+    * @param {Object} object the JavaScript object to serialize.
+    * @param {Boolean} [options.checkKeys=false] the serializer will check if keys are valid.
+    * @param {Boolean} [options.serializeFunctions=false] serialize the JavaScript functions.
+    * @param {Boolean} [options.ignoreUndefined=true]
+    * @return {Buffer} returns a Buffer instance.
+
+#### BSON.serializeWithBufferAndIndex
+
+The BSON `serializeWithBufferAndIndex` method takes an object, a target buffer instance and an optional options object and returns the end serialization index in the final buffer.
+
+  * `BSON.serializeWithBufferAndIndex(object, buffer, options)`
+    * @param {Object} object the JavaScript object to serialize.
+    * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
+    * @param {Boolean} [options.checkKeys=false] the serializer will check if keys are valid.
+    * @param {Boolean} [options.serializeFunctions=false] serialize the JavaScript functions.
+    * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields.
+    * @param {Number} [options.index=0] the index in the buffer where we wish to start serializing into.
+    * @return {Number} returns the index pointing to the last written byte in the buffer.
+
+#### BSON.calculateObjectSize
+
+The BSON `calculateObjectSize` method takes a JavaScript object and an optional options object and returns the size of the BSON object.
+
+  * `BSON.calculateObjectSize(object, options)`
+    * @param {Object} object the JavaScript object to serialize.
+    * @param {Boolean} [options.serializeFunctions=false] serialize the JavaScript functions.
+    * @param {Boolean} [options.ignoreUndefined=true]
+    * @return {Buffer} returns a Buffer instance.
+
+#### BSON.deserialize
+
+The BSON `deserialize` method takes a Node.js Buffer and an optional options object and returns a deserialized JavaScript object.
+
+  * `BSON.deserialize(buffer, options)`
+    * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
+    * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
+    * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
+    * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
+    * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a Node.js Buffer instance.
+    * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
+    * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
+    * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
+    * @return {Object} returns the deserialized Javascript Object.
+
+#### BSON.deserializeStream
+
+The BSON `deserializeStream` method takes a Node.js Buffer, `startIndex` and allow more control over deserialization of a Buffer containing concatenated BSON documents.
+
+  * `BSON.deserializeStream(buffer, startIndex, numberOfDocuments, documents, docStartIndex, options)`
+    * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
+    * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
+    * @param {Number} numberOfDocuments number of documents to deserialize.
+    * @param {Array} documents an array where to store the deserialized documents.
+    * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
+    * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
+    * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
+    * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
+    * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
+    * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a Node.js Buffer instance.
+    * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
+    * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
+    * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
+    * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
+
+## FAQ
+
+#### Why does `undefined` get converted to `null`?
+
+The `undefined` BSON type has been [deprecated for many years](http://bsonspec.org/spec.html), so this library has dropped support for it. Use the `ignoreUndefined` option (for example, from the [driver](http://mongodb.github.io/node-mongodb-native/2.2/api/MongoClient.html#connect) ) to instead remove `undefined` keys.
+
+#### How do I add custom serialization logic?
+
+This library looks for `toBSON()` functions on every path, and calls the `toBSON()` function to get the value to serialize.
+
+```javascript
+var bson = new BSON();
+
+class CustomSerialize {
+  toBSON() {
+    return 42;
+  }
+}
+
+const obj = { answer: new CustomSerialize() };
+// "{ answer: 42 }"
+console.log(bson.deserialize(bson.serialize(obj)));
+```
diff --git a/NodeAPI/node_modules/bson/bower.json b/NodeAPI/node_modules/bson/bower.json
new file mode 100644
index 0000000000000000000000000000000000000000..eded1f82a5ce0e7a9cea0068942e126cd83c2850
--- /dev/null
+++ b/NodeAPI/node_modules/bson/bower.json
@@ -0,0 +1,26 @@
+{
+  "name": "bson",
+  "description": "A bson parser for node.js and the browser",
+  "keywords": [
+    "mongodb",
+    "bson",
+    "parser"
+  ],
+  "author": "Christian Amor Kvalheim <christkv@gmail.com>",
+  "main": "./browser_build/bson.js",
+  "license": "Apache-2.0",
+  "moduleType": [
+    "globals",
+    "node"
+  ],
+  "ignore": [
+    "**/.*",
+    "alternate_parsers",
+    "benchmarks",
+    "bower_components",
+    "node_modules",
+    "test",
+    "tools"
+  ],
+  "version": "1.1.6"
+}
diff --git a/NodeAPI/node_modules/bson/browser_build/bson.js b/NodeAPI/node_modules/bson/browser_build/bson.js
new file mode 100644
index 0000000000000000000000000000000000000000..9540a86f2df7e6aece13ecf4e08b52d7d2a8bc48
--- /dev/null
+++ b/NodeAPI/node_modules/bson/browser_build/bson.js
@@ -0,0 +1,18218 @@
+(function webpackUniversalModuleDefinition(root, factory) {
+	if(typeof exports === 'object' && typeof module === 'object')
+		module.exports = factory();
+	else if(typeof define === 'function' && define.amd)
+		define([], factory);
+	else {
+		var a = factory();
+		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
+	}
+})(this, function() {
+return /******/ (function(modules) { // webpackBootstrap
+/******/ 	// The module cache
+/******/ 	var installedModules = {};
+
+/******/ 	// The require function
+/******/ 	function __webpack_require__(moduleId) {
+
+/******/ 		// Check if module is in cache
+/******/ 		if(installedModules[moduleId])
+/******/ 			return installedModules[moduleId].exports;
+
+/******/ 		// Create a new module (and put it into the cache)
+/******/ 		var module = installedModules[moduleId] = {
+/******/ 			exports: {},
+/******/ 			id: moduleId,
+/******/ 			loaded: false
+/******/ 		};
+
+/******/ 		// Execute the module function
+/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
+
+/******/ 		// Flag the module as loaded
+/******/ 		module.loaded = true;
+
+/******/ 		// Return the exports of the module
+/******/ 		return module.exports;
+/******/ 	}
+
+
+/******/ 	// expose the modules object (__webpack_modules__)
+/******/ 	__webpack_require__.m = modules;
+
+/******/ 	// expose the module cache
+/******/ 	__webpack_require__.c = installedModules;
+
+/******/ 	// __webpack_public_path__
+/******/ 	__webpack_require__.p = "/";
+
+/******/ 	// Load entry module and return exports
+/******/ 	return __webpack_require__(0);
+/******/ })
+/************************************************************************/
+/******/ ([
+/* 0 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(1);
+	module.exports = __webpack_require__(332);
+
+
+/***/ }),
+/* 1 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(global) {"use strict";
+
+	__webpack_require__(2);
+
+	__webpack_require__(328);
+
+	__webpack_require__(329);
+
+	if (global._babelPolyfill) {
+	  throw new Error("only one instance of babel-polyfill is allowed");
+	}
+	global._babelPolyfill = true;
+
+	var DEFINE_PROPERTY = "defineProperty";
+	function define(O, key, value) {
+	  O[key] || Object[DEFINE_PROPERTY](O, key, {
+	    writable: true,
+	    configurable: true,
+	    value: value
+	  });
+	}
+
+	define(String.prototype, "padLeft", "".padStart);
+	define(String.prototype, "padRight", "".padEnd);
+
+	"pop,reverse,shift,keys,values,entries,indexOf,every,some,forEach,map,filter,find,findIndex,includes,join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill".split(",").forEach(function (key) {
+	  [][key] && define(Array, key, Function.call.bind([][key]));
+	});
+	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ }),
+/* 2 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(3);
+	__webpack_require__(53);
+	__webpack_require__(54);
+	__webpack_require__(55);
+	__webpack_require__(56);
+	__webpack_require__(58);
+	__webpack_require__(60);
+	__webpack_require__(61);
+	__webpack_require__(62);
+	__webpack_require__(63);
+	__webpack_require__(64);
+	__webpack_require__(65);
+	__webpack_require__(66);
+	__webpack_require__(67);
+	__webpack_require__(68);
+	__webpack_require__(70);
+	__webpack_require__(72);
+	__webpack_require__(74);
+	__webpack_require__(76);
+	__webpack_require__(79);
+	__webpack_require__(80);
+	__webpack_require__(81);
+	__webpack_require__(85);
+	__webpack_require__(87);
+	__webpack_require__(89);
+	__webpack_require__(92);
+	__webpack_require__(93);
+	__webpack_require__(94);
+	__webpack_require__(95);
+	__webpack_require__(97);
+	__webpack_require__(98);
+	__webpack_require__(99);
+	__webpack_require__(100);
+	__webpack_require__(101);
+	__webpack_require__(102);
+	__webpack_require__(103);
+	__webpack_require__(105);
+	__webpack_require__(106);
+	__webpack_require__(107);
+	__webpack_require__(109);
+	__webpack_require__(110);
+	__webpack_require__(111);
+	__webpack_require__(113);
+	__webpack_require__(115);
+	__webpack_require__(116);
+	__webpack_require__(117);
+	__webpack_require__(118);
+	__webpack_require__(119);
+	__webpack_require__(120);
+	__webpack_require__(121);
+	__webpack_require__(122);
+	__webpack_require__(123);
+	__webpack_require__(124);
+	__webpack_require__(125);
+	__webpack_require__(126);
+	__webpack_require__(127);
+	__webpack_require__(132);
+	__webpack_require__(133);
+	__webpack_require__(137);
+	__webpack_require__(138);
+	__webpack_require__(139);
+	__webpack_require__(140);
+	__webpack_require__(142);
+	__webpack_require__(143);
+	__webpack_require__(144);
+	__webpack_require__(145);
+	__webpack_require__(146);
+	__webpack_require__(147);
+	__webpack_require__(148);
+	__webpack_require__(149);
+	__webpack_require__(150);
+	__webpack_require__(151);
+	__webpack_require__(152);
+	__webpack_require__(153);
+	__webpack_require__(154);
+	__webpack_require__(155);
+	__webpack_require__(156);
+	__webpack_require__(158);
+	__webpack_require__(159);
+	__webpack_require__(161);
+	__webpack_require__(162);
+	__webpack_require__(168);
+	__webpack_require__(169);
+	__webpack_require__(171);
+	__webpack_require__(172);
+	__webpack_require__(173);
+	__webpack_require__(177);
+	__webpack_require__(178);
+	__webpack_require__(179);
+	__webpack_require__(180);
+	__webpack_require__(181);
+	__webpack_require__(183);
+	__webpack_require__(184);
+	__webpack_require__(185);
+	__webpack_require__(186);
+	__webpack_require__(189);
+	__webpack_require__(191);
+	__webpack_require__(192);
+	__webpack_require__(193);
+	__webpack_require__(195);
+	__webpack_require__(197);
+	__webpack_require__(199);
+	__webpack_require__(201);
+	__webpack_require__(202);
+	__webpack_require__(203);
+	__webpack_require__(207);
+	__webpack_require__(208);
+	__webpack_require__(209);
+	__webpack_require__(211);
+	__webpack_require__(221);
+	__webpack_require__(225);
+	__webpack_require__(226);
+	__webpack_require__(228);
+	__webpack_require__(229);
+	__webpack_require__(233);
+	__webpack_require__(234);
+	__webpack_require__(236);
+	__webpack_require__(237);
+	__webpack_require__(238);
+	__webpack_require__(239);
+	__webpack_require__(240);
+	__webpack_require__(241);
+	__webpack_require__(242);
+	__webpack_require__(243);
+	__webpack_require__(244);
+	__webpack_require__(245);
+	__webpack_require__(246);
+	__webpack_require__(247);
+	__webpack_require__(248);
+	__webpack_require__(249);
+	__webpack_require__(250);
+	__webpack_require__(251);
+	__webpack_require__(252);
+	__webpack_require__(253);
+	__webpack_require__(254);
+	__webpack_require__(256);
+	__webpack_require__(257);
+	__webpack_require__(258);
+	__webpack_require__(259);
+	__webpack_require__(260);
+	__webpack_require__(262);
+	__webpack_require__(263);
+	__webpack_require__(264);
+	__webpack_require__(266);
+	__webpack_require__(267);
+	__webpack_require__(268);
+	__webpack_require__(269);
+	__webpack_require__(270);
+	__webpack_require__(271);
+	__webpack_require__(272);
+	__webpack_require__(273);
+	__webpack_require__(275);
+	__webpack_require__(276);
+	__webpack_require__(278);
+	__webpack_require__(279);
+	__webpack_require__(280);
+	__webpack_require__(281);
+	__webpack_require__(284);
+	__webpack_require__(285);
+	__webpack_require__(287);
+	__webpack_require__(288);
+	__webpack_require__(289);
+	__webpack_require__(290);
+	__webpack_require__(292);
+	__webpack_require__(293);
+	__webpack_require__(294);
+	__webpack_require__(295);
+	__webpack_require__(296);
+	__webpack_require__(297);
+	__webpack_require__(298);
+	__webpack_require__(299);
+	__webpack_require__(300);
+	__webpack_require__(301);
+	__webpack_require__(303);
+	__webpack_require__(304);
+	__webpack_require__(305);
+	__webpack_require__(306);
+	__webpack_require__(307);
+	__webpack_require__(308);
+	__webpack_require__(309);
+	__webpack_require__(310);
+	__webpack_require__(311);
+	__webpack_require__(312);
+	__webpack_require__(313);
+	__webpack_require__(315);
+	__webpack_require__(316);
+	__webpack_require__(317);
+	__webpack_require__(318);
+	__webpack_require__(319);
+	__webpack_require__(320);
+	__webpack_require__(321);
+	__webpack_require__(322);
+	__webpack_require__(323);
+	__webpack_require__(324);
+	__webpack_require__(325);
+	__webpack_require__(326);
+	__webpack_require__(327);
+	module.exports = __webpack_require__(9);
+
+
+/***/ }),
+/* 3 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// ECMAScript 6 symbols shim
+	var global = __webpack_require__(4);
+	var has = __webpack_require__(5);
+	var DESCRIPTORS = __webpack_require__(6);
+	var $export = __webpack_require__(8);
+	var redefine = __webpack_require__(18);
+	var META = __webpack_require__(25).KEY;
+	var $fails = __webpack_require__(7);
+	var shared = __webpack_require__(21);
+	var setToStringTag = __webpack_require__(26);
+	var uid = __webpack_require__(19);
+	var wks = __webpack_require__(27);
+	var wksExt = __webpack_require__(28);
+	var wksDefine = __webpack_require__(29);
+	var enumKeys = __webpack_require__(30);
+	var isArray = __webpack_require__(45);
+	var anObject = __webpack_require__(12);
+	var isObject = __webpack_require__(13);
+	var toObject = __webpack_require__(46);
+	var toIObject = __webpack_require__(33);
+	var toPrimitive = __webpack_require__(16);
+	var createDesc = __webpack_require__(17);
+	var _create = __webpack_require__(47);
+	var gOPNExt = __webpack_require__(50);
+	var $GOPD = __webpack_require__(52);
+	var $GOPS = __webpack_require__(43);
+	var $DP = __webpack_require__(11);
+	var $keys = __webpack_require__(31);
+	var gOPD = $GOPD.f;
+	var dP = $DP.f;
+	var gOPN = gOPNExt.f;
+	var $Symbol = global.Symbol;
+	var $JSON = global.JSON;
+	var _stringify = $JSON && $JSON.stringify;
+	var PROTOTYPE = 'prototype';
+	var HIDDEN = wks('_hidden');
+	var TO_PRIMITIVE = wks('toPrimitive');
+	var isEnum = {}.propertyIsEnumerable;
+	var SymbolRegistry = shared('symbol-registry');
+	var AllSymbols = shared('symbols');
+	var OPSymbols = shared('op-symbols');
+	var ObjectProto = Object[PROTOTYPE];
+	var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
+	var QObject = global.QObject;
+	// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
+	var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
+
+	// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
+	var setSymbolDesc = DESCRIPTORS && $fails(function () {
+	  return _create(dP({}, 'a', {
+	    get: function () { return dP(this, 'a', { value: 7 }).a; }
+	  })).a != 7;
+	}) ? function (it, key, D) {
+	  var protoDesc = gOPD(ObjectProto, key);
+	  if (protoDesc) delete ObjectProto[key];
+	  dP(it, key, D);
+	  if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
+	} : dP;
+
+	var wrap = function (tag) {
+	  var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
+	  sym._k = tag;
+	  return sym;
+	};
+
+	var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
+	  return typeof it == 'symbol';
+	} : function (it) {
+	  return it instanceof $Symbol;
+	};
+
+	var $defineProperty = function defineProperty(it, key, D) {
+	  if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
+	  anObject(it);
+	  key = toPrimitive(key, true);
+	  anObject(D);
+	  if (has(AllSymbols, key)) {
+	    if (!D.enumerable) {
+	      if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
+	      it[HIDDEN][key] = true;
+	    } else {
+	      if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
+	      D = _create(D, { enumerable: createDesc(0, false) });
+	    } return setSymbolDesc(it, key, D);
+	  } return dP(it, key, D);
+	};
+	var $defineProperties = function defineProperties(it, P) {
+	  anObject(it);
+	  var keys = enumKeys(P = toIObject(P));
+	  var i = 0;
+	  var l = keys.length;
+	  var key;
+	  while (l > i) $defineProperty(it, key = keys[i++], P[key]);
+	  return it;
+	};
+	var $create = function create(it, P) {
+	  return P === undefined ? _create(it) : $defineProperties(_create(it), P);
+	};
+	var $propertyIsEnumerable = function propertyIsEnumerable(key) {
+	  var E = isEnum.call(this, key = toPrimitive(key, true));
+	  if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
+	  return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
+	};
+	var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
+	  it = toIObject(it);
+	  key = toPrimitive(key, true);
+	  if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
+	  var D = gOPD(it, key);
+	  if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
+	  return D;
+	};
+	var $getOwnPropertyNames = function getOwnPropertyNames(it) {
+	  var names = gOPN(toIObject(it));
+	  var result = [];
+	  var i = 0;
+	  var key;
+	  while (names.length > i) {
+	    if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
+	  } return result;
+	};
+	var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
+	  var IS_OP = it === ObjectProto;
+	  var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
+	  var result = [];
+	  var i = 0;
+	  var key;
+	  while (names.length > i) {
+	    if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
+	  } return result;
+	};
+
+	// 19.4.1.1 Symbol([description])
+	if (!USE_NATIVE) {
+	  $Symbol = function Symbol() {
+	    if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
+	    var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
+	    var $set = function (value) {
+	      if (this === ObjectProto) $set.call(OPSymbols, value);
+	      if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
+	      setSymbolDesc(this, tag, createDesc(1, value));
+	    };
+	    if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
+	    return wrap(tag);
+	  };
+	  redefine($Symbol[PROTOTYPE], 'toString', function toString() {
+	    return this._k;
+	  });
+
+	  $GOPD.f = $getOwnPropertyDescriptor;
+	  $DP.f = $defineProperty;
+	  __webpack_require__(51).f = gOPNExt.f = $getOwnPropertyNames;
+	  __webpack_require__(44).f = $propertyIsEnumerable;
+	  $GOPS.f = $getOwnPropertySymbols;
+
+	  if (DESCRIPTORS && !__webpack_require__(22)) {
+	    redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
+	  }
+
+	  wksExt.f = function (name) {
+	    return wrap(wks(name));
+	  };
+	}
+
+	$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
+
+	for (var es6Symbols = (
+	  // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
+	  'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
+	).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
+
+	for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
+
+	$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
+	  // 19.4.2.1 Symbol.for(key)
+	  'for': function (key) {
+	    return has(SymbolRegistry, key += '')
+	      ? SymbolRegistry[key]
+	      : SymbolRegistry[key] = $Symbol(key);
+	  },
+	  // 19.4.2.5 Symbol.keyFor(sym)
+	  keyFor: function keyFor(sym) {
+	    if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
+	    for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
+	  },
+	  useSetter: function () { setter = true; },
+	  useSimple: function () { setter = false; }
+	});
+
+	$export($export.S + $export.F * !USE_NATIVE, 'Object', {
+	  // 19.1.2.2 Object.create(O [, Properties])
+	  create: $create,
+	  // 19.1.2.4 Object.defineProperty(O, P, Attributes)
+	  defineProperty: $defineProperty,
+	  // 19.1.2.3 Object.defineProperties(O, Properties)
+	  defineProperties: $defineProperties,
+	  // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
+	  getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
+	  // 19.1.2.7 Object.getOwnPropertyNames(O)
+	  getOwnPropertyNames: $getOwnPropertyNames,
+	  // 19.1.2.8 Object.getOwnPropertySymbols(O)
+	  getOwnPropertySymbols: $getOwnPropertySymbols
+	});
+
+	// Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
+	// https://bugs.chromium.org/p/v8/issues/detail?id=3443
+	var FAILS_ON_PRIMITIVES = $fails(function () { $GOPS.f(1); });
+
+	$export($export.S + $export.F * FAILS_ON_PRIMITIVES, 'Object', {
+	  getOwnPropertySymbols: function getOwnPropertySymbols(it) {
+	    return $GOPS.f(toObject(it));
+	  }
+	});
+
+	// 24.3.2 JSON.stringify(value [, replacer [, space]])
+	$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
+	  var S = $Symbol();
+	  // MS Edge converts symbol values to JSON as {}
+	  // WebKit converts symbol values to JSON as null
+	  // V8 throws on boxed symbols
+	  return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
+	})), 'JSON', {
+	  stringify: function stringify(it) {
+	    var args = [it];
+	    var i = 1;
+	    var replacer, $replacer;
+	    while (arguments.length > i) args.push(arguments[i++]);
+	    $replacer = replacer = args[1];
+	    if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
+	    if (!isArray(replacer)) replacer = function (key, value) {
+	      if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
+	      if (!isSymbol(value)) return value;
+	    };
+	    args[1] = replacer;
+	    return _stringify.apply($JSON, args);
+	  }
+	});
+
+	// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
+	$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(10)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
+	// 19.4.3.5 Symbol.prototype[@@toStringTag]
+	setToStringTag($Symbol, 'Symbol');
+	// 20.2.1.9 Math[@@toStringTag]
+	setToStringTag(Math, 'Math', true);
+	// 24.3.3 JSON[@@toStringTag]
+	setToStringTag(global.JSON, 'JSON', true);
+
+
+/***/ }),
+/* 4 */
+/***/ (function(module, exports) {
+
+	// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
+	var global = module.exports = typeof window != 'undefined' && window.Math == Math
+	  ? window : typeof self != 'undefined' && self.Math == Math ? self
+	  // eslint-disable-next-line no-new-func
+	  : Function('return this')();
+	if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
+
+
+/***/ }),
+/* 5 */
+/***/ (function(module, exports) {
+
+	var hasOwnProperty = {}.hasOwnProperty;
+	module.exports = function (it, key) {
+	  return hasOwnProperty.call(it, key);
+	};
+
+
+/***/ }),
+/* 6 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// Thank's IE8 for his funny defineProperty
+	module.exports = !__webpack_require__(7)(function () {
+	  return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
+	});
+
+
+/***/ }),
+/* 7 */
+/***/ (function(module, exports) {
+
+	module.exports = function (exec) {
+	  try {
+	    return !!exec();
+	  } catch (e) {
+	    return true;
+	  }
+	};
+
+
+/***/ }),
+/* 8 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var core = __webpack_require__(9);
+	var hide = __webpack_require__(10);
+	var redefine = __webpack_require__(18);
+	var ctx = __webpack_require__(23);
+	var PROTOTYPE = 'prototype';
+
+	var $export = function (type, name, source) {
+	  var IS_FORCED = type & $export.F;
+	  var IS_GLOBAL = type & $export.G;
+	  var IS_STATIC = type & $export.S;
+	  var IS_PROTO = type & $export.P;
+	  var IS_BIND = type & $export.B;
+	  var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE];
+	  var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
+	  var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {});
+	  var key, own, out, exp;
+	  if (IS_GLOBAL) source = name;
+	  for (key in source) {
+	    // contains in native
+	    own = !IS_FORCED && target && target[key] !== undefined;
+	    // export native or passed
+	    out = (own ? target : source)[key];
+	    // bind timers to global for call from export context
+	    exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
+	    // extend global
+	    if (target) redefine(target, key, out, type & $export.U);
+	    // export
+	    if (exports[key] != out) hide(exports, key, exp);
+	    if (IS_PROTO && expProto[key] != out) expProto[key] = out;
+	  }
+	};
+	global.core = core;
+	// type bitmap
+	$export.F = 1;   // forced
+	$export.G = 2;   // global
+	$export.S = 4;   // static
+	$export.P = 8;   // proto
+	$export.B = 16;  // bind
+	$export.W = 32;  // wrap
+	$export.U = 64;  // safe
+	$export.R = 128; // real proto method for `library`
+	module.exports = $export;
+
+
+/***/ }),
+/* 9 */
+/***/ (function(module, exports) {
+
+	var core = module.exports = { version: '2.6.10' };
+	if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
+
+
+/***/ }),
+/* 10 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var dP = __webpack_require__(11);
+	var createDesc = __webpack_require__(17);
+	module.exports = __webpack_require__(6) ? function (object, key, value) {
+	  return dP.f(object, key, createDesc(1, value));
+	} : function (object, key, value) {
+	  object[key] = value;
+	  return object;
+	};
+
+
+/***/ }),
+/* 11 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var anObject = __webpack_require__(12);
+	var IE8_DOM_DEFINE = __webpack_require__(14);
+	var toPrimitive = __webpack_require__(16);
+	var dP = Object.defineProperty;
+
+	exports.f = __webpack_require__(6) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
+	  anObject(O);
+	  P = toPrimitive(P, true);
+	  anObject(Attributes);
+	  if (IE8_DOM_DEFINE) try {
+	    return dP(O, P, Attributes);
+	  } catch (e) { /* empty */ }
+	  if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
+	  if ('value' in Attributes) O[P] = Attributes.value;
+	  return O;
+	};
+
+
+/***/ }),
+/* 12 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var isObject = __webpack_require__(13);
+	module.exports = function (it) {
+	  if (!isObject(it)) throw TypeError(it + ' is not an object!');
+	  return it;
+	};
+
+
+/***/ }),
+/* 13 */
+/***/ (function(module, exports) {
+
+	module.exports = function (it) {
+	  return typeof it === 'object' ? it !== null : typeof it === 'function';
+	};
+
+
+/***/ }),
+/* 14 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	module.exports = !__webpack_require__(6) && !__webpack_require__(7)(function () {
+	  return Object.defineProperty(__webpack_require__(15)('div'), 'a', { get: function () { return 7; } }).a != 7;
+	});
+
+
+/***/ }),
+/* 15 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var isObject = __webpack_require__(13);
+	var document = __webpack_require__(4).document;
+	// typeof document.createElement is 'object' in old IE
+	var is = isObject(document) && isObject(document.createElement);
+	module.exports = function (it) {
+	  return is ? document.createElement(it) : {};
+	};
+
+
+/***/ }),
+/* 16 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 7.1.1 ToPrimitive(input [, PreferredType])
+	var isObject = __webpack_require__(13);
+	// instead of the ES6 spec version, we didn't implement @@toPrimitive case
+	// and the second argument - flag - preferred type is a string
+	module.exports = function (it, S) {
+	  if (!isObject(it)) return it;
+	  var fn, val;
+	  if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
+	  if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
+	  if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
+	  throw TypeError("Can't convert object to primitive value");
+	};
+
+
+/***/ }),
+/* 17 */
+/***/ (function(module, exports) {
+
+	module.exports = function (bitmap, value) {
+	  return {
+	    enumerable: !(bitmap & 1),
+	    configurable: !(bitmap & 2),
+	    writable: !(bitmap & 4),
+	    value: value
+	  };
+	};
+
+
+/***/ }),
+/* 18 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var hide = __webpack_require__(10);
+	var has = __webpack_require__(5);
+	var SRC = __webpack_require__(19)('src');
+	var $toString = __webpack_require__(20);
+	var TO_STRING = 'toString';
+	var TPL = ('' + $toString).split(TO_STRING);
+
+	__webpack_require__(9).inspectSource = function (it) {
+	  return $toString.call(it);
+	};
+
+	(module.exports = function (O, key, val, safe) {
+	  var isFunction = typeof val == 'function';
+	  if (isFunction) has(val, 'name') || hide(val, 'name', key);
+	  if (O[key] === val) return;
+	  if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key)));
+	  if (O === global) {
+	    O[key] = val;
+	  } else if (!safe) {
+	    delete O[key];
+	    hide(O, key, val);
+	  } else if (O[key]) {
+	    O[key] = val;
+	  } else {
+	    hide(O, key, val);
+	  }
+	// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
+	})(Function.prototype, TO_STRING, function toString() {
+	  return typeof this == 'function' && this[SRC] || $toString.call(this);
+	});
+
+
+/***/ }),
+/* 19 */
+/***/ (function(module, exports) {
+
+	var id = 0;
+	var px = Math.random();
+	module.exports = function (key) {
+	  return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
+	};
+
+
+/***/ }),
+/* 20 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	module.exports = __webpack_require__(21)('native-function-to-string', Function.toString);
+
+
+/***/ }),
+/* 21 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var core = __webpack_require__(9);
+	var global = __webpack_require__(4);
+	var SHARED = '__core-js_shared__';
+	var store = global[SHARED] || (global[SHARED] = {});
+
+	(module.exports = function (key, value) {
+	  return store[key] || (store[key] = value !== undefined ? value : {});
+	})('versions', []).push({
+	  version: core.version,
+	  mode: __webpack_require__(22) ? 'pure' : 'global',
+	  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
+	});
+
+
+/***/ }),
+/* 22 */
+/***/ (function(module, exports) {
+
+	module.exports = false;
+
+
+/***/ }),
+/* 23 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// optional / simple context binding
+	var aFunction = __webpack_require__(24);
+	module.exports = function (fn, that, length) {
+	  aFunction(fn);
+	  if (that === undefined) return fn;
+	  switch (length) {
+	    case 1: return function (a) {
+	      return fn.call(that, a);
+	    };
+	    case 2: return function (a, b) {
+	      return fn.call(that, a, b);
+	    };
+	    case 3: return function (a, b, c) {
+	      return fn.call(that, a, b, c);
+	    };
+	  }
+	  return function (/* ...args */) {
+	    return fn.apply(that, arguments);
+	  };
+	};
+
+
+/***/ }),
+/* 24 */
+/***/ (function(module, exports) {
+
+	module.exports = function (it) {
+	  if (typeof it != 'function') throw TypeError(it + ' is not a function!');
+	  return it;
+	};
+
+
+/***/ }),
+/* 25 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var META = __webpack_require__(19)('meta');
+	var isObject = __webpack_require__(13);
+	var has = __webpack_require__(5);
+	var setDesc = __webpack_require__(11).f;
+	var id = 0;
+	var isExtensible = Object.isExtensible || function () {
+	  return true;
+	};
+	var FREEZE = !__webpack_require__(7)(function () {
+	  return isExtensible(Object.preventExtensions({}));
+	});
+	var setMeta = function (it) {
+	  setDesc(it, META, { value: {
+	    i: 'O' + ++id, // object ID
+	    w: {}          // weak collections IDs
+	  } });
+	};
+	var fastKey = function (it, create) {
+	  // return primitive with prefix
+	  if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
+	  if (!has(it, META)) {
+	    // can't set metadata to uncaught frozen object
+	    if (!isExtensible(it)) return 'F';
+	    // not necessary to add metadata
+	    if (!create) return 'E';
+	    // add missing metadata
+	    setMeta(it);
+	  // return object ID
+	  } return it[META].i;
+	};
+	var getWeak = function (it, create) {
+	  if (!has(it, META)) {
+	    // can't set metadata to uncaught frozen object
+	    if (!isExtensible(it)) return true;
+	    // not necessary to add metadata
+	    if (!create) return false;
+	    // add missing metadata
+	    setMeta(it);
+	  // return hash weak collections IDs
+	  } return it[META].w;
+	};
+	// add metadata on freeze-family methods calling
+	var onFreeze = function (it) {
+	  if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
+	  return it;
+	};
+	var meta = module.exports = {
+	  KEY: META,
+	  NEED: false,
+	  fastKey: fastKey,
+	  getWeak: getWeak,
+	  onFreeze: onFreeze
+	};
+
+
+/***/ }),
+/* 26 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var def = __webpack_require__(11).f;
+	var has = __webpack_require__(5);
+	var TAG = __webpack_require__(27)('toStringTag');
+
+	module.exports = function (it, tag, stat) {
+	  if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
+	};
+
+
+/***/ }),
+/* 27 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var store = __webpack_require__(21)('wks');
+	var uid = __webpack_require__(19);
+	var Symbol = __webpack_require__(4).Symbol;
+	var USE_SYMBOL = typeof Symbol == 'function';
+
+	var $exports = module.exports = function (name) {
+	  return store[name] || (store[name] =
+	    USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
+	};
+
+	$exports.store = store;
+
+
+/***/ }),
+/* 28 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	exports.f = __webpack_require__(27);
+
+
+/***/ }),
+/* 29 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var core = __webpack_require__(9);
+	var LIBRARY = __webpack_require__(22);
+	var wksExt = __webpack_require__(28);
+	var defineProperty = __webpack_require__(11).f;
+	module.exports = function (name) {
+	  var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
+	  if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
+	};
+
+
+/***/ }),
+/* 30 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// all enumerable object keys, includes symbols
+	var getKeys = __webpack_require__(31);
+	var gOPS = __webpack_require__(43);
+	var pIE = __webpack_require__(44);
+	module.exports = function (it) {
+	  var result = getKeys(it);
+	  var getSymbols = gOPS.f;
+	  if (getSymbols) {
+	    var symbols = getSymbols(it);
+	    var isEnum = pIE.f;
+	    var i = 0;
+	    var key;
+	    while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
+	  } return result;
+	};
+
+
+/***/ }),
+/* 31 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.14 / 15.2.3.14 Object.keys(O)
+	var $keys = __webpack_require__(32);
+	var enumBugKeys = __webpack_require__(42);
+
+	module.exports = Object.keys || function keys(O) {
+	  return $keys(O, enumBugKeys);
+	};
+
+
+/***/ }),
+/* 32 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var has = __webpack_require__(5);
+	var toIObject = __webpack_require__(33);
+	var arrayIndexOf = __webpack_require__(37)(false);
+	var IE_PROTO = __webpack_require__(41)('IE_PROTO');
+
+	module.exports = function (object, names) {
+	  var O = toIObject(object);
+	  var i = 0;
+	  var result = [];
+	  var key;
+	  for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
+	  // Don't enum bug & hidden keys
+	  while (names.length > i) if (has(O, key = names[i++])) {
+	    ~arrayIndexOf(result, key) || result.push(key);
+	  }
+	  return result;
+	};
+
+
+/***/ }),
+/* 33 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// to indexed object, toObject with fallback for non-array-like ES3 strings
+	var IObject = __webpack_require__(34);
+	var defined = __webpack_require__(36);
+	module.exports = function (it) {
+	  return IObject(defined(it));
+	};
+
+
+/***/ }),
+/* 34 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// fallback for non-array-like ES3 and non-enumerable old V8 strings
+	var cof = __webpack_require__(35);
+	// eslint-disable-next-line no-prototype-builtins
+	module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
+	  return cof(it) == 'String' ? it.split('') : Object(it);
+	};
+
+
+/***/ }),
+/* 35 */
+/***/ (function(module, exports) {
+
+	var toString = {}.toString;
+
+	module.exports = function (it) {
+	  return toString.call(it).slice(8, -1);
+	};
+
+
+/***/ }),
+/* 36 */
+/***/ (function(module, exports) {
+
+	// 7.2.1 RequireObjectCoercible(argument)
+	module.exports = function (it) {
+	  if (it == undefined) throw TypeError("Can't call method on  " + it);
+	  return it;
+	};
+
+
+/***/ }),
+/* 37 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// false -> Array#indexOf
+	// true  -> Array#includes
+	var toIObject = __webpack_require__(33);
+	var toLength = __webpack_require__(38);
+	var toAbsoluteIndex = __webpack_require__(40);
+	module.exports = function (IS_INCLUDES) {
+	  return function ($this, el, fromIndex) {
+	    var O = toIObject($this);
+	    var length = toLength(O.length);
+	    var index = toAbsoluteIndex(fromIndex, length);
+	    var value;
+	    // Array#includes uses SameValueZero equality algorithm
+	    // eslint-disable-next-line no-self-compare
+	    if (IS_INCLUDES && el != el) while (length > index) {
+	      value = O[index++];
+	      // eslint-disable-next-line no-self-compare
+	      if (value != value) return true;
+	    // Array#indexOf ignores holes, Array#includes - not
+	    } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
+	      if (O[index] === el) return IS_INCLUDES || index || 0;
+	    } return !IS_INCLUDES && -1;
+	  };
+	};
+
+
+/***/ }),
+/* 38 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 7.1.15 ToLength
+	var toInteger = __webpack_require__(39);
+	var min = Math.min;
+	module.exports = function (it) {
+	  return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
+	};
+
+
+/***/ }),
+/* 39 */
+/***/ (function(module, exports) {
+
+	// 7.1.4 ToInteger
+	var ceil = Math.ceil;
+	var floor = Math.floor;
+	module.exports = function (it) {
+	  return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
+	};
+
+
+/***/ }),
+/* 40 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var toInteger = __webpack_require__(39);
+	var max = Math.max;
+	var min = Math.min;
+	module.exports = function (index, length) {
+	  index = toInteger(index);
+	  return index < 0 ? max(index + length, 0) : min(index, length);
+	};
+
+
+/***/ }),
+/* 41 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var shared = __webpack_require__(21)('keys');
+	var uid = __webpack_require__(19);
+	module.exports = function (key) {
+	  return shared[key] || (shared[key] = uid(key));
+	};
+
+
+/***/ }),
+/* 42 */
+/***/ (function(module, exports) {
+
+	// IE 8- don't enum bug keys
+	module.exports = (
+	  'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
+	).split(',');
+
+
+/***/ }),
+/* 43 */
+/***/ (function(module, exports) {
+
+	exports.f = Object.getOwnPropertySymbols;
+
+
+/***/ }),
+/* 44 */
+/***/ (function(module, exports) {
+
+	exports.f = {}.propertyIsEnumerable;
+
+
+/***/ }),
+/* 45 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 7.2.2 IsArray(argument)
+	var cof = __webpack_require__(35);
+	module.exports = Array.isArray || function isArray(arg) {
+	  return cof(arg) == 'Array';
+	};
+
+
+/***/ }),
+/* 46 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 7.1.13 ToObject(argument)
+	var defined = __webpack_require__(36);
+	module.exports = function (it) {
+	  return Object(defined(it));
+	};
+
+
+/***/ }),
+/* 47 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
+	var anObject = __webpack_require__(12);
+	var dPs = __webpack_require__(48);
+	var enumBugKeys = __webpack_require__(42);
+	var IE_PROTO = __webpack_require__(41)('IE_PROTO');
+	var Empty = function () { /* empty */ };
+	var PROTOTYPE = 'prototype';
+
+	// Create object with fake `null` prototype: use iframe Object with cleared prototype
+	var createDict = function () {
+	  // Thrash, waste and sodomy: IE GC bug
+	  var iframe = __webpack_require__(15)('iframe');
+	  var i = enumBugKeys.length;
+	  var lt = '<';
+	  var gt = '>';
+	  var iframeDocument;
+	  iframe.style.display = 'none';
+	  __webpack_require__(49).appendChild(iframe);
+	  iframe.src = 'javascript:'; // eslint-disable-line no-script-url
+	  // createDict = iframe.contentWindow.Object;
+	  // html.removeChild(iframe);
+	  iframeDocument = iframe.contentWindow.document;
+	  iframeDocument.open();
+	  iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
+	  iframeDocument.close();
+	  createDict = iframeDocument.F;
+	  while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
+	  return createDict();
+	};
+
+	module.exports = Object.create || function create(O, Properties) {
+	  var result;
+	  if (O !== null) {
+	    Empty[PROTOTYPE] = anObject(O);
+	    result = new Empty();
+	    Empty[PROTOTYPE] = null;
+	    // add "__proto__" for Object.getPrototypeOf polyfill
+	    result[IE_PROTO] = O;
+	  } else result = createDict();
+	  return Properties === undefined ? result : dPs(result, Properties);
+	};
+
+
+/***/ }),
+/* 48 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var dP = __webpack_require__(11);
+	var anObject = __webpack_require__(12);
+	var getKeys = __webpack_require__(31);
+
+	module.exports = __webpack_require__(6) ? Object.defineProperties : function defineProperties(O, Properties) {
+	  anObject(O);
+	  var keys = getKeys(Properties);
+	  var length = keys.length;
+	  var i = 0;
+	  var P;
+	  while (length > i) dP.f(O, P = keys[i++], Properties[P]);
+	  return O;
+	};
+
+
+/***/ }),
+/* 49 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var document = __webpack_require__(4).document;
+	module.exports = document && document.documentElement;
+
+
+/***/ }),
+/* 50 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
+	var toIObject = __webpack_require__(33);
+	var gOPN = __webpack_require__(51).f;
+	var toString = {}.toString;
+
+	var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
+	  ? Object.getOwnPropertyNames(window) : [];
+
+	var getWindowNames = function (it) {
+	  try {
+	    return gOPN(it);
+	  } catch (e) {
+	    return windowNames.slice();
+	  }
+	};
+
+	module.exports.f = function getOwnPropertyNames(it) {
+	  return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
+	};
+
+
+/***/ }),
+/* 51 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
+	var $keys = __webpack_require__(32);
+	var hiddenKeys = __webpack_require__(42).concat('length', 'prototype');
+
+	exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
+	  return $keys(O, hiddenKeys);
+	};
+
+
+/***/ }),
+/* 52 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var pIE = __webpack_require__(44);
+	var createDesc = __webpack_require__(17);
+	var toIObject = __webpack_require__(33);
+	var toPrimitive = __webpack_require__(16);
+	var has = __webpack_require__(5);
+	var IE8_DOM_DEFINE = __webpack_require__(14);
+	var gOPD = Object.getOwnPropertyDescriptor;
+
+	exports.f = __webpack_require__(6) ? gOPD : function getOwnPropertyDescriptor(O, P) {
+	  O = toIObject(O);
+	  P = toPrimitive(P, true);
+	  if (IE8_DOM_DEFINE) try {
+	    return gOPD(O, P);
+	  } catch (e) { /* empty */ }
+	  if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
+	};
+
+
+/***/ }),
+/* 53 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
+	$export($export.S, 'Object', { create: __webpack_require__(47) });
+
+
+/***/ }),
+/* 54 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
+	$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperty: __webpack_require__(11).f });
+
+
+/***/ }),
+/* 55 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	// 19.1.2.3 / 15.2.3.7 Object.defineProperties(O, Properties)
+	$export($export.S + $export.F * !__webpack_require__(6), 'Object', { defineProperties: __webpack_require__(48) });
+
+
+/***/ }),
+/* 56 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
+	var toIObject = __webpack_require__(33);
+	var $getOwnPropertyDescriptor = __webpack_require__(52).f;
+
+	__webpack_require__(57)('getOwnPropertyDescriptor', function () {
+	  return function getOwnPropertyDescriptor(it, key) {
+	    return $getOwnPropertyDescriptor(toIObject(it), key);
+	  };
+	});
+
+
+/***/ }),
+/* 57 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// most Object methods by ES6 should accept primitives
+	var $export = __webpack_require__(8);
+	var core = __webpack_require__(9);
+	var fails = __webpack_require__(7);
+	module.exports = function (KEY, exec) {
+	  var fn = (core.Object || {})[KEY] || Object[KEY];
+	  var exp = {};
+	  exp[KEY] = exec(fn);
+	  $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
+	};
+
+
+/***/ }),
+/* 58 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.9 Object.getPrototypeOf(O)
+	var toObject = __webpack_require__(46);
+	var $getPrototypeOf = __webpack_require__(59);
+
+	__webpack_require__(57)('getPrototypeOf', function () {
+	  return function getPrototypeOf(it) {
+	    return $getPrototypeOf(toObject(it));
+	  };
+	});
+
+
+/***/ }),
+/* 59 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
+	var has = __webpack_require__(5);
+	var toObject = __webpack_require__(46);
+	var IE_PROTO = __webpack_require__(41)('IE_PROTO');
+	var ObjectProto = Object.prototype;
+
+	module.exports = Object.getPrototypeOf || function (O) {
+	  O = toObject(O);
+	  if (has(O, IE_PROTO)) return O[IE_PROTO];
+	  if (typeof O.constructor == 'function' && O instanceof O.constructor) {
+	    return O.constructor.prototype;
+	  } return O instanceof Object ? ObjectProto : null;
+	};
+
+
+/***/ }),
+/* 60 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.14 Object.keys(O)
+	var toObject = __webpack_require__(46);
+	var $keys = __webpack_require__(31);
+
+	__webpack_require__(57)('keys', function () {
+	  return function keys(it) {
+	    return $keys(toObject(it));
+	  };
+	});
+
+
+/***/ }),
+/* 61 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.7 Object.getOwnPropertyNames(O)
+	__webpack_require__(57)('getOwnPropertyNames', function () {
+	  return __webpack_require__(50).f;
+	});
+
+
+/***/ }),
+/* 62 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.5 Object.freeze(O)
+	var isObject = __webpack_require__(13);
+	var meta = __webpack_require__(25).onFreeze;
+
+	__webpack_require__(57)('freeze', function ($freeze) {
+	  return function freeze(it) {
+	    return $freeze && isObject(it) ? $freeze(meta(it)) : it;
+	  };
+	});
+
+
+/***/ }),
+/* 63 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.17 Object.seal(O)
+	var isObject = __webpack_require__(13);
+	var meta = __webpack_require__(25).onFreeze;
+
+	__webpack_require__(57)('seal', function ($seal) {
+	  return function seal(it) {
+	    return $seal && isObject(it) ? $seal(meta(it)) : it;
+	  };
+	});
+
+
+/***/ }),
+/* 64 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.15 Object.preventExtensions(O)
+	var isObject = __webpack_require__(13);
+	var meta = __webpack_require__(25).onFreeze;
+
+	__webpack_require__(57)('preventExtensions', function ($preventExtensions) {
+	  return function preventExtensions(it) {
+	    return $preventExtensions && isObject(it) ? $preventExtensions(meta(it)) : it;
+	  };
+	});
+
+
+/***/ }),
+/* 65 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.12 Object.isFrozen(O)
+	var isObject = __webpack_require__(13);
+
+	__webpack_require__(57)('isFrozen', function ($isFrozen) {
+	  return function isFrozen(it) {
+	    return isObject(it) ? $isFrozen ? $isFrozen(it) : false : true;
+	  };
+	});
+
+
+/***/ }),
+/* 66 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.13 Object.isSealed(O)
+	var isObject = __webpack_require__(13);
+
+	__webpack_require__(57)('isSealed', function ($isSealed) {
+	  return function isSealed(it) {
+	    return isObject(it) ? $isSealed ? $isSealed(it) : false : true;
+	  };
+	});
+
+
+/***/ }),
+/* 67 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.2.11 Object.isExtensible(O)
+	var isObject = __webpack_require__(13);
+
+	__webpack_require__(57)('isExtensible', function ($isExtensible) {
+	  return function isExtensible(it) {
+	    return isObject(it) ? $isExtensible ? $isExtensible(it) : true : false;
+	  };
+	});
+
+
+/***/ }),
+/* 68 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.3.1 Object.assign(target, source)
+	var $export = __webpack_require__(8);
+
+	$export($export.S + $export.F, 'Object', { assign: __webpack_require__(69) });
+
+
+/***/ }),
+/* 69 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 19.1.2.1 Object.assign(target, source, ...)
+	var DESCRIPTORS = __webpack_require__(6);
+	var getKeys = __webpack_require__(31);
+	var gOPS = __webpack_require__(43);
+	var pIE = __webpack_require__(44);
+	var toObject = __webpack_require__(46);
+	var IObject = __webpack_require__(34);
+	var $assign = Object.assign;
+
+	// should work with symbols and should have deterministic property order (V8 bug)
+	module.exports = !$assign || __webpack_require__(7)(function () {
+	  var A = {};
+	  var B = {};
+	  // eslint-disable-next-line no-undef
+	  var S = Symbol();
+	  var K = 'abcdefghijklmnopqrst';
+	  A[S] = 7;
+	  K.split('').forEach(function (k) { B[k] = k; });
+	  return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
+	}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
+	  var T = toObject(target);
+	  var aLen = arguments.length;
+	  var index = 1;
+	  var getSymbols = gOPS.f;
+	  var isEnum = pIE.f;
+	  while (aLen > index) {
+	    var S = IObject(arguments[index++]);
+	    var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
+	    var length = keys.length;
+	    var j = 0;
+	    var key;
+	    while (length > j) {
+	      key = keys[j++];
+	      if (!DESCRIPTORS || isEnum.call(S, key)) T[key] = S[key];
+	    }
+	  } return T;
+	} : $assign;
+
+
+/***/ }),
+/* 70 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.3.10 Object.is(value1, value2)
+	var $export = __webpack_require__(8);
+	$export($export.S, 'Object', { is: __webpack_require__(71) });
+
+
+/***/ }),
+/* 71 */
+/***/ (function(module, exports) {
+
+	// 7.2.9 SameValue(x, y)
+	module.exports = Object.is || function is(x, y) {
+	  // eslint-disable-next-line no-self-compare
+	  return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
+	};
+
+
+/***/ }),
+/* 72 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.1.3.19 Object.setPrototypeOf(O, proto)
+	var $export = __webpack_require__(8);
+	$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(73).set });
+
+
+/***/ }),
+/* 73 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// Works with __proto__ only. Old v8 can't work with null proto objects.
+	/* eslint-disable no-proto */
+	var isObject = __webpack_require__(13);
+	var anObject = __webpack_require__(12);
+	var check = function (O, proto) {
+	  anObject(O);
+	  if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
+	};
+	module.exports = {
+	  set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
+	    function (test, buggy, set) {
+	      try {
+	        set = __webpack_require__(23)(Function.call, __webpack_require__(52).f(Object.prototype, '__proto__').set, 2);
+	        set(test, []);
+	        buggy = !(test instanceof Array);
+	      } catch (e) { buggy = true; }
+	      return function setPrototypeOf(O, proto) {
+	        check(O, proto);
+	        if (buggy) O.__proto__ = proto;
+	        else set(O, proto);
+	        return O;
+	      };
+	    }({}, false) : undefined),
+	  check: check
+	};
+
+
+/***/ }),
+/* 74 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 19.1.3.6 Object.prototype.toString()
+	var classof = __webpack_require__(75);
+	var test = {};
+	test[__webpack_require__(27)('toStringTag')] = 'z';
+	if (test + '' != '[object z]') {
+	  __webpack_require__(18)(Object.prototype, 'toString', function toString() {
+	    return '[object ' + classof(this) + ']';
+	  }, true);
+	}
+
+
+/***/ }),
+/* 75 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// getting tag from 19.1.3.6 Object.prototype.toString()
+	var cof = __webpack_require__(35);
+	var TAG = __webpack_require__(27)('toStringTag');
+	// ES3 wrong here
+	var ARG = cof(function () { return arguments; }()) == 'Arguments';
+
+	// fallback for IE11 Script Access Denied error
+	var tryGet = function (it, key) {
+	  try {
+	    return it[key];
+	  } catch (e) { /* empty */ }
+	};
+
+	module.exports = function (it) {
+	  var O, T, B;
+	  return it === undefined ? 'Undefined' : it === null ? 'Null'
+	    // @@toStringTag case
+	    : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
+	    // builtinTag case
+	    : ARG ? cof(O)
+	    // ES3 arguments fallback
+	    : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
+	};
+
+
+/***/ }),
+/* 76 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 19.2.3.2 / 15.3.4.5 Function.prototype.bind(thisArg, args...)
+	var $export = __webpack_require__(8);
+
+	$export($export.P, 'Function', { bind: __webpack_require__(77) });
+
+
+/***/ }),
+/* 77 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var aFunction = __webpack_require__(24);
+	var isObject = __webpack_require__(13);
+	var invoke = __webpack_require__(78);
+	var arraySlice = [].slice;
+	var factories = {};
+
+	var construct = function (F, len, args) {
+	  if (!(len in factories)) {
+	    for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
+	    // eslint-disable-next-line no-new-func
+	    factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
+	  } return factories[len](F, args);
+	};
+
+	module.exports = Function.bind || function bind(that /* , ...args */) {
+	  var fn = aFunction(this);
+	  var partArgs = arraySlice.call(arguments, 1);
+	  var bound = function (/* args... */) {
+	    var args = partArgs.concat(arraySlice.call(arguments));
+	    return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
+	  };
+	  if (isObject(fn.prototype)) bound.prototype = fn.prototype;
+	  return bound;
+	};
+
+
+/***/ }),
+/* 78 */
+/***/ (function(module, exports) {
+
+	// fast apply, http://jsperf.lnkit.com/fast-apply/5
+	module.exports = function (fn, args, that) {
+	  var un = that === undefined;
+	  switch (args.length) {
+	    case 0: return un ? fn()
+	                      : fn.call(that);
+	    case 1: return un ? fn(args[0])
+	                      : fn.call(that, args[0]);
+	    case 2: return un ? fn(args[0], args[1])
+	                      : fn.call(that, args[0], args[1]);
+	    case 3: return un ? fn(args[0], args[1], args[2])
+	                      : fn.call(that, args[0], args[1], args[2]);
+	    case 4: return un ? fn(args[0], args[1], args[2], args[3])
+	                      : fn.call(that, args[0], args[1], args[2], args[3]);
+	  } return fn.apply(that, args);
+	};
+
+
+/***/ }),
+/* 79 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var dP = __webpack_require__(11).f;
+	var FProto = Function.prototype;
+	var nameRE = /^\s*function ([^ (]*)/;
+	var NAME = 'name';
+
+	// 19.2.4.2 name
+	NAME in FProto || __webpack_require__(6) && dP(FProto, NAME, {
+	  configurable: true,
+	  get: function () {
+	    try {
+	      return ('' + this).match(nameRE)[1];
+	    } catch (e) {
+	      return '';
+	    }
+	  }
+	});
+
+
+/***/ }),
+/* 80 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var isObject = __webpack_require__(13);
+	var getPrototypeOf = __webpack_require__(59);
+	var HAS_INSTANCE = __webpack_require__(27)('hasInstance');
+	var FunctionProto = Function.prototype;
+	// 19.2.3.6 Function.prototype[@@hasInstance](V)
+	if (!(HAS_INSTANCE in FunctionProto)) __webpack_require__(11).f(FunctionProto, HAS_INSTANCE, { value: function (O) {
+	  if (typeof this != 'function' || !isObject(O)) return false;
+	  if (!isObject(this.prototype)) return O instanceof this;
+	  // for environment w/o native `@@hasInstance` logic enough `instanceof`, but add this:
+	  while (O = getPrototypeOf(O)) if (this.prototype === O) return true;
+	  return false;
+	} });
+
+
+/***/ }),
+/* 81 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var $parseInt = __webpack_require__(82);
+	// 18.2.5 parseInt(string, radix)
+	$export($export.G + $export.F * (parseInt != $parseInt), { parseInt: $parseInt });
+
+
+/***/ }),
+/* 82 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $parseInt = __webpack_require__(4).parseInt;
+	var $trim = __webpack_require__(83).trim;
+	var ws = __webpack_require__(84);
+	var hex = /^[-+]?0[xX]/;
+
+	module.exports = $parseInt(ws + '08') !== 8 || $parseInt(ws + '0x16') !== 22 ? function parseInt(str, radix) {
+	  var string = $trim(String(str), 3);
+	  return $parseInt(string, (radix >>> 0) || (hex.test(string) ? 16 : 10));
+	} : $parseInt;
+
+
+/***/ }),
+/* 83 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var defined = __webpack_require__(36);
+	var fails = __webpack_require__(7);
+	var spaces = __webpack_require__(84);
+	var space = '[' + spaces + ']';
+	var non = '\u200b\u0085';
+	var ltrim = RegExp('^' + space + space + '*');
+	var rtrim = RegExp(space + space + '*$');
+
+	var exporter = function (KEY, exec, ALIAS) {
+	  var exp = {};
+	  var FORCE = fails(function () {
+	    return !!spaces[KEY]() || non[KEY]() != non;
+	  });
+	  var fn = exp[KEY] = FORCE ? exec(trim) : spaces[KEY];
+	  if (ALIAS) exp[ALIAS] = fn;
+	  $export($export.P + $export.F * FORCE, 'String', exp);
+	};
+
+	// 1 -> String#trimLeft
+	// 2 -> String#trimRight
+	// 3 -> String#trim
+	var trim = exporter.trim = function (string, TYPE) {
+	  string = String(defined(string));
+	  if (TYPE & 1) string = string.replace(ltrim, '');
+	  if (TYPE & 2) string = string.replace(rtrim, '');
+	  return string;
+	};
+
+	module.exports = exporter;
+
+
+/***/ }),
+/* 84 */
+/***/ (function(module, exports) {
+
+	module.exports = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
+	  '\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
+
+
+/***/ }),
+/* 85 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var $parseFloat = __webpack_require__(86);
+	// 18.2.4 parseFloat(string)
+	$export($export.G + $export.F * (parseFloat != $parseFloat), { parseFloat: $parseFloat });
+
+
+/***/ }),
+/* 86 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $parseFloat = __webpack_require__(4).parseFloat;
+	var $trim = __webpack_require__(83).trim;
+
+	module.exports = 1 / $parseFloat(__webpack_require__(84) + '-0') !== -Infinity ? function parseFloat(str) {
+	  var string = $trim(String(str), 3);
+	  var result = $parseFloat(string);
+	  return result === 0 && string.charAt(0) == '-' ? -0 : result;
+	} : $parseFloat;
+
+
+/***/ }),
+/* 87 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var global = __webpack_require__(4);
+	var has = __webpack_require__(5);
+	var cof = __webpack_require__(35);
+	var inheritIfRequired = __webpack_require__(88);
+	var toPrimitive = __webpack_require__(16);
+	var fails = __webpack_require__(7);
+	var gOPN = __webpack_require__(51).f;
+	var gOPD = __webpack_require__(52).f;
+	var dP = __webpack_require__(11).f;
+	var $trim = __webpack_require__(83).trim;
+	var NUMBER = 'Number';
+	var $Number = global[NUMBER];
+	var Base = $Number;
+	var proto = $Number.prototype;
+	// Opera ~12 has broken Object#toString
+	var BROKEN_COF = cof(__webpack_require__(47)(proto)) == NUMBER;
+	var TRIM = 'trim' in String.prototype;
+
+	// 7.1.3 ToNumber(argument)
+	var toNumber = function (argument) {
+	  var it = toPrimitive(argument, false);
+	  if (typeof it == 'string' && it.length > 2) {
+	    it = TRIM ? it.trim() : $trim(it, 3);
+	    var first = it.charCodeAt(0);
+	    var third, radix, maxCode;
+	    if (first === 43 || first === 45) {
+	      third = it.charCodeAt(2);
+	      if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
+	    } else if (first === 48) {
+	      switch (it.charCodeAt(1)) {
+	        case 66: case 98: radix = 2; maxCode = 49; break; // fast equal /^0b[01]+$/i
+	        case 79: case 111: radix = 8; maxCode = 55; break; // fast equal /^0o[0-7]+$/i
+	        default: return +it;
+	      }
+	      for (var digits = it.slice(2), i = 0, l = digits.length, code; i < l; i++) {
+	        code = digits.charCodeAt(i);
+	        // parseInt parses a string to a first unavailable symbol
+	        // but ToNumber should return NaN if a string contains unavailable symbols
+	        if (code < 48 || code > maxCode) return NaN;
+	      } return parseInt(digits, radix);
+	    }
+	  } return +it;
+	};
+
+	if (!$Number(' 0o1') || !$Number('0b1') || $Number('+0x1')) {
+	  $Number = function Number(value) {
+	    var it = arguments.length < 1 ? 0 : value;
+	    var that = this;
+	    return that instanceof $Number
+	      // check on 1..constructor(foo) case
+	      && (BROKEN_COF ? fails(function () { proto.valueOf.call(that); }) : cof(that) != NUMBER)
+	        ? inheritIfRequired(new Base(toNumber(it)), that, $Number) : toNumber(it);
+	  };
+	  for (var keys = __webpack_require__(6) ? gOPN(Base) : (
+	    // ES3:
+	    'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
+	    // ES6 (in case, if modules with ES6 Number statics required before):
+	    'EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,' +
+	    'MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger'
+	  ).split(','), j = 0, key; keys.length > j; j++) {
+	    if (has(Base, key = keys[j]) && !has($Number, key)) {
+	      dP($Number, key, gOPD(Base, key));
+	    }
+	  }
+	  $Number.prototype = proto;
+	  proto.constructor = $Number;
+	  __webpack_require__(18)(global, NUMBER, $Number);
+	}
+
+
+/***/ }),
+/* 88 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var isObject = __webpack_require__(13);
+	var setPrototypeOf = __webpack_require__(73).set;
+	module.exports = function (that, target, C) {
+	  var S = target.constructor;
+	  var P;
+	  if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) {
+	    setPrototypeOf(that, P);
+	  } return that;
+	};
+
+
+/***/ }),
+/* 89 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toInteger = __webpack_require__(39);
+	var aNumberValue = __webpack_require__(90);
+	var repeat = __webpack_require__(91);
+	var $toFixed = 1.0.toFixed;
+	var floor = Math.floor;
+	var data = [0, 0, 0, 0, 0, 0];
+	var ERROR = 'Number.toFixed: incorrect invocation!';
+	var ZERO = '0';
+
+	var multiply = function (n, c) {
+	  var i = -1;
+	  var c2 = c;
+	  while (++i < 6) {
+	    c2 += n * data[i];
+	    data[i] = c2 % 1e7;
+	    c2 = floor(c2 / 1e7);
+	  }
+	};
+	var divide = function (n) {
+	  var i = 6;
+	  var c = 0;
+	  while (--i >= 0) {
+	    c += data[i];
+	    data[i] = floor(c / n);
+	    c = (c % n) * 1e7;
+	  }
+	};
+	var numToString = function () {
+	  var i = 6;
+	  var s = '';
+	  while (--i >= 0) {
+	    if (s !== '' || i === 0 || data[i] !== 0) {
+	      var t = String(data[i]);
+	      s = s === '' ? t : s + repeat.call(ZERO, 7 - t.length) + t;
+	    }
+	  } return s;
+	};
+	var pow = function (x, n, acc) {
+	  return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);
+	};
+	var log = function (x) {
+	  var n = 0;
+	  var x2 = x;
+	  while (x2 >= 4096) {
+	    n += 12;
+	    x2 /= 4096;
+	  }
+	  while (x2 >= 2) {
+	    n += 1;
+	    x2 /= 2;
+	  } return n;
+	};
+
+	$export($export.P + $export.F * (!!$toFixed && (
+	  0.00008.toFixed(3) !== '0.000' ||
+	  0.9.toFixed(0) !== '1' ||
+	  1.255.toFixed(2) !== '1.25' ||
+	  1000000000000000128.0.toFixed(0) !== '1000000000000000128'
+	) || !__webpack_require__(7)(function () {
+	  // V8 ~ Android 4.3-
+	  $toFixed.call({});
+	})), 'Number', {
+	  toFixed: function toFixed(fractionDigits) {
+	    var x = aNumberValue(this, ERROR);
+	    var f = toInteger(fractionDigits);
+	    var s = '';
+	    var m = ZERO;
+	    var e, z, j, k;
+	    if (f < 0 || f > 20) throw RangeError(ERROR);
+	    // eslint-disable-next-line no-self-compare
+	    if (x != x) return 'NaN';
+	    if (x <= -1e21 || x >= 1e21) return String(x);
+	    if (x < 0) {
+	      s = '-';
+	      x = -x;
+	    }
+	    if (x > 1e-21) {
+	      e = log(x * pow(2, 69, 1)) - 69;
+	      z = e < 0 ? x * pow(2, -e, 1) : x / pow(2, e, 1);
+	      z *= 0x10000000000000;
+	      e = 52 - e;
+	      if (e > 0) {
+	        multiply(0, z);
+	        j = f;
+	        while (j >= 7) {
+	          multiply(1e7, 0);
+	          j -= 7;
+	        }
+	        multiply(pow(10, j, 1), 0);
+	        j = e - 1;
+	        while (j >= 23) {
+	          divide(1 << 23);
+	          j -= 23;
+	        }
+	        divide(1 << j);
+	        multiply(1, 1);
+	        divide(2);
+	        m = numToString();
+	      } else {
+	        multiply(0, z);
+	        multiply(1 << -e, 0);
+	        m = numToString() + repeat.call(ZERO, f);
+	      }
+	    }
+	    if (f > 0) {
+	      k = m.length;
+	      m = s + (k <= f ? '0.' + repeat.call(ZERO, f - k) + m : m.slice(0, k - f) + '.' + m.slice(k - f));
+	    } else {
+	      m = s + m;
+	    } return m;
+	  }
+	});
+
+
+/***/ }),
+/* 90 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var cof = __webpack_require__(35);
+	module.exports = function (it, msg) {
+	  if (typeof it != 'number' && cof(it) != 'Number') throw TypeError(msg);
+	  return +it;
+	};
+
+
+/***/ }),
+/* 91 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var toInteger = __webpack_require__(39);
+	var defined = __webpack_require__(36);
+
+	module.exports = function repeat(count) {
+	  var str = String(defined(this));
+	  var res = '';
+	  var n = toInteger(count);
+	  if (n < 0 || n == Infinity) throw RangeError("Count can't be negative");
+	  for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) res += str;
+	  return res;
+	};
+
+
+/***/ }),
+/* 92 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $fails = __webpack_require__(7);
+	var aNumberValue = __webpack_require__(90);
+	var $toPrecision = 1.0.toPrecision;
+
+	$export($export.P + $export.F * ($fails(function () {
+	  // IE7-
+	  return $toPrecision.call(1, undefined) !== '1';
+	}) || !$fails(function () {
+	  // V8 ~ Android 4.3-
+	  $toPrecision.call({});
+	})), 'Number', {
+	  toPrecision: function toPrecision(precision) {
+	    var that = aNumberValue(this, 'Number#toPrecision: incorrect invocation!');
+	    return precision === undefined ? $toPrecision.call(that) : $toPrecision.call(that, precision);
+	  }
+	});
+
+
+/***/ }),
+/* 93 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.1 Number.EPSILON
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Number', { EPSILON: Math.pow(2, -52) });
+
+
+/***/ }),
+/* 94 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.2 Number.isFinite(number)
+	var $export = __webpack_require__(8);
+	var _isFinite = __webpack_require__(4).isFinite;
+
+	$export($export.S, 'Number', {
+	  isFinite: function isFinite(it) {
+	    return typeof it == 'number' && _isFinite(it);
+	  }
+	});
+
+
+/***/ }),
+/* 95 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.3 Number.isInteger(number)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Number', { isInteger: __webpack_require__(96) });
+
+
+/***/ }),
+/* 96 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.3 Number.isInteger(number)
+	var isObject = __webpack_require__(13);
+	var floor = Math.floor;
+	module.exports = function isInteger(it) {
+	  return !isObject(it) && isFinite(it) && floor(it) === it;
+	};
+
+
+/***/ }),
+/* 97 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.4 Number.isNaN(number)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Number', {
+	  isNaN: function isNaN(number) {
+	    // eslint-disable-next-line no-self-compare
+	    return number != number;
+	  }
+	});
+
+
+/***/ }),
+/* 98 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.5 Number.isSafeInteger(number)
+	var $export = __webpack_require__(8);
+	var isInteger = __webpack_require__(96);
+	var abs = Math.abs;
+
+	$export($export.S, 'Number', {
+	  isSafeInteger: function isSafeInteger(number) {
+	    return isInteger(number) && abs(number) <= 0x1fffffffffffff;
+	  }
+	});
+
+
+/***/ }),
+/* 99 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.6 Number.MAX_SAFE_INTEGER
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Number', { MAX_SAFE_INTEGER: 0x1fffffffffffff });
+
+
+/***/ }),
+/* 100 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.1.2.10 Number.MIN_SAFE_INTEGER
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Number', { MIN_SAFE_INTEGER: -0x1fffffffffffff });
+
+
+/***/ }),
+/* 101 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var $parseFloat = __webpack_require__(86);
+	// 20.1.2.12 Number.parseFloat(string)
+	$export($export.S + $export.F * (Number.parseFloat != $parseFloat), 'Number', { parseFloat: $parseFloat });
+
+
+/***/ }),
+/* 102 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var $parseInt = __webpack_require__(82);
+	// 20.1.2.13 Number.parseInt(string, radix)
+	$export($export.S + $export.F * (Number.parseInt != $parseInt), 'Number', { parseInt: $parseInt });
+
+
+/***/ }),
+/* 103 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.3 Math.acosh(x)
+	var $export = __webpack_require__(8);
+	var log1p = __webpack_require__(104);
+	var sqrt = Math.sqrt;
+	var $acosh = Math.acosh;
+
+	$export($export.S + $export.F * !($acosh
+	  // V8 bug: https://code.google.com/p/v8/issues/detail?id=3509
+	  && Math.floor($acosh(Number.MAX_VALUE)) == 710
+	  // Tor Browser bug: Math.acosh(Infinity) -> NaN
+	  && $acosh(Infinity) == Infinity
+	), 'Math', {
+	  acosh: function acosh(x) {
+	    return (x = +x) < 1 ? NaN : x > 94906265.62425156
+	      ? Math.log(x) + Math.LN2
+	      : log1p(x - 1 + sqrt(x - 1) * sqrt(x + 1));
+	  }
+	});
+
+
+/***/ }),
+/* 104 */
+/***/ (function(module, exports) {
+
+	// 20.2.2.20 Math.log1p(x)
+	module.exports = Math.log1p || function log1p(x) {
+	  return (x = +x) > -1e-8 && x < 1e-8 ? x - x * x / 2 : Math.log(1 + x);
+	};
+
+
+/***/ }),
+/* 105 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.5 Math.asinh(x)
+	var $export = __webpack_require__(8);
+	var $asinh = Math.asinh;
+
+	function asinh(x) {
+	  return !isFinite(x = +x) || x == 0 ? x : x < 0 ? -asinh(-x) : Math.log(x + Math.sqrt(x * x + 1));
+	}
+
+	// Tor Browser bug: Math.asinh(0) -> -0
+	$export($export.S + $export.F * !($asinh && 1 / $asinh(0) > 0), 'Math', { asinh: asinh });
+
+
+/***/ }),
+/* 106 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.7 Math.atanh(x)
+	var $export = __webpack_require__(8);
+	var $atanh = Math.atanh;
+
+	// Tor Browser bug: Math.atanh(-0) -> 0
+	$export($export.S + $export.F * !($atanh && 1 / $atanh(-0) < 0), 'Math', {
+	  atanh: function atanh(x) {
+	    return (x = +x) == 0 ? x : Math.log((1 + x) / (1 - x)) / 2;
+	  }
+	});
+
+
+/***/ }),
+/* 107 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.9 Math.cbrt(x)
+	var $export = __webpack_require__(8);
+	var sign = __webpack_require__(108);
+
+	$export($export.S, 'Math', {
+	  cbrt: function cbrt(x) {
+	    return sign(x = +x) * Math.pow(Math.abs(x), 1 / 3);
+	  }
+	});
+
+
+/***/ }),
+/* 108 */
+/***/ (function(module, exports) {
+
+	// 20.2.2.28 Math.sign(x)
+	module.exports = Math.sign || function sign(x) {
+	  // eslint-disable-next-line no-self-compare
+	  return (x = +x) == 0 || x != x ? x : x < 0 ? -1 : 1;
+	};
+
+
+/***/ }),
+/* 109 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.11 Math.clz32(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  clz32: function clz32(x) {
+	    return (x >>>= 0) ? 31 - Math.floor(Math.log(x + 0.5) * Math.LOG2E) : 32;
+	  }
+	});
+
+
+/***/ }),
+/* 110 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.12 Math.cosh(x)
+	var $export = __webpack_require__(8);
+	var exp = Math.exp;
+
+	$export($export.S, 'Math', {
+	  cosh: function cosh(x) {
+	    return (exp(x = +x) + exp(-x)) / 2;
+	  }
+	});
+
+
+/***/ }),
+/* 111 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.14 Math.expm1(x)
+	var $export = __webpack_require__(8);
+	var $expm1 = __webpack_require__(112);
+
+	$export($export.S + $export.F * ($expm1 != Math.expm1), 'Math', { expm1: $expm1 });
+
+
+/***/ }),
+/* 112 */
+/***/ (function(module, exports) {
+
+	// 20.2.2.14 Math.expm1(x)
+	var $expm1 = Math.expm1;
+	module.exports = (!$expm1
+	  // Old FF bug
+	  || $expm1(10) > 22025.465794806719 || $expm1(10) < 22025.4657948067165168
+	  // Tor Browser bug
+	  || $expm1(-2e-17) != -2e-17
+	) ? function expm1(x) {
+	  return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : Math.exp(x) - 1;
+	} : $expm1;
+
+
+/***/ }),
+/* 113 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.16 Math.fround(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { fround: __webpack_require__(114) });
+
+
+/***/ }),
+/* 114 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.16 Math.fround(x)
+	var sign = __webpack_require__(108);
+	var pow = Math.pow;
+	var EPSILON = pow(2, -52);
+	var EPSILON32 = pow(2, -23);
+	var MAX32 = pow(2, 127) * (2 - EPSILON32);
+	var MIN32 = pow(2, -126);
+
+	var roundTiesToEven = function (n) {
+	  return n + 1 / EPSILON - 1 / EPSILON;
+	};
+
+	module.exports = Math.fround || function fround(x) {
+	  var $abs = Math.abs(x);
+	  var $sign = sign(x);
+	  var a, result;
+	  if ($abs < MIN32) return $sign * roundTiesToEven($abs / MIN32 / EPSILON32) * MIN32 * EPSILON32;
+	  a = (1 + EPSILON32 / EPSILON) * $abs;
+	  result = a - (a - $abs);
+	  // eslint-disable-next-line no-self-compare
+	  if (result > MAX32 || result != result) return $sign * Infinity;
+	  return $sign * result;
+	};
+
+
+/***/ }),
+/* 115 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.17 Math.hypot([value1[, value2[, … ]]])
+	var $export = __webpack_require__(8);
+	var abs = Math.abs;
+
+	$export($export.S, 'Math', {
+	  hypot: function hypot(value1, value2) { // eslint-disable-line no-unused-vars
+	    var sum = 0;
+	    var i = 0;
+	    var aLen = arguments.length;
+	    var larg = 0;
+	    var arg, div;
+	    while (i < aLen) {
+	      arg = abs(arguments[i++]);
+	      if (larg < arg) {
+	        div = larg / arg;
+	        sum = sum * div * div + 1;
+	        larg = arg;
+	      } else if (arg > 0) {
+	        div = arg / larg;
+	        sum += div * div;
+	      } else sum += arg;
+	    }
+	    return larg === Infinity ? Infinity : larg * Math.sqrt(sum);
+	  }
+	});
+
+
+/***/ }),
+/* 116 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.18 Math.imul(x, y)
+	var $export = __webpack_require__(8);
+	var $imul = Math.imul;
+
+	// some WebKit versions fails with big numbers, some has wrong arity
+	$export($export.S + $export.F * __webpack_require__(7)(function () {
+	  return $imul(0xffffffff, 5) != -5 || $imul.length != 2;
+	}), 'Math', {
+	  imul: function imul(x, y) {
+	    var UINT16 = 0xffff;
+	    var xn = +x;
+	    var yn = +y;
+	    var xl = UINT16 & xn;
+	    var yl = UINT16 & yn;
+	    return 0 | xl * yl + ((UINT16 & xn >>> 16) * yl + xl * (UINT16 & yn >>> 16) << 16 >>> 0);
+	  }
+	});
+
+
+/***/ }),
+/* 117 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.21 Math.log10(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  log10: function log10(x) {
+	    return Math.log(x) * Math.LOG10E;
+	  }
+	});
+
+
+/***/ }),
+/* 118 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.20 Math.log1p(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { log1p: __webpack_require__(104) });
+
+
+/***/ }),
+/* 119 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.22 Math.log2(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  log2: function log2(x) {
+	    return Math.log(x) / Math.LN2;
+	  }
+	});
+
+
+/***/ }),
+/* 120 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.28 Math.sign(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { sign: __webpack_require__(108) });
+
+
+/***/ }),
+/* 121 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.30 Math.sinh(x)
+	var $export = __webpack_require__(8);
+	var expm1 = __webpack_require__(112);
+	var exp = Math.exp;
+
+	// V8 near Chromium 38 has a problem with very small numbers
+	$export($export.S + $export.F * __webpack_require__(7)(function () {
+	  return !Math.sinh(-2e-17) != -2e-17;
+	}), 'Math', {
+	  sinh: function sinh(x) {
+	    return Math.abs(x = +x) < 1
+	      ? (expm1(x) - expm1(-x)) / 2
+	      : (exp(x - 1) - exp(-x - 1)) * (Math.E / 2);
+	  }
+	});
+
+
+/***/ }),
+/* 122 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.33 Math.tanh(x)
+	var $export = __webpack_require__(8);
+	var expm1 = __webpack_require__(112);
+	var exp = Math.exp;
+
+	$export($export.S, 'Math', {
+	  tanh: function tanh(x) {
+	    var a = expm1(x = +x);
+	    var b = expm1(-x);
+	    return a == Infinity ? 1 : b == Infinity ? -1 : (a - b) / (exp(x) + exp(-x));
+	  }
+	});
+
+
+/***/ }),
+/* 123 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.2.2.34 Math.trunc(x)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  trunc: function trunc(it) {
+	    return (it > 0 ? Math.floor : Math.ceil)(it);
+	  }
+	});
+
+
+/***/ }),
+/* 124 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var toAbsoluteIndex = __webpack_require__(40);
+	var fromCharCode = String.fromCharCode;
+	var $fromCodePoint = String.fromCodePoint;
+
+	// length should be 1, old FF problem
+	$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', {
+	  // 21.1.2.2 String.fromCodePoint(...codePoints)
+	  fromCodePoint: function fromCodePoint(x) { // eslint-disable-line no-unused-vars
+	    var res = [];
+	    var aLen = arguments.length;
+	    var i = 0;
+	    var code;
+	    while (aLen > i) {
+	      code = +arguments[i++];
+	      if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point');
+	      res.push(code < 0x10000
+	        ? fromCharCode(code)
+	        : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)
+	      );
+	    } return res.join('');
+	  }
+	});
+
+
+/***/ }),
+/* 125 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var toIObject = __webpack_require__(33);
+	var toLength = __webpack_require__(38);
+
+	$export($export.S, 'String', {
+	  // 21.1.2.4 String.raw(callSite, ...substitutions)
+	  raw: function raw(callSite) {
+	    var tpl = toIObject(callSite.raw);
+	    var len = toLength(tpl.length);
+	    var aLen = arguments.length;
+	    var res = [];
+	    var i = 0;
+	    while (len > i) {
+	      res.push(String(tpl[i++]));
+	      if (i < aLen) res.push(String(arguments[i]));
+	    } return res.join('');
+	  }
+	});
+
+
+/***/ }),
+/* 126 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 21.1.3.25 String.prototype.trim()
+	__webpack_require__(83)('trim', function ($trim) {
+	  return function trim() {
+	    return $trim(this, 3);
+	  };
+	});
+
+
+/***/ }),
+/* 127 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $at = __webpack_require__(128)(true);
+
+	// 21.1.3.27 String.prototype[@@iterator]()
+	__webpack_require__(129)(String, 'String', function (iterated) {
+	  this._t = String(iterated); // target
+	  this._i = 0;                // next index
+	// 21.1.5.2.1 %StringIteratorPrototype%.next()
+	}, function () {
+	  var O = this._t;
+	  var index = this._i;
+	  var point;
+	  if (index >= O.length) return { value: undefined, done: true };
+	  point = $at(O, index);
+	  this._i += point.length;
+	  return { value: point, done: false };
+	});
+
+
+/***/ }),
+/* 128 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var toInteger = __webpack_require__(39);
+	var defined = __webpack_require__(36);
+	// true  -> String#at
+	// false -> String#codePointAt
+	module.exports = function (TO_STRING) {
+	  return function (that, pos) {
+	    var s = String(defined(that));
+	    var i = toInteger(pos);
+	    var l = s.length;
+	    var a, b;
+	    if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
+	    a = s.charCodeAt(i);
+	    return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
+	      ? TO_STRING ? s.charAt(i) : a
+	      : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
+	  };
+	};
+
+
+/***/ }),
+/* 129 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var LIBRARY = __webpack_require__(22);
+	var $export = __webpack_require__(8);
+	var redefine = __webpack_require__(18);
+	var hide = __webpack_require__(10);
+	var Iterators = __webpack_require__(130);
+	var $iterCreate = __webpack_require__(131);
+	var setToStringTag = __webpack_require__(26);
+	var getPrototypeOf = __webpack_require__(59);
+	var ITERATOR = __webpack_require__(27)('iterator');
+	var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
+	var FF_ITERATOR = '@@iterator';
+	var KEYS = 'keys';
+	var VALUES = 'values';
+
+	var returnThis = function () { return this; };
+
+	module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
+	  $iterCreate(Constructor, NAME, next);
+	  var getMethod = function (kind) {
+	    if (!BUGGY && kind in proto) return proto[kind];
+	    switch (kind) {
+	      case KEYS: return function keys() { return new Constructor(this, kind); };
+	      case VALUES: return function values() { return new Constructor(this, kind); };
+	    } return function entries() { return new Constructor(this, kind); };
+	  };
+	  var TAG = NAME + ' Iterator';
+	  var DEF_VALUES = DEFAULT == VALUES;
+	  var VALUES_BUG = false;
+	  var proto = Base.prototype;
+	  var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
+	  var $default = $native || getMethod(DEFAULT);
+	  var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
+	  var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
+	  var methods, key, IteratorPrototype;
+	  // Fix native
+	  if ($anyNative) {
+	    IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
+	    if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
+	      // Set @@toStringTag to native iterators
+	      setToStringTag(IteratorPrototype, TAG, true);
+	      // fix for some old engines
+	      if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
+	    }
+	  }
+	  // fix Array#{values, @@iterator}.name in V8 / FF
+	  if (DEF_VALUES && $native && $native.name !== VALUES) {
+	    VALUES_BUG = true;
+	    $default = function values() { return $native.call(this); };
+	  }
+	  // Define iterator
+	  if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
+	    hide(proto, ITERATOR, $default);
+	  }
+	  // Plug for library
+	  Iterators[NAME] = $default;
+	  Iterators[TAG] = returnThis;
+	  if (DEFAULT) {
+	    methods = {
+	      values: DEF_VALUES ? $default : getMethod(VALUES),
+	      keys: IS_SET ? $default : getMethod(KEYS),
+	      entries: $entries
+	    };
+	    if (FORCED) for (key in methods) {
+	      if (!(key in proto)) redefine(proto, key, methods[key]);
+	    } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
+	  }
+	  return methods;
+	};
+
+
+/***/ }),
+/* 130 */
+/***/ (function(module, exports) {
+
+	module.exports = {};
+
+
+/***/ }),
+/* 131 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var create = __webpack_require__(47);
+	var descriptor = __webpack_require__(17);
+	var setToStringTag = __webpack_require__(26);
+	var IteratorPrototype = {};
+
+	// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
+	__webpack_require__(10)(IteratorPrototype, __webpack_require__(27)('iterator'), function () { return this; });
+
+	module.exports = function (Constructor, NAME, next) {
+	  Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
+	  setToStringTag(Constructor, NAME + ' Iterator');
+	};
+
+
+/***/ }),
+/* 132 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $at = __webpack_require__(128)(false);
+	$export($export.P, 'String', {
+	  // 21.1.3.3 String.prototype.codePointAt(pos)
+	  codePointAt: function codePointAt(pos) {
+	    return $at(this, pos);
+	  }
+	});
+
+
+/***/ }),
+/* 133 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 21.1.3.6 String.prototype.endsWith(searchString [, endPosition])
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toLength = __webpack_require__(38);
+	var context = __webpack_require__(134);
+	var ENDS_WITH = 'endsWith';
+	var $endsWith = ''[ENDS_WITH];
+
+	$export($export.P + $export.F * __webpack_require__(136)(ENDS_WITH), 'String', {
+	  endsWith: function endsWith(searchString /* , endPosition = @length */) {
+	    var that = context(this, searchString, ENDS_WITH);
+	    var endPosition = arguments.length > 1 ? arguments[1] : undefined;
+	    var len = toLength(that.length);
+	    var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len);
+	    var search = String(searchString);
+	    return $endsWith
+	      ? $endsWith.call(that, search, end)
+	      : that.slice(end - search.length, end) === search;
+	  }
+	});
+
+
+/***/ }),
+/* 134 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// helper for String#{startsWith, endsWith, includes}
+	var isRegExp = __webpack_require__(135);
+	var defined = __webpack_require__(36);
+
+	module.exports = function (that, searchString, NAME) {
+	  if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!");
+	  return String(defined(that));
+	};
+
+
+/***/ }),
+/* 135 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 7.2.8 IsRegExp(argument)
+	var isObject = __webpack_require__(13);
+	var cof = __webpack_require__(35);
+	var MATCH = __webpack_require__(27)('match');
+	module.exports = function (it) {
+	  var isRegExp;
+	  return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp');
+	};
+
+
+/***/ }),
+/* 136 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var MATCH = __webpack_require__(27)('match');
+	module.exports = function (KEY) {
+	  var re = /./;
+	  try {
+	    '/./'[KEY](re);
+	  } catch (e) {
+	    try {
+	      re[MATCH] = false;
+	      return !'/./'[KEY](re);
+	    } catch (f) { /* empty */ }
+	  } return true;
+	};
+
+
+/***/ }),
+/* 137 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 21.1.3.7 String.prototype.includes(searchString, position = 0)
+	'use strict';
+	var $export = __webpack_require__(8);
+	var context = __webpack_require__(134);
+	var INCLUDES = 'includes';
+
+	$export($export.P + $export.F * __webpack_require__(136)(INCLUDES), 'String', {
+	  includes: function includes(searchString /* , position = 0 */) {
+	    return !!~context(this, searchString, INCLUDES)
+	      .indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined);
+	  }
+	});
+
+
+/***/ }),
+/* 138 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+
+	$export($export.P, 'String', {
+	  // 21.1.3.13 String.prototype.repeat(count)
+	  repeat: __webpack_require__(91)
+	});
+
+
+/***/ }),
+/* 139 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 21.1.3.18 String.prototype.startsWith(searchString [, position ])
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toLength = __webpack_require__(38);
+	var context = __webpack_require__(134);
+	var STARTS_WITH = 'startsWith';
+	var $startsWith = ''[STARTS_WITH];
+
+	$export($export.P + $export.F * __webpack_require__(136)(STARTS_WITH), 'String', {
+	  startsWith: function startsWith(searchString /* , position = 0 */) {
+	    var that = context(this, searchString, STARTS_WITH);
+	    var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length));
+	    var search = String(searchString);
+	    return $startsWith
+	      ? $startsWith.call(that, search, index)
+	      : that.slice(index, index + search.length) === search;
+	  }
+	});
+
+
+/***/ }),
+/* 140 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.2 String.prototype.anchor(name)
+	__webpack_require__(141)('anchor', function (createHTML) {
+	  return function anchor(name) {
+	    return createHTML(this, 'a', 'name', name);
+	  };
+	});
+
+
+/***/ }),
+/* 141 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var fails = __webpack_require__(7);
+	var defined = __webpack_require__(36);
+	var quot = /"/g;
+	// B.2.3.2.1 CreateHTML(string, tag, attribute, value)
+	var createHTML = function (string, tag, attribute, value) {
+	  var S = String(defined(string));
+	  var p1 = '<' + tag;
+	  if (attribute !== '') p1 += ' ' + attribute + '="' + String(value).replace(quot, '&quot;') + '"';
+	  return p1 + '>' + S + '</' + tag + '>';
+	};
+	module.exports = function (NAME, exec) {
+	  var O = {};
+	  O[NAME] = exec(createHTML);
+	  $export($export.P + $export.F * fails(function () {
+	    var test = ''[NAME]('"');
+	    return test !== test.toLowerCase() || test.split('"').length > 3;
+	  }), 'String', O);
+	};
+
+
+/***/ }),
+/* 142 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.3 String.prototype.big()
+	__webpack_require__(141)('big', function (createHTML) {
+	  return function big() {
+	    return createHTML(this, 'big', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 143 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.4 String.prototype.blink()
+	__webpack_require__(141)('blink', function (createHTML) {
+	  return function blink() {
+	    return createHTML(this, 'blink', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 144 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.5 String.prototype.bold()
+	__webpack_require__(141)('bold', function (createHTML) {
+	  return function bold() {
+	    return createHTML(this, 'b', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 145 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.6 String.prototype.fixed()
+	__webpack_require__(141)('fixed', function (createHTML) {
+	  return function fixed() {
+	    return createHTML(this, 'tt', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 146 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.7 String.prototype.fontcolor(color)
+	__webpack_require__(141)('fontcolor', function (createHTML) {
+	  return function fontcolor(color) {
+	    return createHTML(this, 'font', 'color', color);
+	  };
+	});
+
+
+/***/ }),
+/* 147 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.8 String.prototype.fontsize(size)
+	__webpack_require__(141)('fontsize', function (createHTML) {
+	  return function fontsize(size) {
+	    return createHTML(this, 'font', 'size', size);
+	  };
+	});
+
+
+/***/ }),
+/* 148 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.9 String.prototype.italics()
+	__webpack_require__(141)('italics', function (createHTML) {
+	  return function italics() {
+	    return createHTML(this, 'i', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 149 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.10 String.prototype.link(url)
+	__webpack_require__(141)('link', function (createHTML) {
+	  return function link(url) {
+	    return createHTML(this, 'a', 'href', url);
+	  };
+	});
+
+
+/***/ }),
+/* 150 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.11 String.prototype.small()
+	__webpack_require__(141)('small', function (createHTML) {
+	  return function small() {
+	    return createHTML(this, 'small', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 151 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.12 String.prototype.strike()
+	__webpack_require__(141)('strike', function (createHTML) {
+	  return function strike() {
+	    return createHTML(this, 'strike', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 152 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.13 String.prototype.sub()
+	__webpack_require__(141)('sub', function (createHTML) {
+	  return function sub() {
+	    return createHTML(this, 'sub', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 153 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// B.2.3.14 String.prototype.sup()
+	__webpack_require__(141)('sup', function (createHTML) {
+	  return function sup() {
+	    return createHTML(this, 'sup', '', '');
+	  };
+	});
+
+
+/***/ }),
+/* 154 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.3.3.1 / 15.9.4.4 Date.now()
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Date', { now: function () { return new Date().getTime(); } });
+
+
+/***/ }),
+/* 155 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toObject = __webpack_require__(46);
+	var toPrimitive = __webpack_require__(16);
+
+	$export($export.P + $export.F * __webpack_require__(7)(function () {
+	  return new Date(NaN).toJSON() !== null
+	    || Date.prototype.toJSON.call({ toISOString: function () { return 1; } }) !== 1;
+	}), 'Date', {
+	  // eslint-disable-next-line no-unused-vars
+	  toJSON: function toJSON(key) {
+	    var O = toObject(this);
+	    var pv = toPrimitive(O);
+	    return typeof pv == 'number' && !isFinite(pv) ? null : O.toISOString();
+	  }
+	});
+
+
+/***/ }),
+/* 156 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
+	var $export = __webpack_require__(8);
+	var toISOString = __webpack_require__(157);
+
+	// PhantomJS / old WebKit has a broken implementations
+	$export($export.P + $export.F * (Date.prototype.toISOString !== toISOString), 'Date', {
+	  toISOString: toISOString
+	});
+
+
+/***/ }),
+/* 157 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 20.3.4.36 / 15.9.5.43 Date.prototype.toISOString()
+	var fails = __webpack_require__(7);
+	var getTime = Date.prototype.getTime;
+	var $toISOString = Date.prototype.toISOString;
+
+	var lz = function (num) {
+	  return num > 9 ? num : '0' + num;
+	};
+
+	// PhantomJS / old WebKit has a broken implementations
+	module.exports = (fails(function () {
+	  return $toISOString.call(new Date(-5e13 - 1)) != '0385-07-25T07:06:39.999Z';
+	}) || !fails(function () {
+	  $toISOString.call(new Date(NaN));
+	})) ? function toISOString() {
+	  if (!isFinite(getTime.call(this))) throw RangeError('Invalid time value');
+	  var d = this;
+	  var y = d.getUTCFullYear();
+	  var m = d.getUTCMilliseconds();
+	  var s = y < 0 ? '-' : y > 9999 ? '+' : '';
+	  return s + ('00000' + Math.abs(y)).slice(s ? -6 : -4) +
+	    '-' + lz(d.getUTCMonth() + 1) + '-' + lz(d.getUTCDate()) +
+	    'T' + lz(d.getUTCHours()) + ':' + lz(d.getUTCMinutes()) +
+	    ':' + lz(d.getUTCSeconds()) + '.' + (m > 99 ? m : '0' + lz(m)) + 'Z';
+	} : $toISOString;
+
+
+/***/ }),
+/* 158 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var DateProto = Date.prototype;
+	var INVALID_DATE = 'Invalid Date';
+	var TO_STRING = 'toString';
+	var $toString = DateProto[TO_STRING];
+	var getTime = DateProto.getTime;
+	if (new Date(NaN) + '' != INVALID_DATE) {
+	  __webpack_require__(18)(DateProto, TO_STRING, function toString() {
+	    var value = getTime.call(this);
+	    // eslint-disable-next-line no-self-compare
+	    return value === value ? $toString.call(this) : INVALID_DATE;
+	  });
+	}
+
+
+/***/ }),
+/* 159 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var TO_PRIMITIVE = __webpack_require__(27)('toPrimitive');
+	var proto = Date.prototype;
+
+	if (!(TO_PRIMITIVE in proto)) __webpack_require__(10)(proto, TO_PRIMITIVE, __webpack_require__(160));
+
+
+/***/ }),
+/* 160 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var anObject = __webpack_require__(12);
+	var toPrimitive = __webpack_require__(16);
+	var NUMBER = 'number';
+
+	module.exports = function (hint) {
+	  if (hint !== 'string' && hint !== NUMBER && hint !== 'default') throw TypeError('Incorrect hint');
+	  return toPrimitive(anObject(this), hint != NUMBER);
+	};
+
+
+/***/ }),
+/* 161 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 22.1.2.2 / 15.4.3.2 Array.isArray(arg)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Array', { isArray: __webpack_require__(45) });
+
+
+/***/ }),
+/* 162 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var ctx = __webpack_require__(23);
+	var $export = __webpack_require__(8);
+	var toObject = __webpack_require__(46);
+	var call = __webpack_require__(163);
+	var isArrayIter = __webpack_require__(164);
+	var toLength = __webpack_require__(38);
+	var createProperty = __webpack_require__(165);
+	var getIterFn = __webpack_require__(166);
+
+	$export($export.S + $export.F * !__webpack_require__(167)(function (iter) { Array.from(iter); }), 'Array', {
+	  // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
+	  from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
+	    var O = toObject(arrayLike);
+	    var C = typeof this == 'function' ? this : Array;
+	    var aLen = arguments.length;
+	    var mapfn = aLen > 1 ? arguments[1] : undefined;
+	    var mapping = mapfn !== undefined;
+	    var index = 0;
+	    var iterFn = getIterFn(O);
+	    var length, result, step, iterator;
+	    if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
+	    // if object isn't iterable or it's array with default iterator - use simple case
+	    if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
+	      for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
+	        createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
+	      }
+	    } else {
+	      length = toLength(O.length);
+	      for (result = new C(length); length > index; index++) {
+	        createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
+	      }
+	    }
+	    result.length = index;
+	    return result;
+	  }
+	});
+
+
+/***/ }),
+/* 163 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// call something on iterator step with safe closing on error
+	var anObject = __webpack_require__(12);
+	module.exports = function (iterator, fn, value, entries) {
+	  try {
+	    return entries ? fn(anObject(value)[0], value[1]) : fn(value);
+	  // 7.4.6 IteratorClose(iterator, completion)
+	  } catch (e) {
+	    var ret = iterator['return'];
+	    if (ret !== undefined) anObject(ret.call(iterator));
+	    throw e;
+	  }
+	};
+
+
+/***/ }),
+/* 164 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// check on default Array iterator
+	var Iterators = __webpack_require__(130);
+	var ITERATOR = __webpack_require__(27)('iterator');
+	var ArrayProto = Array.prototype;
+
+	module.exports = function (it) {
+	  return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
+	};
+
+
+/***/ }),
+/* 165 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $defineProperty = __webpack_require__(11);
+	var createDesc = __webpack_require__(17);
+
+	module.exports = function (object, index, value) {
+	  if (index in object) $defineProperty.f(object, index, createDesc(0, value));
+	  else object[index] = value;
+	};
+
+
+/***/ }),
+/* 166 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var classof = __webpack_require__(75);
+	var ITERATOR = __webpack_require__(27)('iterator');
+	var Iterators = __webpack_require__(130);
+	module.exports = __webpack_require__(9).getIteratorMethod = function (it) {
+	  if (it != undefined) return it[ITERATOR]
+	    || it['@@iterator']
+	    || Iterators[classof(it)];
+	};
+
+
+/***/ }),
+/* 167 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var ITERATOR = __webpack_require__(27)('iterator');
+	var SAFE_CLOSING = false;
+
+	try {
+	  var riter = [7][ITERATOR]();
+	  riter['return'] = function () { SAFE_CLOSING = true; };
+	  // eslint-disable-next-line no-throw-literal
+	  Array.from(riter, function () { throw 2; });
+	} catch (e) { /* empty */ }
+
+	module.exports = function (exec, skipClosing) {
+	  if (!skipClosing && !SAFE_CLOSING) return false;
+	  var safe = false;
+	  try {
+	    var arr = [7];
+	    var iter = arr[ITERATOR]();
+	    iter.next = function () { return { done: safe = true }; };
+	    arr[ITERATOR] = function () { return iter; };
+	    exec(arr);
+	  } catch (e) { /* empty */ }
+	  return safe;
+	};
+
+
+/***/ }),
+/* 168 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var createProperty = __webpack_require__(165);
+
+	// WebKit Array.of isn't generic
+	$export($export.S + $export.F * __webpack_require__(7)(function () {
+	  function F() { /* empty */ }
+	  return !(Array.of.call(F) instanceof F);
+	}), 'Array', {
+	  // 22.1.2.3 Array.of( ...items)
+	  of: function of(/* ...args */) {
+	    var index = 0;
+	    var aLen = arguments.length;
+	    var result = new (typeof this == 'function' ? this : Array)(aLen);
+	    while (aLen > index) createProperty(result, index, arguments[index++]);
+	    result.length = aLen;
+	    return result;
+	  }
+	});
+
+
+/***/ }),
+/* 169 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 22.1.3.13 Array.prototype.join(separator)
+	var $export = __webpack_require__(8);
+	var toIObject = __webpack_require__(33);
+	var arrayJoin = [].join;
+
+	// fallback for not array-like strings
+	$export($export.P + $export.F * (__webpack_require__(34) != Object || !__webpack_require__(170)(arrayJoin)), 'Array', {
+	  join: function join(separator) {
+	    return arrayJoin.call(toIObject(this), separator === undefined ? ',' : separator);
+	  }
+	});
+
+
+/***/ }),
+/* 170 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var fails = __webpack_require__(7);
+
+	module.exports = function (method, arg) {
+	  return !!method && fails(function () {
+	    // eslint-disable-next-line no-useless-call
+	    arg ? method.call(null, function () { /* empty */ }, 1) : method.call(null);
+	  });
+	};
+
+
+/***/ }),
+/* 171 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var html = __webpack_require__(49);
+	var cof = __webpack_require__(35);
+	var toAbsoluteIndex = __webpack_require__(40);
+	var toLength = __webpack_require__(38);
+	var arraySlice = [].slice;
+
+	// fallback for not array-like ES3 strings and DOM objects
+	$export($export.P + $export.F * __webpack_require__(7)(function () {
+	  if (html) arraySlice.call(html);
+	}), 'Array', {
+	  slice: function slice(begin, end) {
+	    var len = toLength(this.length);
+	    var klass = cof(this);
+	    end = end === undefined ? len : end;
+	    if (klass == 'Array') return arraySlice.call(this, begin, end);
+	    var start = toAbsoluteIndex(begin, len);
+	    var upTo = toAbsoluteIndex(end, len);
+	    var size = toLength(upTo - start);
+	    var cloned = new Array(size);
+	    var i = 0;
+	    for (; i < size; i++) cloned[i] = klass == 'String'
+	      ? this.charAt(start + i)
+	      : this[start + i];
+	    return cloned;
+	  }
+	});
+
+
+/***/ }),
+/* 172 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var aFunction = __webpack_require__(24);
+	var toObject = __webpack_require__(46);
+	var fails = __webpack_require__(7);
+	var $sort = [].sort;
+	var test = [1, 2, 3];
+
+	$export($export.P + $export.F * (fails(function () {
+	  // IE8-
+	  test.sort(undefined);
+	}) || !fails(function () {
+	  // V8 bug
+	  test.sort(null);
+	  // Old WebKit
+	}) || !__webpack_require__(170)($sort)), 'Array', {
+	  // 22.1.3.25 Array.prototype.sort(comparefn)
+	  sort: function sort(comparefn) {
+	    return comparefn === undefined
+	      ? $sort.call(toObject(this))
+	      : $sort.call(toObject(this), aFunction(comparefn));
+	  }
+	});
+
+
+/***/ }),
+/* 173 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $forEach = __webpack_require__(174)(0);
+	var STRICT = __webpack_require__(170)([].forEach, true);
+
+	$export($export.P + $export.F * !STRICT, 'Array', {
+	  // 22.1.3.10 / 15.4.4.18 Array.prototype.forEach(callbackfn [, thisArg])
+	  forEach: function forEach(callbackfn /* , thisArg */) {
+	    return $forEach(this, callbackfn, arguments[1]);
+	  }
+	});
+
+
+/***/ }),
+/* 174 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 0 -> Array#forEach
+	// 1 -> Array#map
+	// 2 -> Array#filter
+	// 3 -> Array#some
+	// 4 -> Array#every
+	// 5 -> Array#find
+	// 6 -> Array#findIndex
+	var ctx = __webpack_require__(23);
+	var IObject = __webpack_require__(34);
+	var toObject = __webpack_require__(46);
+	var toLength = __webpack_require__(38);
+	var asc = __webpack_require__(175);
+	module.exports = function (TYPE, $create) {
+	  var IS_MAP = TYPE == 1;
+	  var IS_FILTER = TYPE == 2;
+	  var IS_SOME = TYPE == 3;
+	  var IS_EVERY = TYPE == 4;
+	  var IS_FIND_INDEX = TYPE == 6;
+	  var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
+	  var create = $create || asc;
+	  return function ($this, callbackfn, that) {
+	    var O = toObject($this);
+	    var self = IObject(O);
+	    var f = ctx(callbackfn, that, 3);
+	    var length = toLength(self.length);
+	    var index = 0;
+	    var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
+	    var val, res;
+	    for (;length > index; index++) if (NO_HOLES || index in self) {
+	      val = self[index];
+	      res = f(val, index, O);
+	      if (TYPE) {
+	        if (IS_MAP) result[index] = res;   // map
+	        else if (res) switch (TYPE) {
+	          case 3: return true;             // some
+	          case 5: return val;              // find
+	          case 6: return index;            // findIndex
+	          case 2: result.push(val);        // filter
+	        } else if (IS_EVERY) return false; // every
+	      }
+	    }
+	    return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
+	  };
+	};
+
+
+/***/ }),
+/* 175 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
+	var speciesConstructor = __webpack_require__(176);
+
+	module.exports = function (original, length) {
+	  return new (speciesConstructor(original))(length);
+	};
+
+
+/***/ }),
+/* 176 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var isObject = __webpack_require__(13);
+	var isArray = __webpack_require__(45);
+	var SPECIES = __webpack_require__(27)('species');
+
+	module.exports = function (original) {
+	  var C;
+	  if (isArray(original)) {
+	    C = original.constructor;
+	    // cross-realm fallback
+	    if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
+	    if (isObject(C)) {
+	      C = C[SPECIES];
+	      if (C === null) C = undefined;
+	    }
+	  } return C === undefined ? Array : C;
+	};
+
+
+/***/ }),
+/* 177 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $map = __webpack_require__(174)(1);
+
+	$export($export.P + $export.F * !__webpack_require__(170)([].map, true), 'Array', {
+	  // 22.1.3.15 / 15.4.4.19 Array.prototype.map(callbackfn [, thisArg])
+	  map: function map(callbackfn /* , thisArg */) {
+	    return $map(this, callbackfn, arguments[1]);
+	  }
+	});
+
+
+/***/ }),
+/* 178 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $filter = __webpack_require__(174)(2);
+
+	$export($export.P + $export.F * !__webpack_require__(170)([].filter, true), 'Array', {
+	  // 22.1.3.7 / 15.4.4.20 Array.prototype.filter(callbackfn [, thisArg])
+	  filter: function filter(callbackfn /* , thisArg */) {
+	    return $filter(this, callbackfn, arguments[1]);
+	  }
+	});
+
+
+/***/ }),
+/* 179 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $some = __webpack_require__(174)(3);
+
+	$export($export.P + $export.F * !__webpack_require__(170)([].some, true), 'Array', {
+	  // 22.1.3.23 / 15.4.4.17 Array.prototype.some(callbackfn [, thisArg])
+	  some: function some(callbackfn /* , thisArg */) {
+	    return $some(this, callbackfn, arguments[1]);
+	  }
+	});
+
+
+/***/ }),
+/* 180 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $every = __webpack_require__(174)(4);
+
+	$export($export.P + $export.F * !__webpack_require__(170)([].every, true), 'Array', {
+	  // 22.1.3.5 / 15.4.4.16 Array.prototype.every(callbackfn [, thisArg])
+	  every: function every(callbackfn /* , thisArg */) {
+	    return $every(this, callbackfn, arguments[1]);
+	  }
+	});
+
+
+/***/ }),
+/* 181 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $reduce = __webpack_require__(182);
+
+	$export($export.P + $export.F * !__webpack_require__(170)([].reduce, true), 'Array', {
+	  // 22.1.3.18 / 15.4.4.21 Array.prototype.reduce(callbackfn [, initialValue])
+	  reduce: function reduce(callbackfn /* , initialValue */) {
+	    return $reduce(this, callbackfn, arguments.length, arguments[1], false);
+	  }
+	});
+
+
+/***/ }),
+/* 182 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var aFunction = __webpack_require__(24);
+	var toObject = __webpack_require__(46);
+	var IObject = __webpack_require__(34);
+	var toLength = __webpack_require__(38);
+
+	module.exports = function (that, callbackfn, aLen, memo, isRight) {
+	  aFunction(callbackfn);
+	  var O = toObject(that);
+	  var self = IObject(O);
+	  var length = toLength(O.length);
+	  var index = isRight ? length - 1 : 0;
+	  var i = isRight ? -1 : 1;
+	  if (aLen < 2) for (;;) {
+	    if (index in self) {
+	      memo = self[index];
+	      index += i;
+	      break;
+	    }
+	    index += i;
+	    if (isRight ? index < 0 : length <= index) {
+	      throw TypeError('Reduce of empty array with no initial value');
+	    }
+	  }
+	  for (;isRight ? index >= 0 : length > index; index += i) if (index in self) {
+	    memo = callbackfn(memo, self[index], index, O);
+	  }
+	  return memo;
+	};
+
+
+/***/ }),
+/* 183 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $reduce = __webpack_require__(182);
+
+	$export($export.P + $export.F * !__webpack_require__(170)([].reduceRight, true), 'Array', {
+	  // 22.1.3.19 / 15.4.4.22 Array.prototype.reduceRight(callbackfn [, initialValue])
+	  reduceRight: function reduceRight(callbackfn /* , initialValue */) {
+	    return $reduce(this, callbackfn, arguments.length, arguments[1], true);
+	  }
+	});
+
+
+/***/ }),
+/* 184 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $indexOf = __webpack_require__(37)(false);
+	var $native = [].indexOf;
+	var NEGATIVE_ZERO = !!$native && 1 / [1].indexOf(1, -0) < 0;
+
+	$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', {
+	  // 22.1.3.11 / 15.4.4.14 Array.prototype.indexOf(searchElement [, fromIndex])
+	  indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
+	    return NEGATIVE_ZERO
+	      // convert -0 to +0
+	      ? $native.apply(this, arguments) || 0
+	      : $indexOf(this, searchElement, arguments[1]);
+	  }
+	});
+
+
+/***/ }),
+/* 185 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toIObject = __webpack_require__(33);
+	var toInteger = __webpack_require__(39);
+	var toLength = __webpack_require__(38);
+	var $native = [].lastIndexOf;
+	var NEGATIVE_ZERO = !!$native && 1 / [1].lastIndexOf(1, -0) < 0;
+
+	$export($export.P + $export.F * (NEGATIVE_ZERO || !__webpack_require__(170)($native)), 'Array', {
+	  // 22.1.3.14 / 15.4.4.15 Array.prototype.lastIndexOf(searchElement [, fromIndex])
+	  lastIndexOf: function lastIndexOf(searchElement /* , fromIndex = @[*-1] */) {
+	    // convert -0 to +0
+	    if (NEGATIVE_ZERO) return $native.apply(this, arguments) || 0;
+	    var O = toIObject(this);
+	    var length = toLength(O.length);
+	    var index = length - 1;
+	    if (arguments.length > 1) index = Math.min(index, toInteger(arguments[1]));
+	    if (index < 0) index = length + index;
+	    for (;index >= 0; index--) if (index in O) if (O[index] === searchElement) return index || 0;
+	    return -1;
+	  }
+	});
+
+
+/***/ }),
+/* 186 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
+	var $export = __webpack_require__(8);
+
+	$export($export.P, 'Array', { copyWithin: __webpack_require__(187) });
+
+	__webpack_require__(188)('copyWithin');
+
+
+/***/ }),
+/* 187 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 22.1.3.3 Array.prototype.copyWithin(target, start, end = this.length)
+	'use strict';
+	var toObject = __webpack_require__(46);
+	var toAbsoluteIndex = __webpack_require__(40);
+	var toLength = __webpack_require__(38);
+
+	module.exports = [].copyWithin || function copyWithin(target /* = 0 */, start /* = 0, end = @length */) {
+	  var O = toObject(this);
+	  var len = toLength(O.length);
+	  var to = toAbsoluteIndex(target, len);
+	  var from = toAbsoluteIndex(start, len);
+	  var end = arguments.length > 2 ? arguments[2] : undefined;
+	  var count = Math.min((end === undefined ? len : toAbsoluteIndex(end, len)) - from, len - to);
+	  var inc = 1;
+	  if (from < to && to < from + count) {
+	    inc = -1;
+	    from += count - 1;
+	    to += count - 1;
+	  }
+	  while (count-- > 0) {
+	    if (from in O) O[to] = O[from];
+	    else delete O[to];
+	    to += inc;
+	    from += inc;
+	  } return O;
+	};
+
+
+/***/ }),
+/* 188 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 22.1.3.31 Array.prototype[@@unscopables]
+	var UNSCOPABLES = __webpack_require__(27)('unscopables');
+	var ArrayProto = Array.prototype;
+	if (ArrayProto[UNSCOPABLES] == undefined) __webpack_require__(10)(ArrayProto, UNSCOPABLES, {});
+	module.exports = function (key) {
+	  ArrayProto[UNSCOPABLES][key] = true;
+	};
+
+
+/***/ }),
+/* 189 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
+	var $export = __webpack_require__(8);
+
+	$export($export.P, 'Array', { fill: __webpack_require__(190) });
+
+	__webpack_require__(188)('fill');
+
+
+/***/ }),
+/* 190 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 22.1.3.6 Array.prototype.fill(value, start = 0, end = this.length)
+	'use strict';
+	var toObject = __webpack_require__(46);
+	var toAbsoluteIndex = __webpack_require__(40);
+	var toLength = __webpack_require__(38);
+	module.exports = function fill(value /* , start = 0, end = @length */) {
+	  var O = toObject(this);
+	  var length = toLength(O.length);
+	  var aLen = arguments.length;
+	  var index = toAbsoluteIndex(aLen > 1 ? arguments[1] : undefined, length);
+	  var end = aLen > 2 ? arguments[2] : undefined;
+	  var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
+	  while (endPos > index) O[index++] = value;
+	  return O;
+	};
+
+
+/***/ }),
+/* 191 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 22.1.3.8 Array.prototype.find(predicate, thisArg = undefined)
+	var $export = __webpack_require__(8);
+	var $find = __webpack_require__(174)(5);
+	var KEY = 'find';
+	var forced = true;
+	// Shouldn't skip holes
+	if (KEY in []) Array(1)[KEY](function () { forced = false; });
+	$export($export.P + $export.F * forced, 'Array', {
+	  find: function find(callbackfn /* , that = undefined */) {
+	    return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+	  }
+	});
+	__webpack_require__(188)(KEY);
+
+
+/***/ }),
+/* 192 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 22.1.3.9 Array.prototype.findIndex(predicate, thisArg = undefined)
+	var $export = __webpack_require__(8);
+	var $find = __webpack_require__(174)(6);
+	var KEY = 'findIndex';
+	var forced = true;
+	// Shouldn't skip holes
+	if (KEY in []) Array(1)[KEY](function () { forced = false; });
+	$export($export.P + $export.F * forced, 'Array', {
+	  findIndex: function findIndex(callbackfn /* , that = undefined */) {
+	    return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+	  }
+	});
+	__webpack_require__(188)(KEY);
+
+
+/***/ }),
+/* 193 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(194)('Array');
+
+
+/***/ }),
+/* 194 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var global = __webpack_require__(4);
+	var dP = __webpack_require__(11);
+	var DESCRIPTORS = __webpack_require__(6);
+	var SPECIES = __webpack_require__(27)('species');
+
+	module.exports = function (KEY) {
+	  var C = global[KEY];
+	  if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
+	    configurable: true,
+	    get: function () { return this; }
+	  });
+	};
+
+
+/***/ }),
+/* 195 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var addToUnscopables = __webpack_require__(188);
+	var step = __webpack_require__(196);
+	var Iterators = __webpack_require__(130);
+	var toIObject = __webpack_require__(33);
+
+	// 22.1.3.4 Array.prototype.entries()
+	// 22.1.3.13 Array.prototype.keys()
+	// 22.1.3.29 Array.prototype.values()
+	// 22.1.3.30 Array.prototype[@@iterator]()
+	module.exports = __webpack_require__(129)(Array, 'Array', function (iterated, kind) {
+	  this._t = toIObject(iterated); // target
+	  this._i = 0;                   // next index
+	  this._k = kind;                // kind
+	// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
+	}, function () {
+	  var O = this._t;
+	  var kind = this._k;
+	  var index = this._i++;
+	  if (!O || index >= O.length) {
+	    this._t = undefined;
+	    return step(1);
+	  }
+	  if (kind == 'keys') return step(0, index);
+	  if (kind == 'values') return step(0, O[index]);
+	  return step(0, [index, O[index]]);
+	}, 'values');
+
+	// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
+	Iterators.Arguments = Iterators.Array;
+
+	addToUnscopables('keys');
+	addToUnscopables('values');
+	addToUnscopables('entries');
+
+
+/***/ }),
+/* 196 */
+/***/ (function(module, exports) {
+
+	module.exports = function (done, value) {
+	  return { value: value, done: !!done };
+	};
+
+
+/***/ }),
+/* 197 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var inheritIfRequired = __webpack_require__(88);
+	var dP = __webpack_require__(11).f;
+	var gOPN = __webpack_require__(51).f;
+	var isRegExp = __webpack_require__(135);
+	var $flags = __webpack_require__(198);
+	var $RegExp = global.RegExp;
+	var Base = $RegExp;
+	var proto = $RegExp.prototype;
+	var re1 = /a/g;
+	var re2 = /a/g;
+	// "new" creates a new object, old webkit buggy here
+	var CORRECT_NEW = new $RegExp(re1) !== re1;
+
+	if (__webpack_require__(6) && (!CORRECT_NEW || __webpack_require__(7)(function () {
+	  re2[__webpack_require__(27)('match')] = false;
+	  // RegExp constructor can alter flags and IsRegExp works correct with @@match
+	  return $RegExp(re1) != re1 || $RegExp(re2) == re2 || $RegExp(re1, 'i') != '/a/i';
+	}))) {
+	  $RegExp = function RegExp(p, f) {
+	    var tiRE = this instanceof $RegExp;
+	    var piRE = isRegExp(p);
+	    var fiU = f === undefined;
+	    return !tiRE && piRE && p.constructor === $RegExp && fiU ? p
+	      : inheritIfRequired(CORRECT_NEW
+	        ? new Base(piRE && !fiU ? p.source : p, f)
+	        : Base((piRE = p instanceof $RegExp) ? p.source : p, piRE && fiU ? $flags.call(p) : f)
+	      , tiRE ? this : proto, $RegExp);
+	  };
+	  var proxy = function (key) {
+	    key in $RegExp || dP($RegExp, key, {
+	      configurable: true,
+	      get: function () { return Base[key]; },
+	      set: function (it) { Base[key] = it; }
+	    });
+	  };
+	  for (var keys = gOPN(Base), i = 0; keys.length > i;) proxy(keys[i++]);
+	  proto.constructor = $RegExp;
+	  $RegExp.prototype = proto;
+	  __webpack_require__(18)(global, 'RegExp', $RegExp);
+	}
+
+	__webpack_require__(194)('RegExp');
+
+
+/***/ }),
+/* 198 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 21.2.5.3 get RegExp.prototype.flags
+	var anObject = __webpack_require__(12);
+	module.exports = function () {
+	  var that = anObject(this);
+	  var result = '';
+	  if (that.global) result += 'g';
+	  if (that.ignoreCase) result += 'i';
+	  if (that.multiline) result += 'm';
+	  if (that.unicode) result += 'u';
+	  if (that.sticky) result += 'y';
+	  return result;
+	};
+
+
+/***/ }),
+/* 199 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var regexpExec = __webpack_require__(200);
+	__webpack_require__(8)({
+	  target: 'RegExp',
+	  proto: true,
+	  forced: regexpExec !== /./.exec
+	}, {
+	  exec: regexpExec
+	});
+
+
+/***/ }),
+/* 200 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var regexpFlags = __webpack_require__(198);
+
+	var nativeExec = RegExp.prototype.exec;
+	// This always refers to the native implementation, because the
+	// String#replace polyfill uses ./fix-regexp-well-known-symbol-logic.js,
+	// which loads this file before patching the method.
+	var nativeReplace = String.prototype.replace;
+
+	var patchedExec = nativeExec;
+
+	var LAST_INDEX = 'lastIndex';
+
+	var UPDATES_LAST_INDEX_WRONG = (function () {
+	  var re1 = /a/,
+	      re2 = /b*/g;
+	  nativeExec.call(re1, 'a');
+	  nativeExec.call(re2, 'a');
+	  return re1[LAST_INDEX] !== 0 || re2[LAST_INDEX] !== 0;
+	})();
+
+	// nonparticipating capturing group, copied from es5-shim's String#split patch.
+	var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
+
+	var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED;
+
+	if (PATCH) {
+	  patchedExec = function exec(str) {
+	    var re = this;
+	    var lastIndex, reCopy, match, i;
+
+	    if (NPCG_INCLUDED) {
+	      reCopy = new RegExp('^' + re.source + '$(?!\\s)', regexpFlags.call(re));
+	    }
+	    if (UPDATES_LAST_INDEX_WRONG) lastIndex = re[LAST_INDEX];
+
+	    match = nativeExec.call(re, str);
+
+	    if (UPDATES_LAST_INDEX_WRONG && match) {
+	      re[LAST_INDEX] = re.global ? match.index + match[0].length : lastIndex;
+	    }
+	    if (NPCG_INCLUDED && match && match.length > 1) {
+	      // Fix browsers whose `exec` methods don't consistently return `undefined`
+	      // for NPCG, like IE8. NOTE: This doesn' work for /(.?)?/
+	      // eslint-disable-next-line no-loop-func
+	      nativeReplace.call(match[0], reCopy, function () {
+	        for (i = 1; i < arguments.length - 2; i++) {
+	          if (arguments[i] === undefined) match[i] = undefined;
+	        }
+	      });
+	    }
+
+	    return match;
+	  };
+	}
+
+	module.exports = patchedExec;
+
+
+/***/ }),
+/* 201 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	__webpack_require__(202);
+	var anObject = __webpack_require__(12);
+	var $flags = __webpack_require__(198);
+	var DESCRIPTORS = __webpack_require__(6);
+	var TO_STRING = 'toString';
+	var $toString = /./[TO_STRING];
+
+	var define = function (fn) {
+	  __webpack_require__(18)(RegExp.prototype, TO_STRING, fn, true);
+	};
+
+	// 21.2.5.14 RegExp.prototype.toString()
+	if (__webpack_require__(7)(function () { return $toString.call({ source: 'a', flags: 'b' }) != '/a/b'; })) {
+	  define(function toString() {
+	    var R = anObject(this);
+	    return '/'.concat(R.source, '/',
+	      'flags' in R ? R.flags : !DESCRIPTORS && R instanceof RegExp ? $flags.call(R) : undefined);
+	  });
+	// FF44- RegExp#toString has a wrong name
+	} else if ($toString.name != TO_STRING) {
+	  define(function toString() {
+	    return $toString.call(this);
+	  });
+	}
+
+
+/***/ }),
+/* 202 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 21.2.5.3 get RegExp.prototype.flags()
+	if (__webpack_require__(6) && /./g.flags != 'g') __webpack_require__(11).f(RegExp.prototype, 'flags', {
+	  configurable: true,
+	  get: __webpack_require__(198)
+	});
+
+
+/***/ }),
+/* 203 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var anObject = __webpack_require__(12);
+	var toLength = __webpack_require__(38);
+	var advanceStringIndex = __webpack_require__(204);
+	var regExpExec = __webpack_require__(205);
+
+	// @@match logic
+	__webpack_require__(206)('match', 1, function (defined, MATCH, $match, maybeCallNative) {
+	  return [
+	    // `String.prototype.match` method
+	    // https://tc39.github.io/ecma262/#sec-string.prototype.match
+	    function match(regexp) {
+	      var O = defined(this);
+	      var fn = regexp == undefined ? undefined : regexp[MATCH];
+	      return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[MATCH](String(O));
+	    },
+	    // `RegExp.prototype[@@match]` method
+	    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match
+	    function (regexp) {
+	      var res = maybeCallNative($match, regexp, this);
+	      if (res.done) return res.value;
+	      var rx = anObject(regexp);
+	      var S = String(this);
+	      if (!rx.global) return regExpExec(rx, S);
+	      var fullUnicode = rx.unicode;
+	      rx.lastIndex = 0;
+	      var A = [];
+	      var n = 0;
+	      var result;
+	      while ((result = regExpExec(rx, S)) !== null) {
+	        var matchStr = String(result[0]);
+	        A[n] = matchStr;
+	        if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
+	        n++;
+	      }
+	      return n === 0 ? null : A;
+	    }
+	  ];
+	});
+
+
+/***/ }),
+/* 204 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var at = __webpack_require__(128)(true);
+
+	 // `AdvanceStringIndex` abstract operation
+	// https://tc39.github.io/ecma262/#sec-advancestringindex
+	module.exports = function (S, index, unicode) {
+	  return index + (unicode ? at(S, index).length : 1);
+	};
+
+
+/***/ }),
+/* 205 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var classof = __webpack_require__(75);
+	var builtinExec = RegExp.prototype.exec;
+
+	 // `RegExpExec` abstract operation
+	// https://tc39.github.io/ecma262/#sec-regexpexec
+	module.exports = function (R, S) {
+	  var exec = R.exec;
+	  if (typeof exec === 'function') {
+	    var result = exec.call(R, S);
+	    if (typeof result !== 'object') {
+	      throw new TypeError('RegExp exec method returned something other than an Object or null');
+	    }
+	    return result;
+	  }
+	  if (classof(R) !== 'RegExp') {
+	    throw new TypeError('RegExp#exec called on incompatible receiver');
+	  }
+	  return builtinExec.call(R, S);
+	};
+
+
+/***/ }),
+/* 206 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	__webpack_require__(199);
+	var redefine = __webpack_require__(18);
+	var hide = __webpack_require__(10);
+	var fails = __webpack_require__(7);
+	var defined = __webpack_require__(36);
+	var wks = __webpack_require__(27);
+	var regexpExec = __webpack_require__(200);
+
+	var SPECIES = wks('species');
+
+	var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
+	  // #replace needs built-in support for named groups.
+	  // #match works fine because it just return the exec results, even if it has
+	  // a "grops" property.
+	  var re = /./;
+	  re.exec = function () {
+	    var result = [];
+	    result.groups = { a: '7' };
+	    return result;
+	  };
+	  return ''.replace(re, '$<a>') !== '7';
+	});
+
+	var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = (function () {
+	  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
+	  var re = /(?:)/;
+	  var originalExec = re.exec;
+	  re.exec = function () { return originalExec.apply(this, arguments); };
+	  var result = 'ab'.split(re);
+	  return result.length === 2 && result[0] === 'a' && result[1] === 'b';
+	})();
+
+	module.exports = function (KEY, length, exec) {
+	  var SYMBOL = wks(KEY);
+
+	  var DELEGATES_TO_SYMBOL = !fails(function () {
+	    // String methods call symbol-named RegEp methods
+	    var O = {};
+	    O[SYMBOL] = function () { return 7; };
+	    return ''[KEY](O) != 7;
+	  });
+
+	  var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL ? !fails(function () {
+	    // Symbol-named RegExp methods call .exec
+	    var execCalled = false;
+	    var re = /a/;
+	    re.exec = function () { execCalled = true; return null; };
+	    if (KEY === 'split') {
+	      // RegExp[@@split] doesn't call the regex's exec method, but first creates
+	      // a new one. We need to return the patched regex when creating the new one.
+	      re.constructor = {};
+	      re.constructor[SPECIES] = function () { return re; };
+	    }
+	    re[SYMBOL]('');
+	    return !execCalled;
+	  }) : undefined;
+
+	  if (
+	    !DELEGATES_TO_SYMBOL ||
+	    !DELEGATES_TO_EXEC ||
+	    (KEY === 'replace' && !REPLACE_SUPPORTS_NAMED_GROUPS) ||
+	    (KEY === 'split' && !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC)
+	  ) {
+	    var nativeRegExpMethod = /./[SYMBOL];
+	    var fns = exec(
+	      defined,
+	      SYMBOL,
+	      ''[KEY],
+	      function maybeCallNative(nativeMethod, regexp, str, arg2, forceStringMethod) {
+	        if (regexp.exec === regexpExec) {
+	          if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
+	            // The native String method already delegates to @@method (this
+	            // polyfilled function), leasing to infinite recursion.
+	            // We avoid it by directly calling the native @@method method.
+	            return { done: true, value: nativeRegExpMethod.call(regexp, str, arg2) };
+	          }
+	          return { done: true, value: nativeMethod.call(str, regexp, arg2) };
+	        }
+	        return { done: false };
+	      }
+	    );
+	    var strfn = fns[0];
+	    var rxfn = fns[1];
+
+	    redefine(String.prototype, KEY, strfn);
+	    hide(RegExp.prototype, SYMBOL, length == 2
+	      // 21.2.5.8 RegExp.prototype[@@replace](string, replaceValue)
+	      // 21.2.5.11 RegExp.prototype[@@split](string, limit)
+	      ? function (string, arg) { return rxfn.call(string, this, arg); }
+	      // 21.2.5.6 RegExp.prototype[@@match](string)
+	      // 21.2.5.9 RegExp.prototype[@@search](string)
+	      : function (string) { return rxfn.call(string, this); }
+	    );
+	  }
+	};
+
+
+/***/ }),
+/* 207 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var anObject = __webpack_require__(12);
+	var toObject = __webpack_require__(46);
+	var toLength = __webpack_require__(38);
+	var toInteger = __webpack_require__(39);
+	var advanceStringIndex = __webpack_require__(204);
+	var regExpExec = __webpack_require__(205);
+	var max = Math.max;
+	var min = Math.min;
+	var floor = Math.floor;
+	var SUBSTITUTION_SYMBOLS = /\$([$&`']|\d\d?|<[^>]*>)/g;
+	var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&`']|\d\d?)/g;
+
+	var maybeToString = function (it) {
+	  return it === undefined ? it : String(it);
+	};
+
+	// @@replace logic
+	__webpack_require__(206)('replace', 2, function (defined, REPLACE, $replace, maybeCallNative) {
+	  return [
+	    // `String.prototype.replace` method
+	    // https://tc39.github.io/ecma262/#sec-string.prototype.replace
+	    function replace(searchValue, replaceValue) {
+	      var O = defined(this);
+	      var fn = searchValue == undefined ? undefined : searchValue[REPLACE];
+	      return fn !== undefined
+	        ? fn.call(searchValue, O, replaceValue)
+	        : $replace.call(String(O), searchValue, replaceValue);
+	    },
+	    // `RegExp.prototype[@@replace]` method
+	    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
+	    function (regexp, replaceValue) {
+	      var res = maybeCallNative($replace, regexp, this, replaceValue);
+	      if (res.done) return res.value;
+
+	      var rx = anObject(regexp);
+	      var S = String(this);
+	      var functionalReplace = typeof replaceValue === 'function';
+	      if (!functionalReplace) replaceValue = String(replaceValue);
+	      var global = rx.global;
+	      if (global) {
+	        var fullUnicode = rx.unicode;
+	        rx.lastIndex = 0;
+	      }
+	      var results = [];
+	      while (true) {
+	        var result = regExpExec(rx, S);
+	        if (result === null) break;
+	        results.push(result);
+	        if (!global) break;
+	        var matchStr = String(result[0]);
+	        if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
+	      }
+	      var accumulatedResult = '';
+	      var nextSourcePosition = 0;
+	      for (var i = 0; i < results.length; i++) {
+	        result = results[i];
+	        var matched = String(result[0]);
+	        var position = max(min(toInteger(result.index), S.length), 0);
+	        var captures = [];
+	        // NOTE: This is equivalent to
+	        //   captures = result.slice(1).map(maybeToString)
+	        // but for some reason `nativeSlice.call(result, 1, result.length)` (called in
+	        // the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
+	        // causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
+	        for (var j = 1; j < result.length; j++) captures.push(maybeToString(result[j]));
+	        var namedCaptures = result.groups;
+	        if (functionalReplace) {
+	          var replacerArgs = [matched].concat(captures, position, S);
+	          if (namedCaptures !== undefined) replacerArgs.push(namedCaptures);
+	          var replacement = String(replaceValue.apply(undefined, replacerArgs));
+	        } else {
+	          replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
+	        }
+	        if (position >= nextSourcePosition) {
+	          accumulatedResult += S.slice(nextSourcePosition, position) + replacement;
+	          nextSourcePosition = position + matched.length;
+	        }
+	      }
+	      return accumulatedResult + S.slice(nextSourcePosition);
+	    }
+	  ];
+
+	    // https://tc39.github.io/ecma262/#sec-getsubstitution
+	  function getSubstitution(matched, str, position, captures, namedCaptures, replacement) {
+	    var tailPos = position + matched.length;
+	    var m = captures.length;
+	    var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
+	    if (namedCaptures !== undefined) {
+	      namedCaptures = toObject(namedCaptures);
+	      symbols = SUBSTITUTION_SYMBOLS;
+	    }
+	    return $replace.call(replacement, symbols, function (match, ch) {
+	      var capture;
+	      switch (ch.charAt(0)) {
+	        case '$': return '$';
+	        case '&': return matched;
+	        case '`': return str.slice(0, position);
+	        case "'": return str.slice(tailPos);
+	        case '<':
+	          capture = namedCaptures[ch.slice(1, -1)];
+	          break;
+	        default: // \d\d?
+	          var n = +ch;
+	          if (n === 0) return match;
+	          if (n > m) {
+	            var f = floor(n / 10);
+	            if (f === 0) return match;
+	            if (f <= m) return captures[f - 1] === undefined ? ch.charAt(1) : captures[f - 1] + ch.charAt(1);
+	            return match;
+	          }
+	          capture = captures[n - 1];
+	      }
+	      return capture === undefined ? '' : capture;
+	    });
+	  }
+	});
+
+
+/***/ }),
+/* 208 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var anObject = __webpack_require__(12);
+	var sameValue = __webpack_require__(71);
+	var regExpExec = __webpack_require__(205);
+
+	// @@search logic
+	__webpack_require__(206)('search', 1, function (defined, SEARCH, $search, maybeCallNative) {
+	  return [
+	    // `String.prototype.search` method
+	    // https://tc39.github.io/ecma262/#sec-string.prototype.search
+	    function search(regexp) {
+	      var O = defined(this);
+	      var fn = regexp == undefined ? undefined : regexp[SEARCH];
+	      return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
+	    },
+	    // `RegExp.prototype[@@search]` method
+	    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search
+	    function (regexp) {
+	      var res = maybeCallNative($search, regexp, this);
+	      if (res.done) return res.value;
+	      var rx = anObject(regexp);
+	      var S = String(this);
+	      var previousLastIndex = rx.lastIndex;
+	      if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
+	      var result = regExpExec(rx, S);
+	      if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
+	      return result === null ? -1 : result.index;
+	    }
+	  ];
+	});
+
+
+/***/ }),
+/* 209 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var isRegExp = __webpack_require__(135);
+	var anObject = __webpack_require__(12);
+	var speciesConstructor = __webpack_require__(210);
+	var advanceStringIndex = __webpack_require__(204);
+	var toLength = __webpack_require__(38);
+	var callRegExpExec = __webpack_require__(205);
+	var regexpExec = __webpack_require__(200);
+	var fails = __webpack_require__(7);
+	var $min = Math.min;
+	var $push = [].push;
+	var $SPLIT = 'split';
+	var LENGTH = 'length';
+	var LAST_INDEX = 'lastIndex';
+	var MAX_UINT32 = 0xffffffff;
+
+	// babel-minify transpiles RegExp('x', 'y') -> /x/y and it causes SyntaxError
+	var SUPPORTS_Y = !fails(function () { RegExp(MAX_UINT32, 'y'); });
+
+	// @@split logic
+	__webpack_require__(206)('split', 2, function (defined, SPLIT, $split, maybeCallNative) {
+	  var internalSplit;
+	  if (
+	    'abbc'[$SPLIT](/(b)*/)[1] == 'c' ||
+	    'test'[$SPLIT](/(?:)/, -1)[LENGTH] != 4 ||
+	    'ab'[$SPLIT](/(?:ab)*/)[LENGTH] != 2 ||
+	    '.'[$SPLIT](/(.?)(.?)/)[LENGTH] != 4 ||
+	    '.'[$SPLIT](/()()/)[LENGTH] > 1 ||
+	    ''[$SPLIT](/.?/)[LENGTH]
+	  ) {
+	    // based on es5-shim implementation, need to rework it
+	    internalSplit = function (separator, limit) {
+	      var string = String(this);
+	      if (separator === undefined && limit === 0) return [];
+	      // If `separator` is not a regex, use native split
+	      if (!isRegExp(separator)) return $split.call(string, separator, limit);
+	      var output = [];
+	      var flags = (separator.ignoreCase ? 'i' : '') +
+	                  (separator.multiline ? 'm' : '') +
+	                  (separator.unicode ? 'u' : '') +
+	                  (separator.sticky ? 'y' : '');
+	      var lastLastIndex = 0;
+	      var splitLimit = limit === undefined ? MAX_UINT32 : limit >>> 0;
+	      // Make `global` and avoid `lastIndex` issues by working with a copy
+	      var separatorCopy = new RegExp(separator.source, flags + 'g');
+	      var match, lastIndex, lastLength;
+	      while (match = regexpExec.call(separatorCopy, string)) {
+	        lastIndex = separatorCopy[LAST_INDEX];
+	        if (lastIndex > lastLastIndex) {
+	          output.push(string.slice(lastLastIndex, match.index));
+	          if (match[LENGTH] > 1 && match.index < string[LENGTH]) $push.apply(output, match.slice(1));
+	          lastLength = match[0][LENGTH];
+	          lastLastIndex = lastIndex;
+	          if (output[LENGTH] >= splitLimit) break;
+	        }
+	        if (separatorCopy[LAST_INDEX] === match.index) separatorCopy[LAST_INDEX]++; // Avoid an infinite loop
+	      }
+	      if (lastLastIndex === string[LENGTH]) {
+	        if (lastLength || !separatorCopy.test('')) output.push('');
+	      } else output.push(string.slice(lastLastIndex));
+	      return output[LENGTH] > splitLimit ? output.slice(0, splitLimit) : output;
+	    };
+	  // Chakra, V8
+	  } else if ('0'[$SPLIT](undefined, 0)[LENGTH]) {
+	    internalSplit = function (separator, limit) {
+	      return separator === undefined && limit === 0 ? [] : $split.call(this, separator, limit);
+	    };
+	  } else {
+	    internalSplit = $split;
+	  }
+
+	  return [
+	    // `String.prototype.split` method
+	    // https://tc39.github.io/ecma262/#sec-string.prototype.split
+	    function split(separator, limit) {
+	      var O = defined(this);
+	      var splitter = separator == undefined ? undefined : separator[SPLIT];
+	      return splitter !== undefined
+	        ? splitter.call(separator, O, limit)
+	        : internalSplit.call(String(O), separator, limit);
+	    },
+	    // `RegExp.prototype[@@split]` method
+	    // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split
+	    //
+	    // NOTE: This cannot be properly polyfilled in engines that don't support
+	    // the 'y' flag.
+	    function (regexp, limit) {
+	      var res = maybeCallNative(internalSplit, regexp, this, limit, internalSplit !== $split);
+	      if (res.done) return res.value;
+
+	      var rx = anObject(regexp);
+	      var S = String(this);
+	      var C = speciesConstructor(rx, RegExp);
+
+	      var unicodeMatching = rx.unicode;
+	      var flags = (rx.ignoreCase ? 'i' : '') +
+	                  (rx.multiline ? 'm' : '') +
+	                  (rx.unicode ? 'u' : '') +
+	                  (SUPPORTS_Y ? 'y' : 'g');
+
+	      // ^(? + rx + ) is needed, in combination with some S slicing, to
+	      // simulate the 'y' flag.
+	      var splitter = new C(SUPPORTS_Y ? rx : '^(?:' + rx.source + ')', flags);
+	      var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
+	      if (lim === 0) return [];
+	      if (S.length === 0) return callRegExpExec(splitter, S) === null ? [S] : [];
+	      var p = 0;
+	      var q = 0;
+	      var A = [];
+	      while (q < S.length) {
+	        splitter.lastIndex = SUPPORTS_Y ? q : 0;
+	        var z = callRegExpExec(splitter, SUPPORTS_Y ? S : S.slice(q));
+	        var e;
+	        if (
+	          z === null ||
+	          (e = $min(toLength(splitter.lastIndex + (SUPPORTS_Y ? 0 : q)), S.length)) === p
+	        ) {
+	          q = advanceStringIndex(S, q, unicodeMatching);
+	        } else {
+	          A.push(S.slice(p, q));
+	          if (A.length === lim) return A;
+	          for (var i = 1; i <= z.length - 1; i++) {
+	            A.push(z[i]);
+	            if (A.length === lim) return A;
+	          }
+	          q = p = e;
+	        }
+	      }
+	      A.push(S.slice(p));
+	      return A;
+	    }
+	  ];
+	});
+
+
+/***/ }),
+/* 210 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 7.3.20 SpeciesConstructor(O, defaultConstructor)
+	var anObject = __webpack_require__(12);
+	var aFunction = __webpack_require__(24);
+	var SPECIES = __webpack_require__(27)('species');
+	module.exports = function (O, D) {
+	  var C = anObject(O).constructor;
+	  var S;
+	  return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
+	};
+
+
+/***/ }),
+/* 211 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var LIBRARY = __webpack_require__(22);
+	var global = __webpack_require__(4);
+	var ctx = __webpack_require__(23);
+	var classof = __webpack_require__(75);
+	var $export = __webpack_require__(8);
+	var isObject = __webpack_require__(13);
+	var aFunction = __webpack_require__(24);
+	var anInstance = __webpack_require__(212);
+	var forOf = __webpack_require__(213);
+	var speciesConstructor = __webpack_require__(210);
+	var task = __webpack_require__(214).set;
+	var microtask = __webpack_require__(215)();
+	var newPromiseCapabilityModule = __webpack_require__(216);
+	var perform = __webpack_require__(217);
+	var userAgent = __webpack_require__(218);
+	var promiseResolve = __webpack_require__(219);
+	var PROMISE = 'Promise';
+	var TypeError = global.TypeError;
+	var process = global.process;
+	var versions = process && process.versions;
+	var v8 = versions && versions.v8 || '';
+	var $Promise = global[PROMISE];
+	var isNode = classof(process) == 'process';
+	var empty = function () { /* empty */ };
+	var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
+	var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
+
+	var USE_NATIVE = !!function () {
+	  try {
+	    // correct subclassing with @@species support
+	    var promise = $Promise.resolve(1);
+	    var FakePromise = (promise.constructor = {})[__webpack_require__(27)('species')] = function (exec) {
+	      exec(empty, empty);
+	    };
+	    // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
+	    return (isNode || typeof PromiseRejectionEvent == 'function')
+	      && promise.then(empty) instanceof FakePromise
+	      // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
+	      // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
+	      // we can't detect it synchronously, so just check versions
+	      && v8.indexOf('6.6') !== 0
+	      && userAgent.indexOf('Chrome/66') === -1;
+	  } catch (e) { /* empty */ }
+	}();
+
+	// helpers
+	var isThenable = function (it) {
+	  var then;
+	  return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
+	};
+	var notify = function (promise, isReject) {
+	  if (promise._n) return;
+	  promise._n = true;
+	  var chain = promise._c;
+	  microtask(function () {
+	    var value = promise._v;
+	    var ok = promise._s == 1;
+	    var i = 0;
+	    var run = function (reaction) {
+	      var handler = ok ? reaction.ok : reaction.fail;
+	      var resolve = reaction.resolve;
+	      var reject = reaction.reject;
+	      var domain = reaction.domain;
+	      var result, then, exited;
+	      try {
+	        if (handler) {
+	          if (!ok) {
+	            if (promise._h == 2) onHandleUnhandled(promise);
+	            promise._h = 1;
+	          }
+	          if (handler === true) result = value;
+	          else {
+	            if (domain) domain.enter();
+	            result = handler(value); // may throw
+	            if (domain) {
+	              domain.exit();
+	              exited = true;
+	            }
+	          }
+	          if (result === reaction.promise) {
+	            reject(TypeError('Promise-chain cycle'));
+	          } else if (then = isThenable(result)) {
+	            then.call(result, resolve, reject);
+	          } else resolve(result);
+	        } else reject(value);
+	      } catch (e) {
+	        if (domain && !exited) domain.exit();
+	        reject(e);
+	      }
+	    };
+	    while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
+	    promise._c = [];
+	    promise._n = false;
+	    if (isReject && !promise._h) onUnhandled(promise);
+	  });
+	};
+	var onUnhandled = function (promise) {
+	  task.call(global, function () {
+	    var value = promise._v;
+	    var unhandled = isUnhandled(promise);
+	    var result, handler, console;
+	    if (unhandled) {
+	      result = perform(function () {
+	        if (isNode) {
+	          process.emit('unhandledRejection', value, promise);
+	        } else if (handler = global.onunhandledrejection) {
+	          handler({ promise: promise, reason: value });
+	        } else if ((console = global.console) && console.error) {
+	          console.error('Unhandled promise rejection', value);
+	        }
+	      });
+	      // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
+	      promise._h = isNode || isUnhandled(promise) ? 2 : 1;
+	    } promise._a = undefined;
+	    if (unhandled && result.e) throw result.v;
+	  });
+	};
+	var isUnhandled = function (promise) {
+	  return promise._h !== 1 && (promise._a || promise._c).length === 0;
+	};
+	var onHandleUnhandled = function (promise) {
+	  task.call(global, function () {
+	    var handler;
+	    if (isNode) {
+	      process.emit('rejectionHandled', promise);
+	    } else if (handler = global.onrejectionhandled) {
+	      handler({ promise: promise, reason: promise._v });
+	    }
+	  });
+	};
+	var $reject = function (value) {
+	  var promise = this;
+	  if (promise._d) return;
+	  promise._d = true;
+	  promise = promise._w || promise; // unwrap
+	  promise._v = value;
+	  promise._s = 2;
+	  if (!promise._a) promise._a = promise._c.slice();
+	  notify(promise, true);
+	};
+	var $resolve = function (value) {
+	  var promise = this;
+	  var then;
+	  if (promise._d) return;
+	  promise._d = true;
+	  promise = promise._w || promise; // unwrap
+	  try {
+	    if (promise === value) throw TypeError("Promise can't be resolved itself");
+	    if (then = isThenable(value)) {
+	      microtask(function () {
+	        var wrapper = { _w: promise, _d: false }; // wrap
+	        try {
+	          then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
+	        } catch (e) {
+	          $reject.call(wrapper, e);
+	        }
+	      });
+	    } else {
+	      promise._v = value;
+	      promise._s = 1;
+	      notify(promise, false);
+	    }
+	  } catch (e) {
+	    $reject.call({ _w: promise, _d: false }, e); // wrap
+	  }
+	};
+
+	// constructor polyfill
+	if (!USE_NATIVE) {
+	  // 25.4.3.1 Promise(executor)
+	  $Promise = function Promise(executor) {
+	    anInstance(this, $Promise, PROMISE, '_h');
+	    aFunction(executor);
+	    Internal.call(this);
+	    try {
+	      executor(ctx($resolve, this, 1), ctx($reject, this, 1));
+	    } catch (err) {
+	      $reject.call(this, err);
+	    }
+	  };
+	  // eslint-disable-next-line no-unused-vars
+	  Internal = function Promise(executor) {
+	    this._c = [];             // <- awaiting reactions
+	    this._a = undefined;      // <- checked in isUnhandled reactions
+	    this._s = 0;              // <- state
+	    this._d = false;          // <- done
+	    this._v = undefined;      // <- value
+	    this._h = 0;              // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
+	    this._n = false;          // <- notify
+	  };
+	  Internal.prototype = __webpack_require__(220)($Promise.prototype, {
+	    // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
+	    then: function then(onFulfilled, onRejected) {
+	      var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
+	      reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
+	      reaction.fail = typeof onRejected == 'function' && onRejected;
+	      reaction.domain = isNode ? process.domain : undefined;
+	      this._c.push(reaction);
+	      if (this._a) this._a.push(reaction);
+	      if (this._s) notify(this, false);
+	      return reaction.promise;
+	    },
+	    // 25.4.5.1 Promise.prototype.catch(onRejected)
+	    'catch': function (onRejected) {
+	      return this.then(undefined, onRejected);
+	    }
+	  });
+	  OwnPromiseCapability = function () {
+	    var promise = new Internal();
+	    this.promise = promise;
+	    this.resolve = ctx($resolve, promise, 1);
+	    this.reject = ctx($reject, promise, 1);
+	  };
+	  newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
+	    return C === $Promise || C === Wrapper
+	      ? new OwnPromiseCapability(C)
+	      : newGenericPromiseCapability(C);
+	  };
+	}
+
+	$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
+	__webpack_require__(26)($Promise, PROMISE);
+	__webpack_require__(194)(PROMISE);
+	Wrapper = __webpack_require__(9)[PROMISE];
+
+	// statics
+	$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
+	  // 25.4.4.5 Promise.reject(r)
+	  reject: function reject(r) {
+	    var capability = newPromiseCapability(this);
+	    var $$reject = capability.reject;
+	    $$reject(r);
+	    return capability.promise;
+	  }
+	});
+	$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
+	  // 25.4.4.6 Promise.resolve(x)
+	  resolve: function resolve(x) {
+	    return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
+	  }
+	});
+	$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(167)(function (iter) {
+	  $Promise.all(iter)['catch'](empty);
+	})), PROMISE, {
+	  // 25.4.4.1 Promise.all(iterable)
+	  all: function all(iterable) {
+	    var C = this;
+	    var capability = newPromiseCapability(C);
+	    var resolve = capability.resolve;
+	    var reject = capability.reject;
+	    var result = perform(function () {
+	      var values = [];
+	      var index = 0;
+	      var remaining = 1;
+	      forOf(iterable, false, function (promise) {
+	        var $index = index++;
+	        var alreadyCalled = false;
+	        values.push(undefined);
+	        remaining++;
+	        C.resolve(promise).then(function (value) {
+	          if (alreadyCalled) return;
+	          alreadyCalled = true;
+	          values[$index] = value;
+	          --remaining || resolve(values);
+	        }, reject);
+	      });
+	      --remaining || resolve(values);
+	    });
+	    if (result.e) reject(result.v);
+	    return capability.promise;
+	  },
+	  // 25.4.4.4 Promise.race(iterable)
+	  race: function race(iterable) {
+	    var C = this;
+	    var capability = newPromiseCapability(C);
+	    var reject = capability.reject;
+	    var result = perform(function () {
+	      forOf(iterable, false, function (promise) {
+	        C.resolve(promise).then(capability.resolve, reject);
+	      });
+	    });
+	    if (result.e) reject(result.v);
+	    return capability.promise;
+	  }
+	});
+
+
+/***/ }),
+/* 212 */
+/***/ (function(module, exports) {
+
+	module.exports = function (it, Constructor, name, forbiddenField) {
+	  if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
+	    throw TypeError(name + ': incorrect invocation!');
+	  } return it;
+	};
+
+
+/***/ }),
+/* 213 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var ctx = __webpack_require__(23);
+	var call = __webpack_require__(163);
+	var isArrayIter = __webpack_require__(164);
+	var anObject = __webpack_require__(12);
+	var toLength = __webpack_require__(38);
+	var getIterFn = __webpack_require__(166);
+	var BREAK = {};
+	var RETURN = {};
+	var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
+	  var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
+	  var f = ctx(fn, that, entries ? 2 : 1);
+	  var index = 0;
+	  var length, step, iterator, result;
+	  if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
+	  // fast case for arrays with default iterator
+	  if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
+	    result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
+	    if (result === BREAK || result === RETURN) return result;
+	  } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
+	    result = call(iterator, f, step.value, entries);
+	    if (result === BREAK || result === RETURN) return result;
+	  }
+	};
+	exports.BREAK = BREAK;
+	exports.RETURN = RETURN;
+
+
+/***/ }),
+/* 214 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var ctx = __webpack_require__(23);
+	var invoke = __webpack_require__(78);
+	var html = __webpack_require__(49);
+	var cel = __webpack_require__(15);
+	var global = __webpack_require__(4);
+	var process = global.process;
+	var setTask = global.setImmediate;
+	var clearTask = global.clearImmediate;
+	var MessageChannel = global.MessageChannel;
+	var Dispatch = global.Dispatch;
+	var counter = 0;
+	var queue = {};
+	var ONREADYSTATECHANGE = 'onreadystatechange';
+	var defer, channel, port;
+	var run = function () {
+	  var id = +this;
+	  // eslint-disable-next-line no-prototype-builtins
+	  if (queue.hasOwnProperty(id)) {
+	    var fn = queue[id];
+	    delete queue[id];
+	    fn();
+	  }
+	};
+	var listener = function (event) {
+	  run.call(event.data);
+	};
+	// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
+	if (!setTask || !clearTask) {
+	  setTask = function setImmediate(fn) {
+	    var args = [];
+	    var i = 1;
+	    while (arguments.length > i) args.push(arguments[i++]);
+	    queue[++counter] = function () {
+	      // eslint-disable-next-line no-new-func
+	      invoke(typeof fn == 'function' ? fn : Function(fn), args);
+	    };
+	    defer(counter);
+	    return counter;
+	  };
+	  clearTask = function clearImmediate(id) {
+	    delete queue[id];
+	  };
+	  // Node.js 0.8-
+	  if (__webpack_require__(35)(process) == 'process') {
+	    defer = function (id) {
+	      process.nextTick(ctx(run, id, 1));
+	    };
+	  // Sphere (JS game engine) Dispatch API
+	  } else if (Dispatch && Dispatch.now) {
+	    defer = function (id) {
+	      Dispatch.now(ctx(run, id, 1));
+	    };
+	  // Browsers with MessageChannel, includes WebWorkers
+	  } else if (MessageChannel) {
+	    channel = new MessageChannel();
+	    port = channel.port2;
+	    channel.port1.onmessage = listener;
+	    defer = ctx(port.postMessage, port, 1);
+	  // Browsers with postMessage, skip WebWorkers
+	  // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
+	  } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
+	    defer = function (id) {
+	      global.postMessage(id + '', '*');
+	    };
+	    global.addEventListener('message', listener, false);
+	  // IE8-
+	  } else if (ONREADYSTATECHANGE in cel('script')) {
+	    defer = function (id) {
+	      html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
+	        html.removeChild(this);
+	        run.call(id);
+	      };
+	    };
+	  // Rest old browsers
+	  } else {
+	    defer = function (id) {
+	      setTimeout(ctx(run, id, 1), 0);
+	    };
+	  }
+	}
+	module.exports = {
+	  set: setTask,
+	  clear: clearTask
+	};
+
+
+/***/ }),
+/* 215 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var macrotask = __webpack_require__(214).set;
+	var Observer = global.MutationObserver || global.WebKitMutationObserver;
+	var process = global.process;
+	var Promise = global.Promise;
+	var isNode = __webpack_require__(35)(process) == 'process';
+
+	module.exports = function () {
+	  var head, last, notify;
+
+	  var flush = function () {
+	    var parent, fn;
+	    if (isNode && (parent = process.domain)) parent.exit();
+	    while (head) {
+	      fn = head.fn;
+	      head = head.next;
+	      try {
+	        fn();
+	      } catch (e) {
+	        if (head) notify();
+	        else last = undefined;
+	        throw e;
+	      }
+	    } last = undefined;
+	    if (parent) parent.enter();
+	  };
+
+	  // Node.js
+	  if (isNode) {
+	    notify = function () {
+	      process.nextTick(flush);
+	    };
+	  // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
+	  } else if (Observer && !(global.navigator && global.navigator.standalone)) {
+	    var toggle = true;
+	    var node = document.createTextNode('');
+	    new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
+	    notify = function () {
+	      node.data = toggle = !toggle;
+	    };
+	  // environments with maybe non-completely correct, but existent Promise
+	  } else if (Promise && Promise.resolve) {
+	    // Promise.resolve without an argument throws an error in LG WebOS 2
+	    var promise = Promise.resolve(undefined);
+	    notify = function () {
+	      promise.then(flush);
+	    };
+	  // for other environments - macrotask based on:
+	  // - setImmediate
+	  // - MessageChannel
+	  // - window.postMessag
+	  // - onreadystatechange
+	  // - setTimeout
+	  } else {
+	    notify = function () {
+	      // strange IE + webpack dev server bug - use .call(global)
+	      macrotask.call(global, flush);
+	    };
+	  }
+
+	  return function (fn) {
+	    var task = { fn: fn, next: undefined };
+	    if (last) last.next = task;
+	    if (!head) {
+	      head = task;
+	      notify();
+	    } last = task;
+	  };
+	};
+
+
+/***/ }),
+/* 216 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 25.4.1.5 NewPromiseCapability(C)
+	var aFunction = __webpack_require__(24);
+
+	function PromiseCapability(C) {
+	  var resolve, reject;
+	  this.promise = new C(function ($$resolve, $$reject) {
+	    if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
+	    resolve = $$resolve;
+	    reject = $$reject;
+	  });
+	  this.resolve = aFunction(resolve);
+	  this.reject = aFunction(reject);
+	}
+
+	module.exports.f = function (C) {
+	  return new PromiseCapability(C);
+	};
+
+
+/***/ }),
+/* 217 */
+/***/ (function(module, exports) {
+
+	module.exports = function (exec) {
+	  try {
+	    return { e: false, v: exec() };
+	  } catch (e) {
+	    return { e: true, v: e };
+	  }
+	};
+
+
+/***/ }),
+/* 218 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var navigator = global.navigator;
+
+	module.exports = navigator && navigator.userAgent || '';
+
+
+/***/ }),
+/* 219 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var anObject = __webpack_require__(12);
+	var isObject = __webpack_require__(13);
+	var newPromiseCapability = __webpack_require__(216);
+
+	module.exports = function (C, x) {
+	  anObject(C);
+	  if (isObject(x) && x.constructor === C) return x;
+	  var promiseCapability = newPromiseCapability.f(C);
+	  var resolve = promiseCapability.resolve;
+	  resolve(x);
+	  return promiseCapability.promise;
+	};
+
+
+/***/ }),
+/* 220 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var redefine = __webpack_require__(18);
+	module.exports = function (target, src, safe) {
+	  for (var key in src) redefine(target, key, src[key], safe);
+	  return target;
+	};
+
+
+/***/ }),
+/* 221 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var strong = __webpack_require__(222);
+	var validate = __webpack_require__(223);
+	var MAP = 'Map';
+
+	// 23.1 Map Objects
+	module.exports = __webpack_require__(224)(MAP, function (get) {
+	  return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
+	}, {
+	  // 23.1.3.6 Map.prototype.get(key)
+	  get: function get(key) {
+	    var entry = strong.getEntry(validate(this, MAP), key);
+	    return entry && entry.v;
+	  },
+	  // 23.1.3.9 Map.prototype.set(key, value)
+	  set: function set(key, value) {
+	    return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
+	  }
+	}, strong, true);
+
+
+/***/ }),
+/* 222 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var dP = __webpack_require__(11).f;
+	var create = __webpack_require__(47);
+	var redefineAll = __webpack_require__(220);
+	var ctx = __webpack_require__(23);
+	var anInstance = __webpack_require__(212);
+	var forOf = __webpack_require__(213);
+	var $iterDefine = __webpack_require__(129);
+	var step = __webpack_require__(196);
+	var setSpecies = __webpack_require__(194);
+	var DESCRIPTORS = __webpack_require__(6);
+	var fastKey = __webpack_require__(25).fastKey;
+	var validate = __webpack_require__(223);
+	var SIZE = DESCRIPTORS ? '_s' : 'size';
+
+	var getEntry = function (that, key) {
+	  // fast case
+	  var index = fastKey(key);
+	  var entry;
+	  if (index !== 'F') return that._i[index];
+	  // frozen object case
+	  for (entry = that._f; entry; entry = entry.n) {
+	    if (entry.k == key) return entry;
+	  }
+	};
+
+	module.exports = {
+	  getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
+	    var C = wrapper(function (that, iterable) {
+	      anInstance(that, C, NAME, '_i');
+	      that._t = NAME;         // collection type
+	      that._i = create(null); // index
+	      that._f = undefined;    // first entry
+	      that._l = undefined;    // last entry
+	      that[SIZE] = 0;         // size
+	      if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
+	    });
+	    redefineAll(C.prototype, {
+	      // 23.1.3.1 Map.prototype.clear()
+	      // 23.2.3.2 Set.prototype.clear()
+	      clear: function clear() {
+	        for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
+	          entry.r = true;
+	          if (entry.p) entry.p = entry.p.n = undefined;
+	          delete data[entry.i];
+	        }
+	        that._f = that._l = undefined;
+	        that[SIZE] = 0;
+	      },
+	      // 23.1.3.3 Map.prototype.delete(key)
+	      // 23.2.3.4 Set.prototype.delete(value)
+	      'delete': function (key) {
+	        var that = validate(this, NAME);
+	        var entry = getEntry(that, key);
+	        if (entry) {
+	          var next = entry.n;
+	          var prev = entry.p;
+	          delete that._i[entry.i];
+	          entry.r = true;
+	          if (prev) prev.n = next;
+	          if (next) next.p = prev;
+	          if (that._f == entry) that._f = next;
+	          if (that._l == entry) that._l = prev;
+	          that[SIZE]--;
+	        } return !!entry;
+	      },
+	      // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
+	      // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
+	      forEach: function forEach(callbackfn /* , that = undefined */) {
+	        validate(this, NAME);
+	        var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
+	        var entry;
+	        while (entry = entry ? entry.n : this._f) {
+	          f(entry.v, entry.k, this);
+	          // revert to the last existing entry
+	          while (entry && entry.r) entry = entry.p;
+	        }
+	      },
+	      // 23.1.3.7 Map.prototype.has(key)
+	      // 23.2.3.7 Set.prototype.has(value)
+	      has: function has(key) {
+	        return !!getEntry(validate(this, NAME), key);
+	      }
+	    });
+	    if (DESCRIPTORS) dP(C.prototype, 'size', {
+	      get: function () {
+	        return validate(this, NAME)[SIZE];
+	      }
+	    });
+	    return C;
+	  },
+	  def: function (that, key, value) {
+	    var entry = getEntry(that, key);
+	    var prev, index;
+	    // change existing entry
+	    if (entry) {
+	      entry.v = value;
+	    // create new entry
+	    } else {
+	      that._l = entry = {
+	        i: index = fastKey(key, true), // <- index
+	        k: key,                        // <- key
+	        v: value,                      // <- value
+	        p: prev = that._l,             // <- previous entry
+	        n: undefined,                  // <- next entry
+	        r: false                       // <- removed
+	      };
+	      if (!that._f) that._f = entry;
+	      if (prev) prev.n = entry;
+	      that[SIZE]++;
+	      // add to index
+	      if (index !== 'F') that._i[index] = entry;
+	    } return that;
+	  },
+	  getEntry: getEntry,
+	  setStrong: function (C, NAME, IS_MAP) {
+	    // add .keys, .values, .entries, [@@iterator]
+	    // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
+	    $iterDefine(C, NAME, function (iterated, kind) {
+	      this._t = validate(iterated, NAME); // target
+	      this._k = kind;                     // kind
+	      this._l = undefined;                // previous
+	    }, function () {
+	      var that = this;
+	      var kind = that._k;
+	      var entry = that._l;
+	      // revert to the last existing entry
+	      while (entry && entry.r) entry = entry.p;
+	      // get next entry
+	      if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
+	        // or finish the iteration
+	        that._t = undefined;
+	        return step(1);
+	      }
+	      // return step by kind
+	      if (kind == 'keys') return step(0, entry.k);
+	      if (kind == 'values') return step(0, entry.v);
+	      return step(0, [entry.k, entry.v]);
+	    }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
+
+	    // add [@@species], 23.1.2.2, 23.2.2.2
+	    setSpecies(NAME);
+	  }
+	};
+
+
+/***/ }),
+/* 223 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var isObject = __webpack_require__(13);
+	module.exports = function (it, TYPE) {
+	  if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
+	  return it;
+	};
+
+
+/***/ }),
+/* 224 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var global = __webpack_require__(4);
+	var $export = __webpack_require__(8);
+	var redefine = __webpack_require__(18);
+	var redefineAll = __webpack_require__(220);
+	var meta = __webpack_require__(25);
+	var forOf = __webpack_require__(213);
+	var anInstance = __webpack_require__(212);
+	var isObject = __webpack_require__(13);
+	var fails = __webpack_require__(7);
+	var $iterDetect = __webpack_require__(167);
+	var setToStringTag = __webpack_require__(26);
+	var inheritIfRequired = __webpack_require__(88);
+
+	module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
+	  var Base = global[NAME];
+	  var C = Base;
+	  var ADDER = IS_MAP ? 'set' : 'add';
+	  var proto = C && C.prototype;
+	  var O = {};
+	  var fixMethod = function (KEY) {
+	    var fn = proto[KEY];
+	    redefine(proto, KEY,
+	      KEY == 'delete' ? function (a) {
+	        return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
+	      } : KEY == 'has' ? function has(a) {
+	        return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a);
+	      } : KEY == 'get' ? function get(a) {
+	        return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a);
+	      } : KEY == 'add' ? function add(a) { fn.call(this, a === 0 ? 0 : a); return this; }
+	        : function set(a, b) { fn.call(this, a === 0 ? 0 : a, b); return this; }
+	    );
+	  };
+	  if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
+	    new C().entries().next();
+	  }))) {
+	    // create collection constructor
+	    C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
+	    redefineAll(C.prototype, methods);
+	    meta.NEED = true;
+	  } else {
+	    var instance = new C();
+	    // early implementations not supports chaining
+	    var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance;
+	    // V8 ~  Chromium 40- weak-collections throws on primitives, but should return false
+	    var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); });
+	    // most early implementations doesn't supports iterables, most modern - not close it correctly
+	    var ACCEPT_ITERABLES = $iterDetect(function (iter) { new C(iter); }); // eslint-disable-line no-new
+	    // for early implementations -0 and +0 not the same
+	    var BUGGY_ZERO = !IS_WEAK && fails(function () {
+	      // V8 ~ Chromium 42- fails only with 5+ elements
+	      var $instance = new C();
+	      var index = 5;
+	      while (index--) $instance[ADDER](index, index);
+	      return !$instance.has(-0);
+	    });
+	    if (!ACCEPT_ITERABLES) {
+	      C = wrapper(function (target, iterable) {
+	        anInstance(target, C, NAME);
+	        var that = inheritIfRequired(new Base(), target, C);
+	        if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
+	        return that;
+	      });
+	      C.prototype = proto;
+	      proto.constructor = C;
+	    }
+	    if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) {
+	      fixMethod('delete');
+	      fixMethod('has');
+	      IS_MAP && fixMethod('get');
+	    }
+	    if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER);
+	    // weak collections should not contains .clear method
+	    if (IS_WEAK && proto.clear) delete proto.clear;
+	  }
+
+	  setToStringTag(C, NAME);
+
+	  O[NAME] = C;
+	  $export($export.G + $export.W + $export.F * (C != Base), O);
+
+	  if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
+
+	  return C;
+	};
+
+
+/***/ }),
+/* 225 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var strong = __webpack_require__(222);
+	var validate = __webpack_require__(223);
+	var SET = 'Set';
+
+	// 23.2 Set Objects
+	module.exports = __webpack_require__(224)(SET, function (get) {
+	  return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
+	}, {
+	  // 23.2.3.1 Set.prototype.add(value)
+	  add: function add(value) {
+	    return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
+	  }
+	}, strong);
+
+
+/***/ }),
+/* 226 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var global = __webpack_require__(4);
+	var each = __webpack_require__(174)(0);
+	var redefine = __webpack_require__(18);
+	var meta = __webpack_require__(25);
+	var assign = __webpack_require__(69);
+	var weak = __webpack_require__(227);
+	var isObject = __webpack_require__(13);
+	var validate = __webpack_require__(223);
+	var NATIVE_WEAK_MAP = __webpack_require__(223);
+	var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
+	var WEAK_MAP = 'WeakMap';
+	var getWeak = meta.getWeak;
+	var isExtensible = Object.isExtensible;
+	var uncaughtFrozenStore = weak.ufstore;
+	var InternalMap;
+
+	var wrapper = function (get) {
+	  return function WeakMap() {
+	    return get(this, arguments.length > 0 ? arguments[0] : undefined);
+	  };
+	};
+
+	var methods = {
+	  // 23.3.3.3 WeakMap.prototype.get(key)
+	  get: function get(key) {
+	    if (isObject(key)) {
+	      var data = getWeak(key);
+	      if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key);
+	      return data ? data[this._i] : undefined;
+	    }
+	  },
+	  // 23.3.3.5 WeakMap.prototype.set(key, value)
+	  set: function set(key, value) {
+	    return weak.def(validate(this, WEAK_MAP), key, value);
+	  }
+	};
+
+	// 23.3 WeakMap Objects
+	var $WeakMap = module.exports = __webpack_require__(224)(WEAK_MAP, wrapper, methods, weak, true, true);
+
+	// IE11 WeakMap frozen keys fix
+	if (NATIVE_WEAK_MAP && IS_IE11) {
+	  InternalMap = weak.getConstructor(wrapper, WEAK_MAP);
+	  assign(InternalMap.prototype, methods);
+	  meta.NEED = true;
+	  each(['delete', 'has', 'get', 'set'], function (key) {
+	    var proto = $WeakMap.prototype;
+	    var method = proto[key];
+	    redefine(proto, key, function (a, b) {
+	      // store frozen objects on internal weakmap shim
+	      if (isObject(a) && !isExtensible(a)) {
+	        if (!this._f) this._f = new InternalMap();
+	        var result = this._f[key](a, b);
+	        return key == 'set' ? this : result;
+	      // store all the rest on native weakmap
+	      } return method.call(this, a, b);
+	    });
+	  });
+	}
+
+
+/***/ }),
+/* 227 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var redefineAll = __webpack_require__(220);
+	var getWeak = __webpack_require__(25).getWeak;
+	var anObject = __webpack_require__(12);
+	var isObject = __webpack_require__(13);
+	var anInstance = __webpack_require__(212);
+	var forOf = __webpack_require__(213);
+	var createArrayMethod = __webpack_require__(174);
+	var $has = __webpack_require__(5);
+	var validate = __webpack_require__(223);
+	var arrayFind = createArrayMethod(5);
+	var arrayFindIndex = createArrayMethod(6);
+	var id = 0;
+
+	// fallback for uncaught frozen keys
+	var uncaughtFrozenStore = function (that) {
+	  return that._l || (that._l = new UncaughtFrozenStore());
+	};
+	var UncaughtFrozenStore = function () {
+	  this.a = [];
+	};
+	var findUncaughtFrozen = function (store, key) {
+	  return arrayFind(store.a, function (it) {
+	    return it[0] === key;
+	  });
+	};
+	UncaughtFrozenStore.prototype = {
+	  get: function (key) {
+	    var entry = findUncaughtFrozen(this, key);
+	    if (entry) return entry[1];
+	  },
+	  has: function (key) {
+	    return !!findUncaughtFrozen(this, key);
+	  },
+	  set: function (key, value) {
+	    var entry = findUncaughtFrozen(this, key);
+	    if (entry) entry[1] = value;
+	    else this.a.push([key, value]);
+	  },
+	  'delete': function (key) {
+	    var index = arrayFindIndex(this.a, function (it) {
+	      return it[0] === key;
+	    });
+	    if (~index) this.a.splice(index, 1);
+	    return !!~index;
+	  }
+	};
+
+	module.exports = {
+	  getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
+	    var C = wrapper(function (that, iterable) {
+	      anInstance(that, C, NAME, '_i');
+	      that._t = NAME;      // collection type
+	      that._i = id++;      // collection id
+	      that._l = undefined; // leak store for uncaught frozen objects
+	      if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
+	    });
+	    redefineAll(C.prototype, {
+	      // 23.3.3.2 WeakMap.prototype.delete(key)
+	      // 23.4.3.3 WeakSet.prototype.delete(value)
+	      'delete': function (key) {
+	        if (!isObject(key)) return false;
+	        var data = getWeak(key);
+	        if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key);
+	        return data && $has(data, this._i) && delete data[this._i];
+	      },
+	      // 23.3.3.4 WeakMap.prototype.has(key)
+	      // 23.4.3.4 WeakSet.prototype.has(value)
+	      has: function has(key) {
+	        if (!isObject(key)) return false;
+	        var data = getWeak(key);
+	        if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key);
+	        return data && $has(data, this._i);
+	      }
+	    });
+	    return C;
+	  },
+	  def: function (that, key, value) {
+	    var data = getWeak(anObject(key), true);
+	    if (data === true) uncaughtFrozenStore(that).set(key, value);
+	    else data[that._i] = value;
+	    return that;
+	  },
+	  ufstore: uncaughtFrozenStore
+	};
+
+
+/***/ }),
+/* 228 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var weak = __webpack_require__(227);
+	var validate = __webpack_require__(223);
+	var WEAK_SET = 'WeakSet';
+
+	// 23.4 WeakSet Objects
+	__webpack_require__(224)(WEAK_SET, function (get) {
+	  return function WeakSet() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
+	}, {
+	  // 23.4.3.1 WeakSet.prototype.add(value)
+	  add: function add(value) {
+	    return weak.def(validate(this, WEAK_SET), value, true);
+	  }
+	}, weak, false, true);
+
+
+/***/ }),
+/* 229 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var $typed = __webpack_require__(230);
+	var buffer = __webpack_require__(231);
+	var anObject = __webpack_require__(12);
+	var toAbsoluteIndex = __webpack_require__(40);
+	var toLength = __webpack_require__(38);
+	var isObject = __webpack_require__(13);
+	var ArrayBuffer = __webpack_require__(4).ArrayBuffer;
+	var speciesConstructor = __webpack_require__(210);
+	var $ArrayBuffer = buffer.ArrayBuffer;
+	var $DataView = buffer.DataView;
+	var $isView = $typed.ABV && ArrayBuffer.isView;
+	var $slice = $ArrayBuffer.prototype.slice;
+	var VIEW = $typed.VIEW;
+	var ARRAY_BUFFER = 'ArrayBuffer';
+
+	$export($export.G + $export.W + $export.F * (ArrayBuffer !== $ArrayBuffer), { ArrayBuffer: $ArrayBuffer });
+
+	$export($export.S + $export.F * !$typed.CONSTR, ARRAY_BUFFER, {
+	  // 24.1.3.1 ArrayBuffer.isView(arg)
+	  isView: function isView(it) {
+	    return $isView && $isView(it) || isObject(it) && VIEW in it;
+	  }
+	});
+
+	$export($export.P + $export.U + $export.F * __webpack_require__(7)(function () {
+	  return !new $ArrayBuffer(2).slice(1, undefined).byteLength;
+	}), ARRAY_BUFFER, {
+	  // 24.1.4.3 ArrayBuffer.prototype.slice(start, end)
+	  slice: function slice(start, end) {
+	    if ($slice !== undefined && end === undefined) return $slice.call(anObject(this), start); // FF fix
+	    var len = anObject(this).byteLength;
+	    var first = toAbsoluteIndex(start, len);
+	    var fin = toAbsoluteIndex(end === undefined ? len : end, len);
+	    var result = new (speciesConstructor(this, $ArrayBuffer))(toLength(fin - first));
+	    var viewS = new $DataView(this);
+	    var viewT = new $DataView(result);
+	    var index = 0;
+	    while (first < fin) {
+	      viewT.setUint8(index++, viewS.getUint8(first++));
+	    } return result;
+	  }
+	});
+
+	__webpack_require__(194)(ARRAY_BUFFER);
+
+
+/***/ }),
+/* 230 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var global = __webpack_require__(4);
+	var hide = __webpack_require__(10);
+	var uid = __webpack_require__(19);
+	var TYPED = uid('typed_array');
+	var VIEW = uid('view');
+	var ABV = !!(global.ArrayBuffer && global.DataView);
+	var CONSTR = ABV;
+	var i = 0;
+	var l = 9;
+	var Typed;
+
+	var TypedArrayConstructors = (
+	  'Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array'
+	).split(',');
+
+	while (i < l) {
+	  if (Typed = global[TypedArrayConstructors[i++]]) {
+	    hide(Typed.prototype, TYPED, true);
+	    hide(Typed.prototype, VIEW, true);
+	  } else CONSTR = false;
+	}
+
+	module.exports = {
+	  ABV: ABV,
+	  CONSTR: CONSTR,
+	  TYPED: TYPED,
+	  VIEW: VIEW
+	};
+
+
+/***/ }),
+/* 231 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var global = __webpack_require__(4);
+	var DESCRIPTORS = __webpack_require__(6);
+	var LIBRARY = __webpack_require__(22);
+	var $typed = __webpack_require__(230);
+	var hide = __webpack_require__(10);
+	var redefineAll = __webpack_require__(220);
+	var fails = __webpack_require__(7);
+	var anInstance = __webpack_require__(212);
+	var toInteger = __webpack_require__(39);
+	var toLength = __webpack_require__(38);
+	var toIndex = __webpack_require__(232);
+	var gOPN = __webpack_require__(51).f;
+	var dP = __webpack_require__(11).f;
+	var arrayFill = __webpack_require__(190);
+	var setToStringTag = __webpack_require__(26);
+	var ARRAY_BUFFER = 'ArrayBuffer';
+	var DATA_VIEW = 'DataView';
+	var PROTOTYPE = 'prototype';
+	var WRONG_LENGTH = 'Wrong length!';
+	var WRONG_INDEX = 'Wrong index!';
+	var $ArrayBuffer = global[ARRAY_BUFFER];
+	var $DataView = global[DATA_VIEW];
+	var Math = global.Math;
+	var RangeError = global.RangeError;
+	// eslint-disable-next-line no-shadow-restricted-names
+	var Infinity = global.Infinity;
+	var BaseBuffer = $ArrayBuffer;
+	var abs = Math.abs;
+	var pow = Math.pow;
+	var floor = Math.floor;
+	var log = Math.log;
+	var LN2 = Math.LN2;
+	var BUFFER = 'buffer';
+	var BYTE_LENGTH = 'byteLength';
+	var BYTE_OFFSET = 'byteOffset';
+	var $BUFFER = DESCRIPTORS ? '_b' : BUFFER;
+	var $LENGTH = DESCRIPTORS ? '_l' : BYTE_LENGTH;
+	var $OFFSET = DESCRIPTORS ? '_o' : BYTE_OFFSET;
+
+	// IEEE754 conversions based on https://github.com/feross/ieee754
+	function packIEEE754(value, mLen, nBytes) {
+	  var buffer = new Array(nBytes);
+	  var eLen = nBytes * 8 - mLen - 1;
+	  var eMax = (1 << eLen) - 1;
+	  var eBias = eMax >> 1;
+	  var rt = mLen === 23 ? pow(2, -24) - pow(2, -77) : 0;
+	  var i = 0;
+	  var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
+	  var e, m, c;
+	  value = abs(value);
+	  // eslint-disable-next-line no-self-compare
+	  if (value != value || value === Infinity) {
+	    // eslint-disable-next-line no-self-compare
+	    m = value != value ? 1 : 0;
+	    e = eMax;
+	  } else {
+	    e = floor(log(value) / LN2);
+	    if (value * (c = pow(2, -e)) < 1) {
+	      e--;
+	      c *= 2;
+	    }
+	    if (e + eBias >= 1) {
+	      value += rt / c;
+	    } else {
+	      value += rt * pow(2, 1 - eBias);
+	    }
+	    if (value * c >= 2) {
+	      e++;
+	      c /= 2;
+	    }
+	    if (e + eBias >= eMax) {
+	      m = 0;
+	      e = eMax;
+	    } else if (e + eBias >= 1) {
+	      m = (value * c - 1) * pow(2, mLen);
+	      e = e + eBias;
+	    } else {
+	      m = value * pow(2, eBias - 1) * pow(2, mLen);
+	      e = 0;
+	    }
+	  }
+	  for (; mLen >= 8; buffer[i++] = m & 255, m /= 256, mLen -= 8);
+	  e = e << mLen | m;
+	  eLen += mLen;
+	  for (; eLen > 0; buffer[i++] = e & 255, e /= 256, eLen -= 8);
+	  buffer[--i] |= s * 128;
+	  return buffer;
+	}
+	function unpackIEEE754(buffer, mLen, nBytes) {
+	  var eLen = nBytes * 8 - mLen - 1;
+	  var eMax = (1 << eLen) - 1;
+	  var eBias = eMax >> 1;
+	  var nBits = eLen - 7;
+	  var i = nBytes - 1;
+	  var s = buffer[i--];
+	  var e = s & 127;
+	  var m;
+	  s >>= 7;
+	  for (; nBits > 0; e = e * 256 + buffer[i], i--, nBits -= 8);
+	  m = e & (1 << -nBits) - 1;
+	  e >>= -nBits;
+	  nBits += mLen;
+	  for (; nBits > 0; m = m * 256 + buffer[i], i--, nBits -= 8);
+	  if (e === 0) {
+	    e = 1 - eBias;
+	  } else if (e === eMax) {
+	    return m ? NaN : s ? -Infinity : Infinity;
+	  } else {
+	    m = m + pow(2, mLen);
+	    e = e - eBias;
+	  } return (s ? -1 : 1) * m * pow(2, e - mLen);
+	}
+
+	function unpackI32(bytes) {
+	  return bytes[3] << 24 | bytes[2] << 16 | bytes[1] << 8 | bytes[0];
+	}
+	function packI8(it) {
+	  return [it & 0xff];
+	}
+	function packI16(it) {
+	  return [it & 0xff, it >> 8 & 0xff];
+	}
+	function packI32(it) {
+	  return [it & 0xff, it >> 8 & 0xff, it >> 16 & 0xff, it >> 24 & 0xff];
+	}
+	function packF64(it) {
+	  return packIEEE754(it, 52, 8);
+	}
+	function packF32(it) {
+	  return packIEEE754(it, 23, 4);
+	}
+
+	function addGetter(C, key, internal) {
+	  dP(C[PROTOTYPE], key, { get: function () { return this[internal]; } });
+	}
+
+	function get(view, bytes, index, isLittleEndian) {
+	  var numIndex = +index;
+	  var intIndex = toIndex(numIndex);
+	  if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
+	  var store = view[$BUFFER]._b;
+	  var start = intIndex + view[$OFFSET];
+	  var pack = store.slice(start, start + bytes);
+	  return isLittleEndian ? pack : pack.reverse();
+	}
+	function set(view, bytes, index, conversion, value, isLittleEndian) {
+	  var numIndex = +index;
+	  var intIndex = toIndex(numIndex);
+	  if (intIndex + bytes > view[$LENGTH]) throw RangeError(WRONG_INDEX);
+	  var store = view[$BUFFER]._b;
+	  var start = intIndex + view[$OFFSET];
+	  var pack = conversion(+value);
+	  for (var i = 0; i < bytes; i++) store[start + i] = pack[isLittleEndian ? i : bytes - i - 1];
+	}
+
+	if (!$typed.ABV) {
+	  $ArrayBuffer = function ArrayBuffer(length) {
+	    anInstance(this, $ArrayBuffer, ARRAY_BUFFER);
+	    var byteLength = toIndex(length);
+	    this._b = arrayFill.call(new Array(byteLength), 0);
+	    this[$LENGTH] = byteLength;
+	  };
+
+	  $DataView = function DataView(buffer, byteOffset, byteLength) {
+	    anInstance(this, $DataView, DATA_VIEW);
+	    anInstance(buffer, $ArrayBuffer, DATA_VIEW);
+	    var bufferLength = buffer[$LENGTH];
+	    var offset = toInteger(byteOffset);
+	    if (offset < 0 || offset > bufferLength) throw RangeError('Wrong offset!');
+	    byteLength = byteLength === undefined ? bufferLength - offset : toLength(byteLength);
+	    if (offset + byteLength > bufferLength) throw RangeError(WRONG_LENGTH);
+	    this[$BUFFER] = buffer;
+	    this[$OFFSET] = offset;
+	    this[$LENGTH] = byteLength;
+	  };
+
+	  if (DESCRIPTORS) {
+	    addGetter($ArrayBuffer, BYTE_LENGTH, '_l');
+	    addGetter($DataView, BUFFER, '_b');
+	    addGetter($DataView, BYTE_LENGTH, '_l');
+	    addGetter($DataView, BYTE_OFFSET, '_o');
+	  }
+
+	  redefineAll($DataView[PROTOTYPE], {
+	    getInt8: function getInt8(byteOffset) {
+	      return get(this, 1, byteOffset)[0] << 24 >> 24;
+	    },
+	    getUint8: function getUint8(byteOffset) {
+	      return get(this, 1, byteOffset)[0];
+	    },
+	    getInt16: function getInt16(byteOffset /* , littleEndian */) {
+	      var bytes = get(this, 2, byteOffset, arguments[1]);
+	      return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
+	    },
+	    getUint16: function getUint16(byteOffset /* , littleEndian */) {
+	      var bytes = get(this, 2, byteOffset, arguments[1]);
+	      return bytes[1] << 8 | bytes[0];
+	    },
+	    getInt32: function getInt32(byteOffset /* , littleEndian */) {
+	      return unpackI32(get(this, 4, byteOffset, arguments[1]));
+	    },
+	    getUint32: function getUint32(byteOffset /* , littleEndian */) {
+	      return unpackI32(get(this, 4, byteOffset, arguments[1])) >>> 0;
+	    },
+	    getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
+	      return unpackIEEE754(get(this, 4, byteOffset, arguments[1]), 23, 4);
+	    },
+	    getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
+	      return unpackIEEE754(get(this, 8, byteOffset, arguments[1]), 52, 8);
+	    },
+	    setInt8: function setInt8(byteOffset, value) {
+	      set(this, 1, byteOffset, packI8, value);
+	    },
+	    setUint8: function setUint8(byteOffset, value) {
+	      set(this, 1, byteOffset, packI8, value);
+	    },
+	    setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
+	      set(this, 2, byteOffset, packI16, value, arguments[2]);
+	    },
+	    setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
+	      set(this, 2, byteOffset, packI16, value, arguments[2]);
+	    },
+	    setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
+	      set(this, 4, byteOffset, packI32, value, arguments[2]);
+	    },
+	    setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
+	      set(this, 4, byteOffset, packI32, value, arguments[2]);
+	    },
+	    setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
+	      set(this, 4, byteOffset, packF32, value, arguments[2]);
+	    },
+	    setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
+	      set(this, 8, byteOffset, packF64, value, arguments[2]);
+	    }
+	  });
+	} else {
+	  if (!fails(function () {
+	    $ArrayBuffer(1);
+	  }) || !fails(function () {
+	    new $ArrayBuffer(-1); // eslint-disable-line no-new
+	  }) || fails(function () {
+	    new $ArrayBuffer(); // eslint-disable-line no-new
+	    new $ArrayBuffer(1.5); // eslint-disable-line no-new
+	    new $ArrayBuffer(NaN); // eslint-disable-line no-new
+	    return $ArrayBuffer.name != ARRAY_BUFFER;
+	  })) {
+	    $ArrayBuffer = function ArrayBuffer(length) {
+	      anInstance(this, $ArrayBuffer);
+	      return new BaseBuffer(toIndex(length));
+	    };
+	    var ArrayBufferProto = $ArrayBuffer[PROTOTYPE] = BaseBuffer[PROTOTYPE];
+	    for (var keys = gOPN(BaseBuffer), j = 0, key; keys.length > j;) {
+	      if (!((key = keys[j++]) in $ArrayBuffer)) hide($ArrayBuffer, key, BaseBuffer[key]);
+	    }
+	    if (!LIBRARY) ArrayBufferProto.constructor = $ArrayBuffer;
+	  }
+	  // iOS Safari 7.x bug
+	  var view = new $DataView(new $ArrayBuffer(2));
+	  var $setInt8 = $DataView[PROTOTYPE].setInt8;
+	  view.setInt8(0, 2147483648);
+	  view.setInt8(1, 2147483649);
+	  if (view.getInt8(0) || !view.getInt8(1)) redefineAll($DataView[PROTOTYPE], {
+	    setInt8: function setInt8(byteOffset, value) {
+	      $setInt8.call(this, byteOffset, value << 24 >> 24);
+	    },
+	    setUint8: function setUint8(byteOffset, value) {
+	      $setInt8.call(this, byteOffset, value << 24 >> 24);
+	    }
+	  }, true);
+	}
+	setToStringTag($ArrayBuffer, ARRAY_BUFFER);
+	setToStringTag($DataView, DATA_VIEW);
+	hide($DataView[PROTOTYPE], $typed.VIEW, true);
+	exports[ARRAY_BUFFER] = $ArrayBuffer;
+	exports[DATA_VIEW] = $DataView;
+
+
+/***/ }),
+/* 232 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/ecma262/#sec-toindex
+	var toInteger = __webpack_require__(39);
+	var toLength = __webpack_require__(38);
+	module.exports = function (it) {
+	  if (it === undefined) return 0;
+	  var number = toInteger(it);
+	  var length = toLength(number);
+	  if (number !== length) throw RangeError('Wrong length!');
+	  return length;
+	};
+
+
+/***/ }),
+/* 233 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	$export($export.G + $export.W + $export.F * !__webpack_require__(230).ABV, {
+	  DataView: __webpack_require__(231).DataView
+	});
+
+
+/***/ }),
+/* 234 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Int8', 1, function (init) {
+	  return function Int8Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 235 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	if (__webpack_require__(6)) {
+	  var LIBRARY = __webpack_require__(22);
+	  var global = __webpack_require__(4);
+	  var fails = __webpack_require__(7);
+	  var $export = __webpack_require__(8);
+	  var $typed = __webpack_require__(230);
+	  var $buffer = __webpack_require__(231);
+	  var ctx = __webpack_require__(23);
+	  var anInstance = __webpack_require__(212);
+	  var propertyDesc = __webpack_require__(17);
+	  var hide = __webpack_require__(10);
+	  var redefineAll = __webpack_require__(220);
+	  var toInteger = __webpack_require__(39);
+	  var toLength = __webpack_require__(38);
+	  var toIndex = __webpack_require__(232);
+	  var toAbsoluteIndex = __webpack_require__(40);
+	  var toPrimitive = __webpack_require__(16);
+	  var has = __webpack_require__(5);
+	  var classof = __webpack_require__(75);
+	  var isObject = __webpack_require__(13);
+	  var toObject = __webpack_require__(46);
+	  var isArrayIter = __webpack_require__(164);
+	  var create = __webpack_require__(47);
+	  var getPrototypeOf = __webpack_require__(59);
+	  var gOPN = __webpack_require__(51).f;
+	  var getIterFn = __webpack_require__(166);
+	  var uid = __webpack_require__(19);
+	  var wks = __webpack_require__(27);
+	  var createArrayMethod = __webpack_require__(174);
+	  var createArrayIncludes = __webpack_require__(37);
+	  var speciesConstructor = __webpack_require__(210);
+	  var ArrayIterators = __webpack_require__(195);
+	  var Iterators = __webpack_require__(130);
+	  var $iterDetect = __webpack_require__(167);
+	  var setSpecies = __webpack_require__(194);
+	  var arrayFill = __webpack_require__(190);
+	  var arrayCopyWithin = __webpack_require__(187);
+	  var $DP = __webpack_require__(11);
+	  var $GOPD = __webpack_require__(52);
+	  var dP = $DP.f;
+	  var gOPD = $GOPD.f;
+	  var RangeError = global.RangeError;
+	  var TypeError = global.TypeError;
+	  var Uint8Array = global.Uint8Array;
+	  var ARRAY_BUFFER = 'ArrayBuffer';
+	  var SHARED_BUFFER = 'Shared' + ARRAY_BUFFER;
+	  var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
+	  var PROTOTYPE = 'prototype';
+	  var ArrayProto = Array[PROTOTYPE];
+	  var $ArrayBuffer = $buffer.ArrayBuffer;
+	  var $DataView = $buffer.DataView;
+	  var arrayForEach = createArrayMethod(0);
+	  var arrayFilter = createArrayMethod(2);
+	  var arraySome = createArrayMethod(3);
+	  var arrayEvery = createArrayMethod(4);
+	  var arrayFind = createArrayMethod(5);
+	  var arrayFindIndex = createArrayMethod(6);
+	  var arrayIncludes = createArrayIncludes(true);
+	  var arrayIndexOf = createArrayIncludes(false);
+	  var arrayValues = ArrayIterators.values;
+	  var arrayKeys = ArrayIterators.keys;
+	  var arrayEntries = ArrayIterators.entries;
+	  var arrayLastIndexOf = ArrayProto.lastIndexOf;
+	  var arrayReduce = ArrayProto.reduce;
+	  var arrayReduceRight = ArrayProto.reduceRight;
+	  var arrayJoin = ArrayProto.join;
+	  var arraySort = ArrayProto.sort;
+	  var arraySlice = ArrayProto.slice;
+	  var arrayToString = ArrayProto.toString;
+	  var arrayToLocaleString = ArrayProto.toLocaleString;
+	  var ITERATOR = wks('iterator');
+	  var TAG = wks('toStringTag');
+	  var TYPED_CONSTRUCTOR = uid('typed_constructor');
+	  var DEF_CONSTRUCTOR = uid('def_constructor');
+	  var ALL_CONSTRUCTORS = $typed.CONSTR;
+	  var TYPED_ARRAY = $typed.TYPED;
+	  var VIEW = $typed.VIEW;
+	  var WRONG_LENGTH = 'Wrong length!';
+
+	  var $map = createArrayMethod(1, function (O, length) {
+	    return allocate(speciesConstructor(O, O[DEF_CONSTRUCTOR]), length);
+	  });
+
+	  var LITTLE_ENDIAN = fails(function () {
+	    // eslint-disable-next-line no-undef
+	    return new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
+	  });
+
+	  var FORCED_SET = !!Uint8Array && !!Uint8Array[PROTOTYPE].set && fails(function () {
+	    new Uint8Array(1).set({});
+	  });
+
+	  var toOffset = function (it, BYTES) {
+	    var offset = toInteger(it);
+	    if (offset < 0 || offset % BYTES) throw RangeError('Wrong offset!');
+	    return offset;
+	  };
+
+	  var validate = function (it) {
+	    if (isObject(it) && TYPED_ARRAY in it) return it;
+	    throw TypeError(it + ' is not a typed array!');
+	  };
+
+	  var allocate = function (C, length) {
+	    if (!(isObject(C) && TYPED_CONSTRUCTOR in C)) {
+	      throw TypeError('It is not a typed array constructor!');
+	    } return new C(length);
+	  };
+
+	  var speciesFromList = function (O, list) {
+	    return fromList(speciesConstructor(O, O[DEF_CONSTRUCTOR]), list);
+	  };
+
+	  var fromList = function (C, list) {
+	    var index = 0;
+	    var length = list.length;
+	    var result = allocate(C, length);
+	    while (length > index) result[index] = list[index++];
+	    return result;
+	  };
+
+	  var addGetter = function (it, key, internal) {
+	    dP(it, key, { get: function () { return this._d[internal]; } });
+	  };
+
+	  var $from = function from(source /* , mapfn, thisArg */) {
+	    var O = toObject(source);
+	    var aLen = arguments.length;
+	    var mapfn = aLen > 1 ? arguments[1] : undefined;
+	    var mapping = mapfn !== undefined;
+	    var iterFn = getIterFn(O);
+	    var i, length, values, result, step, iterator;
+	    if (iterFn != undefined && !isArrayIter(iterFn)) {
+	      for (iterator = iterFn.call(O), values = [], i = 0; !(step = iterator.next()).done; i++) {
+	        values.push(step.value);
+	      } O = values;
+	    }
+	    if (mapping && aLen > 2) mapfn = ctx(mapfn, arguments[2], 2);
+	    for (i = 0, length = toLength(O.length), result = allocate(this, length); length > i; i++) {
+	      result[i] = mapping ? mapfn(O[i], i) : O[i];
+	    }
+	    return result;
+	  };
+
+	  var $of = function of(/* ...items */) {
+	    var index = 0;
+	    var length = arguments.length;
+	    var result = allocate(this, length);
+	    while (length > index) result[index] = arguments[index++];
+	    return result;
+	  };
+
+	  // iOS Safari 6.x fails here
+	  var TO_LOCALE_BUG = !!Uint8Array && fails(function () { arrayToLocaleString.call(new Uint8Array(1)); });
+
+	  var $toLocaleString = function toLocaleString() {
+	    return arrayToLocaleString.apply(TO_LOCALE_BUG ? arraySlice.call(validate(this)) : validate(this), arguments);
+	  };
+
+	  var proto = {
+	    copyWithin: function copyWithin(target, start /* , end */) {
+	      return arrayCopyWithin.call(validate(this), target, start, arguments.length > 2 ? arguments[2] : undefined);
+	    },
+	    every: function every(callbackfn /* , thisArg */) {
+	      return arrayEvery(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    fill: function fill(value /* , start, end */) { // eslint-disable-line no-unused-vars
+	      return arrayFill.apply(validate(this), arguments);
+	    },
+	    filter: function filter(callbackfn /* , thisArg */) {
+	      return speciesFromList(this, arrayFilter(validate(this), callbackfn,
+	        arguments.length > 1 ? arguments[1] : undefined));
+	    },
+	    find: function find(predicate /* , thisArg */) {
+	      return arrayFind(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    findIndex: function findIndex(predicate /* , thisArg */) {
+	      return arrayFindIndex(validate(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    forEach: function forEach(callbackfn /* , thisArg */) {
+	      arrayForEach(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    indexOf: function indexOf(searchElement /* , fromIndex */) {
+	      return arrayIndexOf(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    includes: function includes(searchElement /* , fromIndex */) {
+	      return arrayIncludes(validate(this), searchElement, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    join: function join(separator) { // eslint-disable-line no-unused-vars
+	      return arrayJoin.apply(validate(this), arguments);
+	    },
+	    lastIndexOf: function lastIndexOf(searchElement /* , fromIndex */) { // eslint-disable-line no-unused-vars
+	      return arrayLastIndexOf.apply(validate(this), arguments);
+	    },
+	    map: function map(mapfn /* , thisArg */) {
+	      return $map(validate(this), mapfn, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    reduce: function reduce(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
+	      return arrayReduce.apply(validate(this), arguments);
+	    },
+	    reduceRight: function reduceRight(callbackfn /* , initialValue */) { // eslint-disable-line no-unused-vars
+	      return arrayReduceRight.apply(validate(this), arguments);
+	    },
+	    reverse: function reverse() {
+	      var that = this;
+	      var length = validate(that).length;
+	      var middle = Math.floor(length / 2);
+	      var index = 0;
+	      var value;
+	      while (index < middle) {
+	        value = that[index];
+	        that[index++] = that[--length];
+	        that[length] = value;
+	      } return that;
+	    },
+	    some: function some(callbackfn /* , thisArg */) {
+	      return arraySome(validate(this), callbackfn, arguments.length > 1 ? arguments[1] : undefined);
+	    },
+	    sort: function sort(comparefn) {
+	      return arraySort.call(validate(this), comparefn);
+	    },
+	    subarray: function subarray(begin, end) {
+	      var O = validate(this);
+	      var length = O.length;
+	      var $begin = toAbsoluteIndex(begin, length);
+	      return new (speciesConstructor(O, O[DEF_CONSTRUCTOR]))(
+	        O.buffer,
+	        O.byteOffset + $begin * O.BYTES_PER_ELEMENT,
+	        toLength((end === undefined ? length : toAbsoluteIndex(end, length)) - $begin)
+	      );
+	    }
+	  };
+
+	  var $slice = function slice(start, end) {
+	    return speciesFromList(this, arraySlice.call(validate(this), start, end));
+	  };
+
+	  var $set = function set(arrayLike /* , offset */) {
+	    validate(this);
+	    var offset = toOffset(arguments[1], 1);
+	    var length = this.length;
+	    var src = toObject(arrayLike);
+	    var len = toLength(src.length);
+	    var index = 0;
+	    if (len + offset > length) throw RangeError(WRONG_LENGTH);
+	    while (index < len) this[offset + index] = src[index++];
+	  };
+
+	  var $iterators = {
+	    entries: function entries() {
+	      return arrayEntries.call(validate(this));
+	    },
+	    keys: function keys() {
+	      return arrayKeys.call(validate(this));
+	    },
+	    values: function values() {
+	      return arrayValues.call(validate(this));
+	    }
+	  };
+
+	  var isTAIndex = function (target, key) {
+	    return isObject(target)
+	      && target[TYPED_ARRAY]
+	      && typeof key != 'symbol'
+	      && key in target
+	      && String(+key) == String(key);
+	  };
+	  var $getDesc = function getOwnPropertyDescriptor(target, key) {
+	    return isTAIndex(target, key = toPrimitive(key, true))
+	      ? propertyDesc(2, target[key])
+	      : gOPD(target, key);
+	  };
+	  var $setDesc = function defineProperty(target, key, desc) {
+	    if (isTAIndex(target, key = toPrimitive(key, true))
+	      && isObject(desc)
+	      && has(desc, 'value')
+	      && !has(desc, 'get')
+	      && !has(desc, 'set')
+	      // TODO: add validation descriptor w/o calling accessors
+	      && !desc.configurable
+	      && (!has(desc, 'writable') || desc.writable)
+	      && (!has(desc, 'enumerable') || desc.enumerable)
+	    ) {
+	      target[key] = desc.value;
+	      return target;
+	    } return dP(target, key, desc);
+	  };
+
+	  if (!ALL_CONSTRUCTORS) {
+	    $GOPD.f = $getDesc;
+	    $DP.f = $setDesc;
+	  }
+
+	  $export($export.S + $export.F * !ALL_CONSTRUCTORS, 'Object', {
+	    getOwnPropertyDescriptor: $getDesc,
+	    defineProperty: $setDesc
+	  });
+
+	  if (fails(function () { arrayToString.call({}); })) {
+	    arrayToString = arrayToLocaleString = function toString() {
+	      return arrayJoin.call(this);
+	    };
+	  }
+
+	  var $TypedArrayPrototype$ = redefineAll({}, proto);
+	  redefineAll($TypedArrayPrototype$, $iterators);
+	  hide($TypedArrayPrototype$, ITERATOR, $iterators.values);
+	  redefineAll($TypedArrayPrototype$, {
+	    slice: $slice,
+	    set: $set,
+	    constructor: function () { /* noop */ },
+	    toString: arrayToString,
+	    toLocaleString: $toLocaleString
+	  });
+	  addGetter($TypedArrayPrototype$, 'buffer', 'b');
+	  addGetter($TypedArrayPrototype$, 'byteOffset', 'o');
+	  addGetter($TypedArrayPrototype$, 'byteLength', 'l');
+	  addGetter($TypedArrayPrototype$, 'length', 'e');
+	  dP($TypedArrayPrototype$, TAG, {
+	    get: function () { return this[TYPED_ARRAY]; }
+	  });
+
+	  // eslint-disable-next-line max-statements
+	  module.exports = function (KEY, BYTES, wrapper, CLAMPED) {
+	    CLAMPED = !!CLAMPED;
+	    var NAME = KEY + (CLAMPED ? 'Clamped' : '') + 'Array';
+	    var GETTER = 'get' + KEY;
+	    var SETTER = 'set' + KEY;
+	    var TypedArray = global[NAME];
+	    var Base = TypedArray || {};
+	    var TAC = TypedArray && getPrototypeOf(TypedArray);
+	    var FORCED = !TypedArray || !$typed.ABV;
+	    var O = {};
+	    var TypedArrayPrototype = TypedArray && TypedArray[PROTOTYPE];
+	    var getter = function (that, index) {
+	      var data = that._d;
+	      return data.v[GETTER](index * BYTES + data.o, LITTLE_ENDIAN);
+	    };
+	    var setter = function (that, index, value) {
+	      var data = that._d;
+	      if (CLAMPED) value = (value = Math.round(value)) < 0 ? 0 : value > 0xff ? 0xff : value & 0xff;
+	      data.v[SETTER](index * BYTES + data.o, value, LITTLE_ENDIAN);
+	    };
+	    var addElement = function (that, index) {
+	      dP(that, index, {
+	        get: function () {
+	          return getter(this, index);
+	        },
+	        set: function (value) {
+	          return setter(this, index, value);
+	        },
+	        enumerable: true
+	      });
+	    };
+	    if (FORCED) {
+	      TypedArray = wrapper(function (that, data, $offset, $length) {
+	        anInstance(that, TypedArray, NAME, '_d');
+	        var index = 0;
+	        var offset = 0;
+	        var buffer, byteLength, length, klass;
+	        if (!isObject(data)) {
+	          length = toIndex(data);
+	          byteLength = length * BYTES;
+	          buffer = new $ArrayBuffer(byteLength);
+	        } else if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
+	          buffer = data;
+	          offset = toOffset($offset, BYTES);
+	          var $len = data.byteLength;
+	          if ($length === undefined) {
+	            if ($len % BYTES) throw RangeError(WRONG_LENGTH);
+	            byteLength = $len - offset;
+	            if (byteLength < 0) throw RangeError(WRONG_LENGTH);
+	          } else {
+	            byteLength = toLength($length) * BYTES;
+	            if (byteLength + offset > $len) throw RangeError(WRONG_LENGTH);
+	          }
+	          length = byteLength / BYTES;
+	        } else if (TYPED_ARRAY in data) {
+	          return fromList(TypedArray, data);
+	        } else {
+	          return $from.call(TypedArray, data);
+	        }
+	        hide(that, '_d', {
+	          b: buffer,
+	          o: offset,
+	          l: byteLength,
+	          e: length,
+	          v: new $DataView(buffer)
+	        });
+	        while (index < length) addElement(that, index++);
+	      });
+	      TypedArrayPrototype = TypedArray[PROTOTYPE] = create($TypedArrayPrototype$);
+	      hide(TypedArrayPrototype, 'constructor', TypedArray);
+	    } else if (!fails(function () {
+	      TypedArray(1);
+	    }) || !fails(function () {
+	      new TypedArray(-1); // eslint-disable-line no-new
+	    }) || !$iterDetect(function (iter) {
+	      new TypedArray(); // eslint-disable-line no-new
+	      new TypedArray(null); // eslint-disable-line no-new
+	      new TypedArray(1.5); // eslint-disable-line no-new
+	      new TypedArray(iter); // eslint-disable-line no-new
+	    }, true)) {
+	      TypedArray = wrapper(function (that, data, $offset, $length) {
+	        anInstance(that, TypedArray, NAME);
+	        var klass;
+	        // `ws` module bug, temporarily remove validation length for Uint8Array
+	        // https://github.com/websockets/ws/pull/645
+	        if (!isObject(data)) return new Base(toIndex(data));
+	        if (data instanceof $ArrayBuffer || (klass = classof(data)) == ARRAY_BUFFER || klass == SHARED_BUFFER) {
+	          return $length !== undefined
+	            ? new Base(data, toOffset($offset, BYTES), $length)
+	            : $offset !== undefined
+	              ? new Base(data, toOffset($offset, BYTES))
+	              : new Base(data);
+	        }
+	        if (TYPED_ARRAY in data) return fromList(TypedArray, data);
+	        return $from.call(TypedArray, data);
+	      });
+	      arrayForEach(TAC !== Function.prototype ? gOPN(Base).concat(gOPN(TAC)) : gOPN(Base), function (key) {
+	        if (!(key in TypedArray)) hide(TypedArray, key, Base[key]);
+	      });
+	      TypedArray[PROTOTYPE] = TypedArrayPrototype;
+	      if (!LIBRARY) TypedArrayPrototype.constructor = TypedArray;
+	    }
+	    var $nativeIterator = TypedArrayPrototype[ITERATOR];
+	    var CORRECT_ITER_NAME = !!$nativeIterator
+	      && ($nativeIterator.name == 'values' || $nativeIterator.name == undefined);
+	    var $iterator = $iterators.values;
+	    hide(TypedArray, TYPED_CONSTRUCTOR, true);
+	    hide(TypedArrayPrototype, TYPED_ARRAY, NAME);
+	    hide(TypedArrayPrototype, VIEW, true);
+	    hide(TypedArrayPrototype, DEF_CONSTRUCTOR, TypedArray);
+
+	    if (CLAMPED ? new TypedArray(1)[TAG] != NAME : !(TAG in TypedArrayPrototype)) {
+	      dP(TypedArrayPrototype, TAG, {
+	        get: function () { return NAME; }
+	      });
+	    }
+
+	    O[NAME] = TypedArray;
+
+	    $export($export.G + $export.W + $export.F * (TypedArray != Base), O);
+
+	    $export($export.S, NAME, {
+	      BYTES_PER_ELEMENT: BYTES
+	    });
+
+	    $export($export.S + $export.F * fails(function () { Base.of.call(TypedArray, 1); }), NAME, {
+	      from: $from,
+	      of: $of
+	    });
+
+	    if (!(BYTES_PER_ELEMENT in TypedArrayPrototype)) hide(TypedArrayPrototype, BYTES_PER_ELEMENT, BYTES);
+
+	    $export($export.P, NAME, proto);
+
+	    setSpecies(NAME);
+
+	    $export($export.P + $export.F * FORCED_SET, NAME, { set: $set });
+
+	    $export($export.P + $export.F * !CORRECT_ITER_NAME, NAME, $iterators);
+
+	    if (!LIBRARY && TypedArrayPrototype.toString != arrayToString) TypedArrayPrototype.toString = arrayToString;
+
+	    $export($export.P + $export.F * fails(function () {
+	      new TypedArray(1).slice();
+	    }), NAME, { slice: $slice });
+
+	    $export($export.P + $export.F * (fails(function () {
+	      return [1, 2].toLocaleString() != new TypedArray([1, 2]).toLocaleString();
+	    }) || !fails(function () {
+	      TypedArrayPrototype.toLocaleString.call([1, 2]);
+	    })), NAME, { toLocaleString: $toLocaleString });
+
+	    Iterators[NAME] = CORRECT_ITER_NAME ? $nativeIterator : $iterator;
+	    if (!LIBRARY && !CORRECT_ITER_NAME) hide(TypedArrayPrototype, ITERATOR, $iterator);
+	  };
+	} else module.exports = function () { /* empty */ };
+
+
+/***/ }),
+/* 236 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Uint8', 1, function (init) {
+	  return function Uint8Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 237 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Uint8', 1, function (init) {
+	  return function Uint8ClampedArray(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	}, true);
+
+
+/***/ }),
+/* 238 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Int16', 2, function (init) {
+	  return function Int16Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 239 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Uint16', 2, function (init) {
+	  return function Uint16Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 240 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Int32', 4, function (init) {
+	  return function Int32Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 241 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Uint32', 4, function (init) {
+	  return function Uint32Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 242 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Float32', 4, function (init) {
+	  return function Float32Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 243 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(235)('Float64', 8, function (init) {
+	  return function Float64Array(data, byteOffset, length) {
+	    return init(this, data, byteOffset, length);
+	  };
+	});
+
+
+/***/ }),
+/* 244 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.1 Reflect.apply(target, thisArgument, argumentsList)
+	var $export = __webpack_require__(8);
+	var aFunction = __webpack_require__(24);
+	var anObject = __webpack_require__(12);
+	var rApply = (__webpack_require__(4).Reflect || {}).apply;
+	var fApply = Function.apply;
+	// MS Edge argumentsList argument is optional
+	$export($export.S + $export.F * !__webpack_require__(7)(function () {
+	  rApply(function () { /* empty */ });
+	}), 'Reflect', {
+	  apply: function apply(target, thisArgument, argumentsList) {
+	    var T = aFunction(target);
+	    var L = anObject(argumentsList);
+	    return rApply ? rApply(T, thisArgument, L) : fApply.call(T, thisArgument, L);
+	  }
+	});
+
+
+/***/ }),
+/* 245 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
+	var $export = __webpack_require__(8);
+	var create = __webpack_require__(47);
+	var aFunction = __webpack_require__(24);
+	var anObject = __webpack_require__(12);
+	var isObject = __webpack_require__(13);
+	var fails = __webpack_require__(7);
+	var bind = __webpack_require__(77);
+	var rConstruct = (__webpack_require__(4).Reflect || {}).construct;
+
+	// MS Edge supports only 2 arguments and argumentsList argument is optional
+	// FF Nightly sets third argument as `new.target`, but does not create `this` from it
+	var NEW_TARGET_BUG = fails(function () {
+	  function F() { /* empty */ }
+	  return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
+	});
+	var ARGS_BUG = !fails(function () {
+	  rConstruct(function () { /* empty */ });
+	});
+
+	$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
+	  construct: function construct(Target, args /* , newTarget */) {
+	    aFunction(Target);
+	    anObject(args);
+	    var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
+	    if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
+	    if (Target == newTarget) {
+	      // w/o altered newTarget, optimization for 0-4 arguments
+	      switch (args.length) {
+	        case 0: return new Target();
+	        case 1: return new Target(args[0]);
+	        case 2: return new Target(args[0], args[1]);
+	        case 3: return new Target(args[0], args[1], args[2]);
+	        case 4: return new Target(args[0], args[1], args[2], args[3]);
+	      }
+	      // w/o altered newTarget, lot of arguments case
+	      var $args = [null];
+	      $args.push.apply($args, args);
+	      return new (bind.apply(Target, $args))();
+	    }
+	    // with altered newTarget, not support built-in constructors
+	    var proto = newTarget.prototype;
+	    var instance = create(isObject(proto) ? proto : Object.prototype);
+	    var result = Function.apply.call(Target, instance, args);
+	    return isObject(result) ? result : instance;
+	  }
+	});
+
+
+/***/ }),
+/* 246 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.3 Reflect.defineProperty(target, propertyKey, attributes)
+	var dP = __webpack_require__(11);
+	var $export = __webpack_require__(8);
+	var anObject = __webpack_require__(12);
+	var toPrimitive = __webpack_require__(16);
+
+	// MS Edge has broken Reflect.defineProperty - throwing instead of returning false
+	$export($export.S + $export.F * __webpack_require__(7)(function () {
+	  // eslint-disable-next-line no-undef
+	  Reflect.defineProperty(dP.f({}, 1, { value: 1 }), 1, { value: 2 });
+	}), 'Reflect', {
+	  defineProperty: function defineProperty(target, propertyKey, attributes) {
+	    anObject(target);
+	    propertyKey = toPrimitive(propertyKey, true);
+	    anObject(attributes);
+	    try {
+	      dP.f(target, propertyKey, attributes);
+	      return true;
+	    } catch (e) {
+	      return false;
+	    }
+	  }
+	});
+
+
+/***/ }),
+/* 247 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.4 Reflect.deleteProperty(target, propertyKey)
+	var $export = __webpack_require__(8);
+	var gOPD = __webpack_require__(52).f;
+	var anObject = __webpack_require__(12);
+
+	$export($export.S, 'Reflect', {
+	  deleteProperty: function deleteProperty(target, propertyKey) {
+	    var desc = gOPD(anObject(target), propertyKey);
+	    return desc && !desc.configurable ? false : delete target[propertyKey];
+	  }
+	});
+
+
+/***/ }),
+/* 248 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// 26.1.5 Reflect.enumerate(target)
+	var $export = __webpack_require__(8);
+	var anObject = __webpack_require__(12);
+	var Enumerate = function (iterated) {
+	  this._t = anObject(iterated); // target
+	  this._i = 0;                  // next index
+	  var keys = this._k = [];      // keys
+	  var key;
+	  for (key in iterated) keys.push(key);
+	};
+	__webpack_require__(131)(Enumerate, 'Object', function () {
+	  var that = this;
+	  var keys = that._k;
+	  var key;
+	  do {
+	    if (that._i >= keys.length) return { value: undefined, done: true };
+	  } while (!((key = keys[that._i++]) in that._t));
+	  return { value: key, done: false };
+	});
+
+	$export($export.S, 'Reflect', {
+	  enumerate: function enumerate(target) {
+	    return new Enumerate(target);
+	  }
+	});
+
+
+/***/ }),
+/* 249 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.6 Reflect.get(target, propertyKey [, receiver])
+	var gOPD = __webpack_require__(52);
+	var getPrototypeOf = __webpack_require__(59);
+	var has = __webpack_require__(5);
+	var $export = __webpack_require__(8);
+	var isObject = __webpack_require__(13);
+	var anObject = __webpack_require__(12);
+
+	function get(target, propertyKey /* , receiver */) {
+	  var receiver = arguments.length < 3 ? target : arguments[2];
+	  var desc, proto;
+	  if (anObject(target) === receiver) return target[propertyKey];
+	  if (desc = gOPD.f(target, propertyKey)) return has(desc, 'value')
+	    ? desc.value
+	    : desc.get !== undefined
+	      ? desc.get.call(receiver)
+	      : undefined;
+	  if (isObject(proto = getPrototypeOf(target))) return get(proto, propertyKey, receiver);
+	}
+
+	$export($export.S, 'Reflect', { get: get });
+
+
+/***/ }),
+/* 250 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.7 Reflect.getOwnPropertyDescriptor(target, propertyKey)
+	var gOPD = __webpack_require__(52);
+	var $export = __webpack_require__(8);
+	var anObject = __webpack_require__(12);
+
+	$export($export.S, 'Reflect', {
+	  getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
+	    return gOPD.f(anObject(target), propertyKey);
+	  }
+	});
+
+
+/***/ }),
+/* 251 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.8 Reflect.getPrototypeOf(target)
+	var $export = __webpack_require__(8);
+	var getProto = __webpack_require__(59);
+	var anObject = __webpack_require__(12);
+
+	$export($export.S, 'Reflect', {
+	  getPrototypeOf: function getPrototypeOf(target) {
+	    return getProto(anObject(target));
+	  }
+	});
+
+
+/***/ }),
+/* 252 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.9 Reflect.has(target, propertyKey)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Reflect', {
+	  has: function has(target, propertyKey) {
+	    return propertyKey in target;
+	  }
+	});
+
+
+/***/ }),
+/* 253 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.10 Reflect.isExtensible(target)
+	var $export = __webpack_require__(8);
+	var anObject = __webpack_require__(12);
+	var $isExtensible = Object.isExtensible;
+
+	$export($export.S, 'Reflect', {
+	  isExtensible: function isExtensible(target) {
+	    anObject(target);
+	    return $isExtensible ? $isExtensible(target) : true;
+	  }
+	});
+
+
+/***/ }),
+/* 254 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.11 Reflect.ownKeys(target)
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Reflect', { ownKeys: __webpack_require__(255) });
+
+
+/***/ }),
+/* 255 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// all object keys, includes non-enumerable and symbols
+	var gOPN = __webpack_require__(51);
+	var gOPS = __webpack_require__(43);
+	var anObject = __webpack_require__(12);
+	var Reflect = __webpack_require__(4).Reflect;
+	module.exports = Reflect && Reflect.ownKeys || function ownKeys(it) {
+	  var keys = gOPN.f(anObject(it));
+	  var getSymbols = gOPS.f;
+	  return getSymbols ? keys.concat(getSymbols(it)) : keys;
+	};
+
+
+/***/ }),
+/* 256 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.12 Reflect.preventExtensions(target)
+	var $export = __webpack_require__(8);
+	var anObject = __webpack_require__(12);
+	var $preventExtensions = Object.preventExtensions;
+
+	$export($export.S, 'Reflect', {
+	  preventExtensions: function preventExtensions(target) {
+	    anObject(target);
+	    try {
+	      if ($preventExtensions) $preventExtensions(target);
+	      return true;
+	    } catch (e) {
+	      return false;
+	    }
+	  }
+	});
+
+
+/***/ }),
+/* 257 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.13 Reflect.set(target, propertyKey, V [, receiver])
+	var dP = __webpack_require__(11);
+	var gOPD = __webpack_require__(52);
+	var getPrototypeOf = __webpack_require__(59);
+	var has = __webpack_require__(5);
+	var $export = __webpack_require__(8);
+	var createDesc = __webpack_require__(17);
+	var anObject = __webpack_require__(12);
+	var isObject = __webpack_require__(13);
+
+	function set(target, propertyKey, V /* , receiver */) {
+	  var receiver = arguments.length < 4 ? target : arguments[3];
+	  var ownDesc = gOPD.f(anObject(target), propertyKey);
+	  var existingDescriptor, proto;
+	  if (!ownDesc) {
+	    if (isObject(proto = getPrototypeOf(target))) {
+	      return set(proto, propertyKey, V, receiver);
+	    }
+	    ownDesc = createDesc(0);
+	  }
+	  if (has(ownDesc, 'value')) {
+	    if (ownDesc.writable === false || !isObject(receiver)) return false;
+	    if (existingDescriptor = gOPD.f(receiver, propertyKey)) {
+	      if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false) return false;
+	      existingDescriptor.value = V;
+	      dP.f(receiver, propertyKey, existingDescriptor);
+	    } else dP.f(receiver, propertyKey, createDesc(0, V));
+	    return true;
+	  }
+	  return ownDesc.set === undefined ? false : (ownDesc.set.call(receiver, V), true);
+	}
+
+	$export($export.S, 'Reflect', { set: set });
+
+
+/***/ }),
+/* 258 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// 26.1.14 Reflect.setPrototypeOf(target, proto)
+	var $export = __webpack_require__(8);
+	var setProto = __webpack_require__(73);
+
+	if (setProto) $export($export.S, 'Reflect', {
+	  setPrototypeOf: function setPrototypeOf(target, proto) {
+	    setProto.check(target, proto);
+	    try {
+	      setProto.set(target, proto);
+	      return true;
+	    } catch (e) {
+	      return false;
+	    }
+	  }
+	});
+
+
+/***/ }),
+/* 259 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/tc39/Array.prototype.includes
+	var $export = __webpack_require__(8);
+	var $includes = __webpack_require__(37)(true);
+
+	$export($export.P, 'Array', {
+	  includes: function includes(el /* , fromIndex = 0 */) {
+	    return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
+	  }
+	});
+
+	__webpack_require__(188)('includes');
+
+
+/***/ }),
+/* 260 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatMap
+	var $export = __webpack_require__(8);
+	var flattenIntoArray = __webpack_require__(261);
+	var toObject = __webpack_require__(46);
+	var toLength = __webpack_require__(38);
+	var aFunction = __webpack_require__(24);
+	var arraySpeciesCreate = __webpack_require__(175);
+
+	$export($export.P, 'Array', {
+	  flatMap: function flatMap(callbackfn /* , thisArg */) {
+	    var O = toObject(this);
+	    var sourceLen, A;
+	    aFunction(callbackfn);
+	    sourceLen = toLength(O.length);
+	    A = arraySpeciesCreate(O, 0);
+	    flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments[1]);
+	    return A;
+	  }
+	});
+
+	__webpack_require__(188)('flatMap');
+
+
+/***/ }),
+/* 261 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
+	var isArray = __webpack_require__(45);
+	var isObject = __webpack_require__(13);
+	var toLength = __webpack_require__(38);
+	var ctx = __webpack_require__(23);
+	var IS_CONCAT_SPREADABLE = __webpack_require__(27)('isConcatSpreadable');
+
+	function flattenIntoArray(target, original, source, sourceLen, start, depth, mapper, thisArg) {
+	  var targetIndex = start;
+	  var sourceIndex = 0;
+	  var mapFn = mapper ? ctx(mapper, thisArg, 3) : false;
+	  var element, spreadable;
+
+	  while (sourceIndex < sourceLen) {
+	    if (sourceIndex in source) {
+	      element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
+
+	      spreadable = false;
+	      if (isObject(element)) {
+	        spreadable = element[IS_CONCAT_SPREADABLE];
+	        spreadable = spreadable !== undefined ? !!spreadable : isArray(element);
+	      }
+
+	      if (spreadable && depth > 0) {
+	        targetIndex = flattenIntoArray(target, original, element, toLength(element.length), targetIndex, depth - 1) - 1;
+	      } else {
+	        if (targetIndex >= 0x1fffffffffffff) throw TypeError();
+	        target[targetIndex] = element;
+	      }
+
+	      targetIndex++;
+	    }
+	    sourceIndex++;
+	  }
+	  return targetIndex;
+	}
+
+	module.exports = flattenIntoArray;
+
+
+/***/ }),
+/* 262 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://tc39.github.io/proposal-flatMap/#sec-Array.prototype.flatten
+	var $export = __webpack_require__(8);
+	var flattenIntoArray = __webpack_require__(261);
+	var toObject = __webpack_require__(46);
+	var toLength = __webpack_require__(38);
+	var toInteger = __webpack_require__(39);
+	var arraySpeciesCreate = __webpack_require__(175);
+
+	$export($export.P, 'Array', {
+	  flatten: function flatten(/* depthArg = 1 */) {
+	    var depthArg = arguments[0];
+	    var O = toObject(this);
+	    var sourceLen = toLength(O.length);
+	    var A = arraySpeciesCreate(O, 0);
+	    flattenIntoArray(A, O, O, sourceLen, 0, depthArg === undefined ? 1 : toInteger(depthArg));
+	    return A;
+	  }
+	});
+
+	__webpack_require__(188)('flatten');
+
+
+/***/ }),
+/* 263 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/mathiasbynens/String.prototype.at
+	var $export = __webpack_require__(8);
+	var $at = __webpack_require__(128)(true);
+
+	$export($export.P, 'String', {
+	  at: function at(pos) {
+	    return $at(this, pos);
+	  }
+	});
+
+
+/***/ }),
+/* 264 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/tc39/proposal-string-pad-start-end
+	var $export = __webpack_require__(8);
+	var $pad = __webpack_require__(265);
+	var userAgent = __webpack_require__(218);
+
+	// https://github.com/zloirock/core-js/issues/280
+	var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
+
+	$export($export.P + $export.F * WEBKIT_BUG, 'String', {
+	  padStart: function padStart(maxLength /* , fillString = ' ' */) {
+	    return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true);
+	  }
+	});
+
+
+/***/ }),
+/* 265 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-string-pad-start-end
+	var toLength = __webpack_require__(38);
+	var repeat = __webpack_require__(91);
+	var defined = __webpack_require__(36);
+
+	module.exports = function (that, maxLength, fillString, left) {
+	  var S = String(defined(that));
+	  var stringLength = S.length;
+	  var fillStr = fillString === undefined ? ' ' : String(fillString);
+	  var intMaxLength = toLength(maxLength);
+	  if (intMaxLength <= stringLength || fillStr == '') return S;
+	  var fillLen = intMaxLength - stringLength;
+	  var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length));
+	  if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen);
+	  return left ? stringFiller + S : S + stringFiller;
+	};
+
+
+/***/ }),
+/* 266 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/tc39/proposal-string-pad-start-end
+	var $export = __webpack_require__(8);
+	var $pad = __webpack_require__(265);
+	var userAgent = __webpack_require__(218);
+
+	// https://github.com/zloirock/core-js/issues/280
+	var WEBKIT_BUG = /Version\/10\.\d+(\.\d+)?( Mobile\/\w+)? Safari\//.test(userAgent);
+
+	$export($export.P + $export.F * WEBKIT_BUG, 'String', {
+	  padEnd: function padEnd(maxLength /* , fillString = ' ' */) {
+	    return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false);
+	  }
+	});
+
+
+/***/ }),
+/* 267 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
+	__webpack_require__(83)('trimLeft', function ($trim) {
+	  return function trimLeft() {
+	    return $trim(this, 1);
+	  };
+	}, 'trimStart');
+
+
+/***/ }),
+/* 268 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/sebmarkbage/ecmascript-string-left-right-trim
+	__webpack_require__(83)('trimRight', function ($trim) {
+	  return function trimRight() {
+	    return $trim(this, 2);
+	  };
+	}, 'trimEnd');
+
+
+/***/ }),
+/* 269 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://tc39.github.io/String.prototype.matchAll/
+	var $export = __webpack_require__(8);
+	var defined = __webpack_require__(36);
+	var toLength = __webpack_require__(38);
+	var isRegExp = __webpack_require__(135);
+	var getFlags = __webpack_require__(198);
+	var RegExpProto = RegExp.prototype;
+
+	var $RegExpStringIterator = function (regexp, string) {
+	  this._r = regexp;
+	  this._s = string;
+	};
+
+	__webpack_require__(131)($RegExpStringIterator, 'RegExp String', function next() {
+	  var match = this._r.exec(this._s);
+	  return { value: match, done: match === null };
+	});
+
+	$export($export.P, 'String', {
+	  matchAll: function matchAll(regexp) {
+	    defined(this);
+	    if (!isRegExp(regexp)) throw TypeError(regexp + ' is not a regexp!');
+	    var S = String(this);
+	    var flags = 'flags' in RegExpProto ? String(regexp.flags) : getFlags.call(regexp);
+	    var rx = new RegExp(regexp.source, ~flags.indexOf('g') ? flags : 'g' + flags);
+	    rx.lastIndex = toLength(regexp.lastIndex);
+	    return new $RegExpStringIterator(rx, S);
+	  }
+	});
+
+
+/***/ }),
+/* 270 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(29)('asyncIterator');
+
+
+/***/ }),
+/* 271 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(29)('observable');
+
+
+/***/ }),
+/* 272 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-object-getownpropertydescriptors
+	var $export = __webpack_require__(8);
+	var ownKeys = __webpack_require__(255);
+	var toIObject = __webpack_require__(33);
+	var gOPD = __webpack_require__(52);
+	var createProperty = __webpack_require__(165);
+
+	$export($export.S, 'Object', {
+	  getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
+	    var O = toIObject(object);
+	    var getDesc = gOPD.f;
+	    var keys = ownKeys(O);
+	    var result = {};
+	    var i = 0;
+	    var key, desc;
+	    while (keys.length > i) {
+	      desc = getDesc(O, key = keys[i++]);
+	      if (desc !== undefined) createProperty(result, key, desc);
+	    }
+	    return result;
+	  }
+	});
+
+
+/***/ }),
+/* 273 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-object-values-entries
+	var $export = __webpack_require__(8);
+	var $values = __webpack_require__(274)(false);
+
+	$export($export.S, 'Object', {
+	  values: function values(it) {
+	    return $values(it);
+	  }
+	});
+
+
+/***/ }),
+/* 274 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var DESCRIPTORS = __webpack_require__(6);
+	var getKeys = __webpack_require__(31);
+	var toIObject = __webpack_require__(33);
+	var isEnum = __webpack_require__(44).f;
+	module.exports = function (isEntries) {
+	  return function (it) {
+	    var O = toIObject(it);
+	    var keys = getKeys(O);
+	    var length = keys.length;
+	    var i = 0;
+	    var result = [];
+	    var key;
+	    while (length > i) {
+	      key = keys[i++];
+	      if (!DESCRIPTORS || isEnum.call(O, key)) {
+	        result.push(isEntries ? [key, O[key]] : O[key]);
+	      }
+	    }
+	    return result;
+	  };
+	};
+
+
+/***/ }),
+/* 275 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-object-values-entries
+	var $export = __webpack_require__(8);
+	var $entries = __webpack_require__(274)(true);
+
+	$export($export.S, 'Object', {
+	  entries: function entries(it) {
+	    return $entries(it);
+	  }
+	});
+
+
+/***/ }),
+/* 276 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toObject = __webpack_require__(46);
+	var aFunction = __webpack_require__(24);
+	var $defineProperty = __webpack_require__(11);
+
+	// B.2.2.2 Object.prototype.__defineGetter__(P, getter)
+	__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
+	  __defineGetter__: function __defineGetter__(P, getter) {
+	    $defineProperty.f(toObject(this), P, { get: aFunction(getter), enumerable: true, configurable: true });
+	  }
+	});
+
+
+/***/ }),
+/* 277 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// Forced replacement prototype accessors methods
+	module.exports = __webpack_require__(22) || !__webpack_require__(7)(function () {
+	  var K = Math.random();
+	  // In FF throws only define methods
+	  // eslint-disable-next-line no-undef, no-useless-call
+	  __defineSetter__.call(null, K, function () { /* empty */ });
+	  delete __webpack_require__(4)[K];
+	});
+
+
+/***/ }),
+/* 278 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toObject = __webpack_require__(46);
+	var aFunction = __webpack_require__(24);
+	var $defineProperty = __webpack_require__(11);
+
+	// B.2.2.3 Object.prototype.__defineSetter__(P, setter)
+	__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
+	  __defineSetter__: function __defineSetter__(P, setter) {
+	    $defineProperty.f(toObject(this), P, { set: aFunction(setter), enumerable: true, configurable: true });
+	  }
+	});
+
+
+/***/ }),
+/* 279 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toObject = __webpack_require__(46);
+	var toPrimitive = __webpack_require__(16);
+	var getPrototypeOf = __webpack_require__(59);
+	var getOwnPropertyDescriptor = __webpack_require__(52).f;
+
+	// B.2.2.4 Object.prototype.__lookupGetter__(P)
+	__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
+	  __lookupGetter__: function __lookupGetter__(P) {
+	    var O = toObject(this);
+	    var K = toPrimitive(P, true);
+	    var D;
+	    do {
+	      if (D = getOwnPropertyDescriptor(O, K)) return D.get;
+	    } while (O = getPrototypeOf(O));
+	  }
+	});
+
+
+/***/ }),
+/* 280 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	var $export = __webpack_require__(8);
+	var toObject = __webpack_require__(46);
+	var toPrimitive = __webpack_require__(16);
+	var getPrototypeOf = __webpack_require__(59);
+	var getOwnPropertyDescriptor = __webpack_require__(52).f;
+
+	// B.2.2.5 Object.prototype.__lookupSetter__(P)
+	__webpack_require__(6) && $export($export.P + __webpack_require__(277), 'Object', {
+	  __lookupSetter__: function __lookupSetter__(P) {
+	    var O = toObject(this);
+	    var K = toPrimitive(P, true);
+	    var D;
+	    do {
+	      if (D = getOwnPropertyDescriptor(O, K)) return D.set;
+	    } while (O = getPrototypeOf(O));
+	  }
+	});
+
+
+/***/ }),
+/* 281 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/DavidBruant/Map-Set.prototype.toJSON
+	var $export = __webpack_require__(8);
+
+	$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(282)('Map') });
+
+
+/***/ }),
+/* 282 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/DavidBruant/Map-Set.prototype.toJSON
+	var classof = __webpack_require__(75);
+	var from = __webpack_require__(283);
+	module.exports = function (NAME) {
+	  return function toJSON() {
+	    if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
+	    return from(this);
+	  };
+	};
+
+
+/***/ }),
+/* 283 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var forOf = __webpack_require__(213);
+
+	module.exports = function (iter, ITERATOR) {
+	  var result = [];
+	  forOf(iter, false, result.push, result, ITERATOR);
+	  return result;
+	};
+
+
+/***/ }),
+/* 284 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/DavidBruant/Map-Set.prototype.toJSON
+	var $export = __webpack_require__(8);
+
+	$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(282)('Set') });
+
+
+/***/ }),
+/* 285 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
+	__webpack_require__(286)('Map');
+
+
+/***/ }),
+/* 286 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://tc39.github.io/proposal-setmap-offrom/
+	var $export = __webpack_require__(8);
+
+	module.exports = function (COLLECTION) {
+	  $export($export.S, COLLECTION, { of: function of() {
+	    var length = arguments.length;
+	    var A = new Array(length);
+	    while (length--) A[length] = arguments[length];
+	    return new this(A);
+	  } });
+	};
+
+
+/***/ }),
+/* 287 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
+	__webpack_require__(286)('Set');
+
+
+/***/ }),
+/* 288 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.of
+	__webpack_require__(286)('WeakMap');
+
+
+/***/ }),
+/* 289 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.of
+	__webpack_require__(286)('WeakSet');
+
+
+/***/ }),
+/* 290 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
+	__webpack_require__(291)('Map');
+
+
+/***/ }),
+/* 291 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://tc39.github.io/proposal-setmap-offrom/
+	var $export = __webpack_require__(8);
+	var aFunction = __webpack_require__(24);
+	var ctx = __webpack_require__(23);
+	var forOf = __webpack_require__(213);
+
+	module.exports = function (COLLECTION) {
+	  $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
+	    var mapFn = arguments[1];
+	    var mapping, A, n, cb;
+	    aFunction(this);
+	    mapping = mapFn !== undefined;
+	    if (mapping) aFunction(mapFn);
+	    if (source == undefined) return new this();
+	    A = [];
+	    if (mapping) {
+	      n = 0;
+	      cb = ctx(mapFn, arguments[2], 2);
+	      forOf(source, false, function (nextItem) {
+	        A.push(cb(nextItem, n++));
+	      });
+	    } else {
+	      forOf(source, false, A.push, A);
+	    }
+	    return new this(A);
+	  } });
+	};
+
+
+/***/ }),
+/* 292 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
+	__webpack_require__(291)('Set');
+
+
+/***/ }),
+/* 293 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-weakmap.from
+	__webpack_require__(291)('WeakMap');
+
+
+/***/ }),
+/* 294 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://tc39.github.io/proposal-setmap-offrom/#sec-weakset.from
+	__webpack_require__(291)('WeakSet');
+
+
+/***/ }),
+/* 295 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-global
+	var $export = __webpack_require__(8);
+
+	$export($export.G, { global: __webpack_require__(4) });
+
+
+/***/ }),
+/* 296 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-global
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'System', { global: __webpack_require__(4) });
+
+
+/***/ }),
+/* 297 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/ljharb/proposal-is-error
+	var $export = __webpack_require__(8);
+	var cof = __webpack_require__(35);
+
+	$export($export.S, 'Error', {
+	  isError: function isError(it) {
+	    return cof(it) === 'Error';
+	  }
+	});
+
+
+/***/ }),
+/* 298 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  clamp: function clamp(x, lower, upper) {
+	    return Math.min(upper, Math.max(lower, x));
+	  }
+	});
+
+
+/***/ }),
+/* 299 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { DEG_PER_RAD: Math.PI / 180 });
+
+
+/***/ }),
+/* 300 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+	var RAD_PER_DEG = 180 / Math.PI;
+
+	$export($export.S, 'Math', {
+	  degrees: function degrees(radians) {
+	    return radians * RAD_PER_DEG;
+	  }
+	});
+
+
+/***/ }),
+/* 301 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+	var scale = __webpack_require__(302);
+	var fround = __webpack_require__(114);
+
+	$export($export.S, 'Math', {
+	  fscale: function fscale(x, inLow, inHigh, outLow, outHigh) {
+	    return fround(scale(x, inLow, inHigh, outLow, outHigh));
+	  }
+	});
+
+
+/***/ }),
+/* 302 */
+/***/ (function(module, exports) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	module.exports = Math.scale || function scale(x, inLow, inHigh, outLow, outHigh) {
+	  if (
+	    arguments.length === 0
+	      // eslint-disable-next-line no-self-compare
+	      || x != x
+	      // eslint-disable-next-line no-self-compare
+	      || inLow != inLow
+	      // eslint-disable-next-line no-self-compare
+	      || inHigh != inHigh
+	      // eslint-disable-next-line no-self-compare
+	      || outLow != outLow
+	      // eslint-disable-next-line no-self-compare
+	      || outHigh != outHigh
+	  ) return NaN;
+	  if (x === Infinity || x === -Infinity) return x;
+	  return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
+	};
+
+
+/***/ }),
+/* 303 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  iaddh: function iaddh(x0, x1, y0, y1) {
+	    var $x0 = x0 >>> 0;
+	    var $x1 = x1 >>> 0;
+	    var $y0 = y0 >>> 0;
+	    return $x1 + (y1 >>> 0) + (($x0 & $y0 | ($x0 | $y0) & ~($x0 + $y0 >>> 0)) >>> 31) | 0;
+	  }
+	});
+
+
+/***/ }),
+/* 304 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  isubh: function isubh(x0, x1, y0, y1) {
+	    var $x0 = x0 >>> 0;
+	    var $x1 = x1 >>> 0;
+	    var $y0 = y0 >>> 0;
+	    return $x1 - (y1 >>> 0) - ((~$x0 & $y0 | ~($x0 ^ $y0) & $x0 - $y0 >>> 0) >>> 31) | 0;
+	  }
+	});
+
+
+/***/ }),
+/* 305 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  imulh: function imulh(u, v) {
+	    var UINT16 = 0xffff;
+	    var $u = +u;
+	    var $v = +v;
+	    var u0 = $u & UINT16;
+	    var v0 = $v & UINT16;
+	    var u1 = $u >> 16;
+	    var v1 = $v >> 16;
+	    var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
+	    return u1 * v1 + (t >> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >> 16);
+	  }
+	});
+
+
+/***/ }),
+/* 306 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { RAD_PER_DEG: 180 / Math.PI });
+
+
+/***/ }),
+/* 307 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+	var DEG_PER_RAD = Math.PI / 180;
+
+	$export($export.S, 'Math', {
+	  radians: function radians(degrees) {
+	    return degrees * DEG_PER_RAD;
+	  }
+	});
+
+
+/***/ }),
+/* 308 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://rwaldron.github.io/proposal-math-extensions/
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { scale: __webpack_require__(302) });
+
+
+/***/ }),
+/* 309 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://gist.github.com/BrendanEich/4294d5c212a6d2254703
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', {
+	  umulh: function umulh(u, v) {
+	    var UINT16 = 0xffff;
+	    var $u = +u;
+	    var $v = +v;
+	    var u0 = $u & UINT16;
+	    var v0 = $v & UINT16;
+	    var u1 = $u >>> 16;
+	    var v1 = $v >>> 16;
+	    var t = (u1 * v0 >>> 0) + (u0 * v0 >>> 16);
+	    return u1 * v1 + (t >>> 16) + ((u0 * v1 >>> 0) + (t & UINT16) >>> 16);
+	  }
+	});
+
+
+/***/ }),
+/* 310 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// http://jfbastien.github.io/papers/Math.signbit.html
+	var $export = __webpack_require__(8);
+
+	$export($export.S, 'Math', { signbit: function signbit(x) {
+	  // eslint-disable-next-line no-self-compare
+	  return (x = +x) != x ? x : x == 0 ? 1 / x == Infinity : x > 0;
+	} });
+
+
+/***/ }),
+/* 311 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/tc39/proposal-promise-finally
+	'use strict';
+	var $export = __webpack_require__(8);
+	var core = __webpack_require__(9);
+	var global = __webpack_require__(4);
+	var speciesConstructor = __webpack_require__(210);
+	var promiseResolve = __webpack_require__(219);
+
+	$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
+	  var C = speciesConstructor(this, core.Promise || global.Promise);
+	  var isFunction = typeof onFinally == 'function';
+	  return this.then(
+	    isFunction ? function (x) {
+	      return promiseResolve(C, onFinally()).then(function () { return x; });
+	    } : onFinally,
+	    isFunction ? function (e) {
+	      return promiseResolve(C, onFinally()).then(function () { throw e; });
+	    } : onFinally
+	  );
+	} });
+
+
+/***/ }),
+/* 312 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/tc39/proposal-promise-try
+	var $export = __webpack_require__(8);
+	var newPromiseCapability = __webpack_require__(216);
+	var perform = __webpack_require__(217);
+
+	$export($export.S, 'Promise', { 'try': function (callbackfn) {
+	  var promiseCapability = newPromiseCapability.f(this);
+	  var result = perform(callbackfn);
+	  (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
+	  return promiseCapability.promise;
+	} });
+
+
+/***/ }),
+/* 313 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var toMetaKey = metadata.key;
+	var ordinaryDefineOwnMetadata = metadata.set;
+
+	metadata.exp({ defineMetadata: function defineMetadata(metadataKey, metadataValue, target, targetKey) {
+	  ordinaryDefineOwnMetadata(metadataKey, metadataValue, anObject(target), toMetaKey(targetKey));
+	} });
+
+
+/***/ }),
+/* 314 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var Map = __webpack_require__(221);
+	var $export = __webpack_require__(8);
+	var shared = __webpack_require__(21)('metadata');
+	var store = shared.store || (shared.store = new (__webpack_require__(226))());
+
+	var getOrCreateMetadataMap = function (target, targetKey, create) {
+	  var targetMetadata = store.get(target);
+	  if (!targetMetadata) {
+	    if (!create) return undefined;
+	    store.set(target, targetMetadata = new Map());
+	  }
+	  var keyMetadata = targetMetadata.get(targetKey);
+	  if (!keyMetadata) {
+	    if (!create) return undefined;
+	    targetMetadata.set(targetKey, keyMetadata = new Map());
+	  } return keyMetadata;
+	};
+	var ordinaryHasOwnMetadata = function (MetadataKey, O, P) {
+	  var metadataMap = getOrCreateMetadataMap(O, P, false);
+	  return metadataMap === undefined ? false : metadataMap.has(MetadataKey);
+	};
+	var ordinaryGetOwnMetadata = function (MetadataKey, O, P) {
+	  var metadataMap = getOrCreateMetadataMap(O, P, false);
+	  return metadataMap === undefined ? undefined : metadataMap.get(MetadataKey);
+	};
+	var ordinaryDefineOwnMetadata = function (MetadataKey, MetadataValue, O, P) {
+	  getOrCreateMetadataMap(O, P, true).set(MetadataKey, MetadataValue);
+	};
+	var ordinaryOwnMetadataKeys = function (target, targetKey) {
+	  var metadataMap = getOrCreateMetadataMap(target, targetKey, false);
+	  var keys = [];
+	  if (metadataMap) metadataMap.forEach(function (_, key) { keys.push(key); });
+	  return keys;
+	};
+	var toMetaKey = function (it) {
+	  return it === undefined || typeof it == 'symbol' ? it : String(it);
+	};
+	var exp = function (O) {
+	  $export($export.S, 'Reflect', O);
+	};
+
+	module.exports = {
+	  store: store,
+	  map: getOrCreateMetadataMap,
+	  has: ordinaryHasOwnMetadata,
+	  get: ordinaryGetOwnMetadata,
+	  set: ordinaryDefineOwnMetadata,
+	  keys: ordinaryOwnMetadataKeys,
+	  key: toMetaKey,
+	  exp: exp
+	};
+
+
+/***/ }),
+/* 315 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var toMetaKey = metadata.key;
+	var getOrCreateMetadataMap = metadata.map;
+	var store = metadata.store;
+
+	metadata.exp({ deleteMetadata: function deleteMetadata(metadataKey, target /* , targetKey */) {
+	  var targetKey = arguments.length < 3 ? undefined : toMetaKey(arguments[2]);
+	  var metadataMap = getOrCreateMetadataMap(anObject(target), targetKey, false);
+	  if (metadataMap === undefined || !metadataMap['delete'](metadataKey)) return false;
+	  if (metadataMap.size) return true;
+	  var targetMetadata = store.get(target);
+	  targetMetadata['delete'](targetKey);
+	  return !!targetMetadata.size || store['delete'](target);
+	} });
+
+
+/***/ }),
+/* 316 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var getPrototypeOf = __webpack_require__(59);
+	var ordinaryHasOwnMetadata = metadata.has;
+	var ordinaryGetOwnMetadata = metadata.get;
+	var toMetaKey = metadata.key;
+
+	var ordinaryGetMetadata = function (MetadataKey, O, P) {
+	  var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
+	  if (hasOwn) return ordinaryGetOwnMetadata(MetadataKey, O, P);
+	  var parent = getPrototypeOf(O);
+	  return parent !== null ? ordinaryGetMetadata(MetadataKey, parent, P) : undefined;
+	};
+
+	metadata.exp({ getMetadata: function getMetadata(metadataKey, target /* , targetKey */) {
+	  return ordinaryGetMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
+	} });
+
+
+/***/ }),
+/* 317 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var Set = __webpack_require__(225);
+	var from = __webpack_require__(283);
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var getPrototypeOf = __webpack_require__(59);
+	var ordinaryOwnMetadataKeys = metadata.keys;
+	var toMetaKey = metadata.key;
+
+	var ordinaryMetadataKeys = function (O, P) {
+	  var oKeys = ordinaryOwnMetadataKeys(O, P);
+	  var parent = getPrototypeOf(O);
+	  if (parent === null) return oKeys;
+	  var pKeys = ordinaryMetadataKeys(parent, P);
+	  return pKeys.length ? oKeys.length ? from(new Set(oKeys.concat(pKeys))) : pKeys : oKeys;
+	};
+
+	metadata.exp({ getMetadataKeys: function getMetadataKeys(target /* , targetKey */) {
+	  return ordinaryMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
+	} });
+
+
+/***/ }),
+/* 318 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var ordinaryGetOwnMetadata = metadata.get;
+	var toMetaKey = metadata.key;
+
+	metadata.exp({ getOwnMetadata: function getOwnMetadata(metadataKey, target /* , targetKey */) {
+	  return ordinaryGetOwnMetadata(metadataKey, anObject(target)
+	    , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
+	} });
+
+
+/***/ }),
+/* 319 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var ordinaryOwnMetadataKeys = metadata.keys;
+	var toMetaKey = metadata.key;
+
+	metadata.exp({ getOwnMetadataKeys: function getOwnMetadataKeys(target /* , targetKey */) {
+	  return ordinaryOwnMetadataKeys(anObject(target), arguments.length < 2 ? undefined : toMetaKey(arguments[1]));
+	} });
+
+
+/***/ }),
+/* 320 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var getPrototypeOf = __webpack_require__(59);
+	var ordinaryHasOwnMetadata = metadata.has;
+	var toMetaKey = metadata.key;
+
+	var ordinaryHasMetadata = function (MetadataKey, O, P) {
+	  var hasOwn = ordinaryHasOwnMetadata(MetadataKey, O, P);
+	  if (hasOwn) return true;
+	  var parent = getPrototypeOf(O);
+	  return parent !== null ? ordinaryHasMetadata(MetadataKey, parent, P) : false;
+	};
+
+	metadata.exp({ hasMetadata: function hasMetadata(metadataKey, target /* , targetKey */) {
+	  return ordinaryHasMetadata(metadataKey, anObject(target), arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
+	} });
+
+
+/***/ }),
+/* 321 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var ordinaryHasOwnMetadata = metadata.has;
+	var toMetaKey = metadata.key;
+
+	metadata.exp({ hasOwnMetadata: function hasOwnMetadata(metadataKey, target /* , targetKey */) {
+	  return ordinaryHasOwnMetadata(metadataKey, anObject(target)
+	    , arguments.length < 3 ? undefined : toMetaKey(arguments[2]));
+	} });
+
+
+/***/ }),
+/* 322 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $metadata = __webpack_require__(314);
+	var anObject = __webpack_require__(12);
+	var aFunction = __webpack_require__(24);
+	var toMetaKey = $metadata.key;
+	var ordinaryDefineOwnMetadata = $metadata.set;
+
+	$metadata.exp({ metadata: function metadata(metadataKey, metadataValue) {
+	  return function decorator(target, targetKey) {
+	    ordinaryDefineOwnMetadata(
+	      metadataKey, metadataValue,
+	      (targetKey !== undefined ? anObject : aFunction)(target),
+	      toMetaKey(targetKey)
+	    );
+	  };
+	} });
+
+
+/***/ }),
+/* 323 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/rwaldron/tc39-notes/blob/master/es6/2014-09/sept-25.md#510-globalasap-for-enqueuing-a-microtask
+	var $export = __webpack_require__(8);
+	var microtask = __webpack_require__(215)();
+	var process = __webpack_require__(4).process;
+	var isNode = __webpack_require__(35)(process) == 'process';
+
+	$export($export.G, {
+	  asap: function asap(fn) {
+	    var domain = isNode && process.domain;
+	    microtask(domain ? domain.bind(fn) : fn);
+	  }
+	});
+
+
+/***/ }),
+/* 324 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+	// https://github.com/zenparsing/es-observable
+	var $export = __webpack_require__(8);
+	var global = __webpack_require__(4);
+	var core = __webpack_require__(9);
+	var microtask = __webpack_require__(215)();
+	var OBSERVABLE = __webpack_require__(27)('observable');
+	var aFunction = __webpack_require__(24);
+	var anObject = __webpack_require__(12);
+	var anInstance = __webpack_require__(212);
+	var redefineAll = __webpack_require__(220);
+	var hide = __webpack_require__(10);
+	var forOf = __webpack_require__(213);
+	var RETURN = forOf.RETURN;
+
+	var getMethod = function (fn) {
+	  return fn == null ? undefined : aFunction(fn);
+	};
+
+	var cleanupSubscription = function (subscription) {
+	  var cleanup = subscription._c;
+	  if (cleanup) {
+	    subscription._c = undefined;
+	    cleanup();
+	  }
+	};
+
+	var subscriptionClosed = function (subscription) {
+	  return subscription._o === undefined;
+	};
+
+	var closeSubscription = function (subscription) {
+	  if (!subscriptionClosed(subscription)) {
+	    subscription._o = undefined;
+	    cleanupSubscription(subscription);
+	  }
+	};
+
+	var Subscription = function (observer, subscriber) {
+	  anObject(observer);
+	  this._c = undefined;
+	  this._o = observer;
+	  observer = new SubscriptionObserver(this);
+	  try {
+	    var cleanup = subscriber(observer);
+	    var subscription = cleanup;
+	    if (cleanup != null) {
+	      if (typeof cleanup.unsubscribe === 'function') cleanup = function () { subscription.unsubscribe(); };
+	      else aFunction(cleanup);
+	      this._c = cleanup;
+	    }
+	  } catch (e) {
+	    observer.error(e);
+	    return;
+	  } if (subscriptionClosed(this)) cleanupSubscription(this);
+	};
+
+	Subscription.prototype = redefineAll({}, {
+	  unsubscribe: function unsubscribe() { closeSubscription(this); }
+	});
+
+	var SubscriptionObserver = function (subscription) {
+	  this._s = subscription;
+	};
+
+	SubscriptionObserver.prototype = redefineAll({}, {
+	  next: function next(value) {
+	    var subscription = this._s;
+	    if (!subscriptionClosed(subscription)) {
+	      var observer = subscription._o;
+	      try {
+	        var m = getMethod(observer.next);
+	        if (m) return m.call(observer, value);
+	      } catch (e) {
+	        try {
+	          closeSubscription(subscription);
+	        } finally {
+	          throw e;
+	        }
+	      }
+	    }
+	  },
+	  error: function error(value) {
+	    var subscription = this._s;
+	    if (subscriptionClosed(subscription)) throw value;
+	    var observer = subscription._o;
+	    subscription._o = undefined;
+	    try {
+	      var m = getMethod(observer.error);
+	      if (!m) throw value;
+	      value = m.call(observer, value);
+	    } catch (e) {
+	      try {
+	        cleanupSubscription(subscription);
+	      } finally {
+	        throw e;
+	      }
+	    } cleanupSubscription(subscription);
+	    return value;
+	  },
+	  complete: function complete(value) {
+	    var subscription = this._s;
+	    if (!subscriptionClosed(subscription)) {
+	      var observer = subscription._o;
+	      subscription._o = undefined;
+	      try {
+	        var m = getMethod(observer.complete);
+	        value = m ? m.call(observer, value) : undefined;
+	      } catch (e) {
+	        try {
+	          cleanupSubscription(subscription);
+	        } finally {
+	          throw e;
+	        }
+	      } cleanupSubscription(subscription);
+	      return value;
+	    }
+	  }
+	});
+
+	var $Observable = function Observable(subscriber) {
+	  anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber);
+	};
+
+	redefineAll($Observable.prototype, {
+	  subscribe: function subscribe(observer) {
+	    return new Subscription(observer, this._f);
+	  },
+	  forEach: function forEach(fn) {
+	    var that = this;
+	    return new (core.Promise || global.Promise)(function (resolve, reject) {
+	      aFunction(fn);
+	      var subscription = that.subscribe({
+	        next: function (value) {
+	          try {
+	            return fn(value);
+	          } catch (e) {
+	            reject(e);
+	            subscription.unsubscribe();
+	          }
+	        },
+	        error: reject,
+	        complete: resolve
+	      });
+	    });
+	  }
+	});
+
+	redefineAll($Observable, {
+	  from: function from(x) {
+	    var C = typeof this === 'function' ? this : $Observable;
+	    var method = getMethod(anObject(x)[OBSERVABLE]);
+	    if (method) {
+	      var observable = anObject(method.call(x));
+	      return observable.constructor === C ? observable : new C(function (observer) {
+	        return observable.subscribe(observer);
+	      });
+	    }
+	    return new C(function (observer) {
+	      var done = false;
+	      microtask(function () {
+	        if (!done) {
+	          try {
+	            if (forOf(x, false, function (it) {
+	              observer.next(it);
+	              if (done) return RETURN;
+	            }) === RETURN) return;
+	          } catch (e) {
+	            if (done) throw e;
+	            observer.error(e);
+	            return;
+	          } observer.complete();
+	        }
+	      });
+	      return function () { done = true; };
+	    });
+	  },
+	  of: function of() {
+	    for (var i = 0, l = arguments.length, items = new Array(l); i < l;) items[i] = arguments[i++];
+	    return new (typeof this === 'function' ? this : $Observable)(function (observer) {
+	      var done = false;
+	      microtask(function () {
+	        if (!done) {
+	          for (var j = 0; j < items.length; ++j) {
+	            observer.next(items[j]);
+	            if (done) return;
+	          } observer.complete();
+	        }
+	      });
+	      return function () { done = true; };
+	    });
+	  }
+	});
+
+	hide($Observable.prototype, OBSERVABLE, function () { return this; });
+
+	$export($export.G, { Observable: $Observable });
+
+	__webpack_require__(194)('Observable');
+
+
+/***/ }),
+/* 325 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// ie9- setTimeout & setInterval additional parameters fix
+	var global = __webpack_require__(4);
+	var $export = __webpack_require__(8);
+	var userAgent = __webpack_require__(218);
+	var slice = [].slice;
+	var MSIE = /MSIE .\./.test(userAgent); // <- dirty ie9- check
+	var wrap = function (set) {
+	  return function (fn, time /* , ...args */) {
+	    var boundArgs = arguments.length > 2;
+	    var args = boundArgs ? slice.call(arguments, 2) : false;
+	    return set(boundArgs ? function () {
+	      // eslint-disable-next-line no-new-func
+	      (typeof fn == 'function' ? fn : Function(fn)).apply(this, args);
+	    } : fn, time);
+	  };
+	};
+	$export($export.G + $export.B + $export.F * MSIE, {
+	  setTimeout: wrap(global.setTimeout),
+	  setInterval: wrap(global.setInterval)
+	});
+
+
+/***/ }),
+/* 326 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $export = __webpack_require__(8);
+	var $task = __webpack_require__(214);
+	$export($export.G + $export.B, {
+	  setImmediate: $task.set,
+	  clearImmediate: $task.clear
+	});
+
+
+/***/ }),
+/* 327 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var $iterators = __webpack_require__(195);
+	var getKeys = __webpack_require__(31);
+	var redefine = __webpack_require__(18);
+	var global = __webpack_require__(4);
+	var hide = __webpack_require__(10);
+	var Iterators = __webpack_require__(130);
+	var wks = __webpack_require__(27);
+	var ITERATOR = wks('iterator');
+	var TO_STRING_TAG = wks('toStringTag');
+	var ArrayValues = Iterators.Array;
+
+	var DOMIterables = {
+	  CSSRuleList: true, // TODO: Not spec compliant, should be false.
+	  CSSStyleDeclaration: false,
+	  CSSValueList: false,
+	  ClientRectList: false,
+	  DOMRectList: false,
+	  DOMStringList: false,
+	  DOMTokenList: true,
+	  DataTransferItemList: false,
+	  FileList: false,
+	  HTMLAllCollection: false,
+	  HTMLCollection: false,
+	  HTMLFormElement: false,
+	  HTMLSelectElement: false,
+	  MediaList: true, // TODO: Not spec compliant, should be false.
+	  MimeTypeArray: false,
+	  NamedNodeMap: false,
+	  NodeList: true,
+	  PaintRequestList: false,
+	  Plugin: false,
+	  PluginArray: false,
+	  SVGLengthList: false,
+	  SVGNumberList: false,
+	  SVGPathSegList: false,
+	  SVGPointList: false,
+	  SVGStringList: false,
+	  SVGTransformList: false,
+	  SourceBufferList: false,
+	  StyleSheetList: true, // TODO: Not spec compliant, should be false.
+	  TextTrackCueList: false,
+	  TextTrackList: false,
+	  TouchList: false
+	};
+
+	for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) {
+	  var NAME = collections[i];
+	  var explicit = DOMIterables[NAME];
+	  var Collection = global[NAME];
+	  var proto = Collection && Collection.prototype;
+	  var key;
+	  if (proto) {
+	    if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues);
+	    if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
+	    Iterators[NAME] = ArrayValues;
+	    if (explicit) for (key in $iterators) if (!proto[key]) redefine(proto, key, $iterators[key], true);
+	  }
+	}
+
+
+/***/ }),
+/* 328 */
+/***/ (function(module, exports) {
+
+	/* WEBPACK VAR INJECTION */(function(global) {/**
+	 * Copyright (c) 2014, Facebook, Inc.
+	 * All rights reserved.
+	 *
+	 * This source code is licensed under the BSD-style license found in the
+	 * https://raw.github.com/facebook/regenerator/master/LICENSE file. An
+	 * additional grant of patent rights can be found in the PATENTS file in
+	 * the same directory.
+	 */
+
+	!(function(global) {
+	  "use strict";
+
+	  var Op = Object.prototype;
+	  var hasOwn = Op.hasOwnProperty;
+	  var undefined; // More compressible than void 0.
+	  var $Symbol = typeof Symbol === "function" ? Symbol : {};
+	  var iteratorSymbol = $Symbol.iterator || "@@iterator";
+	  var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
+	  var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
+
+	  var inModule = typeof module === "object";
+	  var runtime = global.regeneratorRuntime;
+	  if (runtime) {
+	    if (inModule) {
+	      // If regeneratorRuntime is defined globally and we're in a module,
+	      // make the exports object identical to regeneratorRuntime.
+	      module.exports = runtime;
+	    }
+	    // Don't bother evaluating the rest of this file if the runtime was
+	    // already defined globally.
+	    return;
+	  }
+
+	  // Define the runtime globally (as expected by generated code) as either
+	  // module.exports (if we're in a module) or a new, empty object.
+	  runtime = global.regeneratorRuntime = inModule ? module.exports : {};
+
+	  function wrap(innerFn, outerFn, self, tryLocsList) {
+	    // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
+	    var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
+	    var generator = Object.create(protoGenerator.prototype);
+	    var context = new Context(tryLocsList || []);
+
+	    // The ._invoke method unifies the implementations of the .next,
+	    // .throw, and .return methods.
+	    generator._invoke = makeInvokeMethod(innerFn, self, context);
+
+	    return generator;
+	  }
+	  runtime.wrap = wrap;
+
+	  // Try/catch helper to minimize deoptimizations. Returns a completion
+	  // record like context.tryEntries[i].completion. This interface could
+	  // have been (and was previously) designed to take a closure to be
+	  // invoked without arguments, but in all the cases we care about we
+	  // already have an existing method we want to call, so there's no need
+	  // to create a new function object. We can even get away with assuming
+	  // the method takes exactly one argument, since that happens to be true
+	  // in every case, so we don't have to touch the arguments object. The
+	  // only additional allocation required is the completion record, which
+	  // has a stable shape and so hopefully should be cheap to allocate.
+	  function tryCatch(fn, obj, arg) {
+	    try {
+	      return { type: "normal", arg: fn.call(obj, arg) };
+	    } catch (err) {
+	      return { type: "throw", arg: err };
+	    }
+	  }
+
+	  var GenStateSuspendedStart = "suspendedStart";
+	  var GenStateSuspendedYield = "suspendedYield";
+	  var GenStateExecuting = "executing";
+	  var GenStateCompleted = "completed";
+
+	  // Returning this object from the innerFn has the same effect as
+	  // breaking out of the dispatch switch statement.
+	  var ContinueSentinel = {};
+
+	  // Dummy constructor functions that we use as the .constructor and
+	  // .constructor.prototype properties for functions that return Generator
+	  // objects. For full spec compliance, you may wish to configure your
+	  // minifier not to mangle the names of these two functions.
+	  function Generator() {}
+	  function GeneratorFunction() {}
+	  function GeneratorFunctionPrototype() {}
+
+	  // This is a polyfill for %IteratorPrototype% for environments that
+	  // don't natively support it.
+	  var IteratorPrototype = {};
+	  IteratorPrototype[iteratorSymbol] = function () {
+	    return this;
+	  };
+
+	  var getProto = Object.getPrototypeOf;
+	  var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
+	  if (NativeIteratorPrototype &&
+	      NativeIteratorPrototype !== Op &&
+	      hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
+	    // This environment has a native %IteratorPrototype%; use it instead
+	    // of the polyfill.
+	    IteratorPrototype = NativeIteratorPrototype;
+	  }
+
+	  var Gp = GeneratorFunctionPrototype.prototype =
+	    Generator.prototype = Object.create(IteratorPrototype);
+	  GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
+	  GeneratorFunctionPrototype.constructor = GeneratorFunction;
+	  GeneratorFunctionPrototype[toStringTagSymbol] =
+	    GeneratorFunction.displayName = "GeneratorFunction";
+
+	  // Helper for defining the .next, .throw, and .return methods of the
+	  // Iterator interface in terms of a single ._invoke method.
+	  function defineIteratorMethods(prototype) {
+	    ["next", "throw", "return"].forEach(function(method) {
+	      prototype[method] = function(arg) {
+	        return this._invoke(method, arg);
+	      };
+	    });
+	  }
+
+	  runtime.isGeneratorFunction = function(genFun) {
+	    var ctor = typeof genFun === "function" && genFun.constructor;
+	    return ctor
+	      ? ctor === GeneratorFunction ||
+	        // For the native GeneratorFunction constructor, the best we can
+	        // do is to check its .name property.
+	        (ctor.displayName || ctor.name) === "GeneratorFunction"
+	      : false;
+	  };
+
+	  runtime.mark = function(genFun) {
+	    if (Object.setPrototypeOf) {
+	      Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
+	    } else {
+	      genFun.__proto__ = GeneratorFunctionPrototype;
+	      if (!(toStringTagSymbol in genFun)) {
+	        genFun[toStringTagSymbol] = "GeneratorFunction";
+	      }
+	    }
+	    genFun.prototype = Object.create(Gp);
+	    return genFun;
+	  };
+
+	  // Within the body of any async function, `await x` is transformed to
+	  // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
+	  // `hasOwn.call(value, "__await")` to determine if the yielded value is
+	  // meant to be awaited.
+	  runtime.awrap = function(arg) {
+	    return { __await: arg };
+	  };
+
+	  function AsyncIterator(generator) {
+	    function invoke(method, arg, resolve, reject) {
+	      var record = tryCatch(generator[method], generator, arg);
+	      if (record.type === "throw") {
+	        reject(record.arg);
+	      } else {
+	        var result = record.arg;
+	        var value = result.value;
+	        if (value &&
+	            typeof value === "object" &&
+	            hasOwn.call(value, "__await")) {
+	          return Promise.resolve(value.__await).then(function(value) {
+	            invoke("next", value, resolve, reject);
+	          }, function(err) {
+	            invoke("throw", err, resolve, reject);
+	          });
+	        }
+
+	        return Promise.resolve(value).then(function(unwrapped) {
+	          // When a yielded Promise is resolved, its final value becomes
+	          // the .value of the Promise<{value,done}> result for the
+	          // current iteration. If the Promise is rejected, however, the
+	          // result for this iteration will be rejected with the same
+	          // reason. Note that rejections of yielded Promises are not
+	          // thrown back into the generator function, as is the case
+	          // when an awaited Promise is rejected. This difference in
+	          // behavior between yield and await is important, because it
+	          // allows the consumer to decide what to do with the yielded
+	          // rejection (swallow it and continue, manually .throw it back
+	          // into the generator, abandon iteration, whatever). With
+	          // await, by contrast, there is no opportunity to examine the
+	          // rejection reason outside the generator function, so the
+	          // only option is to throw it from the await expression, and
+	          // let the generator function handle the exception.
+	          result.value = unwrapped;
+	          resolve(result);
+	        }, reject);
+	      }
+	    }
+
+	    if (typeof global.process === "object" && global.process.domain) {
+	      invoke = global.process.domain.bind(invoke);
+	    }
+
+	    var previousPromise;
+
+	    function enqueue(method, arg) {
+	      function callInvokeWithMethodAndArg() {
+	        return new Promise(function(resolve, reject) {
+	          invoke(method, arg, resolve, reject);
+	        });
+	      }
+
+	      return previousPromise =
+	        // If enqueue has been called before, then we want to wait until
+	        // all previous Promises have been resolved before calling invoke,
+	        // so that results are always delivered in the correct order. If
+	        // enqueue has not been called before, then it is important to
+	        // call invoke immediately, without waiting on a callback to fire,
+	        // so that the async generator function has the opportunity to do
+	        // any necessary setup in a predictable way. This predictability
+	        // is why the Promise constructor synchronously invokes its
+	        // executor callback, and why async functions synchronously
+	        // execute code before the first await. Since we implement simple
+	        // async functions in terms of async generators, it is especially
+	        // important to get this right, even though it requires care.
+	        previousPromise ? previousPromise.then(
+	          callInvokeWithMethodAndArg,
+	          // Avoid propagating failures to Promises returned by later
+	          // invocations of the iterator.
+	          callInvokeWithMethodAndArg
+	        ) : callInvokeWithMethodAndArg();
+	    }
+
+	    // Define the unified helper method that is used to implement .next,
+	    // .throw, and .return (see defineIteratorMethods).
+	    this._invoke = enqueue;
+	  }
+
+	  defineIteratorMethods(AsyncIterator.prototype);
+	  AsyncIterator.prototype[asyncIteratorSymbol] = function () {
+	    return this;
+	  };
+	  runtime.AsyncIterator = AsyncIterator;
+
+	  // Note that simple async functions are implemented on top of
+	  // AsyncIterator objects; they just return a Promise for the value of
+	  // the final result produced by the iterator.
+	  runtime.async = function(innerFn, outerFn, self, tryLocsList) {
+	    var iter = new AsyncIterator(
+	      wrap(innerFn, outerFn, self, tryLocsList)
+	    );
+
+	    return runtime.isGeneratorFunction(outerFn)
+	      ? iter // If outerFn is a generator, return the full iterator.
+	      : iter.next().then(function(result) {
+	          return result.done ? result.value : iter.next();
+	        });
+	  };
+
+	  function makeInvokeMethod(innerFn, self, context) {
+	    var state = GenStateSuspendedStart;
+
+	    return function invoke(method, arg) {
+	      if (state === GenStateExecuting) {
+	        throw new Error("Generator is already running");
+	      }
+
+	      if (state === GenStateCompleted) {
+	        if (method === "throw") {
+	          throw arg;
+	        }
+
+	        // Be forgiving, per 25.3.3.3.3 of the spec:
+	        // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
+	        return doneResult();
+	      }
+
+	      context.method = method;
+	      context.arg = arg;
+
+	      while (true) {
+	        var delegate = context.delegate;
+	        if (delegate) {
+	          var delegateResult = maybeInvokeDelegate(delegate, context);
+	          if (delegateResult) {
+	            if (delegateResult === ContinueSentinel) continue;
+	            return delegateResult;
+	          }
+	        }
+
+	        if (context.method === "next") {
+	          // Setting context._sent for legacy support of Babel's
+	          // function.sent implementation.
+	          context.sent = context._sent = context.arg;
+
+	        } else if (context.method === "throw") {
+	          if (state === GenStateSuspendedStart) {
+	            state = GenStateCompleted;
+	            throw context.arg;
+	          }
+
+	          context.dispatchException(context.arg);
+
+	        } else if (context.method === "return") {
+	          context.abrupt("return", context.arg);
+	        }
+
+	        state = GenStateExecuting;
+
+	        var record = tryCatch(innerFn, self, context);
+	        if (record.type === "normal") {
+	          // If an exception is thrown from innerFn, we leave state ===
+	          // GenStateExecuting and loop back for another invocation.
+	          state = context.done
+	            ? GenStateCompleted
+	            : GenStateSuspendedYield;
+
+	          if (record.arg === ContinueSentinel) {
+	            continue;
+	          }
+
+	          return {
+	            value: record.arg,
+	            done: context.done
+	          };
+
+	        } else if (record.type === "throw") {
+	          state = GenStateCompleted;
+	          // Dispatch the exception by looping back around to the
+	          // context.dispatchException(context.arg) call above.
+	          context.method = "throw";
+	          context.arg = record.arg;
+	        }
+	      }
+	    };
+	  }
+
+	  // Call delegate.iterator[context.method](context.arg) and handle the
+	  // result, either by returning a { value, done } result from the
+	  // delegate iterator, or by modifying context.method and context.arg,
+	  // setting context.delegate to null, and returning the ContinueSentinel.
+	  function maybeInvokeDelegate(delegate, context) {
+	    var method = delegate.iterator[context.method];
+	    if (method === undefined) {
+	      // A .throw or .return when the delegate iterator has no .throw
+	      // method always terminates the yield* loop.
+	      context.delegate = null;
+
+	      if (context.method === "throw") {
+	        if (delegate.iterator.return) {
+	          // If the delegate iterator has a return method, give it a
+	          // chance to clean up.
+	          context.method = "return";
+	          context.arg = undefined;
+	          maybeInvokeDelegate(delegate, context);
+
+	          if (context.method === "throw") {
+	            // If maybeInvokeDelegate(context) changed context.method from
+	            // "return" to "throw", let that override the TypeError below.
+	            return ContinueSentinel;
+	          }
+	        }
+
+	        context.method = "throw";
+	        context.arg = new TypeError(
+	          "The iterator does not provide a 'throw' method");
+	      }
+
+	      return ContinueSentinel;
+	    }
+
+	    var record = tryCatch(method, delegate.iterator, context.arg);
+
+	    if (record.type === "throw") {
+	      context.method = "throw";
+	      context.arg = record.arg;
+	      context.delegate = null;
+	      return ContinueSentinel;
+	    }
+
+	    var info = record.arg;
+
+	    if (! info) {
+	      context.method = "throw";
+	      context.arg = new TypeError("iterator result is not an object");
+	      context.delegate = null;
+	      return ContinueSentinel;
+	    }
+
+	    if (info.done) {
+	      // Assign the result of the finished delegate to the temporary
+	      // variable specified by delegate.resultName (see delegateYield).
+	      context[delegate.resultName] = info.value;
+
+	      // Resume execution at the desired location (see delegateYield).
+	      context.next = delegate.nextLoc;
+
+	      // If context.method was "throw" but the delegate handled the
+	      // exception, let the outer generator proceed normally. If
+	      // context.method was "next", forget context.arg since it has been
+	      // "consumed" by the delegate iterator. If context.method was
+	      // "return", allow the original .return call to continue in the
+	      // outer generator.
+	      if (context.method !== "return") {
+	        context.method = "next";
+	        context.arg = undefined;
+	      }
+
+	    } else {
+	      // Re-yield the result returned by the delegate method.
+	      return info;
+	    }
+
+	    // The delegate iterator is finished, so forget it and continue with
+	    // the outer generator.
+	    context.delegate = null;
+	    return ContinueSentinel;
+	  }
+
+	  // Define Generator.prototype.{next,throw,return} in terms of the
+	  // unified ._invoke helper method.
+	  defineIteratorMethods(Gp);
+
+	  Gp[toStringTagSymbol] = "Generator";
+
+	  // A Generator should always return itself as the iterator object when the
+	  // @@iterator function is called on it. Some browsers' implementations of the
+	  // iterator prototype chain incorrectly implement this, causing the Generator
+	  // object to not be returned from this call. This ensures that doesn't happen.
+	  // See https://github.com/facebook/regenerator/issues/274 for more details.
+	  Gp[iteratorSymbol] = function() {
+	    return this;
+	  };
+
+	  Gp.toString = function() {
+	    return "[object Generator]";
+	  };
+
+	  function pushTryEntry(locs) {
+	    var entry = { tryLoc: locs[0] };
+
+	    if (1 in locs) {
+	      entry.catchLoc = locs[1];
+	    }
+
+	    if (2 in locs) {
+	      entry.finallyLoc = locs[2];
+	      entry.afterLoc = locs[3];
+	    }
+
+	    this.tryEntries.push(entry);
+	  }
+
+	  function resetTryEntry(entry) {
+	    var record = entry.completion || {};
+	    record.type = "normal";
+	    delete record.arg;
+	    entry.completion = record;
+	  }
+
+	  function Context(tryLocsList) {
+	    // The root entry object (effectively a try statement without a catch
+	    // or a finally block) gives us a place to store values thrown from
+	    // locations where there is no enclosing try statement.
+	    this.tryEntries = [{ tryLoc: "root" }];
+	    tryLocsList.forEach(pushTryEntry, this);
+	    this.reset(true);
+	  }
+
+	  runtime.keys = function(object) {
+	    var keys = [];
+	    for (var key in object) {
+	      keys.push(key);
+	    }
+	    keys.reverse();
+
+	    // Rather than returning an object with a next method, we keep
+	    // things simple and return the next function itself.
+	    return function next() {
+	      while (keys.length) {
+	        var key = keys.pop();
+	        if (key in object) {
+	          next.value = key;
+	          next.done = false;
+	          return next;
+	        }
+	      }
+
+	      // To avoid creating an additional object, we just hang the .value
+	      // and .done properties off the next function object itself. This
+	      // also ensures that the minifier will not anonymize the function.
+	      next.done = true;
+	      return next;
+	    };
+	  };
+
+	  function values(iterable) {
+	    if (iterable) {
+	      var iteratorMethod = iterable[iteratorSymbol];
+	      if (iteratorMethod) {
+	        return iteratorMethod.call(iterable);
+	      }
+
+	      if (typeof iterable.next === "function") {
+	        return iterable;
+	      }
+
+	      if (!isNaN(iterable.length)) {
+	        var i = -1, next = function next() {
+	          while (++i < iterable.length) {
+	            if (hasOwn.call(iterable, i)) {
+	              next.value = iterable[i];
+	              next.done = false;
+	              return next;
+	            }
+	          }
+
+	          next.value = undefined;
+	          next.done = true;
+
+	          return next;
+	        };
+
+	        return next.next = next;
+	      }
+	    }
+
+	    // Return an iterator with no values.
+	    return { next: doneResult };
+	  }
+	  runtime.values = values;
+
+	  function doneResult() {
+	    return { value: undefined, done: true };
+	  }
+
+	  Context.prototype = {
+	    constructor: Context,
+
+	    reset: function(skipTempReset) {
+	      this.prev = 0;
+	      this.next = 0;
+	      // Resetting context._sent for legacy support of Babel's
+	      // function.sent implementation.
+	      this.sent = this._sent = undefined;
+	      this.done = false;
+	      this.delegate = null;
+
+	      this.method = "next";
+	      this.arg = undefined;
+
+	      this.tryEntries.forEach(resetTryEntry);
+
+	      if (!skipTempReset) {
+	        for (var name in this) {
+	          // Not sure about the optimal order of these conditions:
+	          if (name.charAt(0) === "t" &&
+	              hasOwn.call(this, name) &&
+	              !isNaN(+name.slice(1))) {
+	            this[name] = undefined;
+	          }
+	        }
+	      }
+	    },
+
+	    stop: function() {
+	      this.done = true;
+
+	      var rootEntry = this.tryEntries[0];
+	      var rootRecord = rootEntry.completion;
+	      if (rootRecord.type === "throw") {
+	        throw rootRecord.arg;
+	      }
+
+	      return this.rval;
+	    },
+
+	    dispatchException: function(exception) {
+	      if (this.done) {
+	        throw exception;
+	      }
+
+	      var context = this;
+	      function handle(loc, caught) {
+	        record.type = "throw";
+	        record.arg = exception;
+	        context.next = loc;
+
+	        if (caught) {
+	          // If the dispatched exception was caught by a catch block,
+	          // then let that catch block handle the exception normally.
+	          context.method = "next";
+	          context.arg = undefined;
+	        }
+
+	        return !! caught;
+	      }
+
+	      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+	        var entry = this.tryEntries[i];
+	        var record = entry.completion;
+
+	        if (entry.tryLoc === "root") {
+	          // Exception thrown outside of any try block that could handle
+	          // it, so set the completion value of the entire function to
+	          // throw the exception.
+	          return handle("end");
+	        }
+
+	        if (entry.tryLoc <= this.prev) {
+	          var hasCatch = hasOwn.call(entry, "catchLoc");
+	          var hasFinally = hasOwn.call(entry, "finallyLoc");
+
+	          if (hasCatch && hasFinally) {
+	            if (this.prev < entry.catchLoc) {
+	              return handle(entry.catchLoc, true);
+	            } else if (this.prev < entry.finallyLoc) {
+	              return handle(entry.finallyLoc);
+	            }
+
+	          } else if (hasCatch) {
+	            if (this.prev < entry.catchLoc) {
+	              return handle(entry.catchLoc, true);
+	            }
+
+	          } else if (hasFinally) {
+	            if (this.prev < entry.finallyLoc) {
+	              return handle(entry.finallyLoc);
+	            }
+
+	          } else {
+	            throw new Error("try statement without catch or finally");
+	          }
+	        }
+	      }
+	    },
+
+	    abrupt: function(type, arg) {
+	      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+	        var entry = this.tryEntries[i];
+	        if (entry.tryLoc <= this.prev &&
+	            hasOwn.call(entry, "finallyLoc") &&
+	            this.prev < entry.finallyLoc) {
+	          var finallyEntry = entry;
+	          break;
+	        }
+	      }
+
+	      if (finallyEntry &&
+	          (type === "break" ||
+	           type === "continue") &&
+	          finallyEntry.tryLoc <= arg &&
+	          arg <= finallyEntry.finallyLoc) {
+	        // Ignore the finally entry if control is not jumping to a
+	        // location outside the try/catch block.
+	        finallyEntry = null;
+	      }
+
+	      var record = finallyEntry ? finallyEntry.completion : {};
+	      record.type = type;
+	      record.arg = arg;
+
+	      if (finallyEntry) {
+	        this.method = "next";
+	        this.next = finallyEntry.finallyLoc;
+	        return ContinueSentinel;
+	      }
+
+	      return this.complete(record);
+	    },
+
+	    complete: function(record, afterLoc) {
+	      if (record.type === "throw") {
+	        throw record.arg;
+	      }
+
+	      if (record.type === "break" ||
+	          record.type === "continue") {
+	        this.next = record.arg;
+	      } else if (record.type === "return") {
+	        this.rval = this.arg = record.arg;
+	        this.method = "return";
+	        this.next = "end";
+	      } else if (record.type === "normal" && afterLoc) {
+	        this.next = afterLoc;
+	      }
+
+	      return ContinueSentinel;
+	    },
+
+	    finish: function(finallyLoc) {
+	      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+	        var entry = this.tryEntries[i];
+	        if (entry.finallyLoc === finallyLoc) {
+	          this.complete(entry.completion, entry.afterLoc);
+	          resetTryEntry(entry);
+	          return ContinueSentinel;
+	        }
+	      }
+	    },
+
+	    "catch": function(tryLoc) {
+	      for (var i = this.tryEntries.length - 1; i >= 0; --i) {
+	        var entry = this.tryEntries[i];
+	        if (entry.tryLoc === tryLoc) {
+	          var record = entry.completion;
+	          if (record.type === "throw") {
+	            var thrown = record.arg;
+	            resetTryEntry(entry);
+	          }
+	          return thrown;
+	        }
+	      }
+
+	      // The context.catch method must only be called with a location
+	      // argument that corresponds to a known catch block.
+	      throw new Error("illegal catch attempt");
+	    },
+
+	    delegateYield: function(iterable, resultName, nextLoc) {
+	      this.delegate = {
+	        iterator: values(iterable),
+	        resultName: resultName,
+	        nextLoc: nextLoc
+	      };
+
+	      if (this.method === "next") {
+	        // Deliberately forget the last sent value so that we don't
+	        // accidentally pass it on to the delegate.
+	        this.arg = undefined;
+	      }
+
+	      return ContinueSentinel;
+	    }
+	  };
+	})(
+	  // Among the various tricks for obtaining a reference to the global
+	  // object, this seems to be the most reliable technique that does not
+	  // use indirect eval (which violates Content Security Policy).
+	  typeof global === "object" ? global :
+	  typeof window === "object" ? window :
+	  typeof self === "object" ? self : this
+	);
+
+	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ }),
+/* 329 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	__webpack_require__(330);
+	module.exports = __webpack_require__(9).RegExp.escape;
+
+
+/***/ }),
+/* 330 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	// https://github.com/benjamingr/RexExp.escape
+	var $export = __webpack_require__(8);
+	var $re = __webpack_require__(331)(/[\\^$*+?.()|[\]{}]/g, '\\$&');
+
+	$export($export.S, 'RegExp', { escape: function escape(it) { return $re(it); } });
+
+
+/***/ }),
+/* 331 */
+/***/ (function(module, exports) {
+
+	module.exports = function (regExp, replace) {
+	  var replacer = replace === Object(replace) ? function (part) {
+	    return replace[part];
+	  } : replace;
+	  return function (it) {
+	    return String(it).replace(regExp, replacer);
+	  };
+	};
+
+
+/***/ }),
+/* 332 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	var BSON = __webpack_require__(333),
+	    Binary = __webpack_require__(356),
+	    Code = __webpack_require__(351),
+	    DBRef = __webpack_require__(355),
+	    Decimal128 = __webpack_require__(352),
+	    Double = __webpack_require__(336),
+	    Int32 = __webpack_require__(350),
+	    Long = __webpack_require__(335),
+	    Map = __webpack_require__(334),
+	    MaxKey = __webpack_require__(354),
+	    MinKey = __webpack_require__(353),
+	    ObjectId = __webpack_require__(338),
+	    BSONRegExp = __webpack_require__(348),
+	    Symbol = __webpack_require__(349),
+	    Timestamp = __webpack_require__(337);
+
+	// BSON MAX VALUES
+	BSON.BSON_INT32_MAX = 0x7fffffff;
+	BSON.BSON_INT32_MIN = -0x80000000;
+
+	BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+	BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+	// JS MAX PRECISE VALUES
+	BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+	BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+	// Add BSON types to function creation
+	BSON.Binary = Binary;
+	BSON.Code = Code;
+	BSON.DBRef = DBRef;
+	BSON.Decimal128 = Decimal128;
+	BSON.Double = Double;
+	BSON.Int32 = Int32;
+	BSON.Long = Long;
+	BSON.Map = Map;
+	BSON.MaxKey = MaxKey;
+	BSON.MinKey = MinKey;
+	BSON.ObjectId = ObjectId;
+	BSON.ObjectID = ObjectId;
+	BSON.BSONRegExp = BSONRegExp;
+	BSON.Symbol = Symbol;
+	BSON.Timestamp = Timestamp;
+
+	// Return the BSON
+	module.exports = BSON;
+
+/***/ }),
+/* 333 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var Map = __webpack_require__(334),
+	    Long = __webpack_require__(335),
+	    Double = __webpack_require__(336),
+	    Timestamp = __webpack_require__(337),
+	    ObjectID = __webpack_require__(338),
+	    BSONRegExp = __webpack_require__(348),
+	    Symbol = __webpack_require__(349),
+	    Int32 = __webpack_require__(350),
+	    Code = __webpack_require__(351),
+	    Decimal128 = __webpack_require__(352),
+	    MinKey = __webpack_require__(353),
+	    MaxKey = __webpack_require__(354),
+	    DBRef = __webpack_require__(355),
+	    Binary = __webpack_require__(356);
+
+	// Parts of the parser
+	var deserialize = __webpack_require__(357),
+	    serializer = __webpack_require__(358),
+	    calculateObjectSize = __webpack_require__(360),
+	    utils = __webpack_require__(344);
+
+	/**
+	 * @ignore
+	 * @api private
+	 */
+	// Default Max Size
+	var MAXSIZE = 1024 * 1024 * 17;
+
+	// Current Internal Temporary Serialization Buffer
+	var buffer = utils.allocBuffer(MAXSIZE);
+
+	var BSON = function () {};
+
+	/**
+	 * Serialize a Javascript object.
+	 *
+	 * @param {Object} object the Javascript object to serialize.
+	 * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
+	 * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
+	 * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
+	 * @param {Number} [options.minInternalBufferSize=1024*1024*17] minimum size of the internal temporary serialization buffer **(default:1024*1024*17)**.
+	 * @return {Buffer} returns the Buffer object containing the serialized object.
+	 * @api public
+	 */
+	BSON.prototype.serialize = function serialize(object, options) {
+	  options = options || {};
+	  // Unpack the options
+	  var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
+	  var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+	  var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
+	  var minInternalBufferSize = typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
+
+	  // Resize the internal serialization buffer if needed
+	  if (buffer.length < minInternalBufferSize) {
+	    buffer = utils.allocBuffer(minInternalBufferSize);
+	  }
+
+	  // Attempt to serialize
+	  var serializationIndex = serializer(buffer, object, checkKeys, 0, 0, serializeFunctions, ignoreUndefined, []);
+	  // Create the final buffer
+	  var finishedBuffer = utils.allocBuffer(serializationIndex);
+	  // Copy into the finished buffer
+	  buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
+	  // Return the buffer
+	  return finishedBuffer;
+	};
+
+	/**
+	 * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
+	 *
+	 * @param {Object} object the Javascript object to serialize.
+	 * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
+	 * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
+	 * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
+	 * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
+	 * @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
+	 * @return {Number} returns the index pointing to the last written byte in the buffer.
+	 * @api public
+	 */
+	BSON.prototype.serializeWithBufferAndIndex = function (object, finalBuffer, options) {
+	  options = options || {};
+	  // Unpack the options
+	  var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
+	  var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+	  var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
+	  var startIndex = typeof options.index === 'number' ? options.index : 0;
+
+	  // Attempt to serialize
+	  var serializationIndex = serializer(finalBuffer, object, checkKeys, startIndex || 0, 0, serializeFunctions, ignoreUndefined);
+
+	  // Return the index
+	  return serializationIndex - 1;
+	};
+
+	/**
+	 * Deserialize data as BSON.
+	 *
+	 * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
+	 * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
+	 * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
+	 * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
+	 * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
+	 * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
+	 * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
+	 * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
+	 * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
+	 * @return {Object} returns the deserialized Javascript Object.
+	 * @api public
+	 */
+	BSON.prototype.deserialize = function (buffer, options) {
+	  return deserialize(buffer, options);
+	};
+
+	/**
+	 * Calculate the bson size for a passed in Javascript object.
+	 *
+	 * @param {Object} object the Javascript object to calculate the BSON byte size for.
+	 * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
+	 * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
+	 * @return {Number} returns the number of bytes the BSON object will take up.
+	 * @api public
+	 */
+	BSON.prototype.calculateObjectSize = function (object, options) {
+	  options = options || {};
+
+	  var serializeFunctions = typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+	  var ignoreUndefined = typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
+
+	  return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
+	};
+
+	/**
+	 * Deserialize stream data as BSON documents.
+	 *
+	 * @param {Buffer} data the buffer containing the serialized set of BSON documents.
+	 * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
+	 * @param {Number} numberOfDocuments number of documents to deserialize.
+	 * @param {Array} documents an array where to store the deserialized documents.
+	 * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
+	 * @param {Object} [options] additional options used for the deserialization.
+	 * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
+	 * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
+	 * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
+	 * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
+	 * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
+	 * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
+	 * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
+	 * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
+	 * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
+	 * @api public
+	 */
+	BSON.prototype.deserializeStream = function (data, startIndex, numberOfDocuments, documents, docStartIndex, options) {
+	  options = options != null ? options : {};
+	  var index = startIndex;
+	  // Loop over all documents
+	  for (var i = 0; i < numberOfDocuments; i++) {
+	    // Find size of the document
+	    var size = data[index] | data[index + 1] << 8 | data[index + 2] << 16 | data[index + 3] << 24;
+	    // Update options with index
+	    options['index'] = index;
+	    // Parse the document at this point
+	    documents[docStartIndex + i] = this.deserialize(data, options);
+	    // Adjust index by the document size
+	    index = index + size;
+	  }
+
+	  // Return object containing end index of parsing and list of documents
+	  return index;
+	};
+
+	/**
+	 * @ignore
+	 * @api private
+	 */
+	// BSON MAX VALUES
+	BSON.BSON_INT32_MAX = 0x7fffffff;
+	BSON.BSON_INT32_MIN = -0x80000000;
+
+	BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+	BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+	// JS MAX PRECISE VALUES
+	BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+	BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+	// Internal long versions
+	// var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
+	// var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
+
+	/**
+	 * Number BSON Type
+	 *
+	 * @classconstant BSON_DATA_NUMBER
+	 **/
+	BSON.BSON_DATA_NUMBER = 1;
+	/**
+	 * String BSON Type
+	 *
+	 * @classconstant BSON_DATA_STRING
+	 **/
+	BSON.BSON_DATA_STRING = 2;
+	/**
+	 * Object BSON Type
+	 *
+	 * @classconstant BSON_DATA_OBJECT
+	 **/
+	BSON.BSON_DATA_OBJECT = 3;
+	/**
+	 * Array BSON Type
+	 *
+	 * @classconstant BSON_DATA_ARRAY
+	 **/
+	BSON.BSON_DATA_ARRAY = 4;
+	/**
+	 * Binary BSON Type
+	 *
+	 * @classconstant BSON_DATA_BINARY
+	 **/
+	BSON.BSON_DATA_BINARY = 5;
+	/**
+	 * ObjectID BSON Type
+	 *
+	 * @classconstant BSON_DATA_OID
+	 **/
+	BSON.BSON_DATA_OID = 7;
+	/**
+	 * Boolean BSON Type
+	 *
+	 * @classconstant BSON_DATA_BOOLEAN
+	 **/
+	BSON.BSON_DATA_BOOLEAN = 8;
+	/**
+	 * Date BSON Type
+	 *
+	 * @classconstant BSON_DATA_DATE
+	 **/
+	BSON.BSON_DATA_DATE = 9;
+	/**
+	 * null BSON Type
+	 *
+	 * @classconstant BSON_DATA_NULL
+	 **/
+	BSON.BSON_DATA_NULL = 10;
+	/**
+	 * RegExp BSON Type
+	 *
+	 * @classconstant BSON_DATA_REGEXP
+	 **/
+	BSON.BSON_DATA_REGEXP = 11;
+	/**
+	 * Code BSON Type
+	 *
+	 * @classconstant BSON_DATA_CODE
+	 **/
+	BSON.BSON_DATA_CODE = 13;
+	/**
+	 * Symbol BSON Type
+	 *
+	 * @classconstant BSON_DATA_SYMBOL
+	 **/
+	BSON.BSON_DATA_SYMBOL = 14;
+	/**
+	 * Code with Scope BSON Type
+	 *
+	 * @classconstant BSON_DATA_CODE_W_SCOPE
+	 **/
+	BSON.BSON_DATA_CODE_W_SCOPE = 15;
+	/**
+	 * 32 bit Integer BSON Type
+	 *
+	 * @classconstant BSON_DATA_INT
+	 **/
+	BSON.BSON_DATA_INT = 16;
+	/**
+	 * Timestamp BSON Type
+	 *
+	 * @classconstant BSON_DATA_TIMESTAMP
+	 **/
+	BSON.BSON_DATA_TIMESTAMP = 17;
+	/**
+	 * Long BSON Type
+	 *
+	 * @classconstant BSON_DATA_LONG
+	 **/
+	BSON.BSON_DATA_LONG = 18;
+	/**
+	 * MinKey BSON Type
+	 *
+	 * @classconstant BSON_DATA_MIN_KEY
+	 **/
+	BSON.BSON_DATA_MIN_KEY = 0xff;
+	/**
+	 * MaxKey BSON Type
+	 *
+	 * @classconstant BSON_DATA_MAX_KEY
+	 **/
+	BSON.BSON_DATA_MAX_KEY = 0x7f;
+
+	/**
+	 * Binary Default Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
+	/**
+	 * Binary Function Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
+	/**
+	 * Binary Byte Array Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
+	/**
+	 * Binary UUID Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_UUID
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_UUID = 3;
+	/**
+	 * Binary MD5 Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_MD5
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
+	/**
+	 * Binary User Defined Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
+
+	// Return BSON
+	module.exports = BSON;
+	module.exports.Code = Code;
+	module.exports.Map = Map;
+	module.exports.Symbol = Symbol;
+	module.exports.BSON = BSON;
+	module.exports.DBRef = DBRef;
+	module.exports.Binary = Binary;
+	module.exports.ObjectID = ObjectID;
+	module.exports.Long = Long;
+	module.exports.Timestamp = Timestamp;
+	module.exports.Double = Double;
+	module.exports.Int32 = Int32;
+	module.exports.MinKey = MinKey;
+	module.exports.MaxKey = MaxKey;
+	module.exports.BSONRegExp = BSONRegExp;
+	module.exports.Decimal128 = Decimal128;
+
+/***/ }),
+/* 334 */
+/***/ (function(module, exports) {
+
+	/* WEBPACK VAR INJECTION */(function(global) {'use strict';
+
+	// We have an ES6 Map available, return the native instance
+
+	if (typeof global.Map !== 'undefined') {
+	  module.exports = global.Map;
+	  module.exports.Map = global.Map;
+	} else {
+	  // We will return a polyfill
+	  var Map = function (array) {
+	    this._keys = [];
+	    this._values = {};
+
+	    for (var i = 0; i < array.length; i++) {
+	      if (array[i] == null) continue; // skip null and undefined
+	      var entry = array[i];
+	      var key = entry[0];
+	      var value = entry[1];
+	      // Add the key to the list of keys in order
+	      this._keys.push(key);
+	      // Add the key and value to the values dictionary with a point
+	      // to the location in the ordered keys list
+	      this._values[key] = { v: value, i: this._keys.length - 1 };
+	    }
+	  };
+
+	  Map.prototype.clear = function () {
+	    this._keys = [];
+	    this._values = {};
+	  };
+
+	  Map.prototype.delete = function (key) {
+	    var value = this._values[key];
+	    if (value == null) return false;
+	    // Delete entry
+	    delete this._values[key];
+	    // Remove the key from the ordered keys list
+	    this._keys.splice(value.i, 1);
+	    return true;
+	  };
+
+	  Map.prototype.entries = function () {
+	    var self = this;
+	    var index = 0;
+
+	    return {
+	      next: function () {
+	        var key = self._keys[index++];
+	        return {
+	          value: key !== undefined ? [key, self._values[key].v] : undefined,
+	          done: key !== undefined ? false : true
+	        };
+	      }
+	    };
+	  };
+
+	  Map.prototype.forEach = function (callback, self) {
+	    self = self || this;
+
+	    for (var i = 0; i < this._keys.length; i++) {
+	      var key = this._keys[i];
+	      // Call the forEach callback
+	      callback.call(self, this._values[key].v, key, self);
+	    }
+	  };
+
+	  Map.prototype.get = function (key) {
+	    return this._values[key] ? this._values[key].v : undefined;
+	  };
+
+	  Map.prototype.has = function (key) {
+	    return this._values[key] != null;
+	  };
+
+	  Map.prototype.keys = function () {
+	    var self = this;
+	    var index = 0;
+
+	    return {
+	      next: function () {
+	        var key = self._keys[index++];
+	        return {
+	          value: key !== undefined ? key : undefined,
+	          done: key !== undefined ? false : true
+	        };
+	      }
+	    };
+	  };
+
+	  Map.prototype.set = function (key, value) {
+	    if (this._values[key]) {
+	      this._values[key].v = value;
+	      return this;
+	    }
+
+	    // Add the key to the list of keys in order
+	    this._keys.push(key);
+	    // Add the key and value to the values dictionary with a point
+	    // to the location in the ordered keys list
+	    this._values[key] = { v: value, i: this._keys.length - 1 };
+	    return this;
+	  };
+
+	  Map.prototype.values = function () {
+	    var self = this;
+	    var index = 0;
+
+	    return {
+	      next: function () {
+	        var key = self._keys[index++];
+	        return {
+	          value: key !== undefined ? self._values[key].v : undefined,
+	          done: key !== undefined ? false : true
+	        };
+	      }
+	    };
+	  };
+
+	  // Last ismaster
+	  Object.defineProperty(Map.prototype, 'size', {
+	    enumerable: true,
+	    get: function () {
+	      return this._keys.length;
+	    }
+	  });
+
+	  module.exports = Map;
+	  module.exports.Map = Map;
+	}
+	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ }),
+/* 335 */
+/***/ (function(module, exports) {
+
+	// Licensed under the Apache License, Version 2.0 (the "License");
+	// you may not use this file except in compliance with the License.
+	// You may obtain a copy of the License at
+	//
+	//     http://www.apache.org/licenses/LICENSE-2.0
+	//
+	// Unless required by applicable law or agreed to in writing, software
+	// distributed under the License is distributed on an "AS IS" BASIS,
+	// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	// See the License for the specific language governing permissions and
+	// limitations under the License.
+	//
+	// Copyright 2009 Google Inc. All Rights Reserved
+
+	/**
+	 * Defines a Long class for representing a 64-bit two's-complement
+	 * integer value, which faithfully simulates the behavior of a Java "Long". This
+	 * implementation is derived from LongLib in GWT.
+	 *
+	 * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
+	 * values as *signed* integers.  See the from* functions below for more
+	 * convenient ways of constructing Longs.
+	 *
+	 * The internal representation of a Long is the two given signed, 32-bit values.
+	 * We use 32-bit pieces because these are the size of integers on which
+	 * Javascript performs bit-operations.  For operations like addition and
+	 * multiplication, we split each number into 16-bit pieces, which can easily be
+	 * multiplied within Javascript's floating-point representation without overflow
+	 * or change in sign.
+	 *
+	 * In the algorithms below, we frequently reduce the negative case to the
+	 * positive case by negating the input(s) and then post-processing the result.
+	 * Note that we must ALWAYS check specially whether those values are MIN_VALUE
+	 * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
+	 * a positive number, it overflows back into a negative).  Not handling this
+	 * case would often result in infinite recursion.
+	 *
+	 * @class
+	 * @param {number} low  the low (signed) 32 bits of the Long.
+	 * @param {number} high the high (signed) 32 bits of the Long.
+	 * @return {Long}
+	 */
+	function Long(low, high) {
+	  if (!(this instanceof Long)) return new Long(low, high);
+
+	  this._bsontype = 'Long';
+	  /**
+	   * @type {number}
+	   * @ignore
+	   */
+	  this.low_ = low | 0; // force into 32 signed bits.
+
+	  /**
+	   * @type {number}
+	   * @ignore
+	   */
+	  this.high_ = high | 0; // force into 32 signed bits.
+	}
+
+	/**
+	 * Return the int value.
+	 *
+	 * @method
+	 * @return {number} the value, assuming it is a 32-bit integer.
+	 */
+	Long.prototype.toInt = function () {
+	  return this.low_;
+	};
+
+	/**
+	 * Return the Number value.
+	 *
+	 * @method
+	 * @return {number} the closest floating-point representation to this value.
+	 */
+	Long.prototype.toNumber = function () {
+	  return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
+	};
+
+	/**
+	 * Return the JSON value.
+	 *
+	 * @method
+	 * @return {string} the JSON representation.
+	 */
+	Long.prototype.toJSON = function () {
+	  return this.toString();
+	};
+
+	/**
+	 * Return the String value.
+	 *
+	 * @method
+	 * @param {number} [opt_radix] the radix in which the text should be written.
+	 * @return {string} the textual representation of this value.
+	 */
+	Long.prototype.toString = function (opt_radix) {
+	  var radix = opt_radix || 10;
+	  if (radix < 2 || 36 < radix) {
+	    throw Error('radix out of range: ' + radix);
+	  }
+
+	  if (this.isZero()) {
+	    return '0';
+	  }
+
+	  if (this.isNegative()) {
+	    if (this.equals(Long.MIN_VALUE)) {
+	      // We need to change the Long value before it can be negated, so we remove
+	      // the bottom-most digit in this base and then recurse to do the rest.
+	      var radixLong = Long.fromNumber(radix);
+	      var div = this.div(radixLong);
+	      var rem = div.multiply(radixLong).subtract(this);
+	      return div.toString(radix) + rem.toInt().toString(radix);
+	    } else {
+	      return '-' + this.negate().toString(radix);
+	    }
+	  }
+
+	  // Do several (6) digits each time through the loop, so as to
+	  // minimize the calls to the very expensive emulated div.
+	  var radixToPower = Long.fromNumber(Math.pow(radix, 6));
+
+	  rem = this;
+	  var result = '';
+
+	  while (!rem.isZero()) {
+	    var remDiv = rem.div(radixToPower);
+	    var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
+	    var digits = intval.toString(radix);
+
+	    rem = remDiv;
+	    if (rem.isZero()) {
+	      return digits + result;
+	    } else {
+	      while (digits.length < 6) {
+	        digits = '0' + digits;
+	      }
+	      result = '' + digits + result;
+	    }
+	  }
+	};
+
+	/**
+	 * Return the high 32-bits value.
+	 *
+	 * @method
+	 * @return {number} the high 32-bits as a signed value.
+	 */
+	Long.prototype.getHighBits = function () {
+	  return this.high_;
+	};
+
+	/**
+	 * Return the low 32-bits value.
+	 *
+	 * @method
+	 * @return {number} the low 32-bits as a signed value.
+	 */
+	Long.prototype.getLowBits = function () {
+	  return this.low_;
+	};
+
+	/**
+	 * Return the low unsigned 32-bits value.
+	 *
+	 * @method
+	 * @return {number} the low 32-bits as an unsigned value.
+	 */
+	Long.prototype.getLowBitsUnsigned = function () {
+	  return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
+	};
+
+	/**
+	 * Returns the number of bits needed to represent the absolute value of this Long.
+	 *
+	 * @method
+	 * @return {number} Returns the number of bits needed to represent the absolute value of this Long.
+	 */
+	Long.prototype.getNumBitsAbs = function () {
+	  if (this.isNegative()) {
+	    if (this.equals(Long.MIN_VALUE)) {
+	      return 64;
+	    } else {
+	      return this.negate().getNumBitsAbs();
+	    }
+	  } else {
+	    var val = this.high_ !== 0 ? this.high_ : this.low_;
+	    for (var bit = 31; bit > 0; bit--) {
+	      if ((val & 1 << bit) !== 0) {
+	        break;
+	      }
+	    }
+	    return this.high_ !== 0 ? bit + 33 : bit + 1;
+	  }
+	};
+
+	/**
+	 * Return whether this value is zero.
+	 *
+	 * @method
+	 * @return {boolean} whether this value is zero.
+	 */
+	Long.prototype.isZero = function () {
+	  return this.high_ === 0 && this.low_ === 0;
+	};
+
+	/**
+	 * Return whether this value is negative.
+	 *
+	 * @method
+	 * @return {boolean} whether this value is negative.
+	 */
+	Long.prototype.isNegative = function () {
+	  return this.high_ < 0;
+	};
+
+	/**
+	 * Return whether this value is odd.
+	 *
+	 * @method
+	 * @return {boolean} whether this value is odd.
+	 */
+	Long.prototype.isOdd = function () {
+	  return (this.low_ & 1) === 1;
+	};
+
+	/**
+	 * Return whether this Long equals the other
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} whether this Long equals the other
+	 */
+	Long.prototype.equals = function (other) {
+	  return this.high_ === other.high_ && this.low_ === other.low_;
+	};
+
+	/**
+	 * Return whether this Long does not equal the other.
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} whether this Long does not equal the other.
+	 */
+	Long.prototype.notEquals = function (other) {
+	  return this.high_ !== other.high_ || this.low_ !== other.low_;
+	};
+
+	/**
+	 * Return whether this Long is less than the other.
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} whether this Long is less than the other.
+	 */
+	Long.prototype.lessThan = function (other) {
+	  return this.compare(other) < 0;
+	};
+
+	/**
+	 * Return whether this Long is less than or equal to the other.
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} whether this Long is less than or equal to the other.
+	 */
+	Long.prototype.lessThanOrEqual = function (other) {
+	  return this.compare(other) <= 0;
+	};
+
+	/**
+	 * Return whether this Long is greater than the other.
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} whether this Long is greater than the other.
+	 */
+	Long.prototype.greaterThan = function (other) {
+	  return this.compare(other) > 0;
+	};
+
+	/**
+	 * Return whether this Long is greater than or equal to the other.
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} whether this Long is greater than or equal to the other.
+	 */
+	Long.prototype.greaterThanOrEqual = function (other) {
+	  return this.compare(other) >= 0;
+	};
+
+	/**
+	 * Compares this Long with the given one.
+	 *
+	 * @method
+	 * @param {Long} other Long to compare against.
+	 * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
+	 */
+	Long.prototype.compare = function (other) {
+	  if (this.equals(other)) {
+	    return 0;
+	  }
+
+	  var thisNeg = this.isNegative();
+	  var otherNeg = other.isNegative();
+	  if (thisNeg && !otherNeg) {
+	    return -1;
+	  }
+	  if (!thisNeg && otherNeg) {
+	    return 1;
+	  }
+
+	  // at this point, the signs are the same, so subtraction will not overflow
+	  if (this.subtract(other).isNegative()) {
+	    return -1;
+	  } else {
+	    return 1;
+	  }
+	};
+
+	/**
+	 * The negation of this value.
+	 *
+	 * @method
+	 * @return {Long} the negation of this value.
+	 */
+	Long.prototype.negate = function () {
+	  if (this.equals(Long.MIN_VALUE)) {
+	    return Long.MIN_VALUE;
+	  } else {
+	    return this.not().add(Long.ONE);
+	  }
+	};
+
+	/**
+	 * Returns the sum of this and the given Long.
+	 *
+	 * @method
+	 * @param {Long} other Long to add to this one.
+	 * @return {Long} the sum of this and the given Long.
+	 */
+	Long.prototype.add = function (other) {
+	  // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
+
+	  var a48 = this.high_ >>> 16;
+	  var a32 = this.high_ & 0xffff;
+	  var a16 = this.low_ >>> 16;
+	  var a00 = this.low_ & 0xffff;
+
+	  var b48 = other.high_ >>> 16;
+	  var b32 = other.high_ & 0xffff;
+	  var b16 = other.low_ >>> 16;
+	  var b00 = other.low_ & 0xffff;
+
+	  var c48 = 0,
+	      c32 = 0,
+	      c16 = 0,
+	      c00 = 0;
+	  c00 += a00 + b00;
+	  c16 += c00 >>> 16;
+	  c00 &= 0xffff;
+	  c16 += a16 + b16;
+	  c32 += c16 >>> 16;
+	  c16 &= 0xffff;
+	  c32 += a32 + b32;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c48 += a48 + b48;
+	  c48 &= 0xffff;
+	  return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
+	};
+
+	/**
+	 * Returns the difference of this and the given Long.
+	 *
+	 * @method
+	 * @param {Long} other Long to subtract from this.
+	 * @return {Long} the difference of this and the given Long.
+	 */
+	Long.prototype.subtract = function (other) {
+	  return this.add(other.negate());
+	};
+
+	/**
+	 * Returns the product of this and the given Long.
+	 *
+	 * @method
+	 * @param {Long} other Long to multiply with this.
+	 * @return {Long} the product of this and the other.
+	 */
+	Long.prototype.multiply = function (other) {
+	  if (this.isZero()) {
+	    return Long.ZERO;
+	  } else if (other.isZero()) {
+	    return Long.ZERO;
+	  }
+
+	  if (this.equals(Long.MIN_VALUE)) {
+	    return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
+	  } else if (other.equals(Long.MIN_VALUE)) {
+	    return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
+	  }
+
+	  if (this.isNegative()) {
+	    if (other.isNegative()) {
+	      return this.negate().multiply(other.negate());
+	    } else {
+	      return this.negate().multiply(other).negate();
+	    }
+	  } else if (other.isNegative()) {
+	    return this.multiply(other.negate()).negate();
+	  }
+
+	  // If both Longs are small, use float multiplication
+	  if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
+	    return Long.fromNumber(this.toNumber() * other.toNumber());
+	  }
+
+	  // Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
+	  // We can skip products that would overflow.
+
+	  var a48 = this.high_ >>> 16;
+	  var a32 = this.high_ & 0xffff;
+	  var a16 = this.low_ >>> 16;
+	  var a00 = this.low_ & 0xffff;
+
+	  var b48 = other.high_ >>> 16;
+	  var b32 = other.high_ & 0xffff;
+	  var b16 = other.low_ >>> 16;
+	  var b00 = other.low_ & 0xffff;
+
+	  var c48 = 0,
+	      c32 = 0,
+	      c16 = 0,
+	      c00 = 0;
+	  c00 += a00 * b00;
+	  c16 += c00 >>> 16;
+	  c00 &= 0xffff;
+	  c16 += a16 * b00;
+	  c32 += c16 >>> 16;
+	  c16 &= 0xffff;
+	  c16 += a00 * b16;
+	  c32 += c16 >>> 16;
+	  c16 &= 0xffff;
+	  c32 += a32 * b00;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c32 += a16 * b16;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c32 += a00 * b32;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
+	  c48 &= 0xffff;
+	  return Long.fromBits(c16 << 16 | c00, c48 << 16 | c32);
+	};
+
+	/**
+	 * Returns this Long divided by the given one.
+	 *
+	 * @method
+	 * @param {Long} other Long by which to divide.
+	 * @return {Long} this Long divided by the given one.
+	 */
+	Long.prototype.div = function (other) {
+	  if (other.isZero()) {
+	    throw Error('division by zero');
+	  } else if (this.isZero()) {
+	    return Long.ZERO;
+	  }
+
+	  if (this.equals(Long.MIN_VALUE)) {
+	    if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
+	      return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
+	    } else if (other.equals(Long.MIN_VALUE)) {
+	      return Long.ONE;
+	    } else {
+	      // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
+	      var halfThis = this.shiftRight(1);
+	      var approx = halfThis.div(other).shiftLeft(1);
+	      if (approx.equals(Long.ZERO)) {
+	        return other.isNegative() ? Long.ONE : Long.NEG_ONE;
+	      } else {
+	        var rem = this.subtract(other.multiply(approx));
+	        var result = approx.add(rem.div(other));
+	        return result;
+	      }
+	    }
+	  } else if (other.equals(Long.MIN_VALUE)) {
+	    return Long.ZERO;
+	  }
+
+	  if (this.isNegative()) {
+	    if (other.isNegative()) {
+	      return this.negate().div(other.negate());
+	    } else {
+	      return this.negate().div(other).negate();
+	    }
+	  } else if (other.isNegative()) {
+	    return this.div(other.negate()).negate();
+	  }
+
+	  // Repeat the following until the remainder is less than other:  find a
+	  // floating-point that approximates remainder / other *from below*, add this
+	  // into the result, and subtract it from the remainder.  It is critical that
+	  // the approximate value is less than or equal to the real value so that the
+	  // remainder never becomes negative.
+	  var res = Long.ZERO;
+	  rem = this;
+	  while (rem.greaterThanOrEqual(other)) {
+	    // Approximate the result of division. This may be a little greater or
+	    // smaller than the actual value.
+	    approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
+
+	    // We will tweak the approximate result by changing it in the 48-th digit or
+	    // the smallest non-fractional digit, whichever is larger.
+	    var log2 = Math.ceil(Math.log(approx) / Math.LN2);
+	    var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
+
+	    // Decrease the approximation until it is smaller than the remainder.  Note
+	    // that if it is too large, the product overflows and is negative.
+	    var approxRes = Long.fromNumber(approx);
+	    var approxRem = approxRes.multiply(other);
+	    while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
+	      approx -= delta;
+	      approxRes = Long.fromNumber(approx);
+	      approxRem = approxRes.multiply(other);
+	    }
+
+	    // We know the answer can't be zero... and actually, zero would cause
+	    // infinite recursion since we would make no progress.
+	    if (approxRes.isZero()) {
+	      approxRes = Long.ONE;
+	    }
+
+	    res = res.add(approxRes);
+	    rem = rem.subtract(approxRem);
+	  }
+	  return res;
+	};
+
+	/**
+	 * Returns this Long modulo the given one.
+	 *
+	 * @method
+	 * @param {Long} other Long by which to mod.
+	 * @return {Long} this Long modulo the given one.
+	 */
+	Long.prototype.modulo = function (other) {
+	  return this.subtract(this.div(other).multiply(other));
+	};
+
+	/**
+	 * The bitwise-NOT of this value.
+	 *
+	 * @method
+	 * @return {Long} the bitwise-NOT of this value.
+	 */
+	Long.prototype.not = function () {
+	  return Long.fromBits(~this.low_, ~this.high_);
+	};
+
+	/**
+	 * Returns the bitwise-AND of this Long and the given one.
+	 *
+	 * @method
+	 * @param {Long} other the Long with which to AND.
+	 * @return {Long} the bitwise-AND of this and the other.
+	 */
+	Long.prototype.and = function (other) {
+	  return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
+	};
+
+	/**
+	 * Returns the bitwise-OR of this Long and the given one.
+	 *
+	 * @method
+	 * @param {Long} other the Long with which to OR.
+	 * @return {Long} the bitwise-OR of this and the other.
+	 */
+	Long.prototype.or = function (other) {
+	  return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
+	};
+
+	/**
+	 * Returns the bitwise-XOR of this Long and the given one.
+	 *
+	 * @method
+	 * @param {Long} other the Long with which to XOR.
+	 * @return {Long} the bitwise-XOR of this and the other.
+	 */
+	Long.prototype.xor = function (other) {
+	  return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
+	};
+
+	/**
+	 * Returns this Long with bits shifted to the left by the given amount.
+	 *
+	 * @method
+	 * @param {number} numBits the number of bits by which to shift.
+	 * @return {Long} this shifted to the left by the given amount.
+	 */
+	Long.prototype.shiftLeft = function (numBits) {
+	  numBits &= 63;
+	  if (numBits === 0) {
+	    return this;
+	  } else {
+	    var low = this.low_;
+	    if (numBits < 32) {
+	      var high = this.high_;
+	      return Long.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
+	    } else {
+	      return Long.fromBits(0, low << numBits - 32);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns this Long with bits shifted to the right by the given amount.
+	 *
+	 * @method
+	 * @param {number} numBits the number of bits by which to shift.
+	 * @return {Long} this shifted to the right by the given amount.
+	 */
+	Long.prototype.shiftRight = function (numBits) {
+	  numBits &= 63;
+	  if (numBits === 0) {
+	    return this;
+	  } else {
+	    var high = this.high_;
+	    if (numBits < 32) {
+	      var low = this.low_;
+	      return Long.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
+	    } else {
+	      return Long.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
+	 *
+	 * @method
+	 * @param {number} numBits the number of bits by which to shift.
+	 * @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
+	 */
+	Long.prototype.shiftRightUnsigned = function (numBits) {
+	  numBits &= 63;
+	  if (numBits === 0) {
+	    return this;
+	  } else {
+	    var high = this.high_;
+	    if (numBits < 32) {
+	      var low = this.low_;
+	      return Long.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
+	    } else if (numBits === 32) {
+	      return Long.fromBits(high, 0);
+	    } else {
+	      return Long.fromBits(high >>> numBits - 32, 0);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns a Long representing the given (32-bit) integer value.
+	 *
+	 * @method
+	 * @param {number} value the 32-bit integer in question.
+	 * @return {Long} the corresponding Long value.
+	 */
+	Long.fromInt = function (value) {
+	  if (-128 <= value && value < 128) {
+	    var cachedObj = Long.INT_CACHE_[value];
+	    if (cachedObj) {
+	      return cachedObj;
+	    }
+	  }
+
+	  var obj = new Long(value | 0, value < 0 ? -1 : 0);
+	  if (-128 <= value && value < 128) {
+	    Long.INT_CACHE_[value] = obj;
+	  }
+	  return obj;
+	};
+
+	/**
+	 * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
+	 *
+	 * @method
+	 * @param {number} value the number in question.
+	 * @return {Long} the corresponding Long value.
+	 */
+	Long.fromNumber = function (value) {
+	  if (isNaN(value) || !isFinite(value)) {
+	    return Long.ZERO;
+	  } else if (value <= -Long.TWO_PWR_63_DBL_) {
+	    return Long.MIN_VALUE;
+	  } else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
+	    return Long.MAX_VALUE;
+	  } else if (value < 0) {
+	    return Long.fromNumber(-value).negate();
+	  } else {
+	    return new Long(value % Long.TWO_PWR_32_DBL_ | 0, value / Long.TWO_PWR_32_DBL_ | 0);
+	  }
+	};
+
+	/**
+	 * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
+	 *
+	 * @method
+	 * @param {number} lowBits the low 32-bits.
+	 * @param {number} highBits the high 32-bits.
+	 * @return {Long} the corresponding Long value.
+	 */
+	Long.fromBits = function (lowBits, highBits) {
+	  return new Long(lowBits, highBits);
+	};
+
+	/**
+	 * Returns a Long representation of the given string, written using the given radix.
+	 *
+	 * @method
+	 * @param {string} str the textual representation of the Long.
+	 * @param {number} opt_radix the radix in which the text is written.
+	 * @return {Long} the corresponding Long value.
+	 */
+	Long.fromString = function (str, opt_radix) {
+	  if (str.length === 0) {
+	    throw Error('number format error: empty string');
+	  }
+
+	  var radix = opt_radix || 10;
+	  if (radix < 2 || 36 < radix) {
+	    throw Error('radix out of range: ' + radix);
+	  }
+
+	  if (str.charAt(0) === '-') {
+	    return Long.fromString(str.substring(1), radix).negate();
+	  } else if (str.indexOf('-') >= 0) {
+	    throw Error('number format error: interior "-" character: ' + str);
+	  }
+
+	  // Do several (8) digits each time through the loop, so as to
+	  // minimize the calls to the very expensive emulated div.
+	  var radixToPower = Long.fromNumber(Math.pow(radix, 8));
+
+	  var result = Long.ZERO;
+	  for (var i = 0; i < str.length; i += 8) {
+	    var size = Math.min(8, str.length - i);
+	    var value = parseInt(str.substring(i, i + size), radix);
+	    if (size < 8) {
+	      var power = Long.fromNumber(Math.pow(radix, size));
+	      result = result.multiply(power).add(Long.fromNumber(value));
+	    } else {
+	      result = result.multiply(radixToPower);
+	      result = result.add(Long.fromNumber(value));
+	    }
+	  }
+	  return result;
+	};
+
+	// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
+	// from* methods on which they depend.
+
+	/**
+	 * A cache of the Long representations of small integer values.
+	 * @type {Object}
+	 * @ignore
+	 */
+	Long.INT_CACHE_ = {};
+
+	// NOTE: the compiler should inline these constant values below and then remove
+	// these variables, so there should be no runtime penalty for these.
+
+	/**
+	 * Number used repeated below in calculations.  This must appear before the
+	 * first call to any from* function below.
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_16_DBL_ = 1 << 16;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_24_DBL_ = 1 << 24;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
+
+	/** @type {Long} */
+	Long.ZERO = Long.fromInt(0);
+
+	/** @type {Long} */
+	Long.ONE = Long.fromInt(1);
+
+	/** @type {Long} */
+	Long.NEG_ONE = Long.fromInt(-1);
+
+	/** @type {Long} */
+	Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0);
+
+	/** @type {Long} */
+	Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
+
+	/**
+	 * @type {Long}
+	 * @ignore
+	 */
+	Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
+
+	/**
+	 * Expose.
+	 */
+	module.exports = Long;
+	module.exports.Long = Long;
+
+/***/ }),
+/* 336 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of the BSON Double type.
+	 *
+	 * @class
+	 * @param {number} value the number we want to represent as a double.
+	 * @return {Double}
+	 */
+	function Double(value) {
+	  if (!(this instanceof Double)) return new Double(value);
+
+	  this._bsontype = 'Double';
+	  this.value = value;
+	}
+
+	/**
+	 * Access the number value.
+	 *
+	 * @method
+	 * @return {number} returns the wrapped double number.
+	 */
+	Double.prototype.valueOf = function () {
+	  return this.value;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Double.prototype.toJSON = function () {
+	  return this.value;
+	};
+
+	module.exports = Double;
+	module.exports.Double = Double;
+
+/***/ }),
+/* 337 */
+/***/ (function(module, exports) {
+
+	// Licensed under the Apache License, Version 2.0 (the "License");
+	// you may not use this file except in compliance with the License.
+	// You may obtain a copy of the License at
+	//
+	//     http://www.apache.org/licenses/LICENSE-2.0
+	//
+	// Unless required by applicable law or agreed to in writing, software
+	// distributed under the License is distributed on an "AS IS" BASIS,
+	// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	// See the License for the specific language governing permissions and
+	// limitations under the License.
+	//
+	// Copyright 2009 Google Inc. All Rights Reserved
+
+	/**
+	 * This type is for INTERNAL use in MongoDB only and should not be used in applications.
+	 * The appropriate corresponding type is the JavaScript Date type.
+	 * 
+	 * Defines a Timestamp class for representing a 64-bit two's-complement
+	 * integer value, which faithfully simulates the behavior of a Java "Timestamp". This
+	 * implementation is derived from TimestampLib in GWT.
+	 *
+	 * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
+	 * values as *signed* integers.  See the from* functions below for more
+	 * convenient ways of constructing Timestamps.
+	 *
+	 * The internal representation of a Timestamp is the two given signed, 32-bit values.
+	 * We use 32-bit pieces because these are the size of integers on which
+	 * Javascript performs bit-operations.  For operations like addition and
+	 * multiplication, we split each number into 16-bit pieces, which can easily be
+	 * multiplied within Javascript's floating-point representation without overflow
+	 * or change in sign.
+	 *
+	 * In the algorithms below, we frequently reduce the negative case to the
+	 * positive case by negating the input(s) and then post-processing the result.
+	 * Note that we must ALWAYS check specially whether those values are MIN_VALUE
+	 * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
+	 * a positive number, it overflows back into a negative).  Not handling this
+	 * case would often result in infinite recursion.
+	 *
+	 * @class
+	 * @param {number} low  the low (signed) 32 bits of the Timestamp.
+	 * @param {number} high the high (signed) 32 bits of the Timestamp.
+	 */
+	function Timestamp(low, high) {
+	  if (!(this instanceof Timestamp)) return new Timestamp(low, high);
+	  this._bsontype = 'Timestamp';
+	  /**
+	   * @type {number}
+	   * @ignore
+	   */
+	  this.low_ = low | 0; // force into 32 signed bits.
+
+	  /**
+	   * @type {number}
+	   * @ignore
+	   */
+	  this.high_ = high | 0; // force into 32 signed bits.
+	}
+
+	/**
+	 * Return the int value.
+	 *
+	 * @return {number} the value, assuming it is a 32-bit integer.
+	 */
+	Timestamp.prototype.toInt = function () {
+	  return this.low_;
+	};
+
+	/**
+	 * Return the Number value.
+	 *
+	 * @method
+	 * @return {number} the closest floating-point representation to this value.
+	 */
+	Timestamp.prototype.toNumber = function () {
+	  return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
+	};
+
+	/**
+	 * Return the JSON value.
+	 *
+	 * @method
+	 * @return {string} the JSON representation.
+	 */
+	Timestamp.prototype.toJSON = function () {
+	  return this.toString();
+	};
+
+	/**
+	 * Return the String value.
+	 *
+	 * @method
+	 * @param {number} [opt_radix] the radix in which the text should be written.
+	 * @return {string} the textual representation of this value.
+	 */
+	Timestamp.prototype.toString = function (opt_radix) {
+	  var radix = opt_radix || 10;
+	  if (radix < 2 || 36 < radix) {
+	    throw Error('radix out of range: ' + radix);
+	  }
+
+	  if (this.isZero()) {
+	    return '0';
+	  }
+
+	  if (this.isNegative()) {
+	    if (this.equals(Timestamp.MIN_VALUE)) {
+	      // We need to change the Timestamp value before it can be negated, so we remove
+	      // the bottom-most digit in this base and then recurse to do the rest.
+	      var radixTimestamp = Timestamp.fromNumber(radix);
+	      var div = this.div(radixTimestamp);
+	      var rem = div.multiply(radixTimestamp).subtract(this);
+	      return div.toString(radix) + rem.toInt().toString(radix);
+	    } else {
+	      return '-' + this.negate().toString(radix);
+	    }
+	  }
+
+	  // Do several (6) digits each time through the loop, so as to
+	  // minimize the calls to the very expensive emulated div.
+	  var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
+
+	  rem = this;
+	  var result = '';
+
+	  while (!rem.isZero()) {
+	    var remDiv = rem.div(radixToPower);
+	    var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
+	    var digits = intval.toString(radix);
+
+	    rem = remDiv;
+	    if (rem.isZero()) {
+	      return digits + result;
+	    } else {
+	      while (digits.length < 6) {
+	        digits = '0' + digits;
+	      }
+	      result = '' + digits + result;
+	    }
+	  }
+	};
+
+	/**
+	 * Return the high 32-bits value.
+	 *
+	 * @method
+	 * @return {number} the high 32-bits as a signed value.
+	 */
+	Timestamp.prototype.getHighBits = function () {
+	  return this.high_;
+	};
+
+	/**
+	 * Return the low 32-bits value.
+	 *
+	 * @method
+	 * @return {number} the low 32-bits as a signed value.
+	 */
+	Timestamp.prototype.getLowBits = function () {
+	  return this.low_;
+	};
+
+	/**
+	 * Return the low unsigned 32-bits value.
+	 *
+	 * @method
+	 * @return {number} the low 32-bits as an unsigned value.
+	 */
+	Timestamp.prototype.getLowBitsUnsigned = function () {
+	  return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
+	};
+
+	/**
+	 * Returns the number of bits needed to represent the absolute value of this Timestamp.
+	 *
+	 * @method
+	 * @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
+	 */
+	Timestamp.prototype.getNumBitsAbs = function () {
+	  if (this.isNegative()) {
+	    if (this.equals(Timestamp.MIN_VALUE)) {
+	      return 64;
+	    } else {
+	      return this.negate().getNumBitsAbs();
+	    }
+	  } else {
+	    var val = this.high_ !== 0 ? this.high_ : this.low_;
+	    for (var bit = 31; bit > 0; bit--) {
+	      if ((val & 1 << bit) !== 0) {
+	        break;
+	      }
+	    }
+	    return this.high_ !== 0 ? bit + 33 : bit + 1;
+	  }
+	};
+
+	/**
+	 * Return whether this value is zero.
+	 *
+	 * @method
+	 * @return {boolean} whether this value is zero.
+	 */
+	Timestamp.prototype.isZero = function () {
+	  return this.high_ === 0 && this.low_ === 0;
+	};
+
+	/**
+	 * Return whether this value is negative.
+	 *
+	 * @method
+	 * @return {boolean} whether this value is negative.
+	 */
+	Timestamp.prototype.isNegative = function () {
+	  return this.high_ < 0;
+	};
+
+	/**
+	 * Return whether this value is odd.
+	 *
+	 * @method
+	 * @return {boolean} whether this value is odd.
+	 */
+	Timestamp.prototype.isOdd = function () {
+	  return (this.low_ & 1) === 1;
+	};
+
+	/**
+	 * Return whether this Timestamp equals the other
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} whether this Timestamp equals the other
+	 */
+	Timestamp.prototype.equals = function (other) {
+	  return this.high_ === other.high_ && this.low_ === other.low_;
+	};
+
+	/**
+	 * Return whether this Timestamp does not equal the other.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} whether this Timestamp does not equal the other.
+	 */
+	Timestamp.prototype.notEquals = function (other) {
+	  return this.high_ !== other.high_ || this.low_ !== other.low_;
+	};
+
+	/**
+	 * Return whether this Timestamp is less than the other.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} whether this Timestamp is less than the other.
+	 */
+	Timestamp.prototype.lessThan = function (other) {
+	  return this.compare(other) < 0;
+	};
+
+	/**
+	 * Return whether this Timestamp is less than or equal to the other.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} whether this Timestamp is less than or equal to the other.
+	 */
+	Timestamp.prototype.lessThanOrEqual = function (other) {
+	  return this.compare(other) <= 0;
+	};
+
+	/**
+	 * Return whether this Timestamp is greater than the other.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} whether this Timestamp is greater than the other.
+	 */
+	Timestamp.prototype.greaterThan = function (other) {
+	  return this.compare(other) > 0;
+	};
+
+	/**
+	 * Return whether this Timestamp is greater than or equal to the other.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} whether this Timestamp is greater than or equal to the other.
+	 */
+	Timestamp.prototype.greaterThanOrEqual = function (other) {
+	  return this.compare(other) >= 0;
+	};
+
+	/**
+	 * Compares this Timestamp with the given one.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to compare against.
+	 * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
+	 */
+	Timestamp.prototype.compare = function (other) {
+	  if (this.equals(other)) {
+	    return 0;
+	  }
+
+	  var thisNeg = this.isNegative();
+	  var otherNeg = other.isNegative();
+	  if (thisNeg && !otherNeg) {
+	    return -1;
+	  }
+	  if (!thisNeg && otherNeg) {
+	    return 1;
+	  }
+
+	  // at this point, the signs are the same, so subtraction will not overflow
+	  if (this.subtract(other).isNegative()) {
+	    return -1;
+	  } else {
+	    return 1;
+	  }
+	};
+
+	/**
+	 * The negation of this value.
+	 *
+	 * @method
+	 * @return {Timestamp} the negation of this value.
+	 */
+	Timestamp.prototype.negate = function () {
+	  if (this.equals(Timestamp.MIN_VALUE)) {
+	    return Timestamp.MIN_VALUE;
+	  } else {
+	    return this.not().add(Timestamp.ONE);
+	  }
+	};
+
+	/**
+	 * Returns the sum of this and the given Timestamp.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to add to this one.
+	 * @return {Timestamp} the sum of this and the given Timestamp.
+	 */
+	Timestamp.prototype.add = function (other) {
+	  // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
+
+	  var a48 = this.high_ >>> 16;
+	  var a32 = this.high_ & 0xffff;
+	  var a16 = this.low_ >>> 16;
+	  var a00 = this.low_ & 0xffff;
+
+	  var b48 = other.high_ >>> 16;
+	  var b32 = other.high_ & 0xffff;
+	  var b16 = other.low_ >>> 16;
+	  var b00 = other.low_ & 0xffff;
+
+	  var c48 = 0,
+	      c32 = 0,
+	      c16 = 0,
+	      c00 = 0;
+	  c00 += a00 + b00;
+	  c16 += c00 >>> 16;
+	  c00 &= 0xffff;
+	  c16 += a16 + b16;
+	  c32 += c16 >>> 16;
+	  c16 &= 0xffff;
+	  c32 += a32 + b32;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c48 += a48 + b48;
+	  c48 &= 0xffff;
+	  return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
+	};
+
+	/**
+	 * Returns the difference of this and the given Timestamp.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to subtract from this.
+	 * @return {Timestamp} the difference of this and the given Timestamp.
+	 */
+	Timestamp.prototype.subtract = function (other) {
+	  return this.add(other.negate());
+	};
+
+	/**
+	 * Returns the product of this and the given Timestamp.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp to multiply with this.
+	 * @return {Timestamp} the product of this and the other.
+	 */
+	Timestamp.prototype.multiply = function (other) {
+	  if (this.isZero()) {
+	    return Timestamp.ZERO;
+	  } else if (other.isZero()) {
+	    return Timestamp.ZERO;
+	  }
+
+	  if (this.equals(Timestamp.MIN_VALUE)) {
+	    return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
+	  } else if (other.equals(Timestamp.MIN_VALUE)) {
+	    return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
+	  }
+
+	  if (this.isNegative()) {
+	    if (other.isNegative()) {
+	      return this.negate().multiply(other.negate());
+	    } else {
+	      return this.negate().multiply(other).negate();
+	    }
+	  } else if (other.isNegative()) {
+	    return this.multiply(other.negate()).negate();
+	  }
+
+	  // If both Timestamps are small, use float multiplication
+	  if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
+	    return Timestamp.fromNumber(this.toNumber() * other.toNumber());
+	  }
+
+	  // Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
+	  // We can skip products that would overflow.
+
+	  var a48 = this.high_ >>> 16;
+	  var a32 = this.high_ & 0xffff;
+	  var a16 = this.low_ >>> 16;
+	  var a00 = this.low_ & 0xffff;
+
+	  var b48 = other.high_ >>> 16;
+	  var b32 = other.high_ & 0xffff;
+	  var b16 = other.low_ >>> 16;
+	  var b00 = other.low_ & 0xffff;
+
+	  var c48 = 0,
+	      c32 = 0,
+	      c16 = 0,
+	      c00 = 0;
+	  c00 += a00 * b00;
+	  c16 += c00 >>> 16;
+	  c00 &= 0xffff;
+	  c16 += a16 * b00;
+	  c32 += c16 >>> 16;
+	  c16 &= 0xffff;
+	  c16 += a00 * b16;
+	  c32 += c16 >>> 16;
+	  c16 &= 0xffff;
+	  c32 += a32 * b00;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c32 += a16 * b16;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c32 += a00 * b32;
+	  c48 += c32 >>> 16;
+	  c32 &= 0xffff;
+	  c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
+	  c48 &= 0xffff;
+	  return Timestamp.fromBits(c16 << 16 | c00, c48 << 16 | c32);
+	};
+
+	/**
+	 * Returns this Timestamp divided by the given one.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp by which to divide.
+	 * @return {Timestamp} this Timestamp divided by the given one.
+	 */
+	Timestamp.prototype.div = function (other) {
+	  if (other.isZero()) {
+	    throw Error('division by zero');
+	  } else if (this.isZero()) {
+	    return Timestamp.ZERO;
+	  }
+
+	  if (this.equals(Timestamp.MIN_VALUE)) {
+	    if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
+	      return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
+	    } else if (other.equals(Timestamp.MIN_VALUE)) {
+	      return Timestamp.ONE;
+	    } else {
+	      // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
+	      var halfThis = this.shiftRight(1);
+	      var approx = halfThis.div(other).shiftLeft(1);
+	      if (approx.equals(Timestamp.ZERO)) {
+	        return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
+	      } else {
+	        var rem = this.subtract(other.multiply(approx));
+	        var result = approx.add(rem.div(other));
+	        return result;
+	      }
+	    }
+	  } else if (other.equals(Timestamp.MIN_VALUE)) {
+	    return Timestamp.ZERO;
+	  }
+
+	  if (this.isNegative()) {
+	    if (other.isNegative()) {
+	      return this.negate().div(other.negate());
+	    } else {
+	      return this.negate().div(other).negate();
+	    }
+	  } else if (other.isNegative()) {
+	    return this.div(other.negate()).negate();
+	  }
+
+	  // Repeat the following until the remainder is less than other:  find a
+	  // floating-point that approximates remainder / other *from below*, add this
+	  // into the result, and subtract it from the remainder.  It is critical that
+	  // the approximate value is less than or equal to the real value so that the
+	  // remainder never becomes negative.
+	  var res = Timestamp.ZERO;
+	  rem = this;
+	  while (rem.greaterThanOrEqual(other)) {
+	    // Approximate the result of division. This may be a little greater or
+	    // smaller than the actual value.
+	    approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
+
+	    // We will tweak the approximate result by changing it in the 48-th digit or
+	    // the smallest non-fractional digit, whichever is larger.
+	    var log2 = Math.ceil(Math.log(approx) / Math.LN2);
+	    var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
+
+	    // Decrease the approximation until it is smaller than the remainder.  Note
+	    // that if it is too large, the product overflows and is negative.
+	    var approxRes = Timestamp.fromNumber(approx);
+	    var approxRem = approxRes.multiply(other);
+	    while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
+	      approx -= delta;
+	      approxRes = Timestamp.fromNumber(approx);
+	      approxRem = approxRes.multiply(other);
+	    }
+
+	    // We know the answer can't be zero... and actually, zero would cause
+	    // infinite recursion since we would make no progress.
+	    if (approxRes.isZero()) {
+	      approxRes = Timestamp.ONE;
+	    }
+
+	    res = res.add(approxRes);
+	    rem = rem.subtract(approxRem);
+	  }
+	  return res;
+	};
+
+	/**
+	 * Returns this Timestamp modulo the given one.
+	 *
+	 * @method
+	 * @param {Timestamp} other Timestamp by which to mod.
+	 * @return {Timestamp} this Timestamp modulo the given one.
+	 */
+	Timestamp.prototype.modulo = function (other) {
+	  return this.subtract(this.div(other).multiply(other));
+	};
+
+	/**
+	 * The bitwise-NOT of this value.
+	 *
+	 * @method
+	 * @return {Timestamp} the bitwise-NOT of this value.
+	 */
+	Timestamp.prototype.not = function () {
+	  return Timestamp.fromBits(~this.low_, ~this.high_);
+	};
+
+	/**
+	 * Returns the bitwise-AND of this Timestamp and the given one.
+	 *
+	 * @method
+	 * @param {Timestamp} other the Timestamp with which to AND.
+	 * @return {Timestamp} the bitwise-AND of this and the other.
+	 */
+	Timestamp.prototype.and = function (other) {
+	  return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
+	};
+
+	/**
+	 * Returns the bitwise-OR of this Timestamp and the given one.
+	 *
+	 * @method
+	 * @param {Timestamp} other the Timestamp with which to OR.
+	 * @return {Timestamp} the bitwise-OR of this and the other.
+	 */
+	Timestamp.prototype.or = function (other) {
+	  return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
+	};
+
+	/**
+	 * Returns the bitwise-XOR of this Timestamp and the given one.
+	 *
+	 * @method
+	 * @param {Timestamp} other the Timestamp with which to XOR.
+	 * @return {Timestamp} the bitwise-XOR of this and the other.
+	 */
+	Timestamp.prototype.xor = function (other) {
+	  return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
+	};
+
+	/**
+	 * Returns this Timestamp with bits shifted to the left by the given amount.
+	 *
+	 * @method
+	 * @param {number} numBits the number of bits by which to shift.
+	 * @return {Timestamp} this shifted to the left by the given amount.
+	 */
+	Timestamp.prototype.shiftLeft = function (numBits) {
+	  numBits &= 63;
+	  if (numBits === 0) {
+	    return this;
+	  } else {
+	    var low = this.low_;
+	    if (numBits < 32) {
+	      var high = this.high_;
+	      return Timestamp.fromBits(low << numBits, high << numBits | low >>> 32 - numBits);
+	    } else {
+	      return Timestamp.fromBits(0, low << numBits - 32);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns this Timestamp with bits shifted to the right by the given amount.
+	 *
+	 * @method
+	 * @param {number} numBits the number of bits by which to shift.
+	 * @return {Timestamp} this shifted to the right by the given amount.
+	 */
+	Timestamp.prototype.shiftRight = function (numBits) {
+	  numBits &= 63;
+	  if (numBits === 0) {
+	    return this;
+	  } else {
+	    var high = this.high_;
+	    if (numBits < 32) {
+	      var low = this.low_;
+	      return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >> numBits);
+	    } else {
+	      return Timestamp.fromBits(high >> numBits - 32, high >= 0 ? 0 : -1);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
+	 *
+	 * @method
+	 * @param {number} numBits the number of bits by which to shift.
+	 * @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
+	 */
+	Timestamp.prototype.shiftRightUnsigned = function (numBits) {
+	  numBits &= 63;
+	  if (numBits === 0) {
+	    return this;
+	  } else {
+	    var high = this.high_;
+	    if (numBits < 32) {
+	      var low = this.low_;
+	      return Timestamp.fromBits(low >>> numBits | high << 32 - numBits, high >>> numBits);
+	    } else if (numBits === 32) {
+	      return Timestamp.fromBits(high, 0);
+	    } else {
+	      return Timestamp.fromBits(high >>> numBits - 32, 0);
+	    }
+	  }
+	};
+
+	/**
+	 * Returns a Timestamp representing the given (32-bit) integer value.
+	 *
+	 * @method
+	 * @param {number} value the 32-bit integer in question.
+	 * @return {Timestamp} the corresponding Timestamp value.
+	 */
+	Timestamp.fromInt = function (value) {
+	  if (-128 <= value && value < 128) {
+	    var cachedObj = Timestamp.INT_CACHE_[value];
+	    if (cachedObj) {
+	      return cachedObj;
+	    }
+	  }
+
+	  var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
+	  if (-128 <= value && value < 128) {
+	    Timestamp.INT_CACHE_[value] = obj;
+	  }
+	  return obj;
+	};
+
+	/**
+	 * Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
+	 *
+	 * @method
+	 * @param {number} value the number in question.
+	 * @return {Timestamp} the corresponding Timestamp value.
+	 */
+	Timestamp.fromNumber = function (value) {
+	  if (isNaN(value) || !isFinite(value)) {
+	    return Timestamp.ZERO;
+	  } else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
+	    return Timestamp.MIN_VALUE;
+	  } else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
+	    return Timestamp.MAX_VALUE;
+	  } else if (value < 0) {
+	    return Timestamp.fromNumber(-value).negate();
+	  } else {
+	    return new Timestamp(value % Timestamp.TWO_PWR_32_DBL_ | 0, value / Timestamp.TWO_PWR_32_DBL_ | 0);
+	  }
+	};
+
+	/**
+	 * Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
+	 *
+	 * @method
+	 * @param {number} lowBits the low 32-bits.
+	 * @param {number} highBits the high 32-bits.
+	 * @return {Timestamp} the corresponding Timestamp value.
+	 */
+	Timestamp.fromBits = function (lowBits, highBits) {
+	  return new Timestamp(lowBits, highBits);
+	};
+
+	/**
+	 * Returns a Timestamp representation of the given string, written using the given radix.
+	 *
+	 * @method
+	 * @param {string} str the textual representation of the Timestamp.
+	 * @param {number} opt_radix the radix in which the text is written.
+	 * @return {Timestamp} the corresponding Timestamp value.
+	 */
+	Timestamp.fromString = function (str, opt_radix) {
+	  if (str.length === 0) {
+	    throw Error('number format error: empty string');
+	  }
+
+	  var radix = opt_radix || 10;
+	  if (radix < 2 || 36 < radix) {
+	    throw Error('radix out of range: ' + radix);
+	  }
+
+	  if (str.charAt(0) === '-') {
+	    return Timestamp.fromString(str.substring(1), radix).negate();
+	  } else if (str.indexOf('-') >= 0) {
+	    throw Error('number format error: interior "-" character: ' + str);
+	  }
+
+	  // Do several (8) digits each time through the loop, so as to
+	  // minimize the calls to the very expensive emulated div.
+	  var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
+
+	  var result = Timestamp.ZERO;
+	  for (var i = 0; i < str.length; i += 8) {
+	    var size = Math.min(8, str.length - i);
+	    var value = parseInt(str.substring(i, i + size), radix);
+	    if (size < 8) {
+	      var power = Timestamp.fromNumber(Math.pow(radix, size));
+	      result = result.multiply(power).add(Timestamp.fromNumber(value));
+	    } else {
+	      result = result.multiply(radixToPower);
+	      result = result.add(Timestamp.fromNumber(value));
+	    }
+	  }
+	  return result;
+	};
+
+	// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
+	// from* methods on which they depend.
+
+	/**
+	 * A cache of the Timestamp representations of small integer values.
+	 * @type {Object}
+	 * @ignore
+	 */
+	Timestamp.INT_CACHE_ = {};
+
+	// NOTE: the compiler should inline these constant values below and then remove
+	// these variables, so there should be no runtime penalty for these.
+
+	/**
+	 * Number used repeated below in calculations.  This must appear before the
+	 * first call to any from* function below.
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
+
+	/**
+	 * @type {number}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
+
+	/** @type {Timestamp} */
+	Timestamp.ZERO = Timestamp.fromInt(0);
+
+	/** @type {Timestamp} */
+	Timestamp.ONE = Timestamp.fromInt(1);
+
+	/** @type {Timestamp} */
+	Timestamp.NEG_ONE = Timestamp.fromInt(-1);
+
+	/** @type {Timestamp} */
+	Timestamp.MAX_VALUE = Timestamp.fromBits(0xffffffff | 0, 0x7fffffff | 0);
+
+	/** @type {Timestamp} */
+	Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
+
+	/**
+	 * @type {Timestamp}
+	 * @ignore
+	 */
+	Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
+
+	/**
+	 * Expose.
+	 */
+	module.exports = Timestamp;
+	module.exports.Timestamp = Timestamp;
+
+/***/ }),
+/* 338 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(Buffer, process) {// Custom inspect property name / symbol.
+	var inspect = 'inspect';
+
+	var utils = __webpack_require__(344);
+
+	/**
+	 * Machine id.
+	 *
+	 * Create a random 3-byte value (i.e. unique for this
+	 * process). Other drivers use a md5 of the machine id here, but
+	 * that would mean an asyc call to gethostname, so we don't bother.
+	 * @ignore
+	 */
+	var MACHINE_ID = parseInt(Math.random() * 0xffffff, 10);
+
+	// Regular expression that checks for hex value
+	var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
+
+	// Check if buffer exists
+	try {
+	  if (Buffer && Buffer.from) {
+	    var hasBufferType = true;
+	    inspect = __webpack_require__(345).inspect.custom || 'inspect';
+	  }
+	} catch (err) {
+	  hasBufferType = false;
+	}
+
+	/**
+	* Create a new ObjectID instance
+	*
+	* @class
+	* @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
+	* @property {number} generationTime The generation time of this ObjectId instance
+	* @return {ObjectID} instance of ObjectID.
+	*/
+	var ObjectID = function ObjectID(id) {
+	  // Duck-typing to support ObjectId from different npm packages
+	  if (id instanceof ObjectID) return id;
+	  if (!(this instanceof ObjectID)) return new ObjectID(id);
+
+	  this._bsontype = 'ObjectID';
+
+	  // The most common usecase (blank id, new objectId instance)
+	  if (id == null || typeof id === 'number') {
+	    // Generate a new id
+	    this.id = this.generate(id);
+	    // If we are caching the hex string
+	    if (ObjectID.cacheHexString) this.__id = this.toString('hex');
+	    // Return the object
+	    return;
+	  }
+
+	  // Check if the passed in id is valid
+	  var valid = ObjectID.isValid(id);
+
+	  // Throw an error if it's not a valid setup
+	  if (!valid && id != null) {
+	    throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
+	  } else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) {
+	    return new ObjectID(utils.toBuffer(id, 'hex'));
+	  } else if (valid && typeof id === 'string' && id.length === 24) {
+	    return ObjectID.createFromHexString(id);
+	  } else if (id != null && id.length === 12) {
+	    // assume 12 byte string
+	    this.id = id;
+	  } else if (id != null && id.toHexString) {
+	    // Duck-typing to support ObjectId from different npm packages
+	    return id;
+	  } else {
+	    throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
+	  }
+
+	  if (ObjectID.cacheHexString) this.__id = this.toString('hex');
+	};
+
+	// Allow usage of ObjectId as well as ObjectID
+	// var ObjectId = ObjectID;
+
+	// Precomputed hex table enables speedy hex string conversion
+	var hexTable = [];
+	for (var i = 0; i < 256; i++) {
+	  hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
+	}
+
+	/**
+	* Return the ObjectID id as a 24 byte hex string representation
+	*
+	* @method
+	* @return {string} return the 24 byte hex string representation.
+	*/
+	ObjectID.prototype.toHexString = function () {
+	  if (ObjectID.cacheHexString && this.__id) return this.__id;
+
+	  var hexString = '';
+	  if (!this.id || !this.id.length) {
+	    throw new Error('invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' + JSON.stringify(this.id) + ']');
+	  }
+
+	  if (this.id instanceof _Buffer) {
+	    hexString = convertToHex(this.id);
+	    if (ObjectID.cacheHexString) this.__id = hexString;
+	    return hexString;
+	  }
+
+	  for (var i = 0; i < this.id.length; i++) {
+	    hexString += hexTable[this.id.charCodeAt(i)];
+	  }
+
+	  if (ObjectID.cacheHexString) this.__id = hexString;
+	  return hexString;
+	};
+
+	/**
+	* Update the ObjectID index used in generating new ObjectID's on the driver
+	*
+	* @method
+	* @return {number} returns next index value.
+	* @ignore
+	*/
+	ObjectID.prototype.get_inc = function () {
+	  return ObjectID.index = (ObjectID.index + 1) % 0xffffff;
+	};
+
+	/**
+	* Update the ObjectID index used in generating new ObjectID's on the driver
+	*
+	* @method
+	* @return {number} returns next index value.
+	* @ignore
+	*/
+	ObjectID.prototype.getInc = function () {
+	  return this.get_inc();
+	};
+
+	/**
+	* Generate a 12 byte id buffer used in ObjectID's
+	*
+	* @method
+	* @param {number} [time] optional parameter allowing to pass in a second based timestamp.
+	* @return {Buffer} return the 12 byte id buffer string.
+	*/
+	ObjectID.prototype.generate = function (time) {
+	  if ('number' !== typeof time) {
+	    time = ~~(Date.now() / 1000);
+	  }
+
+	  // Use pid
+	  var pid = (typeof process === 'undefined' || process.pid === 1 ? Math.floor(Math.random() * 100000) : process.pid) % 0xffff;
+	  var inc = this.get_inc();
+	  // Buffer used
+	  var buffer = utils.allocBuffer(12);
+	  // Encode time
+	  buffer[3] = time & 0xff;
+	  buffer[2] = time >> 8 & 0xff;
+	  buffer[1] = time >> 16 & 0xff;
+	  buffer[0] = time >> 24 & 0xff;
+	  // Encode machine
+	  buffer[6] = MACHINE_ID & 0xff;
+	  buffer[5] = MACHINE_ID >> 8 & 0xff;
+	  buffer[4] = MACHINE_ID >> 16 & 0xff;
+	  // Encode pid
+	  buffer[8] = pid & 0xff;
+	  buffer[7] = pid >> 8 & 0xff;
+	  // Encode index
+	  buffer[11] = inc & 0xff;
+	  buffer[10] = inc >> 8 & 0xff;
+	  buffer[9] = inc >> 16 & 0xff;
+	  // Return the buffer
+	  return buffer;
+	};
+
+	/**
+	* Converts the id into a 24 byte hex string for printing
+	*
+	* @param {String} format The Buffer toString format parameter.
+	* @return {String} return the 24 byte hex string representation.
+	* @ignore
+	*/
+	ObjectID.prototype.toString = function (format) {
+	  // Is the id a buffer then use the buffer toString method to return the format
+	  if (this.id && this.id.copy) {
+	    return this.id.toString(typeof format === 'string' ? format : 'hex');
+	  }
+
+	  // if(this.buffer )
+	  return this.toHexString();
+	};
+
+	/**
+	* Converts to a string representation of this Id.
+	*
+	* @return {String} return the 24 byte hex string representation.
+	* @ignore
+	*/
+	ObjectID.prototype[inspect] = ObjectID.prototype.toString;
+
+	/**
+	* Converts to its JSON representation.
+	*
+	* @return {String} return the 24 byte hex string representation.
+	* @ignore
+	*/
+	ObjectID.prototype.toJSON = function () {
+	  return this.toHexString();
+	};
+
+	/**
+	* Compares the equality of this ObjectID with `otherID`.
+	*
+	* @method
+	* @param {object} otherID ObjectID instance to compare against.
+	* @return {boolean} the result of comparing two ObjectID's
+	*/
+	ObjectID.prototype.equals = function equals(otherId) {
+	  // var id;
+
+	  if (otherId instanceof ObjectID) {
+	    return this.toString() === otherId.toString();
+	  } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12 && this.id instanceof _Buffer) {
+	    return otherId === this.id.toString('binary');
+	  } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 24) {
+	    return otherId.toLowerCase() === this.toHexString();
+	  } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12) {
+	    return otherId === this.id;
+	  } else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
+	    return otherId.toHexString() === this.toHexString();
+	  } else {
+	    return false;
+	  }
+	};
+
+	/**
+	* Returns the generation date (accurate up to the second) that this ID was generated.
+	*
+	* @method
+	* @return {date} the generation date
+	*/
+	ObjectID.prototype.getTimestamp = function () {
+	  var timestamp = new Date();
+	  var time = this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
+	  timestamp.setTime(Math.floor(time) * 1000);
+	  return timestamp;
+	};
+
+	/**
+	* @ignore
+	*/
+	ObjectID.index = ~~(Math.random() * 0xffffff);
+
+	/**
+	* @ignore
+	*/
+	ObjectID.createPk = function createPk() {
+	  return new ObjectID();
+	};
+
+	/**
+	* Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
+	*
+	* @method
+	* @param {number} time an integer number representing a number of seconds.
+	* @return {ObjectID} return the created ObjectID
+	*/
+	ObjectID.createFromTime = function createFromTime(time) {
+	  var buffer = utils.toBuffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+	  // Encode time into first 4 bytes
+	  buffer[3] = time & 0xff;
+	  buffer[2] = time >> 8 & 0xff;
+	  buffer[1] = time >> 16 & 0xff;
+	  buffer[0] = time >> 24 & 0xff;
+	  // Return the new objectId
+	  return new ObjectID(buffer);
+	};
+
+	// Lookup tables
+	//var encodeLookup = '0123456789abcdef'.split('');
+	var decodeLookup = [];
+	i = 0;
+	while (i < 10) decodeLookup[0x30 + i] = i++;
+	while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
+
+	var _Buffer = Buffer;
+	var convertToHex = function (bytes) {
+	  return bytes.toString('hex');
+	};
+
+	/**
+	* Creates an ObjectID from a hex string representation of an ObjectID.
+	*
+	* @method
+	* @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
+	* @return {ObjectID} return the created ObjectID
+	*/
+	ObjectID.createFromHexString = function createFromHexString(string) {
+	  // Throw an error if it's not a valid setup
+	  if (typeof string === 'undefined' || string != null && string.length !== 24) {
+	    throw new Error('Argument passed in must be a single String of 12 bytes or a string of 24 hex characters');
+	  }
+
+	  // Use Buffer.from method if available
+	  if (hasBufferType) return new ObjectID(utils.toBuffer(string, 'hex'));
+
+	  // Calculate lengths
+	  var array = new _Buffer(12);
+	  var n = 0;
+	  var i = 0;
+
+	  while (i < 24) {
+	    array[n++] = decodeLookup[string.charCodeAt(i++)] << 4 | decodeLookup[string.charCodeAt(i++)];
+	  }
+
+	  return new ObjectID(array);
+	};
+
+	/**
+	* Checks if a value is a valid bson ObjectId
+	*
+	* @method
+	* @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
+	*/
+	ObjectID.isValid = function isValid(id) {
+	  if (id == null) return false;
+
+	  if (typeof id === 'number') {
+	    return true;
+	  }
+
+	  if (typeof id === 'string') {
+	    return id.length === 12 || id.length === 24 && checkForHexRegExp.test(id);
+	  }
+
+	  if (id instanceof ObjectID) {
+	    return true;
+	  }
+
+	  if (id instanceof _Buffer) {
+	    return true;
+	  }
+
+	  // Duck-Typing detection of ObjectId like objects
+	  if (id.toHexString) {
+	    return id.id.length === 12 || id.id.length === 24 && checkForHexRegExp.test(id.id);
+	  }
+
+	  return false;
+	};
+
+	/**
+	* @ignore
+	*/
+	Object.defineProperty(ObjectID.prototype, 'generationTime', {
+	  enumerable: true,
+	  get: function () {
+	    return this.id[3] | this.id[2] << 8 | this.id[1] << 16 | this.id[0] << 24;
+	  },
+	  set: function (value) {
+	    // Encode time into first 4 bytes
+	    this.id[3] = value & 0xff;
+	    this.id[2] = value >> 8 & 0xff;
+	    this.id[1] = value >> 16 & 0xff;
+	    this.id[0] = value >> 24 & 0xff;
+	  }
+	});
+
+	/**
+	 * Expose.
+	 */
+	module.exports = ObjectID;
+	module.exports.ObjectID = ObjectID;
+	module.exports.ObjectId = ObjectID;
+	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer, __webpack_require__(343)))
+
+/***/ }),
+/* 339 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(global) {/*!
+	 * The buffer module from node.js, for the browser.
+	 *
+	 * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+	 * @license  MIT
+	 */
+	/* eslint-disable no-proto */
+
+	'use strict'
+
+	var base64 = __webpack_require__(340)
+	var ieee754 = __webpack_require__(341)
+	var isArray = __webpack_require__(342)
+
+	exports.Buffer = Buffer
+	exports.SlowBuffer = SlowBuffer
+	exports.INSPECT_MAX_BYTES = 50
+
+	/**
+	 * If `Buffer.TYPED_ARRAY_SUPPORT`:
+	 *   === true    Use Uint8Array implementation (fastest)
+	 *   === false   Use Object implementation (most compatible, even IE6)
+	 *
+	 * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
+	 * Opera 11.6+, iOS 4.2+.
+	 *
+	 * Due to various browser bugs, sometimes the Object implementation will be used even
+	 * when the browser supports typed arrays.
+	 *
+	 * Note:
+	 *
+	 *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
+	 *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
+	 *
+	 *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
+	 *
+	 *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
+	 *     incorrect length in some situations.
+
+	 * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
+	 * get the Object implementation, which is slower but behaves correctly.
+	 */
+	Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined
+	  ? global.TYPED_ARRAY_SUPPORT
+	  : typedArraySupport()
+
+	/*
+	 * Export kMaxLength after typed array support is determined.
+	 */
+	exports.kMaxLength = kMaxLength()
+
+	function typedArraySupport () {
+	  try {
+	    var arr = new Uint8Array(1)
+	    arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}
+	    return arr.foo() === 42 && // typed array instances can be augmented
+	        typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
+	        arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`
+	  } catch (e) {
+	    return false
+	  }
+	}
+
+	function kMaxLength () {
+	  return Buffer.TYPED_ARRAY_SUPPORT
+	    ? 0x7fffffff
+	    : 0x3fffffff
+	}
+
+	function createBuffer (that, length) {
+	  if (kMaxLength() < length) {
+	    throw new RangeError('Invalid typed array length')
+	  }
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    // Return an augmented `Uint8Array` instance, for best performance
+	    that = new Uint8Array(length)
+	    that.__proto__ = Buffer.prototype
+	  } else {
+	    // Fallback: Return an object instance of the Buffer class
+	    if (that === null) {
+	      that = new Buffer(length)
+	    }
+	    that.length = length
+	  }
+
+	  return that
+	}
+
+	/**
+	 * The Buffer constructor returns instances of `Uint8Array` that have their
+	 * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
+	 * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
+	 * and the `Uint8Array` methods. Square bracket notation works as expected -- it
+	 * returns a single octet.
+	 *
+	 * The `Uint8Array` prototype remains unmodified.
+	 */
+
+	function Buffer (arg, encodingOrOffset, length) {
+	  if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
+	    return new Buffer(arg, encodingOrOffset, length)
+	  }
+
+	  // Common case.
+	  if (typeof arg === 'number') {
+	    if (typeof encodingOrOffset === 'string') {
+	      throw new Error(
+	        'If encoding is specified then the first argument must be a string'
+	      )
+	    }
+	    return allocUnsafe(this, arg)
+	  }
+	  return from(this, arg, encodingOrOffset, length)
+	}
+
+	Buffer.poolSize = 8192 // not used by this implementation
+
+	// TODO: Legacy, not needed anymore. Remove in next major version.
+	Buffer._augment = function (arr) {
+	  arr.__proto__ = Buffer.prototype
+	  return arr
+	}
+
+	function from (that, value, encodingOrOffset, length) {
+	  if (typeof value === 'number') {
+	    throw new TypeError('"value" argument must not be a number')
+	  }
+
+	  if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
+	    return fromArrayBuffer(that, value, encodingOrOffset, length)
+	  }
+
+	  if (typeof value === 'string') {
+	    return fromString(that, value, encodingOrOffset)
+	  }
+
+	  return fromObject(that, value)
+	}
+
+	/**
+	 * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
+	 * if value is a number.
+	 * Buffer.from(str[, encoding])
+	 * Buffer.from(array)
+	 * Buffer.from(buffer)
+	 * Buffer.from(arrayBuffer[, byteOffset[, length]])
+	 **/
+	Buffer.from = function (value, encodingOrOffset, length) {
+	  return from(null, value, encodingOrOffset, length)
+	}
+
+	if (Buffer.TYPED_ARRAY_SUPPORT) {
+	  Buffer.prototype.__proto__ = Uint8Array.prototype
+	  Buffer.__proto__ = Uint8Array
+	  if (typeof Symbol !== 'undefined' && Symbol.species &&
+	      Buffer[Symbol.species] === Buffer) {
+	    // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
+	    Object.defineProperty(Buffer, Symbol.species, {
+	      value: null,
+	      configurable: true
+	    })
+	  }
+	}
+
+	function assertSize (size) {
+	  if (typeof size !== 'number') {
+	    throw new TypeError('"size" argument must be a number')
+	  } else if (size < 0) {
+	    throw new RangeError('"size" argument must not be negative')
+	  }
+	}
+
+	function alloc (that, size, fill, encoding) {
+	  assertSize(size)
+	  if (size <= 0) {
+	    return createBuffer(that, size)
+	  }
+	  if (fill !== undefined) {
+	    // Only pay attention to encoding if it's a string. This
+	    // prevents accidentally sending in a number that would
+	    // be interpretted as a start offset.
+	    return typeof encoding === 'string'
+	      ? createBuffer(that, size).fill(fill, encoding)
+	      : createBuffer(that, size).fill(fill)
+	  }
+	  return createBuffer(that, size)
+	}
+
+	/**
+	 * Creates a new filled Buffer instance.
+	 * alloc(size[, fill[, encoding]])
+	 **/
+	Buffer.alloc = function (size, fill, encoding) {
+	  return alloc(null, size, fill, encoding)
+	}
+
+	function allocUnsafe (that, size) {
+	  assertSize(size)
+	  that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)
+	  if (!Buffer.TYPED_ARRAY_SUPPORT) {
+	    for (var i = 0; i < size; ++i) {
+	      that[i] = 0
+	    }
+	  }
+	  return that
+	}
+
+	/**
+	 * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
+	 * */
+	Buffer.allocUnsafe = function (size) {
+	  return allocUnsafe(null, size)
+	}
+	/**
+	 * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
+	 */
+	Buffer.allocUnsafeSlow = function (size) {
+	  return allocUnsafe(null, size)
+	}
+
+	function fromString (that, string, encoding) {
+	  if (typeof encoding !== 'string' || encoding === '') {
+	    encoding = 'utf8'
+	  }
+
+	  if (!Buffer.isEncoding(encoding)) {
+	    throw new TypeError('"encoding" must be a valid string encoding')
+	  }
+
+	  var length = byteLength(string, encoding) | 0
+	  that = createBuffer(that, length)
+
+	  var actual = that.write(string, encoding)
+
+	  if (actual !== length) {
+	    // Writing a hex string, for example, that contains invalid characters will
+	    // cause everything after the first invalid character to be ignored. (e.g.
+	    // 'abxxcd' will be treated as 'ab')
+	    that = that.slice(0, actual)
+	  }
+
+	  return that
+	}
+
+	function fromArrayLike (that, array) {
+	  var length = array.length < 0 ? 0 : checked(array.length) | 0
+	  that = createBuffer(that, length)
+	  for (var i = 0; i < length; i += 1) {
+	    that[i] = array[i] & 255
+	  }
+	  return that
+	}
+
+	function fromArrayBuffer (that, array, byteOffset, length) {
+	  array.byteLength // this throws if `array` is not a valid ArrayBuffer
+
+	  if (byteOffset < 0 || array.byteLength < byteOffset) {
+	    throw new RangeError('\'offset\' is out of bounds')
+	  }
+
+	  if (array.byteLength < byteOffset + (length || 0)) {
+	    throw new RangeError('\'length\' is out of bounds')
+	  }
+
+	  if (byteOffset === undefined && length === undefined) {
+	    array = new Uint8Array(array)
+	  } else if (length === undefined) {
+	    array = new Uint8Array(array, byteOffset)
+	  } else {
+	    array = new Uint8Array(array, byteOffset, length)
+	  }
+
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    // Return an augmented `Uint8Array` instance, for best performance
+	    that = array
+	    that.__proto__ = Buffer.prototype
+	  } else {
+	    // Fallback: Return an object instance of the Buffer class
+	    that = fromArrayLike(that, array)
+	  }
+	  return that
+	}
+
+	function fromObject (that, obj) {
+	  if (Buffer.isBuffer(obj)) {
+	    var len = checked(obj.length) | 0
+	    that = createBuffer(that, len)
+
+	    if (that.length === 0) {
+	      return that
+	    }
+
+	    obj.copy(that, 0, 0, len)
+	    return that
+	  }
+
+	  if (obj) {
+	    if ((typeof ArrayBuffer !== 'undefined' &&
+	        obj.buffer instanceof ArrayBuffer) || 'length' in obj) {
+	      if (typeof obj.length !== 'number' || isnan(obj.length)) {
+	        return createBuffer(that, 0)
+	      }
+	      return fromArrayLike(that, obj)
+	    }
+
+	    if (obj.type === 'Buffer' && isArray(obj.data)) {
+	      return fromArrayLike(that, obj.data)
+	    }
+	  }
+
+	  throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
+	}
+
+	function checked (length) {
+	  // Note: cannot use `length < kMaxLength()` here because that fails when
+	  // length is NaN (which is otherwise coerced to zero.)
+	  if (length >= kMaxLength()) {
+	    throw new RangeError('Attempt to allocate Buffer larger than maximum ' +
+	                         'size: 0x' + kMaxLength().toString(16) + ' bytes')
+	  }
+	  return length | 0
+	}
+
+	function SlowBuffer (length) {
+	  if (+length != length) { // eslint-disable-line eqeqeq
+	    length = 0
+	  }
+	  return Buffer.alloc(+length)
+	}
+
+	Buffer.isBuffer = function isBuffer (b) {
+	  return !!(b != null && b._isBuffer)
+	}
+
+	Buffer.compare = function compare (a, b) {
+	  if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
+	    throw new TypeError('Arguments must be Buffers')
+	  }
+
+	  if (a === b) return 0
+
+	  var x = a.length
+	  var y = b.length
+
+	  for (var i = 0, len = Math.min(x, y); i < len; ++i) {
+	    if (a[i] !== b[i]) {
+	      x = a[i]
+	      y = b[i]
+	      break
+	    }
+	  }
+
+	  if (x < y) return -1
+	  if (y < x) return 1
+	  return 0
+	}
+
+	Buffer.isEncoding = function isEncoding (encoding) {
+	  switch (String(encoding).toLowerCase()) {
+	    case 'hex':
+	    case 'utf8':
+	    case 'utf-8':
+	    case 'ascii':
+	    case 'latin1':
+	    case 'binary':
+	    case 'base64':
+	    case 'ucs2':
+	    case 'ucs-2':
+	    case 'utf16le':
+	    case 'utf-16le':
+	      return true
+	    default:
+	      return false
+	  }
+	}
+
+	Buffer.concat = function concat (list, length) {
+	  if (!isArray(list)) {
+	    throw new TypeError('"list" argument must be an Array of Buffers')
+	  }
+
+	  if (list.length === 0) {
+	    return Buffer.alloc(0)
+	  }
+
+	  var i
+	  if (length === undefined) {
+	    length = 0
+	    for (i = 0; i < list.length; ++i) {
+	      length += list[i].length
+	    }
+	  }
+
+	  var buffer = Buffer.allocUnsafe(length)
+	  var pos = 0
+	  for (i = 0; i < list.length; ++i) {
+	    var buf = list[i]
+	    if (!Buffer.isBuffer(buf)) {
+	      throw new TypeError('"list" argument must be an Array of Buffers')
+	    }
+	    buf.copy(buffer, pos)
+	    pos += buf.length
+	  }
+	  return buffer
+	}
+
+	function byteLength (string, encoding) {
+	  if (Buffer.isBuffer(string)) {
+	    return string.length
+	  }
+	  if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&
+	      (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
+	    return string.byteLength
+	  }
+	  if (typeof string !== 'string') {
+	    string = '' + string
+	  }
+
+	  var len = string.length
+	  if (len === 0) return 0
+
+	  // Use a for loop to avoid recursion
+	  var loweredCase = false
+	  for (;;) {
+	    switch (encoding) {
+	      case 'ascii':
+	      case 'latin1':
+	      case 'binary':
+	        return len
+	      case 'utf8':
+	      case 'utf-8':
+	      case undefined:
+	        return utf8ToBytes(string).length
+	      case 'ucs2':
+	      case 'ucs-2':
+	      case 'utf16le':
+	      case 'utf-16le':
+	        return len * 2
+	      case 'hex':
+	        return len >>> 1
+	      case 'base64':
+	        return base64ToBytes(string).length
+	      default:
+	        if (loweredCase) return utf8ToBytes(string).length // assume utf8
+	        encoding = ('' + encoding).toLowerCase()
+	        loweredCase = true
+	    }
+	  }
+	}
+	Buffer.byteLength = byteLength
+
+	function slowToString (encoding, start, end) {
+	  var loweredCase = false
+
+	  // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
+	  // property of a typed array.
+
+	  // This behaves neither like String nor Uint8Array in that we set start/end
+	  // to their upper/lower bounds if the value passed is out of range.
+	  // undefined is handled specially as per ECMA-262 6th Edition,
+	  // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
+	  if (start === undefined || start < 0) {
+	    start = 0
+	  }
+	  // Return early if start > this.length. Done here to prevent potential uint32
+	  // coercion fail below.
+	  if (start > this.length) {
+	    return ''
+	  }
+
+	  if (end === undefined || end > this.length) {
+	    end = this.length
+	  }
+
+	  if (end <= 0) {
+	    return ''
+	  }
+
+	  // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
+	  end >>>= 0
+	  start >>>= 0
+
+	  if (end <= start) {
+	    return ''
+	  }
+
+	  if (!encoding) encoding = 'utf8'
+
+	  while (true) {
+	    switch (encoding) {
+	      case 'hex':
+	        return hexSlice(this, start, end)
+
+	      case 'utf8':
+	      case 'utf-8':
+	        return utf8Slice(this, start, end)
+
+	      case 'ascii':
+	        return asciiSlice(this, start, end)
+
+	      case 'latin1':
+	      case 'binary':
+	        return latin1Slice(this, start, end)
+
+	      case 'base64':
+	        return base64Slice(this, start, end)
+
+	      case 'ucs2':
+	      case 'ucs-2':
+	      case 'utf16le':
+	      case 'utf-16le':
+	        return utf16leSlice(this, start, end)
+
+	      default:
+	        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+	        encoding = (encoding + '').toLowerCase()
+	        loweredCase = true
+	    }
+	  }
+	}
+
+	// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
+	// Buffer instances.
+	Buffer.prototype._isBuffer = true
+
+	function swap (b, n, m) {
+	  var i = b[n]
+	  b[n] = b[m]
+	  b[m] = i
+	}
+
+	Buffer.prototype.swap16 = function swap16 () {
+	  var len = this.length
+	  if (len % 2 !== 0) {
+	    throw new RangeError('Buffer size must be a multiple of 16-bits')
+	  }
+	  for (var i = 0; i < len; i += 2) {
+	    swap(this, i, i + 1)
+	  }
+	  return this
+	}
+
+	Buffer.prototype.swap32 = function swap32 () {
+	  var len = this.length
+	  if (len % 4 !== 0) {
+	    throw new RangeError('Buffer size must be a multiple of 32-bits')
+	  }
+	  for (var i = 0; i < len; i += 4) {
+	    swap(this, i, i + 3)
+	    swap(this, i + 1, i + 2)
+	  }
+	  return this
+	}
+
+	Buffer.prototype.swap64 = function swap64 () {
+	  var len = this.length
+	  if (len % 8 !== 0) {
+	    throw new RangeError('Buffer size must be a multiple of 64-bits')
+	  }
+	  for (var i = 0; i < len; i += 8) {
+	    swap(this, i, i + 7)
+	    swap(this, i + 1, i + 6)
+	    swap(this, i + 2, i + 5)
+	    swap(this, i + 3, i + 4)
+	  }
+	  return this
+	}
+
+	Buffer.prototype.toString = function toString () {
+	  var length = this.length | 0
+	  if (length === 0) return ''
+	  if (arguments.length === 0) return utf8Slice(this, 0, length)
+	  return slowToString.apply(this, arguments)
+	}
+
+	Buffer.prototype.equals = function equals (b) {
+	  if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')
+	  if (this === b) return true
+	  return Buffer.compare(this, b) === 0
+	}
+
+	Buffer.prototype.inspect = function inspect () {
+	  var str = ''
+	  var max = exports.INSPECT_MAX_BYTES
+	  if (this.length > 0) {
+	    str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')
+	    if (this.length > max) str += ' ... '
+	  }
+	  return '<Buffer ' + str + '>'
+	}
+
+	Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {
+	  if (!Buffer.isBuffer(target)) {
+	    throw new TypeError('Argument must be a Buffer')
+	  }
+
+	  if (start === undefined) {
+	    start = 0
+	  }
+	  if (end === undefined) {
+	    end = target ? target.length : 0
+	  }
+	  if (thisStart === undefined) {
+	    thisStart = 0
+	  }
+	  if (thisEnd === undefined) {
+	    thisEnd = this.length
+	  }
+
+	  if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
+	    throw new RangeError('out of range index')
+	  }
+
+	  if (thisStart >= thisEnd && start >= end) {
+	    return 0
+	  }
+	  if (thisStart >= thisEnd) {
+	    return -1
+	  }
+	  if (start >= end) {
+	    return 1
+	  }
+
+	  start >>>= 0
+	  end >>>= 0
+	  thisStart >>>= 0
+	  thisEnd >>>= 0
+
+	  if (this === target) return 0
+
+	  var x = thisEnd - thisStart
+	  var y = end - start
+	  var len = Math.min(x, y)
+
+	  var thisCopy = this.slice(thisStart, thisEnd)
+	  var targetCopy = target.slice(start, end)
+
+	  for (var i = 0; i < len; ++i) {
+	    if (thisCopy[i] !== targetCopy[i]) {
+	      x = thisCopy[i]
+	      y = targetCopy[i]
+	      break
+	    }
+	  }
+
+	  if (x < y) return -1
+	  if (y < x) return 1
+	  return 0
+	}
+
+	// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
+	// OR the last index of `val` in `buffer` at offset <= `byteOffset`.
+	//
+	// Arguments:
+	// - buffer - a Buffer to search
+	// - val - a string, Buffer, or number
+	// - byteOffset - an index into `buffer`; will be clamped to an int32
+	// - encoding - an optional encoding, relevant is val is a string
+	// - dir - true for indexOf, false for lastIndexOf
+	function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {
+	  // Empty buffer means no match
+	  if (buffer.length === 0) return -1
+
+	  // Normalize byteOffset
+	  if (typeof byteOffset === 'string') {
+	    encoding = byteOffset
+	    byteOffset = 0
+	  } else if (byteOffset > 0x7fffffff) {
+	    byteOffset = 0x7fffffff
+	  } else if (byteOffset < -0x80000000) {
+	    byteOffset = -0x80000000
+	  }
+	  byteOffset = +byteOffset  // Coerce to Number.
+	  if (isNaN(byteOffset)) {
+	    // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
+	    byteOffset = dir ? 0 : (buffer.length - 1)
+	  }
+
+	  // Normalize byteOffset: negative offsets start from the end of the buffer
+	  if (byteOffset < 0) byteOffset = buffer.length + byteOffset
+	  if (byteOffset >= buffer.length) {
+	    if (dir) return -1
+	    else byteOffset = buffer.length - 1
+	  } else if (byteOffset < 0) {
+	    if (dir) byteOffset = 0
+	    else return -1
+	  }
+
+	  // Normalize val
+	  if (typeof val === 'string') {
+	    val = Buffer.from(val, encoding)
+	  }
+
+	  // Finally, search either indexOf (if dir is true) or lastIndexOf
+	  if (Buffer.isBuffer(val)) {
+	    // Special case: looking for empty string/buffer always fails
+	    if (val.length === 0) {
+	      return -1
+	    }
+	    return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
+	  } else if (typeof val === 'number') {
+	    val = val & 0xFF // Search for a byte value [0-255]
+	    if (Buffer.TYPED_ARRAY_SUPPORT &&
+	        typeof Uint8Array.prototype.indexOf === 'function') {
+	      if (dir) {
+	        return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
+	      } else {
+	        return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
+	      }
+	    }
+	    return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)
+	  }
+
+	  throw new TypeError('val must be string, number or Buffer')
+	}
+
+	function arrayIndexOf (arr, val, byteOffset, encoding, dir) {
+	  var indexSize = 1
+	  var arrLength = arr.length
+	  var valLength = val.length
+
+	  if (encoding !== undefined) {
+	    encoding = String(encoding).toLowerCase()
+	    if (encoding === 'ucs2' || encoding === 'ucs-2' ||
+	        encoding === 'utf16le' || encoding === 'utf-16le') {
+	      if (arr.length < 2 || val.length < 2) {
+	        return -1
+	      }
+	      indexSize = 2
+	      arrLength /= 2
+	      valLength /= 2
+	      byteOffset /= 2
+	    }
+	  }
+
+	  function read (buf, i) {
+	    if (indexSize === 1) {
+	      return buf[i]
+	    } else {
+	      return buf.readUInt16BE(i * indexSize)
+	    }
+	  }
+
+	  var i
+	  if (dir) {
+	    var foundIndex = -1
+	    for (i = byteOffset; i < arrLength; i++) {
+	      if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
+	        if (foundIndex === -1) foundIndex = i
+	        if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
+	      } else {
+	        if (foundIndex !== -1) i -= i - foundIndex
+	        foundIndex = -1
+	      }
+	    }
+	  } else {
+	    if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength
+	    for (i = byteOffset; i >= 0; i--) {
+	      var found = true
+	      for (var j = 0; j < valLength; j++) {
+	        if (read(arr, i + j) !== read(val, j)) {
+	          found = false
+	          break
+	        }
+	      }
+	      if (found) return i
+	    }
+	  }
+
+	  return -1
+	}
+
+	Buffer.prototype.includes = function includes (val, byteOffset, encoding) {
+	  return this.indexOf(val, byteOffset, encoding) !== -1
+	}
+
+	Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {
+	  return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
+	}
+
+	Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {
+	  return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
+	}
+
+	function hexWrite (buf, string, offset, length) {
+	  offset = Number(offset) || 0
+	  var remaining = buf.length - offset
+	  if (!length) {
+	    length = remaining
+	  } else {
+	    length = Number(length)
+	    if (length > remaining) {
+	      length = remaining
+	    }
+	  }
+
+	  // must be an even number of digits
+	  var strLen = string.length
+	  if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')
+
+	  if (length > strLen / 2) {
+	    length = strLen / 2
+	  }
+	  for (var i = 0; i < length; ++i) {
+	    var parsed = parseInt(string.substr(i * 2, 2), 16)
+	    if (isNaN(parsed)) return i
+	    buf[offset + i] = parsed
+	  }
+	  return i
+	}
+
+	function utf8Write (buf, string, offset, length) {
+	  return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
+	}
+
+	function asciiWrite (buf, string, offset, length) {
+	  return blitBuffer(asciiToBytes(string), buf, offset, length)
+	}
+
+	function latin1Write (buf, string, offset, length) {
+	  return asciiWrite(buf, string, offset, length)
+	}
+
+	function base64Write (buf, string, offset, length) {
+	  return blitBuffer(base64ToBytes(string), buf, offset, length)
+	}
+
+	function ucs2Write (buf, string, offset, length) {
+	  return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
+	}
+
+	Buffer.prototype.write = function write (string, offset, length, encoding) {
+	  // Buffer#write(string)
+	  if (offset === undefined) {
+	    encoding = 'utf8'
+	    length = this.length
+	    offset = 0
+	  // Buffer#write(string, encoding)
+	  } else if (length === undefined && typeof offset === 'string') {
+	    encoding = offset
+	    length = this.length
+	    offset = 0
+	  // Buffer#write(string, offset[, length][, encoding])
+	  } else if (isFinite(offset)) {
+	    offset = offset | 0
+	    if (isFinite(length)) {
+	      length = length | 0
+	      if (encoding === undefined) encoding = 'utf8'
+	    } else {
+	      encoding = length
+	      length = undefined
+	    }
+	  // legacy write(string, encoding, offset, length) - remove in v0.13
+	  } else {
+	    throw new Error(
+	      'Buffer.write(string, encoding, offset[, length]) is no longer supported'
+	    )
+	  }
+
+	  var remaining = this.length - offset
+	  if (length === undefined || length > remaining) length = remaining
+
+	  if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {
+	    throw new RangeError('Attempt to write outside buffer bounds')
+	  }
+
+	  if (!encoding) encoding = 'utf8'
+
+	  var loweredCase = false
+	  for (;;) {
+	    switch (encoding) {
+	      case 'hex':
+	        return hexWrite(this, string, offset, length)
+
+	      case 'utf8':
+	      case 'utf-8':
+	        return utf8Write(this, string, offset, length)
+
+	      case 'ascii':
+	        return asciiWrite(this, string, offset, length)
+
+	      case 'latin1':
+	      case 'binary':
+	        return latin1Write(this, string, offset, length)
+
+	      case 'base64':
+	        // Warning: maxLength not taken into account in base64Write
+	        return base64Write(this, string, offset, length)
+
+	      case 'ucs2':
+	      case 'ucs-2':
+	      case 'utf16le':
+	      case 'utf-16le':
+	        return ucs2Write(this, string, offset, length)
+
+	      default:
+	        if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)
+	        encoding = ('' + encoding).toLowerCase()
+	        loweredCase = true
+	    }
+	  }
+	}
+
+	Buffer.prototype.toJSON = function toJSON () {
+	  return {
+	    type: 'Buffer',
+	    data: Array.prototype.slice.call(this._arr || this, 0)
+	  }
+	}
+
+	function base64Slice (buf, start, end) {
+	  if (start === 0 && end === buf.length) {
+	    return base64.fromByteArray(buf)
+	  } else {
+	    return base64.fromByteArray(buf.slice(start, end))
+	  }
+	}
+
+	function utf8Slice (buf, start, end) {
+	  end = Math.min(buf.length, end)
+	  var res = []
+
+	  var i = start
+	  while (i < end) {
+	    var firstByte = buf[i]
+	    var codePoint = null
+	    var bytesPerSequence = (firstByte > 0xEF) ? 4
+	      : (firstByte > 0xDF) ? 3
+	      : (firstByte > 0xBF) ? 2
+	      : 1
+
+	    if (i + bytesPerSequence <= end) {
+	      var secondByte, thirdByte, fourthByte, tempCodePoint
+
+	      switch (bytesPerSequence) {
+	        case 1:
+	          if (firstByte < 0x80) {
+	            codePoint = firstByte
+	          }
+	          break
+	        case 2:
+	          secondByte = buf[i + 1]
+	          if ((secondByte & 0xC0) === 0x80) {
+	            tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)
+	            if (tempCodePoint > 0x7F) {
+	              codePoint = tempCodePoint
+	            }
+	          }
+	          break
+	        case 3:
+	          secondByte = buf[i + 1]
+	          thirdByte = buf[i + 2]
+	          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
+	            tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)
+	            if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
+	              codePoint = tempCodePoint
+	            }
+	          }
+	          break
+	        case 4:
+	          secondByte = buf[i + 1]
+	          thirdByte = buf[i + 2]
+	          fourthByte = buf[i + 3]
+	          if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
+	            tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)
+	            if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
+	              codePoint = tempCodePoint
+	            }
+	          }
+	      }
+	    }
+
+	    if (codePoint === null) {
+	      // we did not generate a valid codePoint so insert a
+	      // replacement char (U+FFFD) and advance only 1 byte
+	      codePoint = 0xFFFD
+	      bytesPerSequence = 1
+	    } else if (codePoint > 0xFFFF) {
+	      // encode to utf16 (surrogate pair dance)
+	      codePoint -= 0x10000
+	      res.push(codePoint >>> 10 & 0x3FF | 0xD800)
+	      codePoint = 0xDC00 | codePoint & 0x3FF
+	    }
+
+	    res.push(codePoint)
+	    i += bytesPerSequence
+	  }
+
+	  return decodeCodePointsArray(res)
+	}
+
+	// Based on http://stackoverflow.com/a/22747272/680742, the browser with
+	// the lowest limit is Chrome, with 0x10000 args.
+	// We go 1 magnitude less, for safety
+	var MAX_ARGUMENTS_LENGTH = 0x1000
+
+	function decodeCodePointsArray (codePoints) {
+	  var len = codePoints.length
+	  if (len <= MAX_ARGUMENTS_LENGTH) {
+	    return String.fromCharCode.apply(String, codePoints) // avoid extra slice()
+	  }
+
+	  // Decode in chunks to avoid "call stack size exceeded".
+	  var res = ''
+	  var i = 0
+	  while (i < len) {
+	    res += String.fromCharCode.apply(
+	      String,
+	      codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)
+	    )
+	  }
+	  return res
+	}
+
+	function asciiSlice (buf, start, end) {
+	  var ret = ''
+	  end = Math.min(buf.length, end)
+
+	  for (var i = start; i < end; ++i) {
+	    ret += String.fromCharCode(buf[i] & 0x7F)
+	  }
+	  return ret
+	}
+
+	function latin1Slice (buf, start, end) {
+	  var ret = ''
+	  end = Math.min(buf.length, end)
+
+	  for (var i = start; i < end; ++i) {
+	    ret += String.fromCharCode(buf[i])
+	  }
+	  return ret
+	}
+
+	function hexSlice (buf, start, end) {
+	  var len = buf.length
+
+	  if (!start || start < 0) start = 0
+	  if (!end || end < 0 || end > len) end = len
+
+	  var out = ''
+	  for (var i = start; i < end; ++i) {
+	    out += toHex(buf[i])
+	  }
+	  return out
+	}
+
+	function utf16leSlice (buf, start, end) {
+	  var bytes = buf.slice(start, end)
+	  var res = ''
+	  for (var i = 0; i < bytes.length; i += 2) {
+	    res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
+	  }
+	  return res
+	}
+
+	Buffer.prototype.slice = function slice (start, end) {
+	  var len = this.length
+	  start = ~~start
+	  end = end === undefined ? len : ~~end
+
+	  if (start < 0) {
+	    start += len
+	    if (start < 0) start = 0
+	  } else if (start > len) {
+	    start = len
+	  }
+
+	  if (end < 0) {
+	    end += len
+	    if (end < 0) end = 0
+	  } else if (end > len) {
+	    end = len
+	  }
+
+	  if (end < start) end = start
+
+	  var newBuf
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    newBuf = this.subarray(start, end)
+	    newBuf.__proto__ = Buffer.prototype
+	  } else {
+	    var sliceLen = end - start
+	    newBuf = new Buffer(sliceLen, undefined)
+	    for (var i = 0; i < sliceLen; ++i) {
+	      newBuf[i] = this[i + start]
+	    }
+	  }
+
+	  return newBuf
+	}
+
+	/*
+	 * Need to make sure that buffer isn't trying to write out of bounds.
+	 */
+	function checkOffset (offset, ext, length) {
+	  if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')
+	  if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')
+	}
+
+	Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {
+	  offset = offset | 0
+	  byteLength = byteLength | 0
+	  if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+	  var val = this[offset]
+	  var mul = 1
+	  var i = 0
+	  while (++i < byteLength && (mul *= 0x100)) {
+	    val += this[offset + i] * mul
+	  }
+
+	  return val
+	}
+
+	Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {
+	  offset = offset | 0
+	  byteLength = byteLength | 0
+	  if (!noAssert) {
+	    checkOffset(offset, byteLength, this.length)
+	  }
+
+	  var val = this[offset + --byteLength]
+	  var mul = 1
+	  while (byteLength > 0 && (mul *= 0x100)) {
+	    val += this[offset + --byteLength] * mul
+	  }
+
+	  return val
+	}
+
+	Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 1, this.length)
+	  return this[offset]
+	}
+
+	Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 2, this.length)
+	  return this[offset] | (this[offset + 1] << 8)
+	}
+
+	Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 2, this.length)
+	  return (this[offset] << 8) | this[offset + 1]
+	}
+
+	Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 4, this.length)
+
+	  return ((this[offset]) |
+	      (this[offset + 1] << 8) |
+	      (this[offset + 2] << 16)) +
+	      (this[offset + 3] * 0x1000000)
+	}
+
+	Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 4, this.length)
+
+	  return (this[offset] * 0x1000000) +
+	    ((this[offset + 1] << 16) |
+	    (this[offset + 2] << 8) |
+	    this[offset + 3])
+	}
+
+	Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {
+	  offset = offset | 0
+	  byteLength = byteLength | 0
+	  if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+	  var val = this[offset]
+	  var mul = 1
+	  var i = 0
+	  while (++i < byteLength && (mul *= 0x100)) {
+	    val += this[offset + i] * mul
+	  }
+	  mul *= 0x80
+
+	  if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+	  return val
+	}
+
+	Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {
+	  offset = offset | 0
+	  byteLength = byteLength | 0
+	  if (!noAssert) checkOffset(offset, byteLength, this.length)
+
+	  var i = byteLength
+	  var mul = 1
+	  var val = this[offset + --i]
+	  while (i > 0 && (mul *= 0x100)) {
+	    val += this[offset + --i] * mul
+	  }
+	  mul *= 0x80
+
+	  if (val >= mul) val -= Math.pow(2, 8 * byteLength)
+
+	  return val
+	}
+
+	Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 1, this.length)
+	  if (!(this[offset] & 0x80)) return (this[offset])
+	  return ((0xff - this[offset] + 1) * -1)
+	}
+
+	Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 2, this.length)
+	  var val = this[offset] | (this[offset + 1] << 8)
+	  return (val & 0x8000) ? val | 0xFFFF0000 : val
+	}
+
+	Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 2, this.length)
+	  var val = this[offset + 1] | (this[offset] << 8)
+	  return (val & 0x8000) ? val | 0xFFFF0000 : val
+	}
+
+	Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 4, this.length)
+
+	  return (this[offset]) |
+	    (this[offset + 1] << 8) |
+	    (this[offset + 2] << 16) |
+	    (this[offset + 3] << 24)
+	}
+
+	Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 4, this.length)
+
+	  return (this[offset] << 24) |
+	    (this[offset + 1] << 16) |
+	    (this[offset + 2] << 8) |
+	    (this[offset + 3])
+	}
+
+	Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 4, this.length)
+	  return ieee754.read(this, offset, true, 23, 4)
+	}
+
+	Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 4, this.length)
+	  return ieee754.read(this, offset, false, 23, 4)
+	}
+
+	Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 8, this.length)
+	  return ieee754.read(this, offset, true, 52, 8)
+	}
+
+	Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {
+	  if (!noAssert) checkOffset(offset, 8, this.length)
+	  return ieee754.read(this, offset, false, 52, 8)
+	}
+
+	function checkInt (buf, value, offset, ext, max, min) {
+	  if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance')
+	  if (value > max || value < min) throw new RangeError('"value" argument is out of bounds')
+	  if (offset + ext > buf.length) throw new RangeError('Index out of range')
+	}
+
+	Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  byteLength = byteLength | 0
+	  if (!noAssert) {
+	    var maxBytes = Math.pow(2, 8 * byteLength) - 1
+	    checkInt(this, value, offset, byteLength, maxBytes, 0)
+	  }
+
+	  var mul = 1
+	  var i = 0
+	  this[offset] = value & 0xFF
+	  while (++i < byteLength && (mul *= 0x100)) {
+	    this[offset + i] = (value / mul) & 0xFF
+	  }
+
+	  return offset + byteLength
+	}
+
+	Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  byteLength = byteLength | 0
+	  if (!noAssert) {
+	    var maxBytes = Math.pow(2, 8 * byteLength) - 1
+	    checkInt(this, value, offset, byteLength, maxBytes, 0)
+	  }
+
+	  var i = byteLength - 1
+	  var mul = 1
+	  this[offset + i] = value & 0xFF
+	  while (--i >= 0 && (mul *= 0x100)) {
+	    this[offset + i] = (value / mul) & 0xFF
+	  }
+
+	  return offset + byteLength
+	}
+
+	Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)
+	  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+	  this[offset] = (value & 0xff)
+	  return offset + 1
+	}
+
+	function objectWriteUInt16 (buf, value, offset, littleEndian) {
+	  if (value < 0) value = 0xffff + value + 1
+	  for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
+	    buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
+	      (littleEndian ? i : 1 - i) * 8
+	  }
+	}
+
+	Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value & 0xff)
+	    this[offset + 1] = (value >>> 8)
+	  } else {
+	    objectWriteUInt16(this, value, offset, true)
+	  }
+	  return offset + 2
+	}
+
+	Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value >>> 8)
+	    this[offset + 1] = (value & 0xff)
+	  } else {
+	    objectWriteUInt16(this, value, offset, false)
+	  }
+	  return offset + 2
+	}
+
+	function objectWriteUInt32 (buf, value, offset, littleEndian) {
+	  if (value < 0) value = 0xffffffff + value + 1
+	  for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
+	    buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
+	  }
+	}
+
+	Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset + 3] = (value >>> 24)
+	    this[offset + 2] = (value >>> 16)
+	    this[offset + 1] = (value >>> 8)
+	    this[offset] = (value & 0xff)
+	  } else {
+	    objectWriteUInt32(this, value, offset, true)
+	  }
+	  return offset + 4
+	}
+
+	Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value >>> 24)
+	    this[offset + 1] = (value >>> 16)
+	    this[offset + 2] = (value >>> 8)
+	    this[offset + 3] = (value & 0xff)
+	  } else {
+	    objectWriteUInt32(this, value, offset, false)
+	  }
+	  return offset + 4
+	}
+
+	Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) {
+	    var limit = Math.pow(2, 8 * byteLength - 1)
+
+	    checkInt(this, value, offset, byteLength, limit - 1, -limit)
+	  }
+
+	  var i = 0
+	  var mul = 1
+	  var sub = 0
+	  this[offset] = value & 0xFF
+	  while (++i < byteLength && (mul *= 0x100)) {
+	    if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
+	      sub = 1
+	    }
+	    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+	  }
+
+	  return offset + byteLength
+	}
+
+	Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) {
+	    var limit = Math.pow(2, 8 * byteLength - 1)
+
+	    checkInt(this, value, offset, byteLength, limit - 1, -limit)
+	  }
+
+	  var i = byteLength - 1
+	  var mul = 1
+	  var sub = 0
+	  this[offset + i] = value & 0xFF
+	  while (--i >= 0 && (mul *= 0x100)) {
+	    if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
+	      sub = 1
+	    }
+	    this[offset + i] = ((value / mul) >> 0) - sub & 0xFF
+	  }
+
+	  return offset + byteLength
+	}
+
+	Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)
+	  if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)
+	  if (value < 0) value = 0xff + value + 1
+	  this[offset] = (value & 0xff)
+	  return offset + 1
+	}
+
+	Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value & 0xff)
+	    this[offset + 1] = (value >>> 8)
+	  } else {
+	    objectWriteUInt16(this, value, offset, true)
+	  }
+	  return offset + 2
+	}
+
+	Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value >>> 8)
+	    this[offset + 1] = (value & 0xff)
+	  } else {
+	    objectWriteUInt16(this, value, offset, false)
+	  }
+	  return offset + 2
+	}
+
+	Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value & 0xff)
+	    this[offset + 1] = (value >>> 8)
+	    this[offset + 2] = (value >>> 16)
+	    this[offset + 3] = (value >>> 24)
+	  } else {
+	    objectWriteUInt32(this, value, offset, true)
+	  }
+	  return offset + 4
+	}
+
+	Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {
+	  value = +value
+	  offset = offset | 0
+	  if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)
+	  if (value < 0) value = 0xffffffff + value + 1
+	  if (Buffer.TYPED_ARRAY_SUPPORT) {
+	    this[offset] = (value >>> 24)
+	    this[offset + 1] = (value >>> 16)
+	    this[offset + 2] = (value >>> 8)
+	    this[offset + 3] = (value & 0xff)
+	  } else {
+	    objectWriteUInt32(this, value, offset, false)
+	  }
+	  return offset + 4
+	}
+
+	function checkIEEE754 (buf, value, offset, ext, max, min) {
+	  if (offset + ext > buf.length) throw new RangeError('Index out of range')
+	  if (offset < 0) throw new RangeError('Index out of range')
+	}
+
+	function writeFloat (buf, value, offset, littleEndian, noAssert) {
+	  if (!noAssert) {
+	    checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)
+	  }
+	  ieee754.write(buf, value, offset, littleEndian, 23, 4)
+	  return offset + 4
+	}
+
+	Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {
+	  return writeFloat(this, value, offset, true, noAssert)
+	}
+
+	Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {
+	  return writeFloat(this, value, offset, false, noAssert)
+	}
+
+	function writeDouble (buf, value, offset, littleEndian, noAssert) {
+	  if (!noAssert) {
+	    checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)
+	  }
+	  ieee754.write(buf, value, offset, littleEndian, 52, 8)
+	  return offset + 8
+	}
+
+	Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {
+	  return writeDouble(this, value, offset, true, noAssert)
+	}
+
+	Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {
+	  return writeDouble(this, value, offset, false, noAssert)
+	}
+
+	// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
+	Buffer.prototype.copy = function copy (target, targetStart, start, end) {
+	  if (!start) start = 0
+	  if (!end && end !== 0) end = this.length
+	  if (targetStart >= target.length) targetStart = target.length
+	  if (!targetStart) targetStart = 0
+	  if (end > 0 && end < start) end = start
+
+	  // Copy 0 bytes; we're done
+	  if (end === start) return 0
+	  if (target.length === 0 || this.length === 0) return 0
+
+	  // Fatal error conditions
+	  if (targetStart < 0) {
+	    throw new RangeError('targetStart out of bounds')
+	  }
+	  if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')
+	  if (end < 0) throw new RangeError('sourceEnd out of bounds')
+
+	  // Are we oob?
+	  if (end > this.length) end = this.length
+	  if (target.length - targetStart < end - start) {
+	    end = target.length - targetStart + start
+	  }
+
+	  var len = end - start
+	  var i
+
+	  if (this === target && start < targetStart && targetStart < end) {
+	    // descending copy from end
+	    for (i = len - 1; i >= 0; --i) {
+	      target[i + targetStart] = this[i + start]
+	    }
+	  } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
+	    // ascending copy from start
+	    for (i = 0; i < len; ++i) {
+	      target[i + targetStart] = this[i + start]
+	    }
+	  } else {
+	    Uint8Array.prototype.set.call(
+	      target,
+	      this.subarray(start, start + len),
+	      targetStart
+	    )
+	  }
+
+	  return len
+	}
+
+	// Usage:
+	//    buffer.fill(number[, offset[, end]])
+	//    buffer.fill(buffer[, offset[, end]])
+	//    buffer.fill(string[, offset[, end]][, encoding])
+	Buffer.prototype.fill = function fill (val, start, end, encoding) {
+	  // Handle string cases:
+	  if (typeof val === 'string') {
+	    if (typeof start === 'string') {
+	      encoding = start
+	      start = 0
+	      end = this.length
+	    } else if (typeof end === 'string') {
+	      encoding = end
+	      end = this.length
+	    }
+	    if (val.length === 1) {
+	      var code = val.charCodeAt(0)
+	      if (code < 256) {
+	        val = code
+	      }
+	    }
+	    if (encoding !== undefined && typeof encoding !== 'string') {
+	      throw new TypeError('encoding must be a string')
+	    }
+	    if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
+	      throw new TypeError('Unknown encoding: ' + encoding)
+	    }
+	  } else if (typeof val === 'number') {
+	    val = val & 255
+	  }
+
+	  // Invalid ranges are not set to a default, so can range check early.
+	  if (start < 0 || this.length < start || this.length < end) {
+	    throw new RangeError('Out of range index')
+	  }
+
+	  if (end <= start) {
+	    return this
+	  }
+
+	  start = start >>> 0
+	  end = end === undefined ? this.length : end >>> 0
+
+	  if (!val) val = 0
+
+	  var i
+	  if (typeof val === 'number') {
+	    for (i = start; i < end; ++i) {
+	      this[i] = val
+	    }
+	  } else {
+	    var bytes = Buffer.isBuffer(val)
+	      ? val
+	      : utf8ToBytes(new Buffer(val, encoding).toString())
+	    var len = bytes.length
+	    for (i = 0; i < end - start; ++i) {
+	      this[i + start] = bytes[i % len]
+	    }
+	  }
+
+	  return this
+	}
+
+	// HELPER FUNCTIONS
+	// ================
+
+	var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g
+
+	function base64clean (str) {
+	  // Node strips out invalid characters like \n and \t from the string, base64-js does not
+	  str = stringtrim(str).replace(INVALID_BASE64_RE, '')
+	  // Node converts strings with length < 2 to ''
+	  if (str.length < 2) return ''
+	  // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
+	  while (str.length % 4 !== 0) {
+	    str = str + '='
+	  }
+	  return str
+	}
+
+	function stringtrim (str) {
+	  if (str.trim) return str.trim()
+	  return str.replace(/^\s+|\s+$/g, '')
+	}
+
+	function toHex (n) {
+	  if (n < 16) return '0' + n.toString(16)
+	  return n.toString(16)
+	}
+
+	function utf8ToBytes (string, units) {
+	  units = units || Infinity
+	  var codePoint
+	  var length = string.length
+	  var leadSurrogate = null
+	  var bytes = []
+
+	  for (var i = 0; i < length; ++i) {
+	    codePoint = string.charCodeAt(i)
+
+	    // is surrogate component
+	    if (codePoint > 0xD7FF && codePoint < 0xE000) {
+	      // last char was a lead
+	      if (!leadSurrogate) {
+	        // no lead yet
+	        if (codePoint > 0xDBFF) {
+	          // unexpected trail
+	          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+	          continue
+	        } else if (i + 1 === length) {
+	          // unpaired lead
+	          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+	          continue
+	        }
+
+	        // valid lead
+	        leadSurrogate = codePoint
+
+	        continue
+	      }
+
+	      // 2 leads in a row
+	      if (codePoint < 0xDC00) {
+	        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+	        leadSurrogate = codePoint
+	        continue
+	      }
+
+	      // valid surrogate pair
+	      codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000
+	    } else if (leadSurrogate) {
+	      // valid bmp char, but last char was a lead
+	      if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
+	    }
+
+	    leadSurrogate = null
+
+	    // encode utf8
+	    if (codePoint < 0x80) {
+	      if ((units -= 1) < 0) break
+	      bytes.push(codePoint)
+	    } else if (codePoint < 0x800) {
+	      if ((units -= 2) < 0) break
+	      bytes.push(
+	        codePoint >> 0x6 | 0xC0,
+	        codePoint & 0x3F | 0x80
+	      )
+	    } else if (codePoint < 0x10000) {
+	      if ((units -= 3) < 0) break
+	      bytes.push(
+	        codePoint >> 0xC | 0xE0,
+	        codePoint >> 0x6 & 0x3F | 0x80,
+	        codePoint & 0x3F | 0x80
+	      )
+	    } else if (codePoint < 0x110000) {
+	      if ((units -= 4) < 0) break
+	      bytes.push(
+	        codePoint >> 0x12 | 0xF0,
+	        codePoint >> 0xC & 0x3F | 0x80,
+	        codePoint >> 0x6 & 0x3F | 0x80,
+	        codePoint & 0x3F | 0x80
+	      )
+	    } else {
+	      throw new Error('Invalid code point')
+	    }
+	  }
+
+	  return bytes
+	}
+
+	function asciiToBytes (str) {
+	  var byteArray = []
+	  for (var i = 0; i < str.length; ++i) {
+	    // Node's code seems to be doing this and not & 0x7F..
+	    byteArray.push(str.charCodeAt(i) & 0xFF)
+	  }
+	  return byteArray
+	}
+
+	function utf16leToBytes (str, units) {
+	  var c, hi, lo
+	  var byteArray = []
+	  for (var i = 0; i < str.length; ++i) {
+	    if ((units -= 2) < 0) break
+
+	    c = str.charCodeAt(i)
+	    hi = c >> 8
+	    lo = c % 256
+	    byteArray.push(lo)
+	    byteArray.push(hi)
+	  }
+
+	  return byteArray
+	}
+
+	function base64ToBytes (str) {
+	  return base64.toByteArray(base64clean(str))
+	}
+
+	function blitBuffer (src, dst, offset, length) {
+	  for (var i = 0; i < length; ++i) {
+	    if ((i + offset >= dst.length) || (i >= src.length)) break
+	    dst[i + offset] = src[i]
+	  }
+	  return i
+	}
+
+	function isnan (val) {
+	  return val !== val // eslint-disable-line no-self-compare
+	}
+
+	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ }),
+/* 340 */
+/***/ (function(module, exports) {
+
+	'use strict'
+
+	exports.byteLength = byteLength
+	exports.toByteArray = toByteArray
+	exports.fromByteArray = fromByteArray
+
+	var lookup = []
+	var revLookup = []
+	var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array
+
+	var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+	for (var i = 0, len = code.length; i < len; ++i) {
+	  lookup[i] = code[i]
+	  revLookup[code.charCodeAt(i)] = i
+	}
+
+	// Support decoding URL-safe base64 strings, as Node.js does.
+	// See: https://en.wikipedia.org/wiki/Base64#URL_applications
+	revLookup['-'.charCodeAt(0)] = 62
+	revLookup['_'.charCodeAt(0)] = 63
+
+	function getLens (b64) {
+	  var len = b64.length
+
+	  if (len % 4 > 0) {
+	    throw new Error('Invalid string. Length must be a multiple of 4')
+	  }
+
+	  // Trim off extra bytes after placeholder bytes are found
+	  // See: https://github.com/beatgammit/base64-js/issues/42
+	  var validLen = b64.indexOf('=')
+	  if (validLen === -1) validLen = len
+
+	  var placeHoldersLen = validLen === len
+	    ? 0
+	    : 4 - (validLen % 4)
+
+	  return [validLen, placeHoldersLen]
+	}
+
+	// base64 is 4/3 + up to two characters of the original data
+	function byteLength (b64) {
+	  var lens = getLens(b64)
+	  var validLen = lens[0]
+	  var placeHoldersLen = lens[1]
+	  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+	}
+
+	function _byteLength (b64, validLen, placeHoldersLen) {
+	  return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
+	}
+
+	function toByteArray (b64) {
+	  var tmp
+	  var lens = getLens(b64)
+	  var validLen = lens[0]
+	  var placeHoldersLen = lens[1]
+
+	  var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
+
+	  var curByte = 0
+
+	  // if there are placeholders, only get up to the last complete 4 chars
+	  var len = placeHoldersLen > 0
+	    ? validLen - 4
+	    : validLen
+
+	  var i
+	  for (i = 0; i < len; i += 4) {
+	    tmp =
+	      (revLookup[b64.charCodeAt(i)] << 18) |
+	      (revLookup[b64.charCodeAt(i + 1)] << 12) |
+	      (revLookup[b64.charCodeAt(i + 2)] << 6) |
+	      revLookup[b64.charCodeAt(i + 3)]
+	    arr[curByte++] = (tmp >> 16) & 0xFF
+	    arr[curByte++] = (tmp >> 8) & 0xFF
+	    arr[curByte++] = tmp & 0xFF
+	  }
+
+	  if (placeHoldersLen === 2) {
+	    tmp =
+	      (revLookup[b64.charCodeAt(i)] << 2) |
+	      (revLookup[b64.charCodeAt(i + 1)] >> 4)
+	    arr[curByte++] = tmp & 0xFF
+	  }
+
+	  if (placeHoldersLen === 1) {
+	    tmp =
+	      (revLookup[b64.charCodeAt(i)] << 10) |
+	      (revLookup[b64.charCodeAt(i + 1)] << 4) |
+	      (revLookup[b64.charCodeAt(i + 2)] >> 2)
+	    arr[curByte++] = (tmp >> 8) & 0xFF
+	    arr[curByte++] = tmp & 0xFF
+	  }
+
+	  return arr
+	}
+
+	function tripletToBase64 (num) {
+	  return lookup[num >> 18 & 0x3F] +
+	    lookup[num >> 12 & 0x3F] +
+	    lookup[num >> 6 & 0x3F] +
+	    lookup[num & 0x3F]
+	}
+
+	function encodeChunk (uint8, start, end) {
+	  var tmp
+	  var output = []
+	  for (var i = start; i < end; i += 3) {
+	    tmp =
+	      ((uint8[i] << 16) & 0xFF0000) +
+	      ((uint8[i + 1] << 8) & 0xFF00) +
+	      (uint8[i + 2] & 0xFF)
+	    output.push(tripletToBase64(tmp))
+	  }
+	  return output.join('')
+	}
+
+	function fromByteArray (uint8) {
+	  var tmp
+	  var len = uint8.length
+	  var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
+	  var parts = []
+	  var maxChunkLength = 16383 // must be multiple of 3
+
+	  // go through the array every three bytes, we'll deal with trailing stuff later
+	  for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
+	    parts.push(encodeChunk(
+	      uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
+	    ))
+	  }
+
+	  // pad the end with zeros, but make sure to not forget the extra bytes
+	  if (extraBytes === 1) {
+	    tmp = uint8[len - 1]
+	    parts.push(
+	      lookup[tmp >> 2] +
+	      lookup[(tmp << 4) & 0x3F] +
+	      '=='
+	    )
+	  } else if (extraBytes === 2) {
+	    tmp = (uint8[len - 2] << 8) + uint8[len - 1]
+	    parts.push(
+	      lookup[tmp >> 10] +
+	      lookup[(tmp >> 4) & 0x3F] +
+	      lookup[(tmp << 2) & 0x3F] +
+	      '='
+	    )
+	  }
+
+	  return parts.join('')
+	}
+
+
+/***/ }),
+/* 341 */
+/***/ (function(module, exports) {
+
+	exports.read = function (buffer, offset, isLE, mLen, nBytes) {
+	  var e, m
+	  var eLen = (nBytes * 8) - mLen - 1
+	  var eMax = (1 << eLen) - 1
+	  var eBias = eMax >> 1
+	  var nBits = -7
+	  var i = isLE ? (nBytes - 1) : 0
+	  var d = isLE ? -1 : 1
+	  var s = buffer[offset + i]
+
+	  i += d
+
+	  e = s & ((1 << (-nBits)) - 1)
+	  s >>= (-nBits)
+	  nBits += eLen
+	  for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+	  m = e & ((1 << (-nBits)) - 1)
+	  e >>= (-nBits)
+	  nBits += mLen
+	  for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}
+
+	  if (e === 0) {
+	    e = 1 - eBias
+	  } else if (e === eMax) {
+	    return m ? NaN : ((s ? -1 : 1) * Infinity)
+	  } else {
+	    m = m + Math.pow(2, mLen)
+	    e = e - eBias
+	  }
+	  return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
+	}
+
+	exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
+	  var e, m, c
+	  var eLen = (nBytes * 8) - mLen - 1
+	  var eMax = (1 << eLen) - 1
+	  var eBias = eMax >> 1
+	  var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)
+	  var i = isLE ? 0 : (nBytes - 1)
+	  var d = isLE ? 1 : -1
+	  var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0
+
+	  value = Math.abs(value)
+
+	  if (isNaN(value) || value === Infinity) {
+	    m = isNaN(value) ? 1 : 0
+	    e = eMax
+	  } else {
+	    e = Math.floor(Math.log(value) / Math.LN2)
+	    if (value * (c = Math.pow(2, -e)) < 1) {
+	      e--
+	      c *= 2
+	    }
+	    if (e + eBias >= 1) {
+	      value += rt / c
+	    } else {
+	      value += rt * Math.pow(2, 1 - eBias)
+	    }
+	    if (value * c >= 2) {
+	      e++
+	      c /= 2
+	    }
+
+	    if (e + eBias >= eMax) {
+	      m = 0
+	      e = eMax
+	    } else if (e + eBias >= 1) {
+	      m = ((value * c) - 1) * Math.pow(2, mLen)
+	      e = e + eBias
+	    } else {
+	      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)
+	      e = 0
+	    }
+	  }
+
+	  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
+
+	  e = (e << mLen) | m
+	  eLen += mLen
+	  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
+
+	  buffer[offset + i - d] |= s * 128
+	}
+
+
+/***/ }),
+/* 342 */
+/***/ (function(module, exports) {
+
+	var toString = {}.toString;
+
+	module.exports = Array.isArray || function (arr) {
+	  return toString.call(arr) == '[object Array]';
+	};
+
+
+/***/ }),
+/* 343 */
+/***/ (function(module, exports) {
+
+	// shim for using process in browser
+	var process = module.exports = {};
+
+	// cached from whatever global is present so that test runners that stub it
+	// don't break things.  But we need to wrap it in a try catch in case it is
+	// wrapped in strict mode code which doesn't define any globals.  It's inside a
+	// function because try/catches deoptimize in certain engines.
+
+	var cachedSetTimeout;
+	var cachedClearTimeout;
+
+	function defaultSetTimout() {
+	    throw new Error('setTimeout has not been defined');
+	}
+	function defaultClearTimeout () {
+	    throw new Error('clearTimeout has not been defined');
+	}
+	(function () {
+	    try {
+	        if (typeof setTimeout === 'function') {
+	            cachedSetTimeout = setTimeout;
+	        } else {
+	            cachedSetTimeout = defaultSetTimout;
+	        }
+	    } catch (e) {
+	        cachedSetTimeout = defaultSetTimout;
+	    }
+	    try {
+	        if (typeof clearTimeout === 'function') {
+	            cachedClearTimeout = clearTimeout;
+	        } else {
+	            cachedClearTimeout = defaultClearTimeout;
+	        }
+	    } catch (e) {
+	        cachedClearTimeout = defaultClearTimeout;
+	    }
+	} ())
+	function runTimeout(fun) {
+	    if (cachedSetTimeout === setTimeout) {
+	        //normal enviroments in sane situations
+	        return setTimeout(fun, 0);
+	    }
+	    // if setTimeout wasn't available but was latter defined
+	    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
+	        cachedSetTimeout = setTimeout;
+	        return setTimeout(fun, 0);
+	    }
+	    try {
+	        // when when somebody has screwed with setTimeout but no I.E. maddness
+	        return cachedSetTimeout(fun, 0);
+	    } catch(e){
+	        try {
+	            // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
+	            return cachedSetTimeout.call(null, fun, 0);
+	        } catch(e){
+	            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
+	            return cachedSetTimeout.call(this, fun, 0);
+	        }
+	    }
+
+
+	}
+	function runClearTimeout(marker) {
+	    if (cachedClearTimeout === clearTimeout) {
+	        //normal enviroments in sane situations
+	        return clearTimeout(marker);
+	    }
+	    // if clearTimeout wasn't available but was latter defined
+	    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
+	        cachedClearTimeout = clearTimeout;
+	        return clearTimeout(marker);
+	    }
+	    try {
+	        // when when somebody has screwed with setTimeout but no I.E. maddness
+	        return cachedClearTimeout(marker);
+	    } catch (e){
+	        try {
+	            // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
+	            return cachedClearTimeout.call(null, marker);
+	        } catch (e){
+	            // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
+	            // Some versions of I.E. have different rules for clearTimeout vs setTimeout
+	            return cachedClearTimeout.call(this, marker);
+	        }
+	    }
+
+
+
+	}
+	var queue = [];
+	var draining = false;
+	var currentQueue;
+	var queueIndex = -1;
+
+	function cleanUpNextTick() {
+	    if (!draining || !currentQueue) {
+	        return;
+	    }
+	    draining = false;
+	    if (currentQueue.length) {
+	        queue = currentQueue.concat(queue);
+	    } else {
+	        queueIndex = -1;
+	    }
+	    if (queue.length) {
+	        drainQueue();
+	    }
+	}
+
+	function drainQueue() {
+	    if (draining) {
+	        return;
+	    }
+	    var timeout = runTimeout(cleanUpNextTick);
+	    draining = true;
+
+	    var len = queue.length;
+	    while(len) {
+	        currentQueue = queue;
+	        queue = [];
+	        while (++queueIndex < len) {
+	            if (currentQueue) {
+	                currentQueue[queueIndex].run();
+	            }
+	        }
+	        queueIndex = -1;
+	        len = queue.length;
+	    }
+	    currentQueue = null;
+	    draining = false;
+	    runClearTimeout(timeout);
+	}
+
+	process.nextTick = function (fun) {
+	    var args = new Array(arguments.length - 1);
+	    if (arguments.length > 1) {
+	        for (var i = 1; i < arguments.length; i++) {
+	            args[i - 1] = arguments[i];
+	        }
+	    }
+	    queue.push(new Item(fun, args));
+	    if (queue.length === 1 && !draining) {
+	        runTimeout(drainQueue);
+	    }
+	};
+
+	// v8 likes predictible objects
+	function Item(fun, array) {
+	    this.fun = fun;
+	    this.array = array;
+	}
+	Item.prototype.run = function () {
+	    this.fun.apply(null, this.array);
+	};
+	process.title = 'browser';
+	process.browser = true;
+	process.env = {};
+	process.argv = [];
+	process.version = ''; // empty string to avoid regexp issues
+	process.versions = {};
+
+	function noop() {}
+
+	process.on = noop;
+	process.addListener = noop;
+	process.once = noop;
+	process.off = noop;
+	process.removeListener = noop;
+	process.removeAllListeners = noop;
+	process.emit = noop;
+	process.prependListener = noop;
+	process.prependOnceListener = noop;
+
+	process.listeners = function (name) { return [] }
+
+	process.binding = function (name) {
+	    throw new Error('process.binding is not supported');
+	};
+
+	process.cwd = function () { return '/' };
+	process.chdir = function (dir) {
+	    throw new Error('process.chdir is not supported');
+	};
+	process.umask = function() { return 0; };
+
+
+/***/ }),
+/* 344 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
+
+	/**
+	 * Normalizes our expected stringified form of a function across versions of node
+	 * @param {Function} fn The function to stringify
+	 */
+
+	function normalizedFunctionString(fn) {
+	  return fn.toString().replace(/function *\(/, 'function (');
+	}
+
+	function newBuffer(item, encoding) {
+	  return new Buffer(item, encoding);
+	}
+
+	function allocBuffer() {
+	  return Buffer.alloc.apply(Buffer, arguments);
+	}
+
+	function toBuffer() {
+	  return Buffer.from.apply(Buffer, arguments);
+	}
+
+	module.exports = {
+	  normalizedFunctionString: normalizedFunctionString,
+	  allocBuffer: typeof Buffer.alloc === 'function' ? allocBuffer : newBuffer,
+	  toBuffer: typeof Buffer.from === 'function' ? toBuffer : newBuffer
+	};
+	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
+
+/***/ }),
+/* 345 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(global, process) {// Copyright Joyent, Inc. and other Node contributors.
+	//
+	// Permission is hereby granted, free of charge, to any person obtaining a
+	// copy of this software and associated documentation files (the
+	// "Software"), to deal in the Software without restriction, including
+	// without limitation the rights to use, copy, modify, merge, publish,
+	// distribute, sublicense, and/or sell copies of the Software, and to permit
+	// persons to whom the Software is furnished to do so, subject to the
+	// following conditions:
+	//
+	// The above copyright notice and this permission notice shall be included
+	// in all copies or substantial portions of the Software.
+	//
+	// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+	// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+	// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+	// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+	// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+	// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+	// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+	var formatRegExp = /%[sdj%]/g;
+	exports.format = function(f) {
+	  if (!isString(f)) {
+	    var objects = [];
+	    for (var i = 0; i < arguments.length; i++) {
+	      objects.push(inspect(arguments[i]));
+	    }
+	    return objects.join(' ');
+	  }
+
+	  var i = 1;
+	  var args = arguments;
+	  var len = args.length;
+	  var str = String(f).replace(formatRegExp, function(x) {
+	    if (x === '%%') return '%';
+	    if (i >= len) return x;
+	    switch (x) {
+	      case '%s': return String(args[i++]);
+	      case '%d': return Number(args[i++]);
+	      case '%j':
+	        try {
+	          return JSON.stringify(args[i++]);
+	        } catch (_) {
+	          return '[Circular]';
+	        }
+	      default:
+	        return x;
+	    }
+	  });
+	  for (var x = args[i]; i < len; x = args[++i]) {
+	    if (isNull(x) || !isObject(x)) {
+	      str += ' ' + x;
+	    } else {
+	      str += ' ' + inspect(x);
+	    }
+	  }
+	  return str;
+	};
+
+
+	// Mark that a method should not be used.
+	// Returns a modified function which warns once by default.
+	// If --no-deprecation is set, then it is a no-op.
+	exports.deprecate = function(fn, msg) {
+	  // Allow for deprecating things in the process of starting up.
+	  if (isUndefined(global.process)) {
+	    return function() {
+	      return exports.deprecate(fn, msg).apply(this, arguments);
+	    };
+	  }
+
+	  if (process.noDeprecation === true) {
+	    return fn;
+	  }
+
+	  var warned = false;
+	  function deprecated() {
+	    if (!warned) {
+	      if (process.throwDeprecation) {
+	        throw new Error(msg);
+	      } else if (process.traceDeprecation) {
+	        console.trace(msg);
+	      } else {
+	        console.error(msg);
+	      }
+	      warned = true;
+	    }
+	    return fn.apply(this, arguments);
+	  }
+
+	  return deprecated;
+	};
+
+
+	var debugs = {};
+	var debugEnviron;
+	exports.debuglog = function(set) {
+	  if (isUndefined(debugEnviron))
+	    debugEnviron = process.env.NODE_DEBUG || '';
+	  set = set.toUpperCase();
+	  if (!debugs[set]) {
+	    if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
+	      var pid = process.pid;
+	      debugs[set] = function() {
+	        var msg = exports.format.apply(exports, arguments);
+	        console.error('%s %d: %s', set, pid, msg);
+	      };
+	    } else {
+	      debugs[set] = function() {};
+	    }
+	  }
+	  return debugs[set];
+	};
+
+
+	/**
+	 * Echos the value of a value. Trys to print the value out
+	 * in the best way possible given the different types.
+	 *
+	 * @param {Object} obj The object to print out.
+	 * @param {Object} opts Optional options object that alters the output.
+	 */
+	/* legacy: obj, showHidden, depth, colors*/
+	function inspect(obj, opts) {
+	  // default options
+	  var ctx = {
+	    seen: [],
+	    stylize: stylizeNoColor
+	  };
+	  // legacy...
+	  if (arguments.length >= 3) ctx.depth = arguments[2];
+	  if (arguments.length >= 4) ctx.colors = arguments[3];
+	  if (isBoolean(opts)) {
+	    // legacy...
+	    ctx.showHidden = opts;
+	  } else if (opts) {
+	    // got an "options" object
+	    exports._extend(ctx, opts);
+	  }
+	  // set default options
+	  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
+	  if (isUndefined(ctx.depth)) ctx.depth = 2;
+	  if (isUndefined(ctx.colors)) ctx.colors = false;
+	  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
+	  if (ctx.colors) ctx.stylize = stylizeWithColor;
+	  return formatValue(ctx, obj, ctx.depth);
+	}
+	exports.inspect = inspect;
+
+
+	// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
+	inspect.colors = {
+	  'bold' : [1, 22],
+	  'italic' : [3, 23],
+	  'underline' : [4, 24],
+	  'inverse' : [7, 27],
+	  'white' : [37, 39],
+	  'grey' : [90, 39],
+	  'black' : [30, 39],
+	  'blue' : [34, 39],
+	  'cyan' : [36, 39],
+	  'green' : [32, 39],
+	  'magenta' : [35, 39],
+	  'red' : [31, 39],
+	  'yellow' : [33, 39]
+	};
+
+	// Don't use 'blue' not visible on cmd.exe
+	inspect.styles = {
+	  'special': 'cyan',
+	  'number': 'yellow',
+	  'boolean': 'yellow',
+	  'undefined': 'grey',
+	  'null': 'bold',
+	  'string': 'green',
+	  'date': 'magenta',
+	  // "name": intentionally not styling
+	  'regexp': 'red'
+	};
+
+
+	function stylizeWithColor(str, styleType) {
+	  var style = inspect.styles[styleType];
+
+	  if (style) {
+	    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
+	           '\u001b[' + inspect.colors[style][1] + 'm';
+	  } else {
+	    return str;
+	  }
+	}
+
+
+	function stylizeNoColor(str, styleType) {
+	  return str;
+	}
+
+
+	function arrayToHash(array) {
+	  var hash = {};
+
+	  array.forEach(function(val, idx) {
+	    hash[val] = true;
+	  });
+
+	  return hash;
+	}
+
+
+	function formatValue(ctx, value, recurseTimes) {
+	  // Provide a hook for user-specified inspect functions.
+	  // Check that value is an object with an inspect function on it
+	  if (ctx.customInspect &&
+	      value &&
+	      isFunction(value.inspect) &&
+	      // Filter out the util module, it's inspect function is special
+	      value.inspect !== exports.inspect &&
+	      // Also filter out any prototype objects using the circular check.
+	      !(value.constructor && value.constructor.prototype === value)) {
+	    var ret = value.inspect(recurseTimes, ctx);
+	    if (!isString(ret)) {
+	      ret = formatValue(ctx, ret, recurseTimes);
+	    }
+	    return ret;
+	  }
+
+	  // Primitive types cannot have properties
+	  var primitive = formatPrimitive(ctx, value);
+	  if (primitive) {
+	    return primitive;
+	  }
+
+	  // Look up the keys of the object.
+	  var keys = Object.keys(value);
+	  var visibleKeys = arrayToHash(keys);
+
+	  if (ctx.showHidden) {
+	    keys = Object.getOwnPropertyNames(value);
+	  }
+
+	  // IE doesn't make error fields non-enumerable
+	  // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
+	  if (isError(value)
+	      && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
+	    return formatError(value);
+	  }
+
+	  // Some type of object without properties can be shortcutted.
+	  if (keys.length === 0) {
+	    if (isFunction(value)) {
+	      var name = value.name ? ': ' + value.name : '';
+	      return ctx.stylize('[Function' + name + ']', 'special');
+	    }
+	    if (isRegExp(value)) {
+	      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+	    }
+	    if (isDate(value)) {
+	      return ctx.stylize(Date.prototype.toString.call(value), 'date');
+	    }
+	    if (isError(value)) {
+	      return formatError(value);
+	    }
+	  }
+
+	  var base = '', array = false, braces = ['{', '}'];
+
+	  // Make Array say that they are Array
+	  if (isArray(value)) {
+	    array = true;
+	    braces = ['[', ']'];
+	  }
+
+	  // Make functions say that they are functions
+	  if (isFunction(value)) {
+	    var n = value.name ? ': ' + value.name : '';
+	    base = ' [Function' + n + ']';
+	  }
+
+	  // Make RegExps say that they are RegExps
+	  if (isRegExp(value)) {
+	    base = ' ' + RegExp.prototype.toString.call(value);
+	  }
+
+	  // Make dates with properties first say the date
+	  if (isDate(value)) {
+	    base = ' ' + Date.prototype.toUTCString.call(value);
+	  }
+
+	  // Make error with message first say the error
+	  if (isError(value)) {
+	    base = ' ' + formatError(value);
+	  }
+
+	  if (keys.length === 0 && (!array || value.length == 0)) {
+	    return braces[0] + base + braces[1];
+	  }
+
+	  if (recurseTimes < 0) {
+	    if (isRegExp(value)) {
+	      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+	    } else {
+	      return ctx.stylize('[Object]', 'special');
+	    }
+	  }
+
+	  ctx.seen.push(value);
+
+	  var output;
+	  if (array) {
+	    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
+	  } else {
+	    output = keys.map(function(key) {
+	      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
+	    });
+	  }
+
+	  ctx.seen.pop();
+
+	  return reduceToSingleString(output, base, braces);
+	}
+
+
+	function formatPrimitive(ctx, value) {
+	  if (isUndefined(value))
+	    return ctx.stylize('undefined', 'undefined');
+	  if (isString(value)) {
+	    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
+	                                             .replace(/'/g, "\\'")
+	                                             .replace(/\\"/g, '"') + '\'';
+	    return ctx.stylize(simple, 'string');
+	  }
+	  if (isNumber(value))
+	    return ctx.stylize('' + value, 'number');
+	  if (isBoolean(value))
+	    return ctx.stylize('' + value, 'boolean');
+	  // For some reason typeof null is "object", so special case here.
+	  if (isNull(value))
+	    return ctx.stylize('null', 'null');
+	}
+
+
+	function formatError(value) {
+	  return '[' + Error.prototype.toString.call(value) + ']';
+	}
+
+
+	function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
+	  var output = [];
+	  for (var i = 0, l = value.length; i < l; ++i) {
+	    if (hasOwnProperty(value, String(i))) {
+	      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+	          String(i), true));
+	    } else {
+	      output.push('');
+	    }
+	  }
+	  keys.forEach(function(key) {
+	    if (!key.match(/^\d+$/)) {
+	      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
+	          key, true));
+	    }
+	  });
+	  return output;
+	}
+
+
+	function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
+	  var name, str, desc;
+	  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
+	  if (desc.get) {
+	    if (desc.set) {
+	      str = ctx.stylize('[Getter/Setter]', 'special');
+	    } else {
+	      str = ctx.stylize('[Getter]', 'special');
+	    }
+	  } else {
+	    if (desc.set) {
+	      str = ctx.stylize('[Setter]', 'special');
+	    }
+	  }
+	  if (!hasOwnProperty(visibleKeys, key)) {
+	    name = '[' + key + ']';
+	  }
+	  if (!str) {
+	    if (ctx.seen.indexOf(desc.value) < 0) {
+	      if (isNull(recurseTimes)) {
+	        str = formatValue(ctx, desc.value, null);
+	      } else {
+	        str = formatValue(ctx, desc.value, recurseTimes - 1);
+	      }
+	      if (str.indexOf('\n') > -1) {
+	        if (array) {
+	          str = str.split('\n').map(function(line) {
+	            return '  ' + line;
+	          }).join('\n').substr(2);
+	        } else {
+	          str = '\n' + str.split('\n').map(function(line) {
+	            return '   ' + line;
+	          }).join('\n');
+	        }
+	      }
+	    } else {
+	      str = ctx.stylize('[Circular]', 'special');
+	    }
+	  }
+	  if (isUndefined(name)) {
+	    if (array && key.match(/^\d+$/)) {
+	      return str;
+	    }
+	    name = JSON.stringify('' + key);
+	    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
+	      name = name.substr(1, name.length - 2);
+	      name = ctx.stylize(name, 'name');
+	    } else {
+	      name = name.replace(/'/g, "\\'")
+	                 .replace(/\\"/g, '"')
+	                 .replace(/(^"|"$)/g, "'");
+	      name = ctx.stylize(name, 'string');
+	    }
+	  }
+
+	  return name + ': ' + str;
+	}
+
+
+	function reduceToSingleString(output, base, braces) {
+	  var numLinesEst = 0;
+	  var length = output.reduce(function(prev, cur) {
+	    numLinesEst++;
+	    if (cur.indexOf('\n') >= 0) numLinesEst++;
+	    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
+	  }, 0);
+
+	  if (length > 60) {
+	    return braces[0] +
+	           (base === '' ? '' : base + '\n ') +
+	           ' ' +
+	           output.join(',\n  ') +
+	           ' ' +
+	           braces[1];
+	  }
+
+	  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
+	}
+
+
+	// NOTE: These type checking functions intentionally don't use `instanceof`
+	// because it is fragile and can be easily faked with `Object.create()`.
+	function isArray(ar) {
+	  return Array.isArray(ar);
+	}
+	exports.isArray = isArray;
+
+	function isBoolean(arg) {
+	  return typeof arg === 'boolean';
+	}
+	exports.isBoolean = isBoolean;
+
+	function isNull(arg) {
+	  return arg === null;
+	}
+	exports.isNull = isNull;
+
+	function isNullOrUndefined(arg) {
+	  return arg == null;
+	}
+	exports.isNullOrUndefined = isNullOrUndefined;
+
+	function isNumber(arg) {
+	  return typeof arg === 'number';
+	}
+	exports.isNumber = isNumber;
+
+	function isString(arg) {
+	  return typeof arg === 'string';
+	}
+	exports.isString = isString;
+
+	function isSymbol(arg) {
+	  return typeof arg === 'symbol';
+	}
+	exports.isSymbol = isSymbol;
+
+	function isUndefined(arg) {
+	  return arg === void 0;
+	}
+	exports.isUndefined = isUndefined;
+
+	function isRegExp(re) {
+	  return isObject(re) && objectToString(re) === '[object RegExp]';
+	}
+	exports.isRegExp = isRegExp;
+
+	function isObject(arg) {
+	  return typeof arg === 'object' && arg !== null;
+	}
+	exports.isObject = isObject;
+
+	function isDate(d) {
+	  return isObject(d) && objectToString(d) === '[object Date]';
+	}
+	exports.isDate = isDate;
+
+	function isError(e) {
+	  return isObject(e) &&
+	      (objectToString(e) === '[object Error]' || e instanceof Error);
+	}
+	exports.isError = isError;
+
+	function isFunction(arg) {
+	  return typeof arg === 'function';
+	}
+	exports.isFunction = isFunction;
+
+	function isPrimitive(arg) {
+	  return arg === null ||
+	         typeof arg === 'boolean' ||
+	         typeof arg === 'number' ||
+	         typeof arg === 'string' ||
+	         typeof arg === 'symbol' ||  // ES6 symbol
+	         typeof arg === 'undefined';
+	}
+	exports.isPrimitive = isPrimitive;
+
+	exports.isBuffer = __webpack_require__(346);
+
+	function objectToString(o) {
+	  return Object.prototype.toString.call(o);
+	}
+
+
+	function pad(n) {
+	  return n < 10 ? '0' + n.toString(10) : n.toString(10);
+	}
+
+
+	var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
+	              'Oct', 'Nov', 'Dec'];
+
+	// 26 Feb 16:19:34
+	function timestamp() {
+	  var d = new Date();
+	  var time = [pad(d.getHours()),
+	              pad(d.getMinutes()),
+	              pad(d.getSeconds())].join(':');
+	  return [d.getDate(), months[d.getMonth()], time].join(' ');
+	}
+
+
+	// log is just a thin wrapper to console.log that prepends a timestamp
+	exports.log = function() {
+	  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
+	};
+
+
+	/**
+	 * Inherit the prototype methods from one constructor into another.
+	 *
+	 * The Function.prototype.inherits from lang.js rewritten as a standalone
+	 * function (not on Function.prototype). NOTE: If this file is to be loaded
+	 * during bootstrapping this function needs to be rewritten using some native
+	 * functions as prototype setup using normal JavaScript does not work as
+	 * expected during bootstrapping (see mirror.js in r114903).
+	 *
+	 * @param {function} ctor Constructor function which needs to inherit the
+	 *     prototype.
+	 * @param {function} superCtor Constructor function to inherit prototype from.
+	 */
+	exports.inherits = __webpack_require__(347);
+
+	exports._extend = function(origin, add) {
+	  // Don't do anything if add isn't an object
+	  if (!add || !isObject(add)) return origin;
+
+	  var keys = Object.keys(add);
+	  var i = keys.length;
+	  while (i--) {
+	    origin[keys[i]] = add[keys[i]];
+	  }
+	  return origin;
+	};
+
+	function hasOwnProperty(obj, prop) {
+	  return Object.prototype.hasOwnProperty.call(obj, prop);
+	}
+
+	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(343)))
+
+/***/ }),
+/* 346 */
+/***/ (function(module, exports) {
+
+	module.exports = function isBuffer(arg) {
+	  return arg && typeof arg === 'object'
+	    && typeof arg.copy === 'function'
+	    && typeof arg.fill === 'function'
+	    && typeof arg.readUInt8 === 'function';
+	}
+
+/***/ }),
+/* 347 */
+/***/ (function(module, exports) {
+
+	if (typeof Object.create === 'function') {
+	  // implementation from standard node.js 'util' module
+	  module.exports = function inherits(ctor, superCtor) {
+	    ctor.super_ = superCtor
+	    ctor.prototype = Object.create(superCtor.prototype, {
+	      constructor: {
+	        value: ctor,
+	        enumerable: false,
+	        writable: true,
+	        configurable: true
+	      }
+	    });
+	  };
+	} else {
+	  // old school shim for old browsers
+	  module.exports = function inherits(ctor, superCtor) {
+	    ctor.super_ = superCtor
+	    var TempCtor = function () {}
+	    TempCtor.prototype = superCtor.prototype
+	    ctor.prototype = new TempCtor()
+	    ctor.prototype.constructor = ctor
+	  }
+	}
+
+
+/***/ }),
+/* 348 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of the BSON RegExp type.
+	 *
+	 * @class
+	 * @return {BSONRegExp} A MinKey instance
+	 */
+	function BSONRegExp(pattern, options) {
+	  if (!(this instanceof BSONRegExp)) return new BSONRegExp();
+
+	  // Execute
+	  this._bsontype = 'BSONRegExp';
+	  this.pattern = pattern || '';
+	  this.options = options || '';
+
+	  // Validate options
+	  for (var i = 0; i < this.options.length; i++) {
+	    if (!(this.options[i] === 'i' || this.options[i] === 'm' || this.options[i] === 'x' || this.options[i] === 'l' || this.options[i] === 's' || this.options[i] === 'u')) {
+	      throw new Error('the regular expression options [' + this.options[i] + '] is not supported');
+	    }
+	  }
+	}
+
+	module.exports = BSONRegExp;
+	module.exports.BSONRegExp = BSONRegExp;
+
+/***/ }),
+/* 349 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(Buffer) {// Custom inspect property name / symbol.
+	var inspect = Buffer ? __webpack_require__(345).inspect.custom || 'inspect' : 'inspect';
+
+	/**
+	 * A class representation of the BSON Symbol type.
+	 *
+	 * @class
+	 * @deprecated
+	 * @param {string} value the string representing the symbol.
+	 * @return {Symbol}
+	 */
+	function Symbol(value) {
+	  if (!(this instanceof Symbol)) return new Symbol(value);
+	  this._bsontype = 'Symbol';
+	  this.value = value;
+	}
+
+	/**
+	 * Access the wrapped string value.
+	 *
+	 * @method
+	 * @return {String} returns the wrapped string.
+	 */
+	Symbol.prototype.valueOf = function () {
+	  return this.value;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Symbol.prototype.toString = function () {
+	  return this.value;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Symbol.prototype[inspect] = function () {
+	  return this.value;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Symbol.prototype.toJSON = function () {
+	  return this.value;
+	};
+
+	module.exports = Symbol;
+	module.exports.Symbol = Symbol;
+	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
+
+/***/ }),
+/* 350 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of a BSON Int32 type.
+	 *
+	 * @class
+	 * @param {number} value the number we want to represent as an int32.
+	 * @return {Int32}
+	 */
+	var Int32 = function (value) {
+	  if (!(this instanceof Int32)) return new Int32(value);
+
+	  this._bsontype = 'Int32';
+	  this.value = value;
+	};
+
+	/**
+	 * Access the number value.
+	 *
+	 * @method
+	 * @return {number} returns the wrapped int32 number.
+	 */
+	Int32.prototype.valueOf = function () {
+	  return this.value;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Int32.prototype.toJSON = function () {
+	  return this.value;
+	};
+
+	module.exports = Int32;
+	module.exports.Int32 = Int32;
+
+/***/ }),
+/* 351 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of the BSON Code type.
+	 *
+	 * @class
+	 * @param {(string|function)} code a string or function.
+	 * @param {Object} [scope] an optional scope for the function.
+	 * @return {Code}
+	 */
+	var Code = function Code(code, scope) {
+	  if (!(this instanceof Code)) return new Code(code, scope);
+	  this._bsontype = 'Code';
+	  this.code = code;
+	  this.scope = scope;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Code.prototype.toJSON = function () {
+	  return { scope: this.scope, code: this.code };
+	};
+
+	module.exports = Code;
+	module.exports.Code = Code;
+
+/***/ }),
+/* 352 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var Long = __webpack_require__(335);
+
+	var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
+	var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
+	var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
+
+	var EXPONENT_MAX = 6111;
+	var EXPONENT_MIN = -6176;
+	var EXPONENT_BIAS = 6176;
+	var MAX_DIGITS = 34;
+
+	// Nan value bits as 32 bit values (due to lack of longs)
+	var NAN_BUFFER = [0x7c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
+	// Infinity value bits 32 bit values (due to lack of longs)
+	var INF_NEGATIVE_BUFFER = [0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
+	var INF_POSITIVE_BUFFER = [0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00].reverse();
+
+	var EXPONENT_REGEX = /^([-+])?(\d+)?$/;
+
+	var utils = __webpack_require__(344);
+
+	// Detect if the value is a digit
+	var isDigit = function (value) {
+	  return !isNaN(parseInt(value, 10));
+	};
+
+	// Divide two uint128 values
+	var divideu128 = function (value) {
+	  var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
+	  var _rem = Long.fromNumber(0);
+	  var i = 0;
+
+	  if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
+	    return { quotient: value, rem: _rem };
+	  }
+
+	  for (i = 0; i <= 3; i++) {
+	    // Adjust remainder to match value of next dividend
+	    _rem = _rem.shiftLeft(32);
+	    // Add the divided to _rem
+	    _rem = _rem.add(new Long(value.parts[i], 0));
+	    value.parts[i] = _rem.div(DIVISOR).low_;
+	    _rem = _rem.modulo(DIVISOR);
+	  }
+
+	  return { quotient: value, rem: _rem };
+	};
+
+	// Multiply two Long values and return the 128 bit value
+	var multiply64x2 = function (left, right) {
+	  if (!left && !right) {
+	    return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
+	  }
+
+	  var leftHigh = left.shiftRightUnsigned(32);
+	  var leftLow = new Long(left.getLowBits(), 0);
+	  var rightHigh = right.shiftRightUnsigned(32);
+	  var rightLow = new Long(right.getLowBits(), 0);
+
+	  var productHigh = leftHigh.multiply(rightHigh);
+	  var productMid = leftHigh.multiply(rightLow);
+	  var productMid2 = leftLow.multiply(rightHigh);
+	  var productLow = leftLow.multiply(rightLow);
+
+	  productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
+	  productMid = new Long(productMid.getLowBits(), 0).add(productMid2).add(productLow.shiftRightUnsigned(32));
+
+	  productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
+	  productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
+
+	  // Return the 128 bit result
+	  return { high: productHigh, low: productLow };
+	};
+
+	var lessThan = function (left, right) {
+	  // Make values unsigned
+	  var uhleft = left.high_ >>> 0;
+	  var uhright = right.high_ >>> 0;
+
+	  // Compare high bits first
+	  if (uhleft < uhright) {
+	    return true;
+	  } else if (uhleft === uhright) {
+	    var ulleft = left.low_ >>> 0;
+	    var ulright = right.low_ >>> 0;
+	    if (ulleft < ulright) return true;
+	  }
+
+	  return false;
+	};
+
+	// var longtoHex = function(value) {
+	//   var buffer = utils.allocBuffer(8);
+	//   var index = 0;
+	//   // Encode the low 64 bits of the decimal
+	//   // Encode low bits
+	//   buffer[index++] = value.low_ & 0xff;
+	//   buffer[index++] = (value.low_ >> 8) & 0xff;
+	//   buffer[index++] = (value.low_ >> 16) & 0xff;
+	//   buffer[index++] = (value.low_ >> 24) & 0xff;
+	//   // Encode high bits
+	//   buffer[index++] = value.high_ & 0xff;
+	//   buffer[index++] = (value.high_ >> 8) & 0xff;
+	//   buffer[index++] = (value.high_ >> 16) & 0xff;
+	//   buffer[index++] = (value.high_ >> 24) & 0xff;
+	//   return buffer.reverse().toString('hex');
+	// };
+
+	// var int32toHex = function(value) {
+	//   var buffer = utils.allocBuffer(4);
+	//   var index = 0;
+	//   // Encode the low 64 bits of the decimal
+	//   // Encode low bits
+	//   buffer[index++] = value & 0xff;
+	//   buffer[index++] = (value >> 8) & 0xff;
+	//   buffer[index++] = (value >> 16) & 0xff;
+	//   buffer[index++] = (value >> 24) & 0xff;
+	//   return buffer.reverse().toString('hex');
+	// };
+
+	/**
+	 * A class representation of the BSON Decimal128 type.
+	 *
+	 * @class
+	 * @param {Buffer} bytes a buffer containing the raw Decimal128 bytes.
+	 * @return {Double}
+	 */
+	var Decimal128 = function (bytes) {
+	  this._bsontype = 'Decimal128';
+	  this.bytes = bytes;
+	};
+
+	/**
+	 * Create a Decimal128 instance from a string representation
+	 *
+	 * @method
+	 * @param {string} string a numeric string representation.
+	 * @return {Decimal128} returns a Decimal128 instance.
+	 */
+	Decimal128.fromString = function (string) {
+	  // Parse state tracking
+	  var isNegative = false;
+	  var sawRadix = false;
+	  var foundNonZero = false;
+
+	  // Total number of significant digits (no leading or trailing zero)
+	  var significantDigits = 0;
+	  // Total number of significand digits read
+	  var nDigitsRead = 0;
+	  // Total number of digits (no leading zeros)
+	  var nDigits = 0;
+	  // The number of the digits after radix
+	  var radixPosition = 0;
+	  // The index of the first non-zero in *str*
+	  var firstNonZero = 0;
+
+	  // Digits Array
+	  var digits = [0];
+	  // The number of digits in digits
+	  var nDigitsStored = 0;
+	  // Insertion pointer for digits
+	  var digitsInsert = 0;
+	  // The index of the first non-zero digit
+	  var firstDigit = 0;
+	  // The index of the last digit
+	  var lastDigit = 0;
+
+	  // Exponent
+	  var exponent = 0;
+	  // loop index over array
+	  var i = 0;
+	  // The high 17 digits of the significand
+	  var significandHigh = [0, 0];
+	  // The low 17 digits of the significand
+	  var significandLow = [0, 0];
+	  // The biased exponent
+	  var biasedExponent = 0;
+
+	  // Read index
+	  var index = 0;
+
+	  // Trim the string
+	  string = string.trim();
+
+	  // Naively prevent against REDOS attacks.
+	  // TODO: implementing a custom parsing for this, or refactoring the regex would yield
+	  //       further gains.
+	  if (string.length >= 7000) {
+	    throw new Error('' + string + ' not a valid Decimal128 string');
+	  }
+
+	  // Results
+	  var stringMatch = string.match(PARSE_STRING_REGEXP);
+	  var infMatch = string.match(PARSE_INF_REGEXP);
+	  var nanMatch = string.match(PARSE_NAN_REGEXP);
+
+	  // Validate the string
+	  if (!stringMatch && !infMatch && !nanMatch || string.length === 0) {
+	    throw new Error('' + string + ' not a valid Decimal128 string');
+	  }
+
+	  // Check if we have an illegal exponent format
+	  if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
+	    throw new Error('' + string + ' not a valid Decimal128 string');
+	  }
+
+	  // Get the negative or positive sign
+	  if (string[index] === '+' || string[index] === '-') {
+	    isNegative = string[index++] === '-';
+	  }
+
+	  // Check if user passed Infinity or NaN
+	  if (!isDigit(string[index]) && string[index] !== '.') {
+	    if (string[index] === 'i' || string[index] === 'I') {
+	      return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+	    } else if (string[index] === 'N') {
+	      return new Decimal128(utils.toBuffer(NAN_BUFFER));
+	    }
+	  }
+
+	  // Read all the digits
+	  while (isDigit(string[index]) || string[index] === '.') {
+	    if (string[index] === '.') {
+	      if (sawRadix) {
+	        return new Decimal128(utils.toBuffer(NAN_BUFFER));
+	      }
+
+	      sawRadix = true;
+	      index = index + 1;
+	      continue;
+	    }
+
+	    if (nDigitsStored < 34) {
+	      if (string[index] !== '0' || foundNonZero) {
+	        if (!foundNonZero) {
+	          firstNonZero = nDigitsRead;
+	        }
+
+	        foundNonZero = true;
+
+	        // Only store 34 digits
+	        digits[digitsInsert++] = parseInt(string[index], 10);
+	        nDigitsStored = nDigitsStored + 1;
+	      }
+	    }
+
+	    if (foundNonZero) {
+	      nDigits = nDigits + 1;
+	    }
+
+	    if (sawRadix) {
+	      radixPosition = radixPosition + 1;
+	    }
+
+	    nDigitsRead = nDigitsRead + 1;
+	    index = index + 1;
+	  }
+
+	  if (sawRadix && !nDigitsRead) {
+	    throw new Error('' + string + ' not a valid Decimal128 string');
+	  }
+
+	  // Read exponent if exists
+	  if (string[index] === 'e' || string[index] === 'E') {
+	    // Read exponent digits
+	    var match = string.substr(++index).match(EXPONENT_REGEX);
+
+	    // No digits read
+	    if (!match || !match[2]) {
+	      return new Decimal128(utils.toBuffer(NAN_BUFFER));
+	    }
+
+	    // Get exponent
+	    exponent = parseInt(match[0], 10);
+
+	    // Adjust the index
+	    index = index + match[0].length;
+	  }
+
+	  // Return not a number
+	  if (string[index]) {
+	    return new Decimal128(utils.toBuffer(NAN_BUFFER));
+	  }
+
+	  // Done reading input
+	  // Find first non-zero digit in digits
+	  firstDigit = 0;
+
+	  if (!nDigitsStored) {
+	    firstDigit = 0;
+	    lastDigit = 0;
+	    digits[0] = 0;
+	    nDigits = 1;
+	    nDigitsStored = 1;
+	    significantDigits = 0;
+	  } else {
+	    lastDigit = nDigitsStored - 1;
+	    significantDigits = nDigits;
+
+	    if (exponent !== 0 && significantDigits !== 1) {
+	      while (string[firstNonZero + significantDigits - 1] === '0') {
+	        significantDigits = significantDigits - 1;
+	      }
+	    }
+	  }
+
+	  // Normalization of exponent
+	  // Correct exponent based on radix position, and shift significand as needed
+	  // to represent user input
+
+	  // Overflow prevention
+	  if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
+	    exponent = EXPONENT_MIN;
+	  } else {
+	    exponent = exponent - radixPosition;
+	  }
+
+	  // Attempt to normalize the exponent
+	  while (exponent > EXPONENT_MAX) {
+	    // Shift exponent to significand and decrease
+	    lastDigit = lastDigit + 1;
+
+	    if (lastDigit - firstDigit > MAX_DIGITS) {
+	      // Check if we have a zero then just hard clamp, otherwise fail
+	      var digitsString = digits.join('');
+	      if (digitsString.match(/^0+$/)) {
+	        exponent = EXPONENT_MAX;
+	        break;
+	      } else {
+	        return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+	      }
+	    }
+
+	    exponent = exponent - 1;
+	  }
+
+	  while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
+	    // Shift last digit
+	    if (lastDigit === 0) {
+	      exponent = EXPONENT_MIN;
+	      significantDigits = 0;
+	      break;
+	    }
+
+	    if (nDigitsStored < nDigits) {
+	      // adjust to match digits not stored
+	      nDigits = nDigits - 1;
+	    } else {
+	      // adjust to round
+	      lastDigit = lastDigit - 1;
+	    }
+
+	    if (exponent < EXPONENT_MAX) {
+	      exponent = exponent + 1;
+	    } else {
+	      // Check if we have a zero then just hard clamp, otherwise fail
+	      digitsString = digits.join('');
+	      if (digitsString.match(/^0+$/)) {
+	        exponent = EXPONENT_MAX;
+	        break;
+	      } else {
+	        return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+	      }
+	    }
+	  }
+
+	  // Round
+	  // We've normalized the exponent, but might still need to round.
+	  if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] !== '0') {
+	    var endOfString = nDigitsRead;
+
+	    // If we have seen a radix point, 'string' is 1 longer than we have
+	    // documented with ndigits_read, so inc the position of the first nonzero
+	    // digit and the position that digits are read to.
+	    if (sawRadix && exponent === EXPONENT_MIN) {
+	      firstNonZero = firstNonZero + 1;
+	      endOfString = endOfString + 1;
+	    }
+
+	    var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
+	    var roundBit = 0;
+
+	    if (roundDigit >= 5) {
+	      roundBit = 1;
+
+	      if (roundDigit === 5) {
+	        roundBit = digits[lastDigit] % 2 === 1;
+
+	        for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
+	          if (parseInt(string[i], 10)) {
+	            roundBit = 1;
+	            break;
+	          }
+	        }
+	      }
+	    }
+
+	    if (roundBit) {
+	      var dIdx = lastDigit;
+
+	      for (; dIdx >= 0; dIdx--) {
+	        if (++digits[dIdx] > 9) {
+	          digits[dIdx] = 0;
+
+	          // overflowed most significant digit
+	          if (dIdx === 0) {
+	            if (exponent < EXPONENT_MAX) {
+	              exponent = exponent + 1;
+	              digits[dIdx] = 1;
+	            } else {
+	              return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+	            }
+	          }
+	        } else {
+	          break;
+	        }
+	      }
+	    }
+	  }
+
+	  // Encode significand
+	  // The high 17 digits of the significand
+	  significandHigh = Long.fromNumber(0);
+	  // The low 17 digits of the significand
+	  significandLow = Long.fromNumber(0);
+
+	  // read a zero
+	  if (significantDigits === 0) {
+	    significandHigh = Long.fromNumber(0);
+	    significandLow = Long.fromNumber(0);
+	  } else if (lastDigit - firstDigit < 17) {
+	    dIdx = firstDigit;
+	    significandLow = Long.fromNumber(digits[dIdx++]);
+	    significandHigh = new Long(0, 0);
+
+	    for (; dIdx <= lastDigit; dIdx++) {
+	      significandLow = significandLow.multiply(Long.fromNumber(10));
+	      significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
+	    }
+	  } else {
+	    dIdx = firstDigit;
+	    significandHigh = Long.fromNumber(digits[dIdx++]);
+
+	    for (; dIdx <= lastDigit - 17; dIdx++) {
+	      significandHigh = significandHigh.multiply(Long.fromNumber(10));
+	      significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
+	    }
+
+	    significandLow = Long.fromNumber(digits[dIdx++]);
+
+	    for (; dIdx <= lastDigit; dIdx++) {
+	      significandLow = significandLow.multiply(Long.fromNumber(10));
+	      significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
+	    }
+	  }
+
+	  var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
+
+	  significand.low = significand.low.add(significandLow);
+
+	  if (lessThan(significand.low, significandLow)) {
+	    significand.high = significand.high.add(Long.fromNumber(1));
+	  }
+
+	  // Biased exponent
+	  biasedExponent = exponent + EXPONENT_BIAS;
+	  var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
+
+	  // Encode combination, exponent, and significand.
+	  if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber)) {
+	    // Encode '11' into bits 1 to 3
+	    dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
+	    dec.high = dec.high.or(Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)));
+	    dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
+	  } else {
+	    dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
+	    dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
+	  }
+
+	  dec.low = significand.low;
+
+	  // Encode sign
+	  if (isNegative) {
+	    dec.high = dec.high.or(Long.fromString('9223372036854775808'));
+	  }
+
+	  // Encode into a buffer
+	  var buffer = utils.allocBuffer(16);
+	  index = 0;
+
+	  // Encode the low 64 bits of the decimal
+	  // Encode low bits
+	  buffer[index++] = dec.low.low_ & 0xff;
+	  buffer[index++] = dec.low.low_ >> 8 & 0xff;
+	  buffer[index++] = dec.low.low_ >> 16 & 0xff;
+	  buffer[index++] = dec.low.low_ >> 24 & 0xff;
+	  // Encode high bits
+	  buffer[index++] = dec.low.high_ & 0xff;
+	  buffer[index++] = dec.low.high_ >> 8 & 0xff;
+	  buffer[index++] = dec.low.high_ >> 16 & 0xff;
+	  buffer[index++] = dec.low.high_ >> 24 & 0xff;
+
+	  // Encode the high 64 bits of the decimal
+	  // Encode low bits
+	  buffer[index++] = dec.high.low_ & 0xff;
+	  buffer[index++] = dec.high.low_ >> 8 & 0xff;
+	  buffer[index++] = dec.high.low_ >> 16 & 0xff;
+	  buffer[index++] = dec.high.low_ >> 24 & 0xff;
+	  // Encode high bits
+	  buffer[index++] = dec.high.high_ & 0xff;
+	  buffer[index++] = dec.high.high_ >> 8 & 0xff;
+	  buffer[index++] = dec.high.high_ >> 16 & 0xff;
+	  buffer[index++] = dec.high.high_ >> 24 & 0xff;
+
+	  // Return the new Decimal128
+	  return new Decimal128(buffer);
+	};
+
+	// Extract least significant 5 bits
+	var COMBINATION_MASK = 0x1f;
+	// Extract least significant 14 bits
+	var EXPONENT_MASK = 0x3fff;
+	// Value of combination field for Inf
+	var COMBINATION_INFINITY = 30;
+	// Value of combination field for NaN
+	var COMBINATION_NAN = 31;
+	// Value of combination field for NaN
+	// var COMBINATION_SNAN = 32;
+	// decimal128 exponent bias
+	EXPONENT_BIAS = 6176;
+
+	/**
+	 * Create a string representation of the raw Decimal128 value
+	 *
+	 * @method
+	 * @return {string} returns a Decimal128 string representation.
+	 */
+	Decimal128.prototype.toString = function () {
+	  // Note: bits in this routine are referred to starting at 0,
+	  // from the sign bit, towards the coefficient.
+
+	  // bits 0 - 31
+	  var high;
+	  // bits 32 - 63
+	  var midh;
+	  // bits 64 - 95
+	  var midl;
+	  // bits 96 - 127
+	  var low;
+	  // bits 1 - 5
+	  var combination;
+	  // decoded biased exponent (14 bits)
+	  var biased_exponent;
+	  // the number of significand digits
+	  var significand_digits = 0;
+	  // the base-10 digits in the significand
+	  var significand = new Array(36);
+	  for (var i = 0; i < significand.length; i++) significand[i] = 0;
+	  // read pointer into significand
+	  var index = 0;
+
+	  // unbiased exponent
+	  var exponent;
+	  // the exponent if scientific notation is used
+	  var scientific_exponent;
+
+	  // true if the number is zero
+	  var is_zero = false;
+
+	  // the most signifcant significand bits (50-46)
+	  var significand_msb;
+	  // temporary storage for significand decoding
+	  var significand128 = { parts: new Array(4) };
+	  // indexing variables
+	  i;
+	  var j, k;
+
+	  // Output string
+	  var string = [];
+
+	  // Unpack index
+	  index = 0;
+
+	  // Buffer reference
+	  var buffer = this.bytes;
+
+	  // Unpack the low 64bits into a long
+	  low = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	  midl = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+
+	  // Unpack the high 64bits into a long
+	  midh = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	  high = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+
+	  // Unpack index
+	  index = 0;
+
+	  // Create the state of the decimal
+	  var dec = {
+	    low: new Long(low, midl),
+	    high: new Long(midh, high)
+	  };
+
+	  if (dec.high.lessThan(Long.ZERO)) {
+	    string.push('-');
+	  }
+
+	  // Decode combination field and exponent
+	  combination = high >> 26 & COMBINATION_MASK;
+
+	  if (combination >> 3 === 3) {
+	    // Check for 'special' values
+	    if (combination === COMBINATION_INFINITY) {
+	      return string.join('') + 'Infinity';
+	    } else if (combination === COMBINATION_NAN) {
+	      return 'NaN';
+	    } else {
+	      biased_exponent = high >> 15 & EXPONENT_MASK;
+	      significand_msb = 0x08 + (high >> 14 & 0x01);
+	    }
+	  } else {
+	    significand_msb = high >> 14 & 0x07;
+	    biased_exponent = high >> 17 & EXPONENT_MASK;
+	  }
+
+	  exponent = biased_exponent - EXPONENT_BIAS;
+
+	  // Create string of significand digits
+
+	  // Convert the 114-bit binary number represented by
+	  // (significand_high, significand_low) to at most 34 decimal
+	  // digits through modulo and division.
+	  significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
+	  significand128.parts[1] = midh;
+	  significand128.parts[2] = midl;
+	  significand128.parts[3] = low;
+
+	  if (significand128.parts[0] === 0 && significand128.parts[1] === 0 && significand128.parts[2] === 0 && significand128.parts[3] === 0) {
+	    is_zero = true;
+	  } else {
+	    for (k = 3; k >= 0; k--) {
+	      var least_digits = 0;
+	      // Peform the divide
+	      var result = divideu128(significand128);
+	      significand128 = result.quotient;
+	      least_digits = result.rem.low_;
+
+	      // We now have the 9 least significant digits (in base 2).
+	      // Convert and output to string.
+	      if (!least_digits) continue;
+
+	      for (j = 8; j >= 0; j--) {
+	        // significand[k * 9 + j] = Math.round(least_digits % 10);
+	        significand[k * 9 + j] = least_digits % 10;
+	        // least_digits = Math.round(least_digits / 10);
+	        least_digits = Math.floor(least_digits / 10);
+	      }
+	    }
+	  }
+
+	  // Output format options:
+	  // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
+	  // Regular    - ddd.ddd
+
+	  if (is_zero) {
+	    significand_digits = 1;
+	    significand[index] = 0;
+	  } else {
+	    significand_digits = 36;
+	    i = 0;
+
+	    while (!significand[index]) {
+	      i++;
+	      significand_digits = significand_digits - 1;
+	      index = index + 1;
+	    }
+	  }
+
+	  scientific_exponent = significand_digits - 1 + exponent;
+
+	  // The scientific exponent checks are dictated by the string conversion
+	  // specification and are somewhat arbitrary cutoffs.
+	  //
+	  // We must check exponent > 0, because if this is the case, the number
+	  // has trailing zeros.  However, we *cannot* output these trailing zeros,
+	  // because doing so would change the precision of the value, and would
+	  // change stored data if the string converted number is round tripped.
+
+	  if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
+	    // Scientific format
+	    string.push(significand[index++]);
+	    significand_digits = significand_digits - 1;
+
+	    if (significand_digits) {
+	      string.push('.');
+	    }
+
+	    for (i = 0; i < significand_digits; i++) {
+	      string.push(significand[index++]);
+	    }
+
+	    // Exponent
+	    string.push('E');
+	    if (scientific_exponent > 0) {
+	      string.push('+' + scientific_exponent);
+	    } else {
+	      string.push(scientific_exponent);
+	    }
+	  } else {
+	    // Regular format with no decimal place
+	    if (exponent >= 0) {
+	      for (i = 0; i < significand_digits; i++) {
+	        string.push(significand[index++]);
+	      }
+	    } else {
+	      var radix_position = significand_digits + exponent;
+
+	      // non-zero digits before radix
+	      if (radix_position > 0) {
+	        for (i = 0; i < radix_position; i++) {
+	          string.push(significand[index++]);
+	        }
+	      } else {
+	        string.push('0');
+	      }
+
+	      string.push('.');
+	      // add leading zeros after radix
+	      while (radix_position++ < 0) {
+	        string.push('0');
+	      }
+
+	      for (i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
+	        string.push(significand[index++]);
+	      }
+	    }
+	  }
+
+	  return string.join('');
+	};
+
+	Decimal128.prototype.toJSON = function () {
+	  return { $numberDecimal: this.toString() };
+	};
+
+	module.exports = Decimal128;
+	module.exports.Decimal128 = Decimal128;
+
+/***/ }),
+/* 353 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of the BSON MinKey type.
+	 *
+	 * @class
+	 * @return {MinKey} A MinKey instance
+	 */
+	function MinKey() {
+	  if (!(this instanceof MinKey)) return new MinKey();
+
+	  this._bsontype = 'MinKey';
+	}
+
+	module.exports = MinKey;
+	module.exports.MinKey = MinKey;
+
+/***/ }),
+/* 354 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of the BSON MaxKey type.
+	 *
+	 * @class
+	 * @return {MaxKey} A MaxKey instance
+	 */
+	function MaxKey() {
+	  if (!(this instanceof MaxKey)) return new MaxKey();
+
+	  this._bsontype = 'MaxKey';
+	}
+
+	module.exports = MaxKey;
+	module.exports.MaxKey = MaxKey;
+
+/***/ }),
+/* 355 */
+/***/ (function(module, exports) {
+
+	/**
+	 * A class representation of the BSON DBRef type.
+	 *
+	 * @class
+	 * @param {string} namespace the collection name.
+	 * @param {ObjectID} oid the reference ObjectID.
+	 * @param {string} [db] optional db name, if omitted the reference is local to the current db.
+	 * @return {DBRef}
+	 */
+	function DBRef(namespace, oid, db) {
+	  if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
+
+	  this._bsontype = 'DBRef';
+	  this.namespace = namespace;
+	  this.oid = oid;
+	  this.db = db;
+	}
+
+	/**
+	 * @ignore
+	 * @api private
+	 */
+	DBRef.prototype.toJSON = function () {
+	  return {
+	    $ref: this.namespace,
+	    $id: this.oid,
+	    $db: this.db == null ? '' : this.db
+	  };
+	};
+
+	module.exports = DBRef;
+	module.exports.DBRef = DBRef;
+
+/***/ }),
+/* 356 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(global) {/**
+	 * Module dependencies.
+	 * @ignore
+	 */
+
+	// Test if we're in Node via presence of "global" not absence of "window"
+	// to support hybrid environments like Electron
+	if (typeof global !== 'undefined') {
+	  var Buffer = __webpack_require__(339).Buffer; // TODO just use global Buffer
+	}
+
+	var utils = __webpack_require__(344);
+
+	/**
+	 * A class representation of the BSON Binary type.
+	 *
+	 * Sub types
+	 *  - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
+	 *  - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
+	 *  - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
+	 *  - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
+	 *  - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
+	 *  - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
+	 *
+	 * @class
+	 * @param {Buffer} buffer a buffer object containing the binary data.
+	 * @param {Number} [subType] the option binary type.
+	 * @return {Binary}
+	 */
+	function Binary(buffer, subType) {
+	  if (!(this instanceof Binary)) return new Binary(buffer, subType);
+
+	  if (buffer != null && !(typeof buffer === 'string') && !Buffer.isBuffer(buffer) && !(buffer instanceof Uint8Array) && !Array.isArray(buffer)) {
+	    throw new Error('only String, Buffer, Uint8Array or Array accepted');
+	  }
+
+	  this._bsontype = 'Binary';
+
+	  if (buffer instanceof Number) {
+	    this.sub_type = buffer;
+	    this.position = 0;
+	  } else {
+	    this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
+	    this.position = 0;
+	  }
+
+	  if (buffer != null && !(buffer instanceof Number)) {
+	    // Only accept Buffer, Uint8Array or Arrays
+	    if (typeof buffer === 'string') {
+	      // Different ways of writing the length of the string for the different types
+	      if (typeof Buffer !== 'undefined') {
+	        this.buffer = utils.toBuffer(buffer);
+	      } else if (typeof Uint8Array !== 'undefined' || Object.prototype.toString.call(buffer) === '[object Array]') {
+	        this.buffer = writeStringToArray(buffer);
+	      } else {
+	        throw new Error('only String, Buffer, Uint8Array or Array accepted');
+	      }
+	    } else {
+	      this.buffer = buffer;
+	    }
+	    this.position = buffer.length;
+	  } else {
+	    if (typeof Buffer !== 'undefined') {
+	      this.buffer = utils.allocBuffer(Binary.BUFFER_SIZE);
+	    } else if (typeof Uint8Array !== 'undefined') {
+	      this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
+	    } else {
+	      this.buffer = new Array(Binary.BUFFER_SIZE);
+	    }
+	    // Set position to start of buffer
+	    this.position = 0;
+	  }
+	}
+
+	/**
+	 * Updates this binary with byte_value.
+	 *
+	 * @method
+	 * @param {string} byte_value a single byte we wish to write.
+	 */
+	Binary.prototype.put = function put(byte_value) {
+	  // If it's a string and a has more than one character throw an error
+	  if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1) throw new Error('only accepts single character String, Uint8Array or Array');
+	  if (typeof byte_value !== 'number' && byte_value < 0 || byte_value > 255) throw new Error('only accepts number in a valid unsigned byte range 0-255');
+
+	  // Decode the byte value once
+	  var decoded_byte = null;
+	  if (typeof byte_value === 'string') {
+	    decoded_byte = byte_value.charCodeAt(0);
+	  } else if (byte_value['length'] != null) {
+	    decoded_byte = byte_value[0];
+	  } else {
+	    decoded_byte = byte_value;
+	  }
+
+	  if (this.buffer.length > this.position) {
+	    this.buffer[this.position++] = decoded_byte;
+	  } else {
+	    if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
+	      // Create additional overflow buffer
+	      var buffer = utils.allocBuffer(Binary.BUFFER_SIZE + this.buffer.length);
+	      // Combine the two buffers together
+	      this.buffer.copy(buffer, 0, 0, this.buffer.length);
+	      this.buffer = buffer;
+	      this.buffer[this.position++] = decoded_byte;
+	    } else {
+	      buffer = null;
+	      // Create a new buffer (typed or normal array)
+	      if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
+	        buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
+	      } else {
+	        buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
+	      }
+
+	      // We need to copy all the content to the new array
+	      for (var i = 0; i < this.buffer.length; i++) {
+	        buffer[i] = this.buffer[i];
+	      }
+
+	      // Reassign the buffer
+	      this.buffer = buffer;
+	      // Write the byte
+	      this.buffer[this.position++] = decoded_byte;
+	    }
+	  }
+	};
+
+	/**
+	 * Writes a buffer or string to the binary.
+	 *
+	 * @method
+	 * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
+	 * @param {number} offset specify the binary of where to write the content.
+	 * @return {null}
+	 */
+	Binary.prototype.write = function write(string, offset) {
+	  offset = typeof offset === 'number' ? offset : this.position;
+
+	  // If the buffer is to small let's extend the buffer
+	  if (this.buffer.length < offset + string.length) {
+	    var buffer = null;
+	    // If we are in node.js
+	    if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
+	      buffer = utils.allocBuffer(this.buffer.length + string.length);
+	      this.buffer.copy(buffer, 0, 0, this.buffer.length);
+	    } else if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
+	      // Create a new buffer
+	      buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
+	      // Copy the content
+	      for (var i = 0; i < this.position; i++) {
+	        buffer[i] = this.buffer[i];
+	      }
+	    }
+
+	    // Assign the new buffer
+	    this.buffer = buffer;
+	  }
+
+	  if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
+	    string.copy(this.buffer, offset, 0, string.length);
+	    this.position = offset + string.length > this.position ? offset + string.length : this.position;
+	    // offset = string.length
+	  } else if (typeof Buffer !== 'undefined' && typeof string === 'string' && Buffer.isBuffer(this.buffer)) {
+	    this.buffer.write(string, offset, 'binary');
+	    this.position = offset + string.length > this.position ? offset + string.length : this.position;
+	    // offset = string.length;
+	  } else if (Object.prototype.toString.call(string) === '[object Uint8Array]' || Object.prototype.toString.call(string) === '[object Array]' && typeof string !== 'string') {
+	    for (i = 0; i < string.length; i++) {
+	      this.buffer[offset++] = string[i];
+	    }
+
+	    this.position = offset > this.position ? offset : this.position;
+	  } else if (typeof string === 'string') {
+	    for (i = 0; i < string.length; i++) {
+	      this.buffer[offset++] = string.charCodeAt(i);
+	    }
+
+	    this.position = offset > this.position ? offset : this.position;
+	  }
+	};
+
+	/**
+	 * Reads **length** bytes starting at **position**.
+	 *
+	 * @method
+	 * @param {number} position read from the given position in the Binary.
+	 * @param {number} length the number of bytes to read.
+	 * @return {Buffer}
+	 */
+	Binary.prototype.read = function read(position, length) {
+	  length = length && length > 0 ? length : this.position;
+
+	  // Let's return the data based on the type we have
+	  if (this.buffer['slice']) {
+	    return this.buffer.slice(position, position + length);
+	  } else {
+	    // Create a buffer to keep the result
+	    var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(length)) : new Array(length);
+	    for (var i = 0; i < length; i++) {
+	      buffer[i] = this.buffer[position++];
+	    }
+	  }
+	  // Return the buffer
+	  return buffer;
+	};
+
+	/**
+	 * Returns the value of this binary as a string.
+	 *
+	 * @method
+	 * @return {string}
+	 */
+	Binary.prototype.value = function value(asRaw) {
+	  asRaw = asRaw == null ? false : asRaw;
+
+	  // Optimize to serialize for the situation where the data == size of buffer
+	  if (asRaw && typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer) && this.buffer.length === this.position) return this.buffer;
+
+	  // If it's a node.js buffer object
+	  if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
+	    return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position);
+	  } else {
+	    if (asRaw) {
+	      // we support the slice command use it
+	      if (this.buffer['slice'] != null) {
+	        return this.buffer.slice(0, this.position);
+	      } else {
+	        // Create a new buffer to copy content to
+	        var newBuffer = Object.prototype.toString.call(this.buffer) === '[object Uint8Array]' ? new Uint8Array(new ArrayBuffer(this.position)) : new Array(this.position);
+	        // Copy content
+	        for (var i = 0; i < this.position; i++) {
+	          newBuffer[i] = this.buffer[i];
+	        }
+	        // Return the buffer
+	        return newBuffer;
+	      }
+	    } else {
+	      return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
+	    }
+	  }
+	};
+
+	/**
+	 * Length.
+	 *
+	 * @method
+	 * @return {number} the length of the binary.
+	 */
+	Binary.prototype.length = function length() {
+	  return this.position;
+	};
+
+	/**
+	 * @ignore
+	 */
+	Binary.prototype.toJSON = function () {
+	  return this.buffer != null ? this.buffer.toString('base64') : '';
+	};
+
+	/**
+	 * @ignore
+	 */
+	Binary.prototype.toString = function (format) {
+	  return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
+	};
+
+	/**
+	 * Binary default subtype
+	 * @ignore
+	 */
+	var BSON_BINARY_SUBTYPE_DEFAULT = 0;
+
+	/**
+	 * @ignore
+	 */
+	var writeStringToArray = function (data) {
+	  // Create a buffer
+	  var buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(data.length)) : new Array(data.length);
+	  // Write the content to the buffer
+	  for (var i = 0; i < data.length; i++) {
+	    buffer[i] = data.charCodeAt(i);
+	  }
+	  // Write the string to the buffer
+	  return buffer;
+	};
+
+	/**
+	 * Convert Array ot Uint8Array to Binary String
+	 *
+	 * @ignore
+	 */
+	var convertArraytoUtf8BinaryString = function (byteArray, startIndex, endIndex) {
+	  var result = '';
+	  for (var i = startIndex; i < endIndex; i++) {
+	    result = result + String.fromCharCode(byteArray[i]);
+	  }
+	  return result;
+	};
+
+	Binary.BUFFER_SIZE = 256;
+
+	/**
+	 * Default BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_DEFAULT = 0;
+	/**
+	 * Function BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_FUNCTION = 1;
+	/**
+	 * Byte Array BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_BYTE_ARRAY = 2;
+	/**
+	 * OLD UUID BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_UUID_OLD = 3;
+	/**
+	 * UUID BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_UUID = 4;
+	/**
+	 * MD5 BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_MD5 = 5;
+	/**
+	 * User BSON type
+	 *
+	 * @classconstant SUBTYPE_DEFAULT
+	 **/
+	Binary.SUBTYPE_USER_DEFINED = 128;
+
+	/**
+	 * Expose.
+	 */
+	module.exports = Binary;
+	module.exports.Binary = Binary;
+	/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
+
+/***/ }),
+/* 357 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	'use strict';
+
+	var Long = __webpack_require__(335).Long,
+	    Double = __webpack_require__(336).Double,
+	    Timestamp = __webpack_require__(337).Timestamp,
+	    ObjectID = __webpack_require__(338).ObjectID,
+	    Symbol = __webpack_require__(349).Symbol,
+	    Code = __webpack_require__(351).Code,
+	    MinKey = __webpack_require__(353).MinKey,
+	    MaxKey = __webpack_require__(354).MaxKey,
+	    Decimal128 = __webpack_require__(352),
+	    Int32 = __webpack_require__(350),
+	    DBRef = __webpack_require__(355).DBRef,
+	    BSONRegExp = __webpack_require__(348).BSONRegExp,
+	    Binary = __webpack_require__(356).Binary;
+
+	var utils = __webpack_require__(344);
+
+	var deserialize = function (buffer, options, isArray) {
+	  options = options == null ? {} : options;
+	  var index = options && options.index ? options.index : 0;
+	  // Read the document size
+	  var size = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
+
+	  // Ensure buffer is valid size
+	  if (size < 5 || buffer.length < size || size + index > buffer.length) {
+	    throw new Error('corrupt bson message');
+	  }
+
+	  // Illegal end value
+	  if (buffer[index + size - 1] !== 0) {
+	    throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
+	  }
+
+	  // Start deserializtion
+	  return deserializeObject(buffer, index, options, isArray);
+	};
+
+	var deserializeObject = function (buffer, index, options, isArray) {
+	  var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
+	  var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
+	  var cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
+
+	  if (!cacheFunctionsCrc32) var crc32 = null;
+
+	  var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
+
+	  // Return raw bson buffer instead of parsing it
+	  var raw = options['raw'] == null ? false : options['raw'];
+
+	  // Return BSONRegExp objects instead of native regular expressions
+	  var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
+
+	  // Controls the promotion of values vs wrapper classes
+	  var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
+	  var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
+	  var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
+
+	  // Set the start index
+	  var startIndex = index;
+
+	  // Validate that we have at least 4 bytes of buffer
+	  if (buffer.length < 5) throw new Error('corrupt bson message < 5 bytes long');
+
+	  // Read the document size
+	  var size = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+
+	  // Ensure buffer is valid size
+	  if (size < 5 || size > buffer.length) throw new Error('corrupt bson message');
+
+	  // Create holding object
+	  var object = isArray ? [] : {};
+	  // Used for arrays to skip having to perform utf8 decoding
+	  var arrayIndex = 0;
+
+	  var done = false;
+
+	  // While we have more left data left keep parsing
+	  // while (buffer[index + 1] !== 0) {
+	  while (!done) {
+	    // Read the type
+	    var elementType = buffer[index++];
+	    // If we get a zero it's the last byte, exit
+	    if (elementType === 0) break;
+
+	    // Get the start search index
+	    var i = index;
+	    // Locate the end of the c string
+	    while (buffer[i] !== 0x00 && i < buffer.length) {
+	      i++;
+	    }
+
+	    // If are at the end of the buffer there is a problem with the document
+	    if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+	    var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
+
+	    index = i + 1;
+
+	    if (elementType === BSON.BSON_DATA_STRING) {
+	      var stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
+	      object[name] = buffer.toString('utf8', index, index + stringSize - 1);
+	      index = index + stringSize;
+	    } else if (elementType === BSON.BSON_DATA_OID) {
+	      var oid = utils.allocBuffer(12);
+	      buffer.copy(oid, 0, index, index + 12);
+	      object[name] = new ObjectID(oid);
+	      index = index + 12;
+	    } else if (elementType === BSON.BSON_DATA_INT && promoteValues === false) {
+	      object[name] = new Int32(buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24);
+	    } else if (elementType === BSON.BSON_DATA_INT) {
+	      object[name] = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	    } else if (elementType === BSON.BSON_DATA_NUMBER && promoteValues === false) {
+	      object[name] = new Double(buffer.readDoubleLE(index));
+	      index = index + 8;
+	    } else if (elementType === BSON.BSON_DATA_NUMBER) {
+	      object[name] = buffer.readDoubleLE(index);
+	      index = index + 8;
+	    } else if (elementType === BSON.BSON_DATA_DATE) {
+	      var lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      var highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      object[name] = new Date(new Long(lowBits, highBits).toNumber());
+	    } else if (elementType === BSON.BSON_DATA_BOOLEAN) {
+	      if (buffer[index] !== 0 && buffer[index] !== 1) throw new Error('illegal boolean type value');
+	      object[name] = buffer[index++] === 1;
+	    } else if (elementType === BSON.BSON_DATA_OBJECT) {
+	      var _index = index;
+	      var objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
+	      if (objectSize <= 0 || objectSize > buffer.length - index) throw new Error('bad embedded document length in bson');
+
+	      // We have a raw value
+	      if (raw) {
+	        object[name] = buffer.slice(index, index + objectSize);
+	      } else {
+	        object[name] = deserializeObject(buffer, _index, options, false);
+	      }
+
+	      index = index + objectSize;
+	    } else if (elementType === BSON.BSON_DATA_ARRAY) {
+	      _index = index;
+	      objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
+	      var arrayOptions = options;
+
+	      // Stop index
+	      var stopIndex = index + objectSize;
+
+	      // All elements of array to be returned as raw bson
+	      if (fieldsAsRaw && fieldsAsRaw[name]) {
+	        arrayOptions = {};
+	        for (var n in options) arrayOptions[n] = options[n];
+	        arrayOptions['raw'] = true;
+	      }
+
+	      object[name] = deserializeObject(buffer, _index, arrayOptions, true);
+	      index = index + objectSize;
+
+	      if (buffer[index - 1] !== 0) throw new Error('invalid array terminator byte');
+	      if (index !== stopIndex) throw new Error('corrupted array bson');
+	    } else if (elementType === BSON.BSON_DATA_UNDEFINED) {
+	      object[name] = undefined;
+	    } else if (elementType === BSON.BSON_DATA_NULL) {
+	      object[name] = null;
+	    } else if (elementType === BSON.BSON_DATA_LONG) {
+	      // Unpack the low and high bits
+	      lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      var long = new Long(lowBits, highBits);
+	      // Promote the long if possible
+	      if (promoteLongs && promoteValues === true) {
+	        object[name] = long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG) ? long.toNumber() : long;
+	      } else {
+	        object[name] = long;
+	      }
+	    } else if (elementType === BSON.BSON_DATA_DECIMAL128) {
+	      // Buffer to contain the decimal bytes
+	      var bytes = utils.allocBuffer(16);
+	      // Copy the next 16 bytes into the bytes buffer
+	      buffer.copy(bytes, 0, index, index + 16);
+	      // Update index
+	      index = index + 16;
+	      // Assign the new Decimal128 value
+	      var decimal128 = new Decimal128(bytes);
+	      // If we have an alternative mapper use that
+	      object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
+	    } else if (elementType === BSON.BSON_DATA_BINARY) {
+	      var binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      var totalBinarySize = binarySize;
+	      var subType = buffer[index++];
+
+	      // Did we have a negative binary size, throw
+	      if (binarySize < 0) throw new Error('Negative binary type element size found');
+
+	      // Is the length longer than the document
+	      if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
+
+	      // Decode as raw Buffer object if options specifies it
+	      if (buffer['slice'] != null) {
+	        // If we have subtype 2 skip the 4 bytes for the size
+	        if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
+	          binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	          if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
+	          if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
+	          if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
+	        }
+
+	        if (promoteBuffers && promoteValues) {
+	          object[name] = buffer.slice(index, index + binarySize);
+	        } else {
+	          object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
+	        }
+	      } else {
+	        var _buffer = typeof Uint8Array !== 'undefined' ? new Uint8Array(new ArrayBuffer(binarySize)) : new Array(binarySize);
+	        // If we have subtype 2 skip the 4 bytes for the size
+	        if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
+	          binarySize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	          if (binarySize < 0) throw new Error('Negative binary type element size found for subtype 0x02');
+	          if (binarySize > totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to long binary size');
+	          if (binarySize < totalBinarySize - 4) throw new Error('Binary type with subtype 0x02 contains to short binary size');
+	        }
+
+	        // Copy the data
+	        for (i = 0; i < binarySize; i++) {
+	          _buffer[i] = buffer[index + i];
+	        }
+
+	        if (promoteBuffers && promoteValues) {
+	          object[name] = _buffer;
+	        } else {
+	          object[name] = new Binary(_buffer, subType);
+	        }
+	      }
+
+	      // Update the index
+	      index = index + binarySize;
+	    } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === false) {
+	      // Get the start search index
+	      i = index;
+	      // Locate the end of the c string
+	      while (buffer[i] !== 0x00 && i < buffer.length) {
+	        i++;
+	      }
+	      // If are at the end of the buffer there is a problem with the document
+	      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+	      // Return the C string
+	      var source = buffer.toString('utf8', index, i);
+	      // Create the regexp
+	      index = i + 1;
+
+	      // Get the start search index
+	      i = index;
+	      // Locate the end of the c string
+	      while (buffer[i] !== 0x00 && i < buffer.length) {
+	        i++;
+	      }
+	      // If are at the end of the buffer there is a problem with the document
+	      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+	      // Return the C string
+	      var regExpOptions = buffer.toString('utf8', index, i);
+	      index = i + 1;
+
+	      // For each option add the corresponding one for javascript
+	      var optionsArray = new Array(regExpOptions.length);
+
+	      // Parse options
+	      for (i = 0; i < regExpOptions.length; i++) {
+	        switch (regExpOptions[i]) {
+	          case 'm':
+	            optionsArray[i] = 'm';
+	            break;
+	          case 's':
+	            optionsArray[i] = 'g';
+	            break;
+	          case 'i':
+	            optionsArray[i] = 'i';
+	            break;
+	        }
+	      }
+
+	      object[name] = new RegExp(source, optionsArray.join(''));
+	    } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === true) {
+	      // Get the start search index
+	      i = index;
+	      // Locate the end of the c string
+	      while (buffer[i] !== 0x00 && i < buffer.length) {
+	        i++;
+	      }
+	      // If are at the end of the buffer there is a problem with the document
+	      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+	      // Return the C string
+	      source = buffer.toString('utf8', index, i);
+	      index = i + 1;
+
+	      // Get the start search index
+	      i = index;
+	      // Locate the end of the c string
+	      while (buffer[i] !== 0x00 && i < buffer.length) {
+	        i++;
+	      }
+	      // If are at the end of the buffer there is a problem with the document
+	      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+	      // Return the C string
+	      regExpOptions = buffer.toString('utf8', index, i);
+	      index = i + 1;
+
+	      // Set the object
+	      object[name] = new BSONRegExp(source, regExpOptions);
+	    } else if (elementType === BSON.BSON_DATA_SYMBOL) {
+	      stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
+	      object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
+	      index = index + stringSize;
+	    } else if (elementType === BSON.BSON_DATA_TIMESTAMP) {
+	      lowBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      highBits = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      object[name] = new Timestamp(lowBits, highBits);
+	    } else if (elementType === BSON.BSON_DATA_MIN_KEY) {
+	      object[name] = new MinKey();
+	    } else if (elementType === BSON.BSON_DATA_MAX_KEY) {
+	      object[name] = new MaxKey();
+	    } else if (elementType === BSON.BSON_DATA_CODE) {
+	      stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
+	      var functionString = buffer.toString('utf8', index, index + stringSize - 1);
+
+	      // If we are evaluating the functions
+	      if (evalFunctions) {
+	        // If we have cache enabled let's look for the md5 of the function in the cache
+	        if (cacheFunctions) {
+	          var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
+	          // Got to do this to avoid V8 deoptimizing the call due to finding eval
+	          object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
+	        } else {
+	          object[name] = isolateEval(functionString);
+	        }
+	      } else {
+	        object[name] = new Code(functionString);
+	      }
+
+	      // Update parse index position
+	      index = index + stringSize;
+	    } else if (elementType === BSON.BSON_DATA_CODE_W_SCOPE) {
+	      var totalSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+
+	      // Element cannot be shorter than totalSize + stringSize + documentSize + terminator
+	      if (totalSize < 4 + 4 + 4 + 1) {
+	        throw new Error('code_w_scope total size shorter minimum expected length');
+	      }
+
+	      // Get the code string size
+	      stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      // Check if we have a valid string
+	      if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
+
+	      // Javascript function
+	      functionString = buffer.toString('utf8', index, index + stringSize - 1);
+	      // Update parse index position
+	      index = index + stringSize;
+	      // Parse the element
+	      _index = index;
+	      // Decode the size of the object document
+	      objectSize = buffer[index] | buffer[index + 1] << 8 | buffer[index + 2] << 16 | buffer[index + 3] << 24;
+	      // Decode the scope object
+	      var scopeObject = deserializeObject(buffer, _index, options, false);
+	      // Adjust the index
+	      index = index + objectSize;
+
+	      // Check if field length is to short
+	      if (totalSize < 4 + 4 + objectSize + stringSize) {
+	        throw new Error('code_w_scope total size is to short, truncating scope');
+	      }
+
+	      // Check if totalSize field is to long
+	      if (totalSize > 4 + 4 + objectSize + stringSize) {
+	        throw new Error('code_w_scope total size is to long, clips outer document');
+	      }
+
+	      // If we are evaluating the functions
+	      if (evalFunctions) {
+	        // If we have cache enabled let's look for the md5 of the function in the cache
+	        if (cacheFunctions) {
+	          hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
+	          // Got to do this to avoid V8 deoptimizing the call due to finding eval
+	          object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
+	        } else {
+	          object[name] = isolateEval(functionString);
+	        }
+
+	        object[name].scope = scopeObject;
+	      } else {
+	        object[name] = new Code(functionString, scopeObject);
+	      }
+	    } else if (elementType === BSON.BSON_DATA_DBPOINTER) {
+	      // Get the code string size
+	      stringSize = buffer[index++] | buffer[index++] << 8 | buffer[index++] << 16 | buffer[index++] << 24;
+	      // Check if we have a valid string
+	      if (stringSize <= 0 || stringSize > buffer.length - index || buffer[index + stringSize - 1] !== 0) throw new Error('bad string length in bson');
+	      // Namespace
+	      var namespace = buffer.toString('utf8', index, index + stringSize - 1);
+	      // Update parse index position
+	      index = index + stringSize;
+
+	      // Read the oid
+	      var oidBuffer = utils.allocBuffer(12);
+	      buffer.copy(oidBuffer, 0, index, index + 12);
+	      oid = new ObjectID(oidBuffer);
+
+	      // Update the index
+	      index = index + 12;
+
+	      // Split the namespace
+	      var parts = namespace.split('.');
+	      var db = parts.shift();
+	      var collection = parts.join('.');
+	      // Upgrade to DBRef type
+	      object[name] = new DBRef(collection, oid, db);
+	    } else {
+	      throw new Error('Detected unknown BSON type ' + elementType.toString(16) + ' for fieldname "' + name + '", are you using the latest BSON parser');
+	    }
+	  }
+
+	  // Check if the deserialization was against a valid array/object
+	  if (size !== index - startIndex) {
+	    if (isArray) throw new Error('corrupt array bson');
+	    throw new Error('corrupt object bson');
+	  }
+
+	  // Check if we have a db ref object
+	  if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
+	  return object;
+	};
+
+	/**
+	 * Ensure eval is isolated.
+	 *
+	 * @ignore
+	 * @api private
+	 */
+	var isolateEvalWithHash = function (functionCache, hash, functionString, object) {
+	  // Contains the value we are going to set
+	  var value = null;
+
+	  // Check for cache hit, eval if missing and return cached function
+	  if (functionCache[hash] == null) {
+	    eval('value = ' + functionString);
+	    functionCache[hash] = value;
+	  }
+	  // Set the object
+	  return functionCache[hash].bind(object);
+	};
+
+	/**
+	 * Ensure eval is isolated.
+	 *
+	 * @ignore
+	 * @api private
+	 */
+	var isolateEval = function (functionString) {
+	  // Contains the value we are going to set
+	  var value = null;
+	  // Eval the function
+	  eval('value = ' + functionString);
+	  return value;
+	};
+
+	var BSON = {};
+
+	/**
+	 * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
+	 *
+	 * @ignore
+	 * @api private
+	 */
+	var functionCache = BSON.functionCache = {};
+
+	/**
+	 * Number BSON Type
+	 *
+	 * @classconstant BSON_DATA_NUMBER
+	 **/
+	BSON.BSON_DATA_NUMBER = 1;
+	/**
+	 * String BSON Type
+	 *
+	 * @classconstant BSON_DATA_STRING
+	 **/
+	BSON.BSON_DATA_STRING = 2;
+	/**
+	 * Object BSON Type
+	 *
+	 * @classconstant BSON_DATA_OBJECT
+	 **/
+	BSON.BSON_DATA_OBJECT = 3;
+	/**
+	 * Array BSON Type
+	 *
+	 * @classconstant BSON_DATA_ARRAY
+	 **/
+	BSON.BSON_DATA_ARRAY = 4;
+	/**
+	 * Binary BSON Type
+	 *
+	 * @classconstant BSON_DATA_BINARY
+	 **/
+	BSON.BSON_DATA_BINARY = 5;
+	/**
+	 * Binary BSON Type
+	 *
+	 * @classconstant BSON_DATA_UNDEFINED
+	 **/
+	BSON.BSON_DATA_UNDEFINED = 6;
+	/**
+	 * ObjectID BSON Type
+	 *
+	 * @classconstant BSON_DATA_OID
+	 **/
+	BSON.BSON_DATA_OID = 7;
+	/**
+	 * Boolean BSON Type
+	 *
+	 * @classconstant BSON_DATA_BOOLEAN
+	 **/
+	BSON.BSON_DATA_BOOLEAN = 8;
+	/**
+	 * Date BSON Type
+	 *
+	 * @classconstant BSON_DATA_DATE
+	 **/
+	BSON.BSON_DATA_DATE = 9;
+	/**
+	 * null BSON Type
+	 *
+	 * @classconstant BSON_DATA_NULL
+	 **/
+	BSON.BSON_DATA_NULL = 10;
+	/**
+	 * RegExp BSON Type
+	 *
+	 * @classconstant BSON_DATA_REGEXP
+	 **/
+	BSON.BSON_DATA_REGEXP = 11;
+	/**
+	 * Code BSON Type
+	 *
+	 * @classconstant BSON_DATA_DBPOINTER
+	 **/
+	BSON.BSON_DATA_DBPOINTER = 12;
+	/**
+	 * Code BSON Type
+	 *
+	 * @classconstant BSON_DATA_CODE
+	 **/
+	BSON.BSON_DATA_CODE = 13;
+	/**
+	 * Symbol BSON Type
+	 *
+	 * @classconstant BSON_DATA_SYMBOL
+	 **/
+	BSON.BSON_DATA_SYMBOL = 14;
+	/**
+	 * Code with Scope BSON Type
+	 *
+	 * @classconstant BSON_DATA_CODE_W_SCOPE
+	 **/
+	BSON.BSON_DATA_CODE_W_SCOPE = 15;
+	/**
+	 * 32 bit Integer BSON Type
+	 *
+	 * @classconstant BSON_DATA_INT
+	 **/
+	BSON.BSON_DATA_INT = 16;
+	/**
+	 * Timestamp BSON Type
+	 *
+	 * @classconstant BSON_DATA_TIMESTAMP
+	 **/
+	BSON.BSON_DATA_TIMESTAMP = 17;
+	/**
+	 * Long BSON Type
+	 *
+	 * @classconstant BSON_DATA_LONG
+	 **/
+	BSON.BSON_DATA_LONG = 18;
+	/**
+	 * Long BSON Type
+	 *
+	 * @classconstant BSON_DATA_DECIMAL128
+	 **/
+	BSON.BSON_DATA_DECIMAL128 = 19;
+	/**
+	 * MinKey BSON Type
+	 *
+	 * @classconstant BSON_DATA_MIN_KEY
+	 **/
+	BSON.BSON_DATA_MIN_KEY = 0xff;
+	/**
+	 * MaxKey BSON Type
+	 *
+	 * @classconstant BSON_DATA_MAX_KEY
+	 **/
+	BSON.BSON_DATA_MAX_KEY = 0x7f;
+
+	/**
+	 * Binary Default Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
+	/**
+	 * Binary Function Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
+	/**
+	 * Binary Byte Array Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
+	/**
+	 * Binary UUID Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_UUID
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_UUID = 3;
+	/**
+	 * Binary MD5 Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_MD5
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
+	/**
+	 * Binary User Defined Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
+
+	// BSON MAX VALUES
+	BSON.BSON_INT32_MAX = 0x7fffffff;
+	BSON.BSON_INT32_MIN = -0x80000000;
+
+	BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+	BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+	// JS MAX PRECISE VALUES
+	BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+	BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+	// Internal long versions
+	var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
+	var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
+
+	module.exports = deserialize;
+
+/***/ }),
+/* 358 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
+
+	var writeIEEE754 = __webpack_require__(359).writeIEEE754,
+	    Long = __webpack_require__(335).Long,
+	    Map = __webpack_require__(334),
+	    Binary = __webpack_require__(356).Binary;
+
+	var normalizedFunctionString = __webpack_require__(344).normalizedFunctionString;
+
+	// try {
+	//   var _Buffer = Uint8Array;
+	// } catch (e) {
+	//   _Buffer = Buffer;
+	// }
+
+	var regexp = /\x00/; // eslint-disable-line no-control-regex
+	var ignoreKeys = ['$db', '$ref', '$id', '$clusterTime'];
+
+	// To ensure that 0.4 of node works correctly
+	var isDate = function isDate(d) {
+	  return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
+	};
+
+	var isRegExp = function isRegExp(d) {
+	  return Object.prototype.toString.call(d) === '[object RegExp]';
+	};
+
+	var serializeString = function (buffer, key, value, index, isArray) {
+	  // Encode String type
+	  buffer[index++] = BSON.BSON_DATA_STRING;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes + 1;
+	  buffer[index - 1] = 0;
+	  // Write the string
+	  var size = buffer.write(value, index + 4, 'utf8');
+	  // Write the size of the string to buffer
+	  buffer[index + 3] = size + 1 >> 24 & 0xff;
+	  buffer[index + 2] = size + 1 >> 16 & 0xff;
+	  buffer[index + 1] = size + 1 >> 8 & 0xff;
+	  buffer[index] = size + 1 & 0xff;
+	  // Update index
+	  index = index + 4 + size;
+	  // Write zero
+	  buffer[index++] = 0;
+	  return index;
+	};
+
+	var serializeNumber = function (buffer, key, value, index, isArray) {
+	  // We have an integer value
+	  if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
+	    // If the value fits in 32 bits encode as int, if it fits in a double
+	    // encode it as a double, otherwise long
+	    if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
+	      // Set int type 32 bits or less
+	      buffer[index++] = BSON.BSON_DATA_INT;
+	      // Number of written bytes
+	      var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	      // Encode the name
+	      index = index + numberOfWrittenBytes;
+	      buffer[index++] = 0;
+	      // Write the int value
+	      buffer[index++] = value & 0xff;
+	      buffer[index++] = value >> 8 & 0xff;
+	      buffer[index++] = value >> 16 & 0xff;
+	      buffer[index++] = value >> 24 & 0xff;
+	    } else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
+	      // Encode as double
+	      buffer[index++] = BSON.BSON_DATA_NUMBER;
+	      // Number of written bytes
+	      numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	      // Encode the name
+	      index = index + numberOfWrittenBytes;
+	      buffer[index++] = 0;
+	      // Write float
+	      writeIEEE754(buffer, value, index, 'little', 52, 8);
+	      // Ajust index
+	      index = index + 8;
+	    } else {
+	      // Set long type
+	      buffer[index++] = BSON.BSON_DATA_LONG;
+	      // Number of written bytes
+	      numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	      // Encode the name
+	      index = index + numberOfWrittenBytes;
+	      buffer[index++] = 0;
+	      var longVal = Long.fromNumber(value);
+	      var lowBits = longVal.getLowBits();
+	      var highBits = longVal.getHighBits();
+	      // Encode low bits
+	      buffer[index++] = lowBits & 0xff;
+	      buffer[index++] = lowBits >> 8 & 0xff;
+	      buffer[index++] = lowBits >> 16 & 0xff;
+	      buffer[index++] = lowBits >> 24 & 0xff;
+	      // Encode high bits
+	      buffer[index++] = highBits & 0xff;
+	      buffer[index++] = highBits >> 8 & 0xff;
+	      buffer[index++] = highBits >> 16 & 0xff;
+	      buffer[index++] = highBits >> 24 & 0xff;
+	    }
+	  } else {
+	    // Encode as double
+	    buffer[index++] = BSON.BSON_DATA_NUMBER;
+	    // Number of written bytes
+	    numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	    // Encode the name
+	    index = index + numberOfWrittenBytes;
+	    buffer[index++] = 0;
+	    // Write float
+	    writeIEEE754(buffer, value, index, 'little', 52, 8);
+	    // Ajust index
+	    index = index + 8;
+	  }
+
+	  return index;
+	};
+
+	var serializeNull = function (buffer, key, value, index, isArray) {
+	  // Set long type
+	  buffer[index++] = BSON.BSON_DATA_NULL;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  return index;
+	};
+
+	var serializeBoolean = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_BOOLEAN;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Encode the boolean value
+	  buffer[index++] = value ? 1 : 0;
+	  return index;
+	};
+
+	var serializeDate = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_DATE;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+
+	  // Write the date
+	  var dateInMilis = Long.fromNumber(value.getTime());
+	  var lowBits = dateInMilis.getLowBits();
+	  var highBits = dateInMilis.getHighBits();
+	  // Encode low bits
+	  buffer[index++] = lowBits & 0xff;
+	  buffer[index++] = lowBits >> 8 & 0xff;
+	  buffer[index++] = lowBits >> 16 & 0xff;
+	  buffer[index++] = lowBits >> 24 & 0xff;
+	  // Encode high bits
+	  buffer[index++] = highBits & 0xff;
+	  buffer[index++] = highBits >> 8 & 0xff;
+	  buffer[index++] = highBits >> 16 & 0xff;
+	  buffer[index++] = highBits >> 24 & 0xff;
+	  return index;
+	};
+
+	var serializeRegExp = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_REGEXP;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  if (value.source && value.source.match(regexp) != null) {
+	    throw Error('value ' + value.source + ' must not contain null bytes');
+	  }
+	  // Adjust the index
+	  index = index + buffer.write(value.source, index, 'utf8');
+	  // Write zero
+	  buffer[index++] = 0x00;
+	  // Write the parameters
+	  if (value.global) buffer[index++] = 0x73; // s
+	  if (value.ignoreCase) buffer[index++] = 0x69; // i
+	  if (value.multiline) buffer[index++] = 0x6d; // m
+	  // Add ending zero
+	  buffer[index++] = 0x00;
+	  return index;
+	};
+
+	var serializeBSONRegExp = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_REGEXP;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+
+	  // Check the pattern for 0 bytes
+	  if (value.pattern.match(regexp) != null) {
+	    // The BSON spec doesn't allow keys with null bytes because keys are
+	    // null-terminated.
+	    throw Error('pattern ' + value.pattern + ' must not contain null bytes');
+	  }
+
+	  // Adjust the index
+	  index = index + buffer.write(value.pattern, index, 'utf8');
+	  // Write zero
+	  buffer[index++] = 0x00;
+	  // Write the options
+	  index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8');
+	  // Add ending zero
+	  buffer[index++] = 0x00;
+	  return index;
+	};
+
+	var serializeMinMax = function (buffer, key, value, index, isArray) {
+	  // Write the type of either min or max key
+	  if (value === null) {
+	    buffer[index++] = BSON.BSON_DATA_NULL;
+	  } else if (value._bsontype === 'MinKey') {
+	    buffer[index++] = BSON.BSON_DATA_MIN_KEY;
+	  } else {
+	    buffer[index++] = BSON.BSON_DATA_MAX_KEY;
+	  }
+
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  return index;
+	};
+
+	var serializeObjectId = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_OID;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+
+	  // Write the objectId into the shared buffer
+	  if (typeof value.id === 'string') {
+	    buffer.write(value.id, index, 'binary');
+	  } else if (value.id && value.id.copy) {
+	    value.id.copy(buffer, index, 0, 12);
+	  } else {
+	    throw new Error('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
+	  }
+
+	  // Ajust index
+	  return index + 12;
+	};
+
+	var serializeBuffer = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_BINARY;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Get size of the buffer (current write point)
+	  var size = value.length;
+	  // Write the size of the string to buffer
+	  buffer[index++] = size & 0xff;
+	  buffer[index++] = size >> 8 & 0xff;
+	  buffer[index++] = size >> 16 & 0xff;
+	  buffer[index++] = size >> 24 & 0xff;
+	  // Write the default subtype
+	  buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
+	  // Copy the content form the binary field to the buffer
+	  value.copy(buffer, index, 0, size);
+	  // Adjust the index
+	  index = index + size;
+	  return index;
+	};
+
+	var serializeObject = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray, path) {
+	  for (var i = 0; i < path.length; i++) {
+	    if (path[i] === value) throw new Error('cyclic dependency detected');
+	  }
+
+	  // Push value to stack
+	  path.push(value);
+	  // Write the type
+	  buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  var endIndex = serializeInto(buffer, value, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined, path);
+	  // Pop stack
+	  path.pop();
+	  // Write size
+	  return endIndex;
+	};
+
+	var serializeDecimal128 = function (buffer, key, value, index, isArray) {
+	  buffer[index++] = BSON.BSON_DATA_DECIMAL128;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Write the data from the value
+	  value.bytes.copy(buffer, index, 0, 16);
+	  return index + 16;
+	};
+
+	var serializeLong = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = value._bsontype === 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Write the date
+	  var lowBits = value.getLowBits();
+	  var highBits = value.getHighBits();
+	  // Encode low bits
+	  buffer[index++] = lowBits & 0xff;
+	  buffer[index++] = lowBits >> 8 & 0xff;
+	  buffer[index++] = lowBits >> 16 & 0xff;
+	  buffer[index++] = lowBits >> 24 & 0xff;
+	  // Encode high bits
+	  buffer[index++] = highBits & 0xff;
+	  buffer[index++] = highBits >> 8 & 0xff;
+	  buffer[index++] = highBits >> 16 & 0xff;
+	  buffer[index++] = highBits >> 24 & 0xff;
+	  return index;
+	};
+
+	var serializeInt32 = function (buffer, key, value, index, isArray) {
+	  // Set int type 32 bits or less
+	  buffer[index++] = BSON.BSON_DATA_INT;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Write the int value
+	  buffer[index++] = value & 0xff;
+	  buffer[index++] = value >> 8 & 0xff;
+	  buffer[index++] = value >> 16 & 0xff;
+	  buffer[index++] = value >> 24 & 0xff;
+	  return index;
+	};
+
+	var serializeDouble = function (buffer, key, value, index, isArray) {
+	  // Encode as double
+	  buffer[index++] = BSON.BSON_DATA_NUMBER;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Write float
+	  writeIEEE754(buffer, value, index, 'little', 52, 8);
+	  // Ajust index
+	  index = index + 8;
+	  return index;
+	};
+
+	var serializeFunction = function (buffer, key, value, index, checkKeys, depth, isArray) {
+	  buffer[index++] = BSON.BSON_DATA_CODE;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Function string
+	  var functionString = normalizedFunctionString(value);
+
+	  // Write the string
+	  var size = buffer.write(functionString, index + 4, 'utf8') + 1;
+	  // Write the size of the string to buffer
+	  buffer[index] = size & 0xff;
+	  buffer[index + 1] = size >> 8 & 0xff;
+	  buffer[index + 2] = size >> 16 & 0xff;
+	  buffer[index + 3] = size >> 24 & 0xff;
+	  // Update index
+	  index = index + 4 + size - 1;
+	  // Write zero
+	  buffer[index++] = 0;
+	  return index;
+	};
+
+	var serializeCode = function (buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, isArray) {
+	  if (value.scope && typeof value.scope === 'object') {
+	    // Write the type
+	    buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
+	    // Number of written bytes
+	    var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	    // Encode the name
+	    index = index + numberOfWrittenBytes;
+	    buffer[index++] = 0;
+
+	    // Starting index
+	    var startIndex = index;
+
+	    // Serialize the function
+	    // Get the function string
+	    var functionString = typeof value.code === 'string' ? value.code : value.code.toString();
+	    // Index adjustment
+	    index = index + 4;
+	    // Write string into buffer
+	    var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
+	    // Write the size of the string to buffer
+	    buffer[index] = codeSize & 0xff;
+	    buffer[index + 1] = codeSize >> 8 & 0xff;
+	    buffer[index + 2] = codeSize >> 16 & 0xff;
+	    buffer[index + 3] = codeSize >> 24 & 0xff;
+	    // Write end 0
+	    buffer[index + 4 + codeSize - 1] = 0;
+	    // Write the
+	    index = index + codeSize + 4;
+
+	    //
+	    // Serialize the scope value
+	    var endIndex = serializeInto(buffer, value.scope, checkKeys, index, depth + 1, serializeFunctions, ignoreUndefined);
+	    index = endIndex - 1;
+
+	    // Writ the total
+	    var totalSize = endIndex - startIndex;
+
+	    // Write the total size of the object
+	    buffer[startIndex++] = totalSize & 0xff;
+	    buffer[startIndex++] = totalSize >> 8 & 0xff;
+	    buffer[startIndex++] = totalSize >> 16 & 0xff;
+	    buffer[startIndex++] = totalSize >> 24 & 0xff;
+	    // Write trailing zero
+	    buffer[index++] = 0;
+	  } else {
+	    buffer[index++] = BSON.BSON_DATA_CODE;
+	    // Number of written bytes
+	    numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	    // Encode the name
+	    index = index + numberOfWrittenBytes;
+	    buffer[index++] = 0;
+	    // Function string
+	    functionString = value.code.toString();
+	    // Write the string
+	    var size = buffer.write(functionString, index + 4, 'utf8') + 1;
+	    // Write the size of the string to buffer
+	    buffer[index] = size & 0xff;
+	    buffer[index + 1] = size >> 8 & 0xff;
+	    buffer[index + 2] = size >> 16 & 0xff;
+	    buffer[index + 3] = size >> 24 & 0xff;
+	    // Update index
+	    index = index + 4 + size - 1;
+	    // Write zero
+	    buffer[index++] = 0;
+	  }
+
+	  return index;
+	};
+
+	var serializeBinary = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_BINARY;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Extract the buffer
+	  var data = value.value(true);
+	  // Calculate size
+	  var size = value.position;
+	  // Add the deprecated 02 type 4 bytes of size to total
+	  if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
+	  // Write the size of the string to buffer
+	  buffer[index++] = size & 0xff;
+	  buffer[index++] = size >> 8 & 0xff;
+	  buffer[index++] = size >> 16 & 0xff;
+	  buffer[index++] = size >> 24 & 0xff;
+	  // Write the subtype to the buffer
+	  buffer[index++] = value.sub_type;
+
+	  // If we have binary type 2 the 4 first bytes are the size
+	  if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
+	    size = size - 4;
+	    buffer[index++] = size & 0xff;
+	    buffer[index++] = size >> 8 & 0xff;
+	    buffer[index++] = size >> 16 & 0xff;
+	    buffer[index++] = size >> 24 & 0xff;
+	  }
+
+	  // Write the data to the object
+	  data.copy(buffer, index, 0, value.position);
+	  // Adjust the index
+	  index = index + value.position;
+	  return index;
+	};
+
+	var serializeSymbol = function (buffer, key, value, index, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_SYMBOL;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+	  // Write the string
+	  var size = buffer.write(value.value, index + 4, 'utf8') + 1;
+	  // Write the size of the string to buffer
+	  buffer[index] = size & 0xff;
+	  buffer[index + 1] = size >> 8 & 0xff;
+	  buffer[index + 2] = size >> 16 & 0xff;
+	  buffer[index + 3] = size >> 24 & 0xff;
+	  // Update index
+	  index = index + 4 + size - 1;
+	  // Write zero
+	  buffer[index++] = 0x00;
+	  return index;
+	};
+
+	var serializeDBRef = function (buffer, key, value, index, depth, serializeFunctions, isArray) {
+	  // Write the type
+	  buffer[index++] = BSON.BSON_DATA_OBJECT;
+	  // Number of written bytes
+	  var numberOfWrittenBytes = !isArray ? buffer.write(key, index, 'utf8') : buffer.write(key, index, 'ascii');
+
+	  // Encode the name
+	  index = index + numberOfWrittenBytes;
+	  buffer[index++] = 0;
+
+	  var startIndex = index;
+	  var endIndex;
+
+	  // Serialize object
+	  if (null != value.db) {
+	    endIndex = serializeInto(buffer, {
+	      $ref: value.namespace,
+	      $id: value.oid,
+	      $db: value.db
+	    }, false, index, depth + 1, serializeFunctions);
+	  } else {
+	    endIndex = serializeInto(buffer, {
+	      $ref: value.namespace,
+	      $id: value.oid
+	    }, false, index, depth + 1, serializeFunctions);
+	  }
+
+	  // Calculate object size
+	  var size = endIndex - startIndex;
+	  // Write the size
+	  buffer[startIndex++] = size & 0xff;
+	  buffer[startIndex++] = size >> 8 & 0xff;
+	  buffer[startIndex++] = size >> 16 & 0xff;
+	  buffer[startIndex++] = size >> 24 & 0xff;
+	  // Set index
+	  return endIndex;
+	};
+
+	var serializeInto = function serializeInto(buffer, object, checkKeys, startingIndex, depth, serializeFunctions, ignoreUndefined, path) {
+	  startingIndex = startingIndex || 0;
+	  path = path || [];
+
+	  // Push the object to the path
+	  path.push(object);
+
+	  // Start place to serialize into
+	  var index = startingIndex + 4;
+	  // var self = this;
+
+	  // Special case isArray
+	  if (Array.isArray(object)) {
+	    // Get object keys
+	    for (var i = 0; i < object.length; i++) {
+	      var key = '' + i;
+	      var value = object[i];
+
+	      // Is there an override value
+	      if (value && value.toBSON) {
+	        if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
+	        value = value.toBSON();
+	      }
+
+	      var type = typeof value;
+	      if (type === 'string') {
+	        index = serializeString(buffer, key, value, index, true);
+	      } else if (type === 'number') {
+	        index = serializeNumber(buffer, key, value, index, true);
+	      } else if (type === 'boolean') {
+	        index = serializeBoolean(buffer, key, value, index, true);
+	      } else if (value instanceof Date || isDate(value)) {
+	        index = serializeDate(buffer, key, value, index, true);
+	      } else if (value === undefined) {
+	        index = serializeNull(buffer, key, value, index, true);
+	      } else if (value === null) {
+	        index = serializeNull(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+	        index = serializeObjectId(buffer, key, value, index, true);
+	      } else if (Buffer.isBuffer(value)) {
+	        index = serializeBuffer(buffer, key, value, index, true);
+	      } else if (value instanceof RegExp || isRegExp(value)) {
+	        index = serializeRegExp(buffer, key, value, index, true);
+	      } else if (type === 'object' && value['_bsontype'] == null) {
+	        index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true, path);
+	      } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
+	        index = serializeDecimal128(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
+	        index = serializeLong(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'Double') {
+	        index = serializeDouble(buffer, key, value, index, true);
+	      } else if (typeof value === 'function' && serializeFunctions) {
+	        index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions, true);
+	      } else if (value['_bsontype'] === 'Code') {
+	        index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, true);
+	      } else if (value['_bsontype'] === 'Binary') {
+	        index = serializeBinary(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'Symbol') {
+	        index = serializeSymbol(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'DBRef') {
+	        index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
+	      } else if (value['_bsontype'] === 'BSONRegExp') {
+	        index = serializeBSONRegExp(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'Int32') {
+	        index = serializeInt32(buffer, key, value, index, true);
+	      } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+	        index = serializeMinMax(buffer, key, value, index, true);
+	      } else if (typeof value['_bsontype'] !== 'undefined') {
+	        throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
+	      }
+	    }
+	  } else if (object instanceof Map) {
+	    var iterator = object.entries();
+	    var done = false;
+
+	    while (!done) {
+	      // Unpack the next entry
+	      var entry = iterator.next();
+	      done = entry.done;
+	      // Are we done, then skip and terminate
+	      if (done) continue;
+
+	      // Get the entry values
+	      key = entry.value[0];
+	      value = entry.value[1];
+
+	      // Check the type of the value
+	      type = typeof value;
+
+	      // Check the key and throw error if it's illegal
+	      if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
+	        if (key.match(regexp) != null) {
+	          // The BSON spec doesn't allow keys with null bytes because keys are
+	          // null-terminated.
+	          throw Error('key ' + key + ' must not contain null bytes');
+	        }
+
+	        if (checkKeys) {
+	          if ('$' === key[0]) {
+	            throw Error('key ' + key + " must not start with '$'");
+	          } else if (~key.indexOf('.')) {
+	            throw Error('key ' + key + " must not contain '.'");
+	          }
+	        }
+	      }
+
+	      if (type === 'string') {
+	        index = serializeString(buffer, key, value, index);
+	      } else if (type === 'number') {
+	        index = serializeNumber(buffer, key, value, index);
+	      } else if (type === 'boolean') {
+	        index = serializeBoolean(buffer, key, value, index);
+	      } else if (value instanceof Date || isDate(value)) {
+	        index = serializeDate(buffer, key, value, index);
+	        // } else if (value === undefined && ignoreUndefined === true) {
+	      } else if (value === null || value === undefined && ignoreUndefined === false) {
+	        index = serializeNull(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+	        index = serializeObjectId(buffer, key, value, index);
+	      } else if (Buffer.isBuffer(value)) {
+	        index = serializeBuffer(buffer, key, value, index);
+	      } else if (value instanceof RegExp || isRegExp(value)) {
+	        index = serializeRegExp(buffer, key, value, index);
+	      } else if (type === 'object' && value['_bsontype'] == null) {
+	        index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
+	      } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
+	        index = serializeDecimal128(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
+	        index = serializeLong(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Double') {
+	        index = serializeDouble(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Code') {
+	        index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
+	      } else if (typeof value === 'function' && serializeFunctions) {
+	        index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
+	      } else if (value['_bsontype'] === 'Binary') {
+	        index = serializeBinary(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Symbol') {
+	        index = serializeSymbol(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'DBRef') {
+	        index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
+	      } else if (value['_bsontype'] === 'BSONRegExp') {
+	        index = serializeBSONRegExp(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Int32') {
+	        index = serializeInt32(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+	        index = serializeMinMax(buffer, key, value, index);
+	      } else if (typeof value['_bsontype'] !== 'undefined') {
+	        throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
+	      }
+	    }
+	  } else {
+	    // Did we provide a custom serialization method
+	    if (object.toBSON) {
+	      if (typeof object.toBSON !== 'function') throw new Error('toBSON is not a function');
+	      object = object.toBSON();
+	      if (object != null && typeof object !== 'object') throw new Error('toBSON function did not return an object');
+	    }
+
+	    // Iterate over all the keys
+	    for (key in object) {
+	      value = object[key];
+	      // Is there an override value
+	      if (value && value.toBSON) {
+	        if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
+	        value = value.toBSON();
+	      }
+
+	      // Check the type of the value
+	      type = typeof value;
+
+	      // Check the key and throw error if it's illegal
+	      if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
+	        if (key.match(regexp) != null) {
+	          // The BSON spec doesn't allow keys with null bytes because keys are
+	          // null-terminated.
+	          throw Error('key ' + key + ' must not contain null bytes');
+	        }
+
+	        if (checkKeys) {
+	          if ('$' === key[0]) {
+	            throw Error('key ' + key + " must not start with '$'");
+	          } else if (~key.indexOf('.')) {
+	            throw Error('key ' + key + " must not contain '.'");
+	          }
+	        }
+	      }
+
+	      if (type === 'string') {
+	        index = serializeString(buffer, key, value, index);
+	      } else if (type === 'number') {
+	        index = serializeNumber(buffer, key, value, index);
+	      } else if (type === 'boolean') {
+	        index = serializeBoolean(buffer, key, value, index);
+	      } else if (value instanceof Date || isDate(value)) {
+	        index = serializeDate(buffer, key, value, index);
+	      } else if (value === undefined) {
+	        if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index);
+	      } else if (value === null) {
+	        index = serializeNull(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+	        index = serializeObjectId(buffer, key, value, index);
+	      } else if (Buffer.isBuffer(value)) {
+	        index = serializeBuffer(buffer, key, value, index);
+	      } else if (value instanceof RegExp || isRegExp(value)) {
+	        index = serializeRegExp(buffer, key, value, index);
+	      } else if (type === 'object' && value['_bsontype'] == null) {
+	        index = serializeObject(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined, false, path);
+	      } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
+	        index = serializeDecimal128(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
+	        index = serializeLong(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Double') {
+	        index = serializeDouble(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Code') {
+	        index = serializeCode(buffer, key, value, index, checkKeys, depth, serializeFunctions, ignoreUndefined);
+	      } else if (typeof value === 'function' && serializeFunctions) {
+	        index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
+	      } else if (value['_bsontype'] === 'Binary') {
+	        index = serializeBinary(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Symbol') {
+	        index = serializeSymbol(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'DBRef') {
+	        index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
+	      } else if (value['_bsontype'] === 'BSONRegExp') {
+	        index = serializeBSONRegExp(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'Int32') {
+	        index = serializeInt32(buffer, key, value, index);
+	      } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+	        index = serializeMinMax(buffer, key, value, index);
+	      } else if (typeof value['_bsontype'] !== 'undefined') {
+	        throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
+	      }
+	    }
+	  }
+
+	  // Remove the path
+	  path.pop();
+
+	  // Final padding byte for object
+	  buffer[index++] = 0x00;
+
+	  // Final size
+	  var size = index - startingIndex;
+	  // Write the size of the object
+	  buffer[startingIndex++] = size & 0xff;
+	  buffer[startingIndex++] = size >> 8 & 0xff;
+	  buffer[startingIndex++] = size >> 16 & 0xff;
+	  buffer[startingIndex++] = size >> 24 & 0xff;
+	  return index;
+	};
+
+	var BSON = {};
+
+	/**
+	 * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
+	 *
+	 * @ignore
+	 * @api private
+	 */
+	// var functionCache = (BSON.functionCache = {});
+
+	/**
+	 * Number BSON Type
+	 *
+	 * @classconstant BSON_DATA_NUMBER
+	 **/
+	BSON.BSON_DATA_NUMBER = 1;
+	/**
+	 * String BSON Type
+	 *
+	 * @classconstant BSON_DATA_STRING
+	 **/
+	BSON.BSON_DATA_STRING = 2;
+	/**
+	 * Object BSON Type
+	 *
+	 * @classconstant BSON_DATA_OBJECT
+	 **/
+	BSON.BSON_DATA_OBJECT = 3;
+	/**
+	 * Array BSON Type
+	 *
+	 * @classconstant BSON_DATA_ARRAY
+	 **/
+	BSON.BSON_DATA_ARRAY = 4;
+	/**
+	 * Binary BSON Type
+	 *
+	 * @classconstant BSON_DATA_BINARY
+	 **/
+	BSON.BSON_DATA_BINARY = 5;
+	/**
+	 * ObjectID BSON Type, deprecated
+	 *
+	 * @classconstant BSON_DATA_UNDEFINED
+	 **/
+	BSON.BSON_DATA_UNDEFINED = 6;
+	/**
+	 * ObjectID BSON Type
+	 *
+	 * @classconstant BSON_DATA_OID
+	 **/
+	BSON.BSON_DATA_OID = 7;
+	/**
+	 * Boolean BSON Type
+	 *
+	 * @classconstant BSON_DATA_BOOLEAN
+	 **/
+	BSON.BSON_DATA_BOOLEAN = 8;
+	/**
+	 * Date BSON Type
+	 *
+	 * @classconstant BSON_DATA_DATE
+	 **/
+	BSON.BSON_DATA_DATE = 9;
+	/**
+	 * null BSON Type
+	 *
+	 * @classconstant BSON_DATA_NULL
+	 **/
+	BSON.BSON_DATA_NULL = 10;
+	/**
+	 * RegExp BSON Type
+	 *
+	 * @classconstant BSON_DATA_REGEXP
+	 **/
+	BSON.BSON_DATA_REGEXP = 11;
+	/**
+	 * Code BSON Type
+	 *
+	 * @classconstant BSON_DATA_CODE
+	 **/
+	BSON.BSON_DATA_CODE = 13;
+	/**
+	 * Symbol BSON Type
+	 *
+	 * @classconstant BSON_DATA_SYMBOL
+	 **/
+	BSON.BSON_DATA_SYMBOL = 14;
+	/**
+	 * Code with Scope BSON Type
+	 *
+	 * @classconstant BSON_DATA_CODE_W_SCOPE
+	 **/
+	BSON.BSON_DATA_CODE_W_SCOPE = 15;
+	/**
+	 * 32 bit Integer BSON Type
+	 *
+	 * @classconstant BSON_DATA_INT
+	 **/
+	BSON.BSON_DATA_INT = 16;
+	/**
+	 * Timestamp BSON Type
+	 *
+	 * @classconstant BSON_DATA_TIMESTAMP
+	 **/
+	BSON.BSON_DATA_TIMESTAMP = 17;
+	/**
+	 * Long BSON Type
+	 *
+	 * @classconstant BSON_DATA_LONG
+	 **/
+	BSON.BSON_DATA_LONG = 18;
+	/**
+	 * Long BSON Type
+	 *
+	 * @classconstant BSON_DATA_DECIMAL128
+	 **/
+	BSON.BSON_DATA_DECIMAL128 = 19;
+	/**
+	 * MinKey BSON Type
+	 *
+	 * @classconstant BSON_DATA_MIN_KEY
+	 **/
+	BSON.BSON_DATA_MIN_KEY = 0xff;
+	/**
+	 * MaxKey BSON Type
+	 *
+	 * @classconstant BSON_DATA_MAX_KEY
+	 **/
+	BSON.BSON_DATA_MAX_KEY = 0x7f;
+	/**
+	 * Binary Default Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
+	/**
+	 * Binary Function Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
+	/**
+	 * Binary Byte Array Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
+	/**
+	 * Binary UUID Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_UUID
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_UUID = 3;
+	/**
+	 * Binary MD5 Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_MD5
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
+	/**
+	 * Binary User Defined Type
+	 *
+	 * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
+	 **/
+	BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
+
+	// BSON MAX VALUES
+	BSON.BSON_INT32_MAX = 0x7fffffff;
+	BSON.BSON_INT32_MIN = -0x80000000;
+
+	BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+	BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+	// JS MAX PRECISE VALUES
+	BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+	BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+	// Internal long versions
+	// var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
+	// var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
+
+	module.exports = serializeInto;
+	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
+
+/***/ }),
+/* 359 */
+/***/ (function(module, exports) {
+
+	// Copyright (c) 2008, Fair Oaks Labs, Inc.
+	// All rights reserved.
+	//
+	// Redistribution and use in source and binary forms, with or without
+	// modification, are permitted provided that the following conditions are met:
+	//
+	//  * Redistributions of source code must retain the above copyright notice,
+	//    this list of conditions and the following disclaimer.
+	//
+	//  * Redistributions in binary form must reproduce the above copyright notice,
+	//    this list of conditions and the following disclaimer in the documentation
+	//    and/or other materials provided with the distribution.
+	//
+	//  * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
+	//    may be used to endorse or promote products derived from this software
+	//    without specific prior written permission.
+	//
+	// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+	// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+	// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+	// ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+	// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+	// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+	// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+	// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+	// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+	// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+	// POSSIBILITY OF SUCH DAMAGE.
+	//
+	//
+	// Modifications to writeIEEE754 to support negative zeroes made by Brian White
+
+	var readIEEE754 = function (buffer, offset, endian, mLen, nBytes) {
+	  var e,
+	      m,
+	      bBE = endian === 'big',
+	      eLen = nBytes * 8 - mLen - 1,
+	      eMax = (1 << eLen) - 1,
+	      eBias = eMax >> 1,
+	      nBits = -7,
+	      i = bBE ? 0 : nBytes - 1,
+	      d = bBE ? 1 : -1,
+	      s = buffer[offset + i];
+
+	  i += d;
+
+	  e = s & (1 << -nBits) - 1;
+	  s >>= -nBits;
+	  nBits += eLen;
+	  for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
+
+	  m = e & (1 << -nBits) - 1;
+	  e >>= -nBits;
+	  nBits += mLen;
+	  for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
+
+	  if (e === 0) {
+	    e = 1 - eBias;
+	  } else if (e === eMax) {
+	    return m ? NaN : (s ? -1 : 1) * Infinity;
+	  } else {
+	    m = m + Math.pow(2, mLen);
+	    e = e - eBias;
+	  }
+	  return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
+	};
+
+	var writeIEEE754 = function (buffer, value, offset, endian, mLen, nBytes) {
+	  var e,
+	      m,
+	      c,
+	      bBE = endian === 'big',
+	      eLen = nBytes * 8 - mLen - 1,
+	      eMax = (1 << eLen) - 1,
+	      eBias = eMax >> 1,
+	      rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
+	      i = bBE ? nBytes - 1 : 0,
+	      d = bBE ? -1 : 1,
+	      s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
+
+	  value = Math.abs(value);
+
+	  if (isNaN(value) || value === Infinity) {
+	    m = isNaN(value) ? 1 : 0;
+	    e = eMax;
+	  } else {
+	    e = Math.floor(Math.log(value) / Math.LN2);
+	    if (value * (c = Math.pow(2, -e)) < 1) {
+	      e--;
+	      c *= 2;
+	    }
+	    if (e + eBias >= 1) {
+	      value += rt / c;
+	    } else {
+	      value += rt * Math.pow(2, 1 - eBias);
+	    }
+	    if (value * c >= 2) {
+	      e++;
+	      c /= 2;
+	    }
+
+	    if (e + eBias >= eMax) {
+	      m = 0;
+	      e = eMax;
+	    } else if (e + eBias >= 1) {
+	      m = (value * c - 1) * Math.pow(2, mLen);
+	      e = e + eBias;
+	    } else {
+	      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
+	      e = 0;
+	    }
+	  }
+
+	  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
+
+	  e = e << mLen | m;
+	  eLen += mLen;
+	  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
+
+	  buffer[offset + i - d] |= s * 128;
+	};
+
+	exports.readIEEE754 = readIEEE754;
+	exports.writeIEEE754 = writeIEEE754;
+
+/***/ }),
+/* 360 */
+/***/ (function(module, exports, __webpack_require__) {
+
+	/* WEBPACK VAR INJECTION */(function(Buffer) {'use strict';
+
+	var Long = __webpack_require__(335).Long,
+	    Double = __webpack_require__(336).Double,
+	    Timestamp = __webpack_require__(337).Timestamp,
+	    ObjectID = __webpack_require__(338).ObjectID,
+	    Symbol = __webpack_require__(349).Symbol,
+	    BSONRegExp = __webpack_require__(348).BSONRegExp,
+	    Code = __webpack_require__(351).Code,
+	    Decimal128 = __webpack_require__(352),
+	    MinKey = __webpack_require__(353).MinKey,
+	    MaxKey = __webpack_require__(354).MaxKey,
+	    DBRef = __webpack_require__(355).DBRef,
+	    Binary = __webpack_require__(356).Binary;
+
+	var normalizedFunctionString = __webpack_require__(344).normalizedFunctionString;
+
+	// To ensure that 0.4 of node works correctly
+	var isDate = function isDate(d) {
+	  return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
+	};
+
+	var calculateObjectSize = function calculateObjectSize(object, serializeFunctions, ignoreUndefined) {
+	  var totalLength = 4 + 1;
+
+	  if (Array.isArray(object)) {
+	    for (var i = 0; i < object.length; i++) {
+	      totalLength += calculateElement(i.toString(), object[i], serializeFunctions, true, ignoreUndefined);
+	    }
+	  } else {
+	    // If we have toBSON defined, override the current object
+	    if (object.toBSON) {
+	      object = object.toBSON();
+	    }
+
+	    // Calculate size
+	    for (var key in object) {
+	      totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
+	    }
+	  }
+
+	  return totalLength;
+	};
+
+	/**
+	 * @ignore
+	 * @api private
+	 */
+	function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
+	  // If we have toBSON defined, override the current object
+	  if (value && value.toBSON) {
+	    value = value.toBSON();
+	  }
+
+	  switch (typeof value) {
+	    case 'string':
+	      return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
+	    case 'number':
+	      if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
+	        if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
+	          // 32 bit
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
+	        } else {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+	        }
+	      } else {
+	        // 64 bit
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+	      }
+	    case 'undefined':
+	      if (isArray || !ignoreUndefined) return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
+	      return 0;
+	    case 'boolean':
+	      return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
+	    case 'object':
+	      if (value == null || value instanceof MinKey || value instanceof MaxKey || value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
+	      } else if (value instanceof ObjectID || value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
+	      } else if (value instanceof Date || isDate(value)) {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+	      } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length;
+	      } else if (value instanceof Long || value instanceof Double || value instanceof Timestamp || value['_bsontype'] === 'Long' || value['_bsontype'] === 'Double' || value['_bsontype'] === 'Timestamp') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+	      } else if (value instanceof Decimal128 || value['_bsontype'] === 'Decimal128') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
+	      } else if (value instanceof Code || value['_bsontype'] === 'Code') {
+	        // Calculate size depending on the availability of a scope
+	        if (value.scope != null && Object.keys(value.scope).length > 0) {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
+	        } else {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(value.code.toString(), 'utf8') + 1;
+	        }
+	      } else if (value instanceof Binary || value['_bsontype'] === 'Binary') {
+	        // Check what kind of subtype we have
+	        if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1 + 4);
+	        } else {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1);
+	        }
+	      } else if (value instanceof Symbol || value['_bsontype'] === 'Symbol') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + Buffer.byteLength(value.value, 'utf8') + 4 + 1 + 1;
+	      } else if (value instanceof DBRef || value['_bsontype'] === 'DBRef') {
+	        // Set up correct object for serialization
+	        var ordered_values = {
+	          $ref: value.namespace,
+	          $id: value.oid
+	        };
+
+	        // Add db reference if it exists
+	        if (null != value.db) {
+	          ordered_values['$db'] = value.db;
+	        }
+
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined);
+	      } else if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
+	      } else if (value instanceof BSONRegExp || value['_bsontype'] === 'BSONRegExp') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.pattern, 'utf8') + 1 + Buffer.byteLength(value.options, 'utf8') + 1;
+	      } else {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + calculateObjectSize(value, serializeFunctions, ignoreUndefined) + 1;
+	      }
+	    case 'function':
+	      // WTF for 0.4.X where typeof /someregexp/ === 'function'
+	      if (value instanceof RegExp || Object.prototype.toString.call(value) === '[object RegExp]' || String.call(value) === '[object RegExp]') {
+	        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + Buffer.byteLength(value.source, 'utf8') + 1 + (value.global ? 1 : 0) + (value.ignoreCase ? 1 : 0) + (value.multiline ? 1 : 0) + 1;
+	      } else {
+	        if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1 + calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined);
+	        } else if (serializeFunctions) {
+	          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1 + 4 + Buffer.byteLength(normalizedFunctionString(value), 'utf8') + 1;
+	        }
+	      }
+	  }
+
+	  return 0;
+	}
+
+	var BSON = {};
+
+	// BSON MAX VALUES
+	BSON.BSON_INT32_MAX = 0x7fffffff;
+	BSON.BSON_INT32_MIN = -0x80000000;
+
+	// JS MAX PRECISE VALUES
+	BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+	BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+	module.exports = calculateObjectSize;
+	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(339).Buffer))
+
+/***/ })
+/******/ ])
+});
+;
\ No newline at end of file
diff --git a/NodeAPI/node_modules/bson/browser_build/package.json b/NodeAPI/node_modules/bson/browser_build/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..980db7f95c43fbcd346a6655ab5197c66d5d0bad
--- /dev/null
+++ b/NodeAPI/node_modules/bson/browser_build/package.json
@@ -0,0 +1,8 @@
+{ "name" :            "bson"
+, "description" :     "A bson parser for node.js and the browser"
+, "main":             "../"
+, "directories" :   { "lib" : "../lib/bson" }
+, "engines" :       { "node" : ">=0.6.0" }
+, "licenses" :    [ { "type" :  "Apache License, Version 2.0"
+                    , "url" :   "http://www.apache.org/licenses/LICENSE-2.0" } ]
+}
diff --git a/NodeAPI/node_modules/bson/index.js b/NodeAPI/node_modules/bson/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..6502552dbe7f46f96779db3910f0d7f07fce15b0
--- /dev/null
+++ b/NodeAPI/node_modules/bson/index.js
@@ -0,0 +1,46 @@
+var BSON = require('./lib/bson/bson'),
+  Binary = require('./lib/bson/binary'),
+  Code = require('./lib/bson/code'),
+  DBRef = require('./lib/bson/db_ref'),
+  Decimal128 = require('./lib/bson/decimal128'),
+  Double = require('./lib/bson/double'),
+  Int32 = require('./lib/bson/int_32'),
+  Long = require('./lib/bson/long'),
+  Map = require('./lib/bson/map'),
+  MaxKey = require('./lib/bson/max_key'),
+  MinKey = require('./lib/bson/min_key'),
+  ObjectId = require('./lib/bson/objectid'),
+  BSONRegExp = require('./lib/bson/regexp'),
+  Symbol = require('./lib/bson/symbol'),
+  Timestamp = require('./lib/bson/timestamp');
+
+// BSON MAX VALUES
+BSON.BSON_INT32_MAX = 0x7fffffff;
+BSON.BSON_INT32_MIN = -0x80000000;
+
+BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+// JS MAX PRECISE VALUES
+BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+// Add BSON types to function creation
+BSON.Binary = Binary;
+BSON.Code = Code;
+BSON.DBRef = DBRef;
+BSON.Decimal128 = Decimal128;
+BSON.Double = Double;
+BSON.Int32 = Int32;
+BSON.Long = Long;
+BSON.Map = Map;
+BSON.MaxKey = MaxKey;
+BSON.MinKey = MinKey;
+BSON.ObjectId = ObjectId;
+BSON.ObjectID = ObjectId;
+BSON.BSONRegExp = BSONRegExp;
+BSON.Symbol = Symbol;
+BSON.Timestamp = Timestamp;
+
+// Return the BSON
+module.exports = BSON;
diff --git a/NodeAPI/node_modules/bson/lib/bson/binary.js b/NodeAPI/node_modules/bson/lib/bson/binary.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d190bcaa7e934d91cf94fd36f03687e59ea7210
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/binary.js
@@ -0,0 +1,384 @@
+/**
+ * Module dependencies.
+ * @ignore
+ */
+
+// Test if we're in Node via presence of "global" not absence of "window"
+// to support hybrid environments like Electron
+if (typeof global !== 'undefined') {
+  var Buffer = require('buffer').Buffer; // TODO just use global Buffer
+}
+
+var utils = require('./parser/utils');
+
+/**
+ * A class representation of the BSON Binary type.
+ *
+ * Sub types
+ *  - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type.
+ *  - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type.
+ *  - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type.
+ *  - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type.
+ *  - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type.
+ *  - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type.
+ *
+ * @class
+ * @param {Buffer} buffer a buffer object containing the binary data.
+ * @param {Number} [subType] the option binary type.
+ * @return {Binary}
+ */
+function Binary(buffer, subType) {
+  if (!(this instanceof Binary)) return new Binary(buffer, subType);
+
+  if (
+    buffer != null &&
+    !(typeof buffer === 'string') &&
+    !Buffer.isBuffer(buffer) &&
+    !(buffer instanceof Uint8Array) &&
+    !Array.isArray(buffer)
+  ) {
+    throw new Error('only String, Buffer, Uint8Array or Array accepted');
+  }
+
+  this._bsontype = 'Binary';
+
+  if (buffer instanceof Number) {
+    this.sub_type = buffer;
+    this.position = 0;
+  } else {
+    this.sub_type = subType == null ? BSON_BINARY_SUBTYPE_DEFAULT : subType;
+    this.position = 0;
+  }
+
+  if (buffer != null && !(buffer instanceof Number)) {
+    // Only accept Buffer, Uint8Array or Arrays
+    if (typeof buffer === 'string') {
+      // Different ways of writing the length of the string for the different types
+      if (typeof Buffer !== 'undefined') {
+        this.buffer = utils.toBuffer(buffer);
+      } else if (
+        typeof Uint8Array !== 'undefined' ||
+        Object.prototype.toString.call(buffer) === '[object Array]'
+      ) {
+        this.buffer = writeStringToArray(buffer);
+      } else {
+        throw new Error('only String, Buffer, Uint8Array or Array accepted');
+      }
+    } else {
+      this.buffer = buffer;
+    }
+    this.position = buffer.length;
+  } else {
+    if (typeof Buffer !== 'undefined') {
+      this.buffer = utils.allocBuffer(Binary.BUFFER_SIZE);
+    } else if (typeof Uint8Array !== 'undefined') {
+      this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE));
+    } else {
+      this.buffer = new Array(Binary.BUFFER_SIZE);
+    }
+    // Set position to start of buffer
+    this.position = 0;
+  }
+}
+
+/**
+ * Updates this binary with byte_value.
+ *
+ * @method
+ * @param {string} byte_value a single byte we wish to write.
+ */
+Binary.prototype.put = function put(byte_value) {
+  // If it's a string and a has more than one character throw an error
+  if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1)
+    throw new Error('only accepts single character String, Uint8Array or Array');
+  if ((typeof byte_value !== 'number' && byte_value < 0) || byte_value > 255)
+    throw new Error('only accepts number in a valid unsigned byte range 0-255');
+
+  // Decode the byte value once
+  var decoded_byte = null;
+  if (typeof byte_value === 'string') {
+    decoded_byte = byte_value.charCodeAt(0);
+  } else if (byte_value['length'] != null) {
+    decoded_byte = byte_value[0];
+  } else {
+    decoded_byte = byte_value;
+  }
+
+  if (this.buffer.length > this.position) {
+    this.buffer[this.position++] = decoded_byte;
+  } else {
+    if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
+      // Create additional overflow buffer
+      var buffer = utils.allocBuffer(Binary.BUFFER_SIZE + this.buffer.length);
+      // Combine the two buffers together
+      this.buffer.copy(buffer, 0, 0, this.buffer.length);
+      this.buffer = buffer;
+      this.buffer[this.position++] = decoded_byte;
+    } else {
+      buffer = null;
+      // Create a new buffer (typed or normal array)
+      if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
+        buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length));
+      } else {
+        buffer = new Array(Binary.BUFFER_SIZE + this.buffer.length);
+      }
+
+      // We need to copy all the content to the new array
+      for (var i = 0; i < this.buffer.length; i++) {
+        buffer[i] = this.buffer[i];
+      }
+
+      // Reassign the buffer
+      this.buffer = buffer;
+      // Write the byte
+      this.buffer[this.position++] = decoded_byte;
+    }
+  }
+};
+
+/**
+ * Writes a buffer or string to the binary.
+ *
+ * @method
+ * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object.
+ * @param {number} offset specify the binary of where to write the content.
+ * @return {null}
+ */
+Binary.prototype.write = function write(string, offset) {
+  offset = typeof offset === 'number' ? offset : this.position;
+
+  // If the buffer is to small let's extend the buffer
+  if (this.buffer.length < offset + string.length) {
+    var buffer = null;
+    // If we are in node.js
+    if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
+      buffer = utils.allocBuffer(this.buffer.length + string.length);
+      this.buffer.copy(buffer, 0, 0, this.buffer.length);
+    } else if (Object.prototype.toString.call(this.buffer) === '[object Uint8Array]') {
+      // Create a new buffer
+      buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length));
+      // Copy the content
+      for (var i = 0; i < this.position; i++) {
+        buffer[i] = this.buffer[i];
+      }
+    }
+
+    // Assign the new buffer
+    this.buffer = buffer;
+  }
+
+  if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) {
+    string.copy(this.buffer, offset, 0, string.length);
+    this.position = offset + string.length > this.position ? offset + string.length : this.position;
+    // offset = string.length
+  } else if (
+    typeof Buffer !== 'undefined' &&
+    typeof string === 'string' &&
+    Buffer.isBuffer(this.buffer)
+  ) {
+    this.buffer.write(string, offset, 'binary');
+    this.position = offset + string.length > this.position ? offset + string.length : this.position;
+    // offset = string.length;
+  } else if (
+    Object.prototype.toString.call(string) === '[object Uint8Array]' ||
+    (Object.prototype.toString.call(string) === '[object Array]' && typeof string !== 'string')
+  ) {
+    for (i = 0; i < string.length; i++) {
+      this.buffer[offset++] = string[i];
+    }
+
+    this.position = offset > this.position ? offset : this.position;
+  } else if (typeof string === 'string') {
+    for (i = 0; i < string.length; i++) {
+      this.buffer[offset++] = string.charCodeAt(i);
+    }
+
+    this.position = offset > this.position ? offset : this.position;
+  }
+};
+
+/**
+ * Reads **length** bytes starting at **position**.
+ *
+ * @method
+ * @param {number} position read from the given position in the Binary.
+ * @param {number} length the number of bytes to read.
+ * @return {Buffer}
+ */
+Binary.prototype.read = function read(position, length) {
+  length = length && length > 0 ? length : this.position;
+
+  // Let's return the data based on the type we have
+  if (this.buffer['slice']) {
+    return this.buffer.slice(position, position + length);
+  } else {
+    // Create a buffer to keep the result
+    var buffer =
+      typeof Uint8Array !== 'undefined'
+        ? new Uint8Array(new ArrayBuffer(length))
+        : new Array(length);
+    for (var i = 0; i < length; i++) {
+      buffer[i] = this.buffer[position++];
+    }
+  }
+  // Return the buffer
+  return buffer;
+};
+
+/**
+ * Returns the value of this binary as a string.
+ *
+ * @method
+ * @return {string}
+ */
+Binary.prototype.value = function value(asRaw) {
+  asRaw = asRaw == null ? false : asRaw;
+
+  // Optimize to serialize for the situation where the data == size of buffer
+  if (
+    asRaw &&
+    typeof Buffer !== 'undefined' &&
+    Buffer.isBuffer(this.buffer) &&
+    this.buffer.length === this.position
+  )
+    return this.buffer;
+
+  // If it's a node.js buffer object
+  if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) {
+    return asRaw
+      ? this.buffer.slice(0, this.position)
+      : this.buffer.toString('binary', 0, this.position);
+  } else {
+    if (asRaw) {
+      // we support the slice command use it
+      if (this.buffer['slice'] != null) {
+        return this.buffer.slice(0, this.position);
+      } else {
+        // Create a new buffer to copy content to
+        var newBuffer =
+          Object.prototype.toString.call(this.buffer) === '[object Uint8Array]'
+            ? new Uint8Array(new ArrayBuffer(this.position))
+            : new Array(this.position);
+        // Copy content
+        for (var i = 0; i < this.position; i++) {
+          newBuffer[i] = this.buffer[i];
+        }
+        // Return the buffer
+        return newBuffer;
+      }
+    } else {
+      return convertArraytoUtf8BinaryString(this.buffer, 0, this.position);
+    }
+  }
+};
+
+/**
+ * Length.
+ *
+ * @method
+ * @return {number} the length of the binary.
+ */
+Binary.prototype.length = function length() {
+  return this.position;
+};
+
+/**
+ * @ignore
+ */
+Binary.prototype.toJSON = function() {
+  return this.buffer != null ? this.buffer.toString('base64') : '';
+};
+
+/**
+ * @ignore
+ */
+Binary.prototype.toString = function(format) {
+  return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : '';
+};
+
+/**
+ * Binary default subtype
+ * @ignore
+ */
+var BSON_BINARY_SUBTYPE_DEFAULT = 0;
+
+/**
+ * @ignore
+ */
+var writeStringToArray = function(data) {
+  // Create a buffer
+  var buffer =
+    typeof Uint8Array !== 'undefined'
+      ? new Uint8Array(new ArrayBuffer(data.length))
+      : new Array(data.length);
+  // Write the content to the buffer
+  for (var i = 0; i < data.length; i++) {
+    buffer[i] = data.charCodeAt(i);
+  }
+  // Write the string to the buffer
+  return buffer;
+};
+
+/**
+ * Convert Array ot Uint8Array to Binary String
+ *
+ * @ignore
+ */
+var convertArraytoUtf8BinaryString = function(byteArray, startIndex, endIndex) {
+  var result = '';
+  for (var i = startIndex; i < endIndex; i++) {
+    result = result + String.fromCharCode(byteArray[i]);
+  }
+  return result;
+};
+
+Binary.BUFFER_SIZE = 256;
+
+/**
+ * Default BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_DEFAULT = 0;
+/**
+ * Function BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_FUNCTION = 1;
+/**
+ * Byte Array BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_BYTE_ARRAY = 2;
+/**
+ * OLD UUID BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_UUID_OLD = 3;
+/**
+ * UUID BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_UUID = 4;
+/**
+ * MD5 BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_MD5 = 5;
+/**
+ * User BSON type
+ *
+ * @classconstant SUBTYPE_DEFAULT
+ **/
+Binary.SUBTYPE_USER_DEFINED = 128;
+
+/**
+ * Expose.
+ */
+module.exports = Binary;
+module.exports.Binary = Binary;
diff --git a/NodeAPI/node_modules/bson/lib/bson/bson.js b/NodeAPI/node_modules/bson/lib/bson/bson.js
new file mode 100644
index 0000000000000000000000000000000000000000..912c5b9213d9f11fe5b68a1523bb21dd19987f4e
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/bson.js
@@ -0,0 +1,386 @@
+'use strict';
+
+var Map = require('./map'),
+  Long = require('./long'),
+  Double = require('./double'),
+  Timestamp = require('./timestamp'),
+  ObjectID = require('./objectid'),
+  BSONRegExp = require('./regexp'),
+  Symbol = require('./symbol'),
+  Int32 = require('./int_32'),
+  Code = require('./code'),
+  Decimal128 = require('./decimal128'),
+  MinKey = require('./min_key'),
+  MaxKey = require('./max_key'),
+  DBRef = require('./db_ref'),
+  Binary = require('./binary');
+
+// Parts of the parser
+var deserialize = require('./parser/deserializer'),
+  serializer = require('./parser/serializer'),
+  calculateObjectSize = require('./parser/calculate_size'),
+  utils = require('./parser/utils');
+
+/**
+ * @ignore
+ * @api private
+ */
+// Default Max Size
+var MAXSIZE = 1024 * 1024 * 17;
+
+// Current Internal Temporary Serialization Buffer
+var buffer = utils.allocBuffer(MAXSIZE);
+
+var BSON = function() {};
+
+/**
+ * Serialize a Javascript object.
+ *
+ * @param {Object} object the Javascript object to serialize.
+ * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
+ * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
+ * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
+ * @param {Number} [options.minInternalBufferSize=1024*1024*17] minimum size of the internal temporary serialization buffer **(default:1024*1024*17)**.
+ * @return {Buffer} returns the Buffer object containing the serialized object.
+ * @api public
+ */
+BSON.prototype.serialize = function serialize(object, options) {
+  options = options || {};
+  // Unpack the options
+  var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
+  var serializeFunctions =
+    typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+  var ignoreUndefined =
+    typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
+  var minInternalBufferSize =
+    typeof options.minInternalBufferSize === 'number' ? options.minInternalBufferSize : MAXSIZE;
+  
+  // Resize the internal serialization buffer if needed
+  if (buffer.length < minInternalBufferSize) {
+    buffer = utils.allocBuffer(minInternalBufferSize);
+  }
+
+  // Attempt to serialize
+  var serializationIndex = serializer(
+    buffer,
+    object,
+    checkKeys,
+    0,
+    0,
+    serializeFunctions,
+    ignoreUndefined,
+    []
+  );
+  // Create the final buffer
+  var finishedBuffer = utils.allocBuffer(serializationIndex);
+  // Copy into the finished buffer
+  buffer.copy(finishedBuffer, 0, 0, finishedBuffer.length);
+  // Return the buffer
+  return finishedBuffer;
+};
+
+/**
+ * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization.
+ *
+ * @param {Object} object the Javascript object to serialize.
+ * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object.
+ * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid.
+ * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
+ * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
+ * @param {Number} [options.index] the index in the buffer where we wish to start serializing into.
+ * @return {Number} returns the index pointing to the last written byte in the buffer.
+ * @api public
+ */
+BSON.prototype.serializeWithBufferAndIndex = function(object, finalBuffer, options) {
+  options = options || {};
+  // Unpack the options
+  var checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
+  var serializeFunctions =
+    typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+  var ignoreUndefined =
+    typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
+  var startIndex = typeof options.index === 'number' ? options.index : 0;
+
+  // Attempt to serialize
+  var serializationIndex = serializer(
+    finalBuffer,
+    object,
+    checkKeys,
+    startIndex || 0,
+    0,
+    serializeFunctions,
+    ignoreUndefined
+  );
+
+  // Return the index
+  return serializationIndex - 1;
+};
+
+/**
+ * Deserialize data as BSON.
+ *
+ * @param {Buffer} buffer the buffer containing the serialized set of BSON documents.
+ * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
+ * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
+ * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
+ * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
+ * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
+ * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
+ * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
+ * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
+ * @return {Object} returns the deserialized Javascript Object.
+ * @api public
+ */
+BSON.prototype.deserialize = function(buffer, options) {
+  return deserialize(buffer, options);
+};
+
+/**
+ * Calculate the bson size for a passed in Javascript object.
+ *
+ * @param {Object} object the Javascript object to calculate the BSON byte size for.
+ * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**.
+ * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**.
+ * @return {Number} returns the number of bytes the BSON object will take up.
+ * @api public
+ */
+BSON.prototype.calculateObjectSize = function(object, options) {
+  options = options || {};
+
+  var serializeFunctions =
+    typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+  var ignoreUndefined =
+    typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : true;
+
+  return calculateObjectSize(object, serializeFunctions, ignoreUndefined);
+};
+
+/**
+ * Deserialize stream data as BSON documents.
+ *
+ * @param {Buffer} data the buffer containing the serialized set of BSON documents.
+ * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start.
+ * @param {Number} numberOfDocuments number of documents to deserialize.
+ * @param {Array} documents an array where to store the deserialized documents.
+ * @param {Number} docStartIndex the index in the documents array from where to start inserting documents.
+ * @param {Object} [options] additional options used for the deserialization.
+ * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized.
+ * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse.
+ * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function.
+ * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits
+ * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance.
+ * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types.
+ * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer.
+ * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances.
+ * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents.
+ * @api public
+ */
+BSON.prototype.deserializeStream = function(
+  data,
+  startIndex,
+  numberOfDocuments,
+  documents,
+  docStartIndex,
+  options
+) {
+  options = options != null ? options : {};
+  var index = startIndex;
+  // Loop over all documents
+  for (var i = 0; i < numberOfDocuments; i++) {
+    // Find size of the document
+    var size =
+      data[index] | (data[index + 1] << 8) | (data[index + 2] << 16) | (data[index + 3] << 24);
+    // Update options with index
+    options['index'] = index;
+    // Parse the document at this point
+    documents[docStartIndex + i] = this.deserialize(data, options);
+    // Adjust index by the document size
+    index = index + size;
+  }
+
+  // Return object containing end index of parsing and list of documents
+  return index;
+};
+
+/**
+ * @ignore
+ * @api private
+ */
+// BSON MAX VALUES
+BSON.BSON_INT32_MAX = 0x7fffffff;
+BSON.BSON_INT32_MIN = -0x80000000;
+
+BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+// JS MAX PRECISE VALUES
+BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+// Internal long versions
+// var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
+// var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
+
+/**
+ * Number BSON Type
+ *
+ * @classconstant BSON_DATA_NUMBER
+ **/
+BSON.BSON_DATA_NUMBER = 1;
+/**
+ * String BSON Type
+ *
+ * @classconstant BSON_DATA_STRING
+ **/
+BSON.BSON_DATA_STRING = 2;
+/**
+ * Object BSON Type
+ *
+ * @classconstant BSON_DATA_OBJECT
+ **/
+BSON.BSON_DATA_OBJECT = 3;
+/**
+ * Array BSON Type
+ *
+ * @classconstant BSON_DATA_ARRAY
+ **/
+BSON.BSON_DATA_ARRAY = 4;
+/**
+ * Binary BSON Type
+ *
+ * @classconstant BSON_DATA_BINARY
+ **/
+BSON.BSON_DATA_BINARY = 5;
+/**
+ * ObjectID BSON Type
+ *
+ * @classconstant BSON_DATA_OID
+ **/
+BSON.BSON_DATA_OID = 7;
+/**
+ * Boolean BSON Type
+ *
+ * @classconstant BSON_DATA_BOOLEAN
+ **/
+BSON.BSON_DATA_BOOLEAN = 8;
+/**
+ * Date BSON Type
+ *
+ * @classconstant BSON_DATA_DATE
+ **/
+BSON.BSON_DATA_DATE = 9;
+/**
+ * null BSON Type
+ *
+ * @classconstant BSON_DATA_NULL
+ **/
+BSON.BSON_DATA_NULL = 10;
+/**
+ * RegExp BSON Type
+ *
+ * @classconstant BSON_DATA_REGEXP
+ **/
+BSON.BSON_DATA_REGEXP = 11;
+/**
+ * Code BSON Type
+ *
+ * @classconstant BSON_DATA_CODE
+ **/
+BSON.BSON_DATA_CODE = 13;
+/**
+ * Symbol BSON Type
+ *
+ * @classconstant BSON_DATA_SYMBOL
+ **/
+BSON.BSON_DATA_SYMBOL = 14;
+/**
+ * Code with Scope BSON Type
+ *
+ * @classconstant BSON_DATA_CODE_W_SCOPE
+ **/
+BSON.BSON_DATA_CODE_W_SCOPE = 15;
+/**
+ * 32 bit Integer BSON Type
+ *
+ * @classconstant BSON_DATA_INT
+ **/
+BSON.BSON_DATA_INT = 16;
+/**
+ * Timestamp BSON Type
+ *
+ * @classconstant BSON_DATA_TIMESTAMP
+ **/
+BSON.BSON_DATA_TIMESTAMP = 17;
+/**
+ * Long BSON Type
+ *
+ * @classconstant BSON_DATA_LONG
+ **/
+BSON.BSON_DATA_LONG = 18;
+/**
+ * MinKey BSON Type
+ *
+ * @classconstant BSON_DATA_MIN_KEY
+ **/
+BSON.BSON_DATA_MIN_KEY = 0xff;
+/**
+ * MaxKey BSON Type
+ *
+ * @classconstant BSON_DATA_MAX_KEY
+ **/
+BSON.BSON_DATA_MAX_KEY = 0x7f;
+
+/**
+ * Binary Default Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
+ **/
+BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
+/**
+ * Binary Function Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
+ **/
+BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
+/**
+ * Binary Byte Array Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
+ **/
+BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
+/**
+ * Binary UUID Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_UUID
+ **/
+BSON.BSON_BINARY_SUBTYPE_UUID = 3;
+/**
+ * Binary MD5 Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_MD5
+ **/
+BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
+/**
+ * Binary User Defined Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
+ **/
+BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
+
+// Return BSON
+module.exports = BSON;
+module.exports.Code = Code;
+module.exports.Map = Map;
+module.exports.Symbol = Symbol;
+module.exports.BSON = BSON;
+module.exports.DBRef = DBRef;
+module.exports.Binary = Binary;
+module.exports.ObjectID = ObjectID;
+module.exports.Long = Long;
+module.exports.Timestamp = Timestamp;
+module.exports.Double = Double;
+module.exports.Int32 = Int32;
+module.exports.MinKey = MinKey;
+module.exports.MaxKey = MaxKey;
+module.exports.BSONRegExp = BSONRegExp;
+module.exports.Decimal128 = Decimal128;
diff --git a/NodeAPI/node_modules/bson/lib/bson/code.js b/NodeAPI/node_modules/bson/lib/bson/code.js
new file mode 100644
index 0000000000000000000000000000000000000000..c2984cd5ab8852c1c7fc6e7c19598305142a2a91
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/code.js
@@ -0,0 +1,24 @@
+/**
+ * A class representation of the BSON Code type.
+ *
+ * @class
+ * @param {(string|function)} code a string or function.
+ * @param {Object} [scope] an optional scope for the function.
+ * @return {Code}
+ */
+var Code = function Code(code, scope) {
+  if (!(this instanceof Code)) return new Code(code, scope);
+  this._bsontype = 'Code';
+  this.code = code;
+  this.scope = scope;
+};
+
+/**
+ * @ignore
+ */
+Code.prototype.toJSON = function() {
+  return { scope: this.scope, code: this.code };
+};
+
+module.exports = Code;
+module.exports.Code = Code;
diff --git a/NodeAPI/node_modules/bson/lib/bson/db_ref.js b/NodeAPI/node_modules/bson/lib/bson/db_ref.js
new file mode 100644
index 0000000000000000000000000000000000000000..f95795b1cf3d90a634b65e459261f044fd4408b4
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/db_ref.js
@@ -0,0 +1,32 @@
+/**
+ * A class representation of the BSON DBRef type.
+ *
+ * @class
+ * @param {string} namespace the collection name.
+ * @param {ObjectID} oid the reference ObjectID.
+ * @param {string} [db] optional db name, if omitted the reference is local to the current db.
+ * @return {DBRef}
+ */
+function DBRef(namespace, oid, db) {
+  if (!(this instanceof DBRef)) return new DBRef(namespace, oid, db);
+
+  this._bsontype = 'DBRef';
+  this.namespace = namespace;
+  this.oid = oid;
+  this.db = db;
+}
+
+/**
+ * @ignore
+ * @api private
+ */
+DBRef.prototype.toJSON = function() {
+  return {
+    $ref: this.namespace,
+    $id: this.oid,
+    $db: this.db == null ? '' : this.db
+  };
+};
+
+module.exports = DBRef;
+module.exports.DBRef = DBRef;
diff --git a/NodeAPI/node_modules/bson/lib/bson/decimal128.js b/NodeAPI/node_modules/bson/lib/bson/decimal128.js
new file mode 100644
index 0000000000000000000000000000000000000000..924513f44b654529b08b39fea86a36f7f5ed47b2
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/decimal128.js
@@ -0,0 +1,820 @@
+'use strict';
+
+var Long = require('./long');
+
+var PARSE_STRING_REGEXP = /^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/;
+var PARSE_INF_REGEXP = /^(\+|-)?(Infinity|inf)$/i;
+var PARSE_NAN_REGEXP = /^(\+|-)?NaN$/i;
+
+var EXPONENT_MAX = 6111;
+var EXPONENT_MIN = -6176;
+var EXPONENT_BIAS = 6176;
+var MAX_DIGITS = 34;
+
+// Nan value bits as 32 bit values (due to lack of longs)
+var NAN_BUFFER = [
+  0x7c,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00
+].reverse();
+// Infinity value bits 32 bit values (due to lack of longs)
+var INF_NEGATIVE_BUFFER = [
+  0xf8,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00
+].reverse();
+var INF_POSITIVE_BUFFER = [
+  0x78,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00,
+  0x00
+].reverse();
+
+var EXPONENT_REGEX = /^([-+])?(\d+)?$/;
+
+var utils = require('./parser/utils');
+
+// Detect if the value is a digit
+var isDigit = function(value) {
+  return !isNaN(parseInt(value, 10));
+};
+
+// Divide two uint128 values
+var divideu128 = function(value) {
+  var DIVISOR = Long.fromNumber(1000 * 1000 * 1000);
+  var _rem = Long.fromNumber(0);
+  var i = 0;
+
+  if (!value.parts[0] && !value.parts[1] && !value.parts[2] && !value.parts[3]) {
+    return { quotient: value, rem: _rem };
+  }
+
+  for (i = 0; i <= 3; i++) {
+    // Adjust remainder to match value of next dividend
+    _rem = _rem.shiftLeft(32);
+    // Add the divided to _rem
+    _rem = _rem.add(new Long(value.parts[i], 0));
+    value.parts[i] = _rem.div(DIVISOR).low_;
+    _rem = _rem.modulo(DIVISOR);
+  }
+
+  return { quotient: value, rem: _rem };
+};
+
+// Multiply two Long values and return the 128 bit value
+var multiply64x2 = function(left, right) {
+  if (!left && !right) {
+    return { high: Long.fromNumber(0), low: Long.fromNumber(0) };
+  }
+
+  var leftHigh = left.shiftRightUnsigned(32);
+  var leftLow = new Long(left.getLowBits(), 0);
+  var rightHigh = right.shiftRightUnsigned(32);
+  var rightLow = new Long(right.getLowBits(), 0);
+
+  var productHigh = leftHigh.multiply(rightHigh);
+  var productMid = leftHigh.multiply(rightLow);
+  var productMid2 = leftLow.multiply(rightHigh);
+  var productLow = leftLow.multiply(rightLow);
+
+  productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
+  productMid = new Long(productMid.getLowBits(), 0)
+    .add(productMid2)
+    .add(productLow.shiftRightUnsigned(32));
+
+  productHigh = productHigh.add(productMid.shiftRightUnsigned(32));
+  productLow = productMid.shiftLeft(32).add(new Long(productLow.getLowBits(), 0));
+
+  // Return the 128 bit result
+  return { high: productHigh, low: productLow };
+};
+
+var lessThan = function(left, right) {
+  // Make values unsigned
+  var uhleft = left.high_ >>> 0;
+  var uhright = right.high_ >>> 0;
+
+  // Compare high bits first
+  if (uhleft < uhright) {
+    return true;
+  } else if (uhleft === uhright) {
+    var ulleft = left.low_ >>> 0;
+    var ulright = right.low_ >>> 0;
+    if (ulleft < ulright) return true;
+  }
+
+  return false;
+};
+
+// var longtoHex = function(value) {
+//   var buffer = utils.allocBuffer(8);
+//   var index = 0;
+//   // Encode the low 64 bits of the decimal
+//   // Encode low bits
+//   buffer[index++] = value.low_ & 0xff;
+//   buffer[index++] = (value.low_ >> 8) & 0xff;
+//   buffer[index++] = (value.low_ >> 16) & 0xff;
+//   buffer[index++] = (value.low_ >> 24) & 0xff;
+//   // Encode high bits
+//   buffer[index++] = value.high_ & 0xff;
+//   buffer[index++] = (value.high_ >> 8) & 0xff;
+//   buffer[index++] = (value.high_ >> 16) & 0xff;
+//   buffer[index++] = (value.high_ >> 24) & 0xff;
+//   return buffer.reverse().toString('hex');
+// };
+
+// var int32toHex = function(value) {
+//   var buffer = utils.allocBuffer(4);
+//   var index = 0;
+//   // Encode the low 64 bits of the decimal
+//   // Encode low bits
+//   buffer[index++] = value & 0xff;
+//   buffer[index++] = (value >> 8) & 0xff;
+//   buffer[index++] = (value >> 16) & 0xff;
+//   buffer[index++] = (value >> 24) & 0xff;
+//   return buffer.reverse().toString('hex');
+// };
+
+/**
+ * A class representation of the BSON Decimal128 type.
+ *
+ * @class
+ * @param {Buffer} bytes a buffer containing the raw Decimal128 bytes.
+ * @return {Double}
+ */
+var Decimal128 = function(bytes) {
+  this._bsontype = 'Decimal128';
+  this.bytes = bytes;
+};
+
+/**
+ * Create a Decimal128 instance from a string representation
+ *
+ * @method
+ * @param {string} string a numeric string representation.
+ * @return {Decimal128} returns a Decimal128 instance.
+ */
+Decimal128.fromString = function(string) {
+  // Parse state tracking
+  var isNegative = false;
+  var sawRadix = false;
+  var foundNonZero = false;
+
+  // Total number of significant digits (no leading or trailing zero)
+  var significantDigits = 0;
+  // Total number of significand digits read
+  var nDigitsRead = 0;
+  // Total number of digits (no leading zeros)
+  var nDigits = 0;
+  // The number of the digits after radix
+  var radixPosition = 0;
+  // The index of the first non-zero in *str*
+  var firstNonZero = 0;
+
+  // Digits Array
+  var digits = [0];
+  // The number of digits in digits
+  var nDigitsStored = 0;
+  // Insertion pointer for digits
+  var digitsInsert = 0;
+  // The index of the first non-zero digit
+  var firstDigit = 0;
+  // The index of the last digit
+  var lastDigit = 0;
+
+  // Exponent
+  var exponent = 0;
+  // loop index over array
+  var i = 0;
+  // The high 17 digits of the significand
+  var significandHigh = [0, 0];
+  // The low 17 digits of the significand
+  var significandLow = [0, 0];
+  // The biased exponent
+  var biasedExponent = 0;
+
+  // Read index
+  var index = 0;
+
+  // Trim the string
+  string = string.trim();
+
+  // Naively prevent against REDOS attacks.
+  // TODO: implementing a custom parsing for this, or refactoring the regex would yield
+  //       further gains.
+  if (string.length >= 7000) {
+    throw new Error('' + string + ' not a valid Decimal128 string');
+  }
+
+  // Results
+  var stringMatch = string.match(PARSE_STRING_REGEXP);
+  var infMatch = string.match(PARSE_INF_REGEXP);
+  var nanMatch = string.match(PARSE_NAN_REGEXP);
+
+  // Validate the string
+  if ((!stringMatch && !infMatch && !nanMatch) || string.length === 0) {
+    throw new Error('' + string + ' not a valid Decimal128 string');
+  }
+
+  // Check if we have an illegal exponent format
+  if (stringMatch && stringMatch[4] && stringMatch[2] === undefined) {
+    throw new Error('' + string + ' not a valid Decimal128 string');
+  }
+
+  // Get the negative or positive sign
+  if (string[index] === '+' || string[index] === '-') {
+    isNegative = string[index++] === '-';
+  }
+
+  // Check if user passed Infinity or NaN
+  if (!isDigit(string[index]) && string[index] !== '.') {
+    if (string[index] === 'i' || string[index] === 'I') {
+      return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+    } else if (string[index] === 'N') {
+      return new Decimal128(utils.toBuffer(NAN_BUFFER));
+    }
+  }
+
+  // Read all the digits
+  while (isDigit(string[index]) || string[index] === '.') {
+    if (string[index] === '.') {
+      if (sawRadix) {
+        return new Decimal128(utils.toBuffer(NAN_BUFFER));
+      }
+
+      sawRadix = true;
+      index = index + 1;
+      continue;
+    }
+
+    if (nDigitsStored < 34) {
+      if (string[index] !== '0' || foundNonZero) {
+        if (!foundNonZero) {
+          firstNonZero = nDigitsRead;
+        }
+
+        foundNonZero = true;
+
+        // Only store 34 digits
+        digits[digitsInsert++] = parseInt(string[index], 10);
+        nDigitsStored = nDigitsStored + 1;
+      }
+    }
+
+    if (foundNonZero) {
+      nDigits = nDigits + 1;
+    }
+
+    if (sawRadix) {
+      radixPosition = radixPosition + 1;
+    }
+
+    nDigitsRead = nDigitsRead + 1;
+    index = index + 1;
+  }
+
+  if (sawRadix && !nDigitsRead) {
+    throw new Error('' + string + ' not a valid Decimal128 string');
+  }
+
+  // Read exponent if exists
+  if (string[index] === 'e' || string[index] === 'E') {
+    // Read exponent digits
+    var match = string.substr(++index).match(EXPONENT_REGEX);
+
+    // No digits read
+    if (!match || !match[2]) {
+      return new Decimal128(utils.toBuffer(NAN_BUFFER));
+    }
+
+    // Get exponent
+    exponent = parseInt(match[0], 10);
+
+    // Adjust the index
+    index = index + match[0].length;
+  }
+
+  // Return not a number
+  if (string[index]) {
+    return new Decimal128(utils.toBuffer(NAN_BUFFER));
+  }
+
+  // Done reading input
+  // Find first non-zero digit in digits
+  firstDigit = 0;
+
+  if (!nDigitsStored) {
+    firstDigit = 0;
+    lastDigit = 0;
+    digits[0] = 0;
+    nDigits = 1;
+    nDigitsStored = 1;
+    significantDigits = 0;
+  } else {
+    lastDigit = nDigitsStored - 1;
+    significantDigits = nDigits;
+
+    if (exponent !== 0 && significantDigits !== 1) {
+      while (string[firstNonZero + significantDigits - 1] === '0') {
+        significantDigits = significantDigits - 1;
+      }
+    }
+  }
+
+  // Normalization of exponent
+  // Correct exponent based on radix position, and shift significand as needed
+  // to represent user input
+
+  // Overflow prevention
+  if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) {
+    exponent = EXPONENT_MIN;
+  } else {
+    exponent = exponent - radixPosition;
+  }
+
+  // Attempt to normalize the exponent
+  while (exponent > EXPONENT_MAX) {
+    // Shift exponent to significand and decrease
+    lastDigit = lastDigit + 1;
+
+    if (lastDigit - firstDigit > MAX_DIGITS) {
+      // Check if we have a zero then just hard clamp, otherwise fail
+      var digitsString = digits.join('');
+      if (digitsString.match(/^0+$/)) {
+        exponent = EXPONENT_MAX;
+        break;
+      } else {
+        return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+      }
+    }
+
+    exponent = exponent - 1;
+  }
+
+  while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) {
+    // Shift last digit
+    if (lastDigit === 0) {
+      exponent = EXPONENT_MIN;
+      significantDigits = 0;
+      break;
+    }
+
+    if (nDigitsStored < nDigits) {
+      // adjust to match digits not stored
+      nDigits = nDigits - 1;
+    } else {
+      // adjust to round
+      lastDigit = lastDigit - 1;
+    }
+
+    if (exponent < EXPONENT_MAX) {
+      exponent = exponent + 1;
+    } else {
+      // Check if we have a zero then just hard clamp, otherwise fail
+      digitsString = digits.join('');
+      if (digitsString.match(/^0+$/)) {
+        exponent = EXPONENT_MAX;
+        break;
+      } else {
+        return new Decimal128(utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER));
+      }
+    }
+  }
+
+  // Round
+  // We've normalized the exponent, but might still need to round.
+  if (lastDigit - firstDigit + 1 < significantDigits && string[significantDigits] !== '0') {
+    var endOfString = nDigitsRead;
+
+    // If we have seen a radix point, 'string' is 1 longer than we have
+    // documented with ndigits_read, so inc the position of the first nonzero
+    // digit and the position that digits are read to.
+    if (sawRadix && exponent === EXPONENT_MIN) {
+      firstNonZero = firstNonZero + 1;
+      endOfString = endOfString + 1;
+    }
+
+    var roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10);
+    var roundBit = 0;
+
+    if (roundDigit >= 5) {
+      roundBit = 1;
+
+      if (roundDigit === 5) {
+        roundBit = digits[lastDigit] % 2 === 1;
+
+        for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) {
+          if (parseInt(string[i], 10)) {
+            roundBit = 1;
+            break;
+          }
+        }
+      }
+    }
+
+    if (roundBit) {
+      var dIdx = lastDigit;
+
+      for (; dIdx >= 0; dIdx--) {
+        if (++digits[dIdx] > 9) {
+          digits[dIdx] = 0;
+
+          // overflowed most significant digit
+          if (dIdx === 0) {
+            if (exponent < EXPONENT_MAX) {
+              exponent = exponent + 1;
+              digits[dIdx] = 1;
+            } else {
+              return new Decimal128(
+                utils.toBuffer(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)
+              );
+            }
+          }
+        } else {
+          break;
+        }
+      }
+    }
+  }
+
+  // Encode significand
+  // The high 17 digits of the significand
+  significandHigh = Long.fromNumber(0);
+  // The low 17 digits of the significand
+  significandLow = Long.fromNumber(0);
+
+  // read a zero
+  if (significantDigits === 0) {
+    significandHigh = Long.fromNumber(0);
+    significandLow = Long.fromNumber(0);
+  } else if (lastDigit - firstDigit < 17) {
+    dIdx = firstDigit;
+    significandLow = Long.fromNumber(digits[dIdx++]);
+    significandHigh = new Long(0, 0);
+
+    for (; dIdx <= lastDigit; dIdx++) {
+      significandLow = significandLow.multiply(Long.fromNumber(10));
+      significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
+    }
+  } else {
+    dIdx = firstDigit;
+    significandHigh = Long.fromNumber(digits[dIdx++]);
+
+    for (; dIdx <= lastDigit - 17; dIdx++) {
+      significandHigh = significandHigh.multiply(Long.fromNumber(10));
+      significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx]));
+    }
+
+    significandLow = Long.fromNumber(digits[dIdx++]);
+
+    for (; dIdx <= lastDigit; dIdx++) {
+      significandLow = significandLow.multiply(Long.fromNumber(10));
+      significandLow = significandLow.add(Long.fromNumber(digits[dIdx]));
+    }
+  }
+
+  var significand = multiply64x2(significandHigh, Long.fromString('100000000000000000'));
+
+  significand.low = significand.low.add(significandLow);
+
+  if (lessThan(significand.low, significandLow)) {
+    significand.high = significand.high.add(Long.fromNumber(1));
+  }
+
+  // Biased exponent
+  biasedExponent = exponent + EXPONENT_BIAS;
+  var dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) };
+
+  // Encode combination, exponent, and significand.
+  if (
+    significand.high
+      .shiftRightUnsigned(49)
+      .and(Long.fromNumber(1))
+      .equals(Long.fromNumber)
+  ) {
+    // Encode '11' into bits 1 to 3
+    dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61));
+    dec.high = dec.high.or(
+      Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47))
+    );
+    dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff)));
+  } else {
+    dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49));
+    dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff)));
+  }
+
+  dec.low = significand.low;
+
+  // Encode sign
+  if (isNegative) {
+    dec.high = dec.high.or(Long.fromString('9223372036854775808'));
+  }
+
+  // Encode into a buffer
+  var buffer = utils.allocBuffer(16);
+  index = 0;
+
+  // Encode the low 64 bits of the decimal
+  // Encode low bits
+  buffer[index++] = dec.low.low_ & 0xff;
+  buffer[index++] = (dec.low.low_ >> 8) & 0xff;
+  buffer[index++] = (dec.low.low_ >> 16) & 0xff;
+  buffer[index++] = (dec.low.low_ >> 24) & 0xff;
+  // Encode high bits
+  buffer[index++] = dec.low.high_ & 0xff;
+  buffer[index++] = (dec.low.high_ >> 8) & 0xff;
+  buffer[index++] = (dec.low.high_ >> 16) & 0xff;
+  buffer[index++] = (dec.low.high_ >> 24) & 0xff;
+
+  // Encode the high 64 bits of the decimal
+  // Encode low bits
+  buffer[index++] = dec.high.low_ & 0xff;
+  buffer[index++] = (dec.high.low_ >> 8) & 0xff;
+  buffer[index++] = (dec.high.low_ >> 16) & 0xff;
+  buffer[index++] = (dec.high.low_ >> 24) & 0xff;
+  // Encode high bits
+  buffer[index++] = dec.high.high_ & 0xff;
+  buffer[index++] = (dec.high.high_ >> 8) & 0xff;
+  buffer[index++] = (dec.high.high_ >> 16) & 0xff;
+  buffer[index++] = (dec.high.high_ >> 24) & 0xff;
+
+  // Return the new Decimal128
+  return new Decimal128(buffer);
+};
+
+// Extract least significant 5 bits
+var COMBINATION_MASK = 0x1f;
+// Extract least significant 14 bits
+var EXPONENT_MASK = 0x3fff;
+// Value of combination field for Inf
+var COMBINATION_INFINITY = 30;
+// Value of combination field for NaN
+var COMBINATION_NAN = 31;
+// Value of combination field for NaN
+// var COMBINATION_SNAN = 32;
+// decimal128 exponent bias
+EXPONENT_BIAS = 6176;
+
+/**
+ * Create a string representation of the raw Decimal128 value
+ *
+ * @method
+ * @return {string} returns a Decimal128 string representation.
+ */
+Decimal128.prototype.toString = function() {
+  // Note: bits in this routine are referred to starting at 0,
+  // from the sign bit, towards the coefficient.
+
+  // bits 0 - 31
+  var high;
+  // bits 32 - 63
+  var midh;
+  // bits 64 - 95
+  var midl;
+  // bits 96 - 127
+  var low;
+  // bits 1 - 5
+  var combination;
+  // decoded biased exponent (14 bits)
+  var biased_exponent;
+  // the number of significand digits
+  var significand_digits = 0;
+  // the base-10 digits in the significand
+  var significand = new Array(36);
+  for (var i = 0; i < significand.length; i++) significand[i] = 0;
+  // read pointer into significand
+  var index = 0;
+
+  // unbiased exponent
+  var exponent;
+  // the exponent if scientific notation is used
+  var scientific_exponent;
+
+  // true if the number is zero
+  var is_zero = false;
+
+  // the most signifcant significand bits (50-46)
+  var significand_msb;
+  // temporary storage for significand decoding
+  var significand128 = { parts: new Array(4) };
+  // indexing variables
+  i;
+  var j, k;
+
+  // Output string
+  var string = [];
+
+  // Unpack index
+  index = 0;
+
+  // Buffer reference
+  var buffer = this.bytes;
+
+  // Unpack the low 64bits into a long
+  low =
+    buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
+  midl =
+    buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
+
+  // Unpack the high 64bits into a long
+  midh =
+    buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
+  high =
+    buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
+
+  // Unpack index
+  index = 0;
+
+  // Create the state of the decimal
+  var dec = {
+    low: new Long(low, midl),
+    high: new Long(midh, high)
+  };
+
+  if (dec.high.lessThan(Long.ZERO)) {
+    string.push('-');
+  }
+
+  // Decode combination field and exponent
+  combination = (high >> 26) & COMBINATION_MASK;
+
+  if (combination >> 3 === 3) {
+    // Check for 'special' values
+    if (combination === COMBINATION_INFINITY) {
+      return string.join('') + 'Infinity';
+    } else if (combination === COMBINATION_NAN) {
+      return 'NaN';
+    } else {
+      biased_exponent = (high >> 15) & EXPONENT_MASK;
+      significand_msb = 0x08 + ((high >> 14) & 0x01);
+    }
+  } else {
+    significand_msb = (high >> 14) & 0x07;
+    biased_exponent = (high >> 17) & EXPONENT_MASK;
+  }
+
+  exponent = biased_exponent - EXPONENT_BIAS;
+
+  // Create string of significand digits
+
+  // Convert the 114-bit binary number represented by
+  // (significand_high, significand_low) to at most 34 decimal
+  // digits through modulo and division.
+  significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14);
+  significand128.parts[1] = midh;
+  significand128.parts[2] = midl;
+  significand128.parts[3] = low;
+
+  if (
+    significand128.parts[0] === 0 &&
+    significand128.parts[1] === 0 &&
+    significand128.parts[2] === 0 &&
+    significand128.parts[3] === 0
+  ) {
+    is_zero = true;
+  } else {
+    for (k = 3; k >= 0; k--) {
+      var least_digits = 0;
+      // Peform the divide
+      var result = divideu128(significand128);
+      significand128 = result.quotient;
+      least_digits = result.rem.low_;
+
+      // We now have the 9 least significant digits (in base 2).
+      // Convert and output to string.
+      if (!least_digits) continue;
+
+      for (j = 8; j >= 0; j--) {
+        // significand[k * 9 + j] = Math.round(least_digits % 10);
+        significand[k * 9 + j] = least_digits % 10;
+        // least_digits = Math.round(least_digits / 10);
+        least_digits = Math.floor(least_digits / 10);
+      }
+    }
+  }
+
+  // Output format options:
+  // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd
+  // Regular    - ddd.ddd
+
+  if (is_zero) {
+    significand_digits = 1;
+    significand[index] = 0;
+  } else {
+    significand_digits = 36;
+    i = 0;
+
+    while (!significand[index]) {
+      i++;
+      significand_digits = significand_digits - 1;
+      index = index + 1;
+    }
+  }
+
+  scientific_exponent = significand_digits - 1 + exponent;
+
+  // The scientific exponent checks are dictated by the string conversion
+  // specification and are somewhat arbitrary cutoffs.
+  //
+  // We must check exponent > 0, because if this is the case, the number
+  // has trailing zeros.  However, we *cannot* output these trailing zeros,
+  // because doing so would change the precision of the value, and would
+  // change stored data if the string converted number is round tripped.
+
+  if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) {
+    // Scientific format
+    string.push(significand[index++]);
+    significand_digits = significand_digits - 1;
+
+    if (significand_digits) {
+      string.push('.');
+    }
+
+    for (i = 0; i < significand_digits; i++) {
+      string.push(significand[index++]);
+    }
+
+    // Exponent
+    string.push('E');
+    if (scientific_exponent > 0) {
+      string.push('+' + scientific_exponent);
+    } else {
+      string.push(scientific_exponent);
+    }
+  } else {
+    // Regular format with no decimal place
+    if (exponent >= 0) {
+      for (i = 0; i < significand_digits; i++) {
+        string.push(significand[index++]);
+      }
+    } else {
+      var radix_position = significand_digits + exponent;
+
+      // non-zero digits before radix
+      if (radix_position > 0) {
+        for (i = 0; i < radix_position; i++) {
+          string.push(significand[index++]);
+        }
+      } else {
+        string.push('0');
+      }
+
+      string.push('.');
+      // add leading zeros after radix
+      while (radix_position++ < 0) {
+        string.push('0');
+      }
+
+      for (i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) {
+        string.push(significand[index++]);
+      }
+    }
+  }
+
+  return string.join('');
+};
+
+Decimal128.prototype.toJSON = function() {
+  return { $numberDecimal: this.toString() };
+};
+
+module.exports = Decimal128;
+module.exports.Decimal128 = Decimal128;
diff --git a/NodeAPI/node_modules/bson/lib/bson/double.js b/NodeAPI/node_modules/bson/lib/bson/double.js
new file mode 100644
index 0000000000000000000000000000000000000000..523c21f88f0d51d9061568d34de4a5cbf9811bdf
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/double.js
@@ -0,0 +1,33 @@
+/**
+ * A class representation of the BSON Double type.
+ *
+ * @class
+ * @param {number} value the number we want to represent as a double.
+ * @return {Double}
+ */
+function Double(value) {
+  if (!(this instanceof Double)) return new Double(value);
+
+  this._bsontype = 'Double';
+  this.value = value;
+}
+
+/**
+ * Access the number value.
+ *
+ * @method
+ * @return {number} returns the wrapped double number.
+ */
+Double.prototype.valueOf = function() {
+  return this.value;
+};
+
+/**
+ * @ignore
+ */
+Double.prototype.toJSON = function() {
+  return this.value;
+};
+
+module.exports = Double;
+module.exports.Double = Double;
diff --git a/NodeAPI/node_modules/bson/lib/bson/float_parser.js b/NodeAPI/node_modules/bson/lib/bson/float_parser.js
new file mode 100644
index 0000000000000000000000000000000000000000..0054a2f66507e756944ec484c2bc11a5a51c2b32
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/float_parser.js
@@ -0,0 +1,124 @@
+// Copyright (c) 2008, Fair Oaks Labs, Inc.
+// All rights reserved.
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+//  * Redistributions of source code must retain the above copyright notice,
+//    this list of conditions and the following disclaimer.
+//
+//  * Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+//  * Neither the name of Fair Oaks Labs, Inc. nor the names of its contributors
+//    may be used to endorse or promote products derived from this software
+//    without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+// ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+// POSSIBILITY OF SUCH DAMAGE.
+//
+//
+// Modifications to writeIEEE754 to support negative zeroes made by Brian White
+
+var readIEEE754 = function(buffer, offset, endian, mLen, nBytes) {
+  var e,
+    m,
+    bBE = endian === 'big',
+    eLen = nBytes * 8 - mLen - 1,
+    eMax = (1 << eLen) - 1,
+    eBias = eMax >> 1,
+    nBits = -7,
+    i = bBE ? 0 : nBytes - 1,
+    d = bBE ? 1 : -1,
+    s = buffer[offset + i];
+
+  i += d;
+
+  e = s & ((1 << -nBits) - 1);
+  s >>= -nBits;
+  nBits += eLen;
+  for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8);
+
+  m = e & ((1 << -nBits) - 1);
+  e >>= -nBits;
+  nBits += mLen;
+  for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8);
+
+  if (e === 0) {
+    e = 1 - eBias;
+  } else if (e === eMax) {
+    return m ? NaN : (s ? -1 : 1) * Infinity;
+  } else {
+    m = m + Math.pow(2, mLen);
+    e = e - eBias;
+  }
+  return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
+};
+
+var writeIEEE754 = function(buffer, value, offset, endian, mLen, nBytes) {
+  var e,
+    m,
+    c,
+    bBE = endian === 'big',
+    eLen = nBytes * 8 - mLen - 1,
+    eMax = (1 << eLen) - 1,
+    eBias = eMax >> 1,
+    rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
+    i = bBE ? nBytes - 1 : 0,
+    d = bBE ? -1 : 1,
+    s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
+
+  value = Math.abs(value);
+
+  if (isNaN(value) || value === Infinity) {
+    m = isNaN(value) ? 1 : 0;
+    e = eMax;
+  } else {
+    e = Math.floor(Math.log(value) / Math.LN2);
+    if (value * (c = Math.pow(2, -e)) < 1) {
+      e--;
+      c *= 2;
+    }
+    if (e + eBias >= 1) {
+      value += rt / c;
+    } else {
+      value += rt * Math.pow(2, 1 - eBias);
+    }
+    if (value * c >= 2) {
+      e++;
+      c /= 2;
+    }
+
+    if (e + eBias >= eMax) {
+      m = 0;
+      e = eMax;
+    } else if (e + eBias >= 1) {
+      m = (value * c - 1) * Math.pow(2, mLen);
+      e = e + eBias;
+    } else {
+      m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
+      e = 0;
+    }
+  }
+
+  for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8);
+
+  e = (e << mLen) | m;
+  eLen += mLen;
+  for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8);
+
+  buffer[offset + i - d] |= s * 128;
+};
+
+exports.readIEEE754 = readIEEE754;
+exports.writeIEEE754 = writeIEEE754;
diff --git a/NodeAPI/node_modules/bson/lib/bson/int_32.js b/NodeAPI/node_modules/bson/lib/bson/int_32.js
new file mode 100644
index 0000000000000000000000000000000000000000..85dbdec61e24d6a9b8763b47cbdb65ca0881100b
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/int_32.js
@@ -0,0 +1,33 @@
+/**
+ * A class representation of a BSON Int32 type.
+ *
+ * @class
+ * @param {number} value the number we want to represent as an int32.
+ * @return {Int32}
+ */
+var Int32 = function(value) {
+  if (!(this instanceof Int32)) return new Int32(value);
+
+  this._bsontype = 'Int32';
+  this.value = value;
+};
+
+/**
+ * Access the number value.
+ *
+ * @method
+ * @return {number} returns the wrapped int32 number.
+ */
+Int32.prototype.valueOf = function() {
+  return this.value;
+};
+
+/**
+ * @ignore
+ */
+Int32.prototype.toJSON = function() {
+  return this.value;
+};
+
+module.exports = Int32;
+module.exports.Int32 = Int32;
diff --git a/NodeAPI/node_modules/bson/lib/bson/long.js b/NodeAPI/node_modules/bson/lib/bson/long.js
new file mode 100644
index 0000000000000000000000000000000000000000..551d1a60444a82a9653de7c32f4ebafa9b121b93
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/long.js
@@ -0,0 +1,865 @@
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Copyright 2009 Google Inc. All Rights Reserved
+
+/**
+ * Defines a Long class for representing a 64-bit two's-complement
+ * integer value, which faithfully simulates the behavior of a Java "Long". This
+ * implementation is derived from LongLib in GWT.
+ *
+ * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
+ * values as *signed* integers.  See the from* functions below for more
+ * convenient ways of constructing Longs.
+ *
+ * The internal representation of a Long is the two given signed, 32-bit values.
+ * We use 32-bit pieces because these are the size of integers on which
+ * Javascript performs bit-operations.  For operations like addition and
+ * multiplication, we split each number into 16-bit pieces, which can easily be
+ * multiplied within Javascript's floating-point representation without overflow
+ * or change in sign.
+ *
+ * In the algorithms below, we frequently reduce the negative case to the
+ * positive case by negating the input(s) and then post-processing the result.
+ * Note that we must ALWAYS check specially whether those values are MIN_VALUE
+ * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
+ * a positive number, it overflows back into a negative).  Not handling this
+ * case would often result in infinite recursion.
+ *
+ * @class
+ * @param {number} low  the low (signed) 32 bits of the Long.
+ * @param {number} high the high (signed) 32 bits of the Long.
+ * @return {Long}
+ */
+function Long(low, high) {
+  if (!(this instanceof Long)) return new Long(low, high);
+
+  this._bsontype = 'Long';
+  /**
+   * @type {number}
+   * @ignore
+   */
+  this.low_ = low | 0; // force into 32 signed bits.
+
+  /**
+   * @type {number}
+   * @ignore
+   */
+  this.high_ = high | 0; // force into 32 signed bits.
+}
+
+/**
+ * Return the int value.
+ *
+ * @method
+ * @return {number} the value, assuming it is a 32-bit integer.
+ */
+Long.prototype.toInt = function() {
+  return this.low_;
+};
+
+/**
+ * Return the Number value.
+ *
+ * @method
+ * @return {number} the closest floating-point representation to this value.
+ */
+Long.prototype.toNumber = function() {
+  return this.high_ * Long.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
+};
+
+/** Converts the Long to a BigInt (arbitrary precision). */
+Long.prototype.toBigInt = function () {
+  return BigInt(this.toString());
+}
+
+/**
+ * Return the JSON value.
+ *
+ * @method
+ * @return {string} the JSON representation.
+ */
+Long.prototype.toJSON = function() {
+  return this.toString();
+};
+
+/**
+ * Return the String value.
+ *
+ * @method
+ * @param {number} [opt_radix] the radix in which the text should be written.
+ * @return {string} the textual representation of this value.
+ */
+Long.prototype.toString = function(opt_radix) {
+  var radix = opt_radix || 10;
+  if (radix < 2 || 36 < radix) {
+    throw Error('radix out of range: ' + radix);
+  }
+
+  if (this.isZero()) {
+    return '0';
+  }
+
+  if (this.isNegative()) {
+    if (this.equals(Long.MIN_VALUE)) {
+      // We need to change the Long value before it can be negated, so we remove
+      // the bottom-most digit in this base and then recurse to do the rest.
+      var radixLong = Long.fromNumber(radix);
+      var div = this.div(radixLong);
+      var rem = div.multiply(radixLong).subtract(this);
+      return div.toString(radix) + rem.toInt().toString(radix);
+    } else {
+      return '-' + this.negate().toString(radix);
+    }
+  }
+
+  // Do several (6) digits each time through the loop, so as to
+  // minimize the calls to the very expensive emulated div.
+  var radixToPower = Long.fromNumber(Math.pow(radix, 6));
+
+  rem = this;
+  var result = '';
+
+  while (!rem.isZero()) {
+    var remDiv = rem.div(radixToPower);
+    var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
+    var digits = intval.toString(radix);
+
+    rem = remDiv;
+    if (rem.isZero()) {
+      return digits + result;
+    } else {
+      while (digits.length < 6) {
+        digits = '0' + digits;
+      }
+      result = '' + digits + result;
+    }
+  }
+};
+
+/**
+ * Return the high 32-bits value.
+ *
+ * @method
+ * @return {number} the high 32-bits as a signed value.
+ */
+Long.prototype.getHighBits = function() {
+  return this.high_;
+};
+
+/**
+ * Return the low 32-bits value.
+ *
+ * @method
+ * @return {number} the low 32-bits as a signed value.
+ */
+Long.prototype.getLowBits = function() {
+  return this.low_;
+};
+
+/**
+ * Return the low unsigned 32-bits value.
+ *
+ * @method
+ * @return {number} the low 32-bits as an unsigned value.
+ */
+Long.prototype.getLowBitsUnsigned = function() {
+  return this.low_ >= 0 ? this.low_ : Long.TWO_PWR_32_DBL_ + this.low_;
+};
+
+/**
+ * Returns the number of bits needed to represent the absolute value of this Long.
+ *
+ * @method
+ * @return {number} Returns the number of bits needed to represent the absolute value of this Long.
+ */
+Long.prototype.getNumBitsAbs = function() {
+  if (this.isNegative()) {
+    if (this.equals(Long.MIN_VALUE)) {
+      return 64;
+    } else {
+      return this.negate().getNumBitsAbs();
+    }
+  } else {
+    var val = this.high_ !== 0 ? this.high_ : this.low_;
+    for (var bit = 31; bit > 0; bit--) {
+      if ((val & (1 << bit)) !== 0) {
+        break;
+      }
+    }
+    return this.high_ !== 0 ? bit + 33 : bit + 1;
+  }
+};
+
+/**
+ * Return whether this value is zero.
+ *
+ * @method
+ * @return {boolean} whether this value is zero.
+ */
+Long.prototype.isZero = function() {
+  return this.high_ === 0 && this.low_ === 0;
+};
+
+/**
+ * Return whether this value is negative.
+ *
+ * @method
+ * @return {boolean} whether this value is negative.
+ */
+Long.prototype.isNegative = function() {
+  return this.high_ < 0;
+};
+
+/**
+ * Return whether this value is odd.
+ *
+ * @method
+ * @return {boolean} whether this value is odd.
+ */
+Long.prototype.isOdd = function() {
+  return (this.low_ & 1) === 1;
+};
+
+/**
+ * Return whether this Long equals the other
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} whether this Long equals the other
+ */
+Long.prototype.equals = function(other) {
+  return this.high_ === other.high_ && this.low_ === other.low_;
+};
+
+/**
+ * Return whether this Long does not equal the other.
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} whether this Long does not equal the other.
+ */
+Long.prototype.notEquals = function(other) {
+  return this.high_ !== other.high_ || this.low_ !== other.low_;
+};
+
+/**
+ * Return whether this Long is less than the other.
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} whether this Long is less than the other.
+ */
+Long.prototype.lessThan = function(other) {
+  return this.compare(other) < 0;
+};
+
+/**
+ * Return whether this Long is less than or equal to the other.
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} whether this Long is less than or equal to the other.
+ */
+Long.prototype.lessThanOrEqual = function(other) {
+  return this.compare(other) <= 0;
+};
+
+/**
+ * Return whether this Long is greater than the other.
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} whether this Long is greater than the other.
+ */
+Long.prototype.greaterThan = function(other) {
+  return this.compare(other) > 0;
+};
+
+/**
+ * Return whether this Long is greater than or equal to the other.
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} whether this Long is greater than or equal to the other.
+ */
+Long.prototype.greaterThanOrEqual = function(other) {
+  return this.compare(other) >= 0;
+};
+
+/**
+ * Compares this Long with the given one.
+ *
+ * @method
+ * @param {Long} other Long to compare against.
+ * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
+ */
+Long.prototype.compare = function(other) {
+  if (this.equals(other)) {
+    return 0;
+  }
+
+  var thisNeg = this.isNegative();
+  var otherNeg = other.isNegative();
+  if (thisNeg && !otherNeg) {
+    return -1;
+  }
+  if (!thisNeg && otherNeg) {
+    return 1;
+  }
+
+  // at this point, the signs are the same, so subtraction will not overflow
+  if (this.subtract(other).isNegative()) {
+    return -1;
+  } else {
+    return 1;
+  }
+};
+
+/**
+ * The negation of this value.
+ *
+ * @method
+ * @return {Long} the negation of this value.
+ */
+Long.prototype.negate = function() {
+  if (this.equals(Long.MIN_VALUE)) {
+    return Long.MIN_VALUE;
+  } else {
+    return this.not().add(Long.ONE);
+  }
+};
+
+/**
+ * Returns the sum of this and the given Long.
+ *
+ * @method
+ * @param {Long} other Long to add to this one.
+ * @return {Long} the sum of this and the given Long.
+ */
+Long.prototype.add = function(other) {
+  // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
+
+  var a48 = this.high_ >>> 16;
+  var a32 = this.high_ & 0xffff;
+  var a16 = this.low_ >>> 16;
+  var a00 = this.low_ & 0xffff;
+
+  var b48 = other.high_ >>> 16;
+  var b32 = other.high_ & 0xffff;
+  var b16 = other.low_ >>> 16;
+  var b00 = other.low_ & 0xffff;
+
+  var c48 = 0,
+    c32 = 0,
+    c16 = 0,
+    c00 = 0;
+  c00 += a00 + b00;
+  c16 += c00 >>> 16;
+  c00 &= 0xffff;
+  c16 += a16 + b16;
+  c32 += c16 >>> 16;
+  c16 &= 0xffff;
+  c32 += a32 + b32;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c48 += a48 + b48;
+  c48 &= 0xffff;
+  return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);
+};
+
+/**
+ * Returns the difference of this and the given Long.
+ *
+ * @method
+ * @param {Long} other Long to subtract from this.
+ * @return {Long} the difference of this and the given Long.
+ */
+Long.prototype.subtract = function(other) {
+  return this.add(other.negate());
+};
+
+/**
+ * Returns the product of this and the given Long.
+ *
+ * @method
+ * @param {Long} other Long to multiply with this.
+ * @return {Long} the product of this and the other.
+ */
+Long.prototype.multiply = function(other) {
+  if (this.isZero()) {
+    return Long.ZERO;
+  } else if (other.isZero()) {
+    return Long.ZERO;
+  }
+
+  if (this.equals(Long.MIN_VALUE)) {
+    return other.isOdd() ? Long.MIN_VALUE : Long.ZERO;
+  } else if (other.equals(Long.MIN_VALUE)) {
+    return this.isOdd() ? Long.MIN_VALUE : Long.ZERO;
+  }
+
+  if (this.isNegative()) {
+    if (other.isNegative()) {
+      return this.negate().multiply(other.negate());
+    } else {
+      return this.negate()
+        .multiply(other)
+        .negate();
+    }
+  } else if (other.isNegative()) {
+    return this.multiply(other.negate()).negate();
+  }
+
+  // If both Longs are small, use float multiplication
+  if (this.lessThan(Long.TWO_PWR_24_) && other.lessThan(Long.TWO_PWR_24_)) {
+    return Long.fromNumber(this.toNumber() * other.toNumber());
+  }
+
+  // Divide each Long into 4 chunks of 16 bits, and then add up 4x4 products.
+  // We can skip products that would overflow.
+
+  var a48 = this.high_ >>> 16;
+  var a32 = this.high_ & 0xffff;
+  var a16 = this.low_ >>> 16;
+  var a00 = this.low_ & 0xffff;
+
+  var b48 = other.high_ >>> 16;
+  var b32 = other.high_ & 0xffff;
+  var b16 = other.low_ >>> 16;
+  var b00 = other.low_ & 0xffff;
+
+  var c48 = 0,
+    c32 = 0,
+    c16 = 0,
+    c00 = 0;
+  c00 += a00 * b00;
+  c16 += c00 >>> 16;
+  c00 &= 0xffff;
+  c16 += a16 * b00;
+  c32 += c16 >>> 16;
+  c16 &= 0xffff;
+  c16 += a00 * b16;
+  c32 += c16 >>> 16;
+  c16 &= 0xffff;
+  c32 += a32 * b00;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c32 += a16 * b16;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c32 += a00 * b32;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
+  c48 &= 0xffff;
+  return Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32);
+};
+
+/**
+ * Returns this Long divided by the given one.
+ *
+ * @method
+ * @param {Long} other Long by which to divide.
+ * @return {Long} this Long divided by the given one.
+ */
+Long.prototype.div = function(other) {
+  if (other.isZero()) {
+    throw Error('division by zero');
+  } else if (this.isZero()) {
+    return Long.ZERO;
+  }
+
+  if (this.equals(Long.MIN_VALUE)) {
+    if (other.equals(Long.ONE) || other.equals(Long.NEG_ONE)) {
+      return Long.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
+    } else if (other.equals(Long.MIN_VALUE)) {
+      return Long.ONE;
+    } else {
+      // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
+      var halfThis = this.shiftRight(1);
+      var approx = halfThis.div(other).shiftLeft(1);
+      if (approx.equals(Long.ZERO)) {
+        return other.isNegative() ? Long.ONE : Long.NEG_ONE;
+      } else {
+        var rem = this.subtract(other.multiply(approx));
+        var result = approx.add(rem.div(other));
+        return result;
+      }
+    }
+  } else if (other.equals(Long.MIN_VALUE)) {
+    return Long.ZERO;
+  }
+
+  if (this.isNegative()) {
+    if (other.isNegative()) {
+      return this.negate().div(other.negate());
+    } else {
+      return this.negate()
+        .div(other)
+        .negate();
+    }
+  } else if (other.isNegative()) {
+    return this.div(other.negate()).negate();
+  }
+
+  // Repeat the following until the remainder is less than other:  find a
+  // floating-point that approximates remainder / other *from below*, add this
+  // into the result, and subtract it from the remainder.  It is critical that
+  // the approximate value is less than or equal to the real value so that the
+  // remainder never becomes negative.
+  var res = Long.ZERO;
+  rem = this;
+  while (rem.greaterThanOrEqual(other)) {
+    // Approximate the result of division. This may be a little greater or
+    // smaller than the actual value.
+    approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
+
+    // We will tweak the approximate result by changing it in the 48-th digit or
+    // the smallest non-fractional digit, whichever is larger.
+    var log2 = Math.ceil(Math.log(approx) / Math.LN2);
+    var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
+
+    // Decrease the approximation until it is smaller than the remainder.  Note
+    // that if it is too large, the product overflows and is negative.
+    var approxRes = Long.fromNumber(approx);
+    var approxRem = approxRes.multiply(other);
+    while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
+      approx -= delta;
+      approxRes = Long.fromNumber(approx);
+      approxRem = approxRes.multiply(other);
+    }
+
+    // We know the answer can't be zero... and actually, zero would cause
+    // infinite recursion since we would make no progress.
+    if (approxRes.isZero()) {
+      approxRes = Long.ONE;
+    }
+
+    res = res.add(approxRes);
+    rem = rem.subtract(approxRem);
+  }
+  return res;
+};
+
+/**
+ * Returns this Long modulo the given one.
+ *
+ * @method
+ * @param {Long} other Long by which to mod.
+ * @return {Long} this Long modulo the given one.
+ */
+Long.prototype.modulo = function(other) {
+  return this.subtract(this.div(other).multiply(other));
+};
+
+/**
+ * The bitwise-NOT of this value.
+ *
+ * @method
+ * @return {Long} the bitwise-NOT of this value.
+ */
+Long.prototype.not = function() {
+  return Long.fromBits(~this.low_, ~this.high_);
+};
+
+/**
+ * Returns the bitwise-AND of this Long and the given one.
+ *
+ * @method
+ * @param {Long} other the Long with which to AND.
+ * @return {Long} the bitwise-AND of this and the other.
+ */
+Long.prototype.and = function(other) {
+  return Long.fromBits(this.low_ & other.low_, this.high_ & other.high_);
+};
+
+/**
+ * Returns the bitwise-OR of this Long and the given one.
+ *
+ * @method
+ * @param {Long} other the Long with which to OR.
+ * @return {Long} the bitwise-OR of this and the other.
+ */
+Long.prototype.or = function(other) {
+  return Long.fromBits(this.low_ | other.low_, this.high_ | other.high_);
+};
+
+/**
+ * Returns the bitwise-XOR of this Long and the given one.
+ *
+ * @method
+ * @param {Long} other the Long with which to XOR.
+ * @return {Long} the bitwise-XOR of this and the other.
+ */
+Long.prototype.xor = function(other) {
+  return Long.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
+};
+
+/**
+ * Returns this Long with bits shifted to the left by the given amount.
+ *
+ * @method
+ * @param {number} numBits the number of bits by which to shift.
+ * @return {Long} this shifted to the left by the given amount.
+ */
+Long.prototype.shiftLeft = function(numBits) {
+  numBits &= 63;
+  if (numBits === 0) {
+    return this;
+  } else {
+    var low = this.low_;
+    if (numBits < 32) {
+      var high = this.high_;
+      return Long.fromBits(low << numBits, (high << numBits) | (low >>> (32 - numBits)));
+    } else {
+      return Long.fromBits(0, low << (numBits - 32));
+    }
+  }
+};
+
+/**
+ * Returns this Long with bits shifted to the right by the given amount.
+ *
+ * @method
+ * @param {number} numBits the number of bits by which to shift.
+ * @return {Long} this shifted to the right by the given amount.
+ */
+Long.prototype.shiftRight = function(numBits) {
+  numBits &= 63;
+  if (numBits === 0) {
+    return this;
+  } else {
+    var high = this.high_;
+    if (numBits < 32) {
+      var low = this.low_;
+      return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >> numBits);
+    } else {
+      return Long.fromBits(high >> (numBits - 32), high >= 0 ? 0 : -1);
+    }
+  }
+};
+
+/**
+ * Returns this Long with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
+ *
+ * @method
+ * @param {number} numBits the number of bits by which to shift.
+ * @return {Long} this shifted to the right by the given amount, with zeros placed into the new leading bits.
+ */
+Long.prototype.shiftRightUnsigned = function(numBits) {
+  numBits &= 63;
+  if (numBits === 0) {
+    return this;
+  } else {
+    var high = this.high_;
+    if (numBits < 32) {
+      var low = this.low_;
+      return Long.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits);
+    } else if (numBits === 32) {
+      return Long.fromBits(high, 0);
+    } else {
+      return Long.fromBits(high >>> (numBits - 32), 0);
+    }
+  }
+};
+
+/**
+ * Returns a Long representing the given (32-bit) integer value.
+ *
+ * @method
+ * @param {number} value the 32-bit integer in question.
+ * @return {Long} the corresponding Long value.
+ */
+Long.fromInt = function(value) {
+  if (-128 <= value && value < 128) {
+    var cachedObj = Long.INT_CACHE_[value];
+    if (cachedObj) {
+      return cachedObj;
+    }
+  }
+
+  var obj = new Long(value | 0, value < 0 ? -1 : 0);
+  if (-128 <= value && value < 128) {
+    Long.INT_CACHE_[value] = obj;
+  }
+  return obj;
+};
+
+/**
+ * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
+ *
+ * @method
+ * @param {number} value the number in question.
+ * @return {Long} the corresponding Long value.
+ */
+Long.fromNumber = function(value) {
+  if (isNaN(value) || !isFinite(value)) {
+    return Long.ZERO;
+  } else if (value <= -Long.TWO_PWR_63_DBL_) {
+    return Long.MIN_VALUE;
+  } else if (value + 1 >= Long.TWO_PWR_63_DBL_) {
+    return Long.MAX_VALUE;
+  } else if (value < 0) {
+    return Long.fromNumber(-value).negate();
+  } else {
+    return new Long((value % Long.TWO_PWR_32_DBL_) | 0, (value / Long.TWO_PWR_32_DBL_) | 0);
+  }
+};
+
+/**
+ * Returns a Long representing the given value, provided that it is a finite number. Otherwise, zero is returned.
+ * @param {bigint} value - The number in question
+ * @returns {Long} The corresponding Long value
+ */
+Long.fromBigInt =  function(value) {
+  return Long.fromString(value.toString(10), 10);
+}
+
+/**
+ * Returns a Long representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
+ *
+ * @method
+ * @param {number} lowBits the low 32-bits.
+ * @param {number} highBits the high 32-bits.
+ * @return {Long} the corresponding Long value.
+ */
+Long.fromBits = function(lowBits, highBits) {
+  return new Long(lowBits, highBits);
+};
+
+/**
+ * Returns a Long representation of the given string, written using the given radix.
+ *
+ * @method
+ * @param {string} str the textual representation of the Long.
+ * @param {number} opt_radix the radix in which the text is written.
+ * @return {Long} the corresponding Long value.
+ */
+Long.fromString = function(str, opt_radix) {
+  if (str.length === 0) {
+    throw Error('number format error: empty string');
+  }
+
+  var radix = opt_radix || 10;
+  if (radix < 2 || 36 < radix) {
+    throw Error('radix out of range: ' + radix);
+  }
+
+  if (str.charAt(0) === '-') {
+    return Long.fromString(str.substring(1), radix).negate();
+  } else if (str.indexOf('-') >= 0) {
+    throw Error('number format error: interior "-" character: ' + str);
+  }
+
+  // Do several (8) digits each time through the loop, so as to
+  // minimize the calls to the very expensive emulated div.
+  var radixToPower = Long.fromNumber(Math.pow(radix, 8));
+
+  var result = Long.ZERO;
+  for (var i = 0; i < str.length; i += 8) {
+    var size = Math.min(8, str.length - i);
+    var value = parseInt(str.substring(i, i + size), radix);
+    if (size < 8) {
+      var power = Long.fromNumber(Math.pow(radix, size));
+      result = result.multiply(power).add(Long.fromNumber(value));
+    } else {
+      result = result.multiply(radixToPower);
+      result = result.add(Long.fromNumber(value));
+    }
+  }
+  return result;
+};
+
+// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
+// from* methods on which they depend.
+
+/**
+ * A cache of the Long representations of small integer values.
+ * @type {Object}
+ * @ignore
+ */
+Long.INT_CACHE_ = {};
+
+// NOTE: the compiler should inline these constant values below and then remove
+// these variables, so there should be no runtime penalty for these.
+
+/**
+ * Number used repeated below in calculations.  This must appear before the
+ * first call to any from* function below.
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_16_DBL_ = 1 << 16;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_24_DBL_ = 1 << 24;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_32_DBL_ = Long.TWO_PWR_16_DBL_ * Long.TWO_PWR_16_DBL_;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_31_DBL_ = Long.TWO_PWR_32_DBL_ / 2;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_48_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_16_DBL_;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_64_DBL_ = Long.TWO_PWR_32_DBL_ * Long.TWO_PWR_32_DBL_;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Long.TWO_PWR_63_DBL_ = Long.TWO_PWR_64_DBL_ / 2;
+
+/** @type {Long} */
+Long.ZERO = Long.fromInt(0);
+
+/** @type {Long} */
+Long.ONE = Long.fromInt(1);
+
+/** @type {Long} */
+Long.NEG_ONE = Long.fromInt(-1);
+
+/** @type {Long} */
+Long.MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0);
+
+/** @type {Long} */
+Long.MIN_VALUE = Long.fromBits(0, 0x80000000 | 0);
+
+/**
+ * @type {Long}
+ * @ignore
+ */
+Long.TWO_PWR_24_ = Long.fromInt(1 << 24);
+
+/**
+ * Expose.
+ */
+module.exports = Long;
+module.exports.Long = Long;
diff --git a/NodeAPI/node_modules/bson/lib/bson/map.js b/NodeAPI/node_modules/bson/lib/bson/map.js
new file mode 100644
index 0000000000000000000000000000000000000000..7edb4f2a1f35baf149e2512291ca6715754d7cd9
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/map.js
@@ -0,0 +1,128 @@
+'use strict';
+
+// We have an ES6 Map available, return the native instance
+if (typeof global.Map !== 'undefined') {
+  module.exports = global.Map;
+  module.exports.Map = global.Map;
+} else {
+  // We will return a polyfill
+  var Map = function(array) {
+    this._keys = [];
+    this._values = {};
+
+    for (var i = 0; i < array.length; i++) {
+      if (array[i] == null) continue; // skip null and undefined
+      var entry = array[i];
+      var key = entry[0];
+      var value = entry[1];
+      // Add the key to the list of keys in order
+      this._keys.push(key);
+      // Add the key and value to the values dictionary with a point
+      // to the location in the ordered keys list
+      this._values[key] = { v: value, i: this._keys.length - 1 };
+    }
+  };
+
+  Map.prototype.clear = function() {
+    this._keys = [];
+    this._values = {};
+  };
+
+  Map.prototype.delete = function(key) {
+    var value = this._values[key];
+    if (value == null) return false;
+    // Delete entry
+    delete this._values[key];
+    // Remove the key from the ordered keys list
+    this._keys.splice(value.i, 1);
+    return true;
+  };
+
+  Map.prototype.entries = function() {
+    var self = this;
+    var index = 0;
+
+    return {
+      next: function() {
+        var key = self._keys[index++];
+        return {
+          value: key !== undefined ? [key, self._values[key].v] : undefined,
+          done: key !== undefined ? false : true
+        };
+      }
+    };
+  };
+
+  Map.prototype.forEach = function(callback, self) {
+    self = self || this;
+
+    for (var i = 0; i < this._keys.length; i++) {
+      var key = this._keys[i];
+      // Call the forEach callback
+      callback.call(self, this._values[key].v, key, self);
+    }
+  };
+
+  Map.prototype.get = function(key) {
+    return this._values[key] ? this._values[key].v : undefined;
+  };
+
+  Map.prototype.has = function(key) {
+    return this._values[key] != null;
+  };
+
+  Map.prototype.keys = function() {
+    var self = this;
+    var index = 0;
+
+    return {
+      next: function() {
+        var key = self._keys[index++];
+        return {
+          value: key !== undefined ? key : undefined,
+          done: key !== undefined ? false : true
+        };
+      }
+    };
+  };
+
+  Map.prototype.set = function(key, value) {
+    if (this._values[key]) {
+      this._values[key].v = value;
+      return this;
+    }
+
+    // Add the key to the list of keys in order
+    this._keys.push(key);
+    // Add the key and value to the values dictionary with a point
+    // to the location in the ordered keys list
+    this._values[key] = { v: value, i: this._keys.length - 1 };
+    return this;
+  };
+
+  Map.prototype.values = function() {
+    var self = this;
+    var index = 0;
+
+    return {
+      next: function() {
+        var key = self._keys[index++];
+        return {
+          value: key !== undefined ? self._values[key].v : undefined,
+          done: key !== undefined ? false : true
+        };
+      }
+    };
+  };
+
+  // Last ismaster
+  Object.defineProperty(Map.prototype, 'size', {
+    enumerable: true,
+    get: function() {
+      return this._keys.length;
+    }
+  });
+
+  module.exports = Map;
+  module.exports.Map = Map;
+}
diff --git a/NodeAPI/node_modules/bson/lib/bson/max_key.js b/NodeAPI/node_modules/bson/lib/bson/max_key.js
new file mode 100644
index 0000000000000000000000000000000000000000..eebca7bc6104dad80ae78fc274cd0ab6b1200d3e
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/max_key.js
@@ -0,0 +1,14 @@
+/**
+ * A class representation of the BSON MaxKey type.
+ *
+ * @class
+ * @return {MaxKey} A MaxKey instance
+ */
+function MaxKey() {
+  if (!(this instanceof MaxKey)) return new MaxKey();
+
+  this._bsontype = 'MaxKey';
+}
+
+module.exports = MaxKey;
+module.exports.MaxKey = MaxKey;
diff --git a/NodeAPI/node_modules/bson/lib/bson/min_key.js b/NodeAPI/node_modules/bson/lib/bson/min_key.js
new file mode 100644
index 0000000000000000000000000000000000000000..15f45228d371998a091a7b77834f560a2bc41522
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/min_key.js
@@ -0,0 +1,14 @@
+/**
+ * A class representation of the BSON MinKey type.
+ *
+ * @class
+ * @return {MinKey} A MinKey instance
+ */
+function MinKey() {
+  if (!(this instanceof MinKey)) return new MinKey();
+
+  this._bsontype = 'MinKey';
+}
+
+module.exports = MinKey;
+module.exports.MinKey = MinKey;
diff --git a/NodeAPI/node_modules/bson/lib/bson/objectid.js b/NodeAPI/node_modules/bson/lib/bson/objectid.js
new file mode 100644
index 0000000000000000000000000000000000000000..0ebcc03432e81cd1184e731f2be4f7db1ef19aa7
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/objectid.js
@@ -0,0 +1,392 @@
+// Custom inspect property name / symbol.
+var inspect = 'inspect';
+
+var utils = require('./parser/utils');
+
+/**
+ * Machine id.
+ *
+ * Create a random 3-byte value (i.e. unique for this
+ * process). Other drivers use a md5 of the machine id here, but
+ * that would mean an asyc call to gethostname, so we don't bother.
+ * @ignore
+ */
+var MACHINE_ID = parseInt(Math.random() * 0xffffff, 10);
+
+// Regular expression that checks for hex value
+var checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$');
+
+// Check if buffer exists
+try {
+  if (Buffer && Buffer.from) {
+    var hasBufferType = true;
+    inspect = require('util').inspect.custom || 'inspect';
+  }
+} catch (err) {
+  hasBufferType = false;
+}
+
+/**
+* Create a new ObjectID instance
+*
+* @class
+* @param {(string|number)} id Can be a 24 byte hex string, 12 byte binary string or a Number.
+* @property {number} generationTime The generation time of this ObjectId instance
+* @return {ObjectID} instance of ObjectID.
+*/
+var ObjectID = function ObjectID(id) {
+  // Duck-typing to support ObjectId from different npm packages
+  if (id instanceof ObjectID) return id;
+  if (!(this instanceof ObjectID)) return new ObjectID(id);
+
+  this._bsontype = 'ObjectID';
+
+  // The most common usecase (blank id, new objectId instance)
+  if (id == null || typeof id === 'number') {
+    // Generate a new id
+    this.id = this.generate(id);
+    // If we are caching the hex string
+    if (ObjectID.cacheHexString) this.__id = this.toString('hex');
+    // Return the object
+    return;
+  }
+
+  // Check if the passed in id is valid
+  var valid = ObjectID.isValid(id);
+
+  // Throw an error if it's not a valid setup
+  if (!valid && id != null) {
+    throw new Error(
+      'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'
+    );
+  } else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) {
+    return new ObjectID(utils.toBuffer(id, 'hex'));
+  } else if (valid && typeof id === 'string' && id.length === 24) {
+    return ObjectID.createFromHexString(id);
+  } else if (id != null && id.length === 12) {
+    // assume 12 byte string
+    this.id = id;
+  } else if (id != null && typeof id.toHexString === 'function') {
+    // Duck-typing to support ObjectId from different npm packages
+    return id;
+  } else {
+    throw new Error(
+      'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'
+    );
+  }
+
+  if (ObjectID.cacheHexString) this.__id = this.toString('hex');
+};
+
+// Allow usage of ObjectId as well as ObjectID
+// var ObjectId = ObjectID;
+
+// Precomputed hex table enables speedy hex string conversion
+var hexTable = [];
+for (var i = 0; i < 256; i++) {
+  hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16);
+}
+
+/**
+* Return the ObjectID id as a 24 byte hex string representation
+*
+* @method
+* @return {string} return the 24 byte hex string representation.
+*/
+ObjectID.prototype.toHexString = function() {
+  if (ObjectID.cacheHexString && this.__id) return this.__id;
+
+  var hexString = '';
+  if (!this.id || !this.id.length) {
+    throw new Error(
+      'invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is [' +
+        JSON.stringify(this.id) +
+        ']'
+    );
+  }
+
+  if (this.id instanceof _Buffer) {
+    hexString = convertToHex(this.id);
+    if (ObjectID.cacheHexString) this.__id = hexString;
+    return hexString;
+  }
+
+  for (var i = 0; i < this.id.length; i++) {
+    hexString += hexTable[this.id.charCodeAt(i)];
+  }
+
+  if (ObjectID.cacheHexString) this.__id = hexString;
+  return hexString;
+};
+
+/**
+* Update the ObjectID index used in generating new ObjectID's on the driver
+*
+* @method
+* @return {number} returns next index value.
+* @ignore
+*/
+ObjectID.prototype.get_inc = function() {
+  return (ObjectID.index = (ObjectID.index + 1) % 0xffffff);
+};
+
+/**
+* Update the ObjectID index used in generating new ObjectID's on the driver
+*
+* @method
+* @return {number} returns next index value.
+* @ignore
+*/
+ObjectID.prototype.getInc = function() {
+  return this.get_inc();
+};
+
+/**
+* Generate a 12 byte id buffer used in ObjectID's
+*
+* @method
+* @param {number} [time] optional parameter allowing to pass in a second based timestamp.
+* @return {Buffer} return the 12 byte id buffer string.
+*/
+ObjectID.prototype.generate = function(time) {
+  if ('number' !== typeof time) {
+    time = ~~(Date.now() / 1000);
+  }
+
+  // Use pid
+  var pid =
+    (typeof process === 'undefined' || process.pid === 1
+      ? Math.floor(Math.random() * 100000)
+      : process.pid) % 0xffff;
+  var inc = this.get_inc();
+  // Buffer used
+  var buffer = utils.allocBuffer(12);
+  // Encode time
+  buffer[3] = time & 0xff;
+  buffer[2] = (time >> 8) & 0xff;
+  buffer[1] = (time >> 16) & 0xff;
+  buffer[0] = (time >> 24) & 0xff;
+  // Encode machine
+  buffer[6] = MACHINE_ID & 0xff;
+  buffer[5] = (MACHINE_ID >> 8) & 0xff;
+  buffer[4] = (MACHINE_ID >> 16) & 0xff;
+  // Encode pid
+  buffer[8] = pid & 0xff;
+  buffer[7] = (pid >> 8) & 0xff;
+  // Encode index
+  buffer[11] = inc & 0xff;
+  buffer[10] = (inc >> 8) & 0xff;
+  buffer[9] = (inc >> 16) & 0xff;
+  // Return the buffer
+  return buffer;
+};
+
+/**
+* Converts the id into a 24 byte hex string for printing
+*
+* @param {String} format The Buffer toString format parameter.
+* @return {String} return the 24 byte hex string representation.
+* @ignore
+*/
+ObjectID.prototype.toString = function(format) {
+  // Is the id a buffer then use the buffer toString method to return the format
+  if (this.id && this.id.copy) {
+    return this.id.toString(typeof format === 'string' ? format : 'hex');
+  }
+
+  // if(this.buffer )
+  return this.toHexString();
+};
+
+/**
+* Converts to a string representation of this Id.
+*
+* @return {String} return the 24 byte hex string representation.
+* @ignore
+*/
+ObjectID.prototype[inspect] = ObjectID.prototype.toString;
+
+/**
+* Converts to its JSON representation.
+*
+* @return {String} return the 24 byte hex string representation.
+* @ignore
+*/
+ObjectID.prototype.toJSON = function() {
+  return this.toHexString();
+};
+
+/**
+* Compares the equality of this ObjectID with `otherID`.
+*
+* @method
+* @param {object} otherID ObjectID instance to compare against.
+* @return {boolean} the result of comparing two ObjectID's
+*/
+ObjectID.prototype.equals = function equals(otherId) {
+  // var id;
+
+  if (otherId instanceof ObjectID) {
+    return this.toString() === otherId.toString();
+  } else if (
+    typeof otherId === 'string' &&
+    ObjectID.isValid(otherId) &&
+    otherId.length === 12 &&
+    this.id instanceof _Buffer
+  ) {
+    return otherId === this.id.toString('binary');
+  } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 24) {
+    return otherId.toLowerCase() === this.toHexString();
+  } else if (typeof otherId === 'string' && ObjectID.isValid(otherId) && otherId.length === 12) {
+    return otherId === this.id;
+  } else if (otherId != null && (otherId instanceof ObjectID || otherId.toHexString)) {
+    return otherId.toHexString() === this.toHexString();
+  } else {
+    return false;
+  }
+};
+
+/**
+* Returns the generation date (accurate up to the second) that this ID was generated.
+*
+* @method
+* @return {date} the generation date
+*/
+ObjectID.prototype.getTimestamp = function() {
+  var timestamp = new Date();
+  var time = this.id[3] | (this.id[2] << 8) | (this.id[1] << 16) | (this.id[0] << 24);
+  timestamp.setTime(Math.floor(time) * 1000);
+  return timestamp;
+};
+
+/**
+* @ignore
+*/
+ObjectID.index = ~~(Math.random() * 0xffffff);
+
+/**
+* @ignore
+*/
+ObjectID.createPk = function createPk() {
+  return new ObjectID();
+};
+
+/**
+* Creates an ObjectID from a second based number, with the rest of the ObjectID zeroed out. Used for comparisons or sorting the ObjectID.
+*
+* @method
+* @param {number} time an integer number representing a number of seconds.
+* @return {ObjectID} return the created ObjectID
+*/
+ObjectID.createFromTime = function createFromTime(time) {
+  var buffer = utils.toBuffer([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
+  // Encode time into first 4 bytes
+  buffer[3] = time & 0xff;
+  buffer[2] = (time >> 8) & 0xff;
+  buffer[1] = (time >> 16) & 0xff;
+  buffer[0] = (time >> 24) & 0xff;
+  // Return the new objectId
+  return new ObjectID(buffer);
+};
+
+// Lookup tables
+//var encodeLookup = '0123456789abcdef'.split('');
+var decodeLookup = [];
+i = 0;
+while (i < 10) decodeLookup[0x30 + i] = i++;
+while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++;
+
+var _Buffer = Buffer;
+var convertToHex = function(bytes) {
+  return bytes.toString('hex');
+};
+
+/**
+* Creates an ObjectID from a hex string representation of an ObjectID.
+*
+* @method
+* @param {string} hexString create a ObjectID from a passed in 24 byte hexstring.
+* @return {ObjectID} return the created ObjectID
+*/
+ObjectID.createFromHexString = function createFromHexString(string) {
+  // Throw an error if it's not a valid setup
+  if (typeof string === 'undefined' || (string != null && string.length !== 24)) {
+    throw new Error(
+      'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters'
+    );
+  }
+
+  // Use Buffer.from method if available
+  if (hasBufferType) return new ObjectID(utils.toBuffer(string, 'hex'));
+
+  // Calculate lengths
+  var array = new _Buffer(12);
+  var n = 0;
+  var i = 0;
+
+  while (i < 24) {
+    array[n++] = (decodeLookup[string.charCodeAt(i++)] << 4) | decodeLookup[string.charCodeAt(i++)];
+  }
+
+  return new ObjectID(array);
+};
+
+/**
+* Checks if a value is a valid bson ObjectId
+*
+* @method
+* @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise.
+*/
+ObjectID.isValid = function isValid(id) {
+  if (id == null) return false;
+
+  if (typeof id === 'number') {
+    return true;
+  }
+
+  if (typeof id === 'string') {
+    return id.length === 12 || (id.length === 24 && checkForHexRegExp.test(id));
+  }
+
+  if (id instanceof ObjectID) {
+    return true;
+  }
+
+  if (id instanceof _Buffer) {
+    return true;
+  }
+
+  // Duck-Typing detection of ObjectId like objects
+  if (
+      typeof id.toHexString === 'function' &&
+      (id.id instanceof _Buffer || typeof id.id === 'string')
+  ) {
+    return id.id.length === 12 || (id.id.length === 24 && checkForHexRegExp.test(id.id));
+  }
+
+  return false;
+};
+
+/**
+* @ignore
+*/
+Object.defineProperty(ObjectID.prototype, 'generationTime', {
+  enumerable: true,
+  get: function() {
+    return this.id[3] | (this.id[2] << 8) | (this.id[1] << 16) | (this.id[0] << 24);
+  },
+  set: function(value) {
+    // Encode time into first 4 bytes
+    this.id[3] = value & 0xff;
+    this.id[2] = (value >> 8) & 0xff;
+    this.id[1] = (value >> 16) & 0xff;
+    this.id[0] = (value >> 24) & 0xff;
+  }
+});
+
+/**
+ * Expose.
+ */
+module.exports = ObjectID;
+module.exports.ObjectID = ObjectID;
+module.exports.ObjectId = ObjectID;
diff --git a/NodeAPI/node_modules/bson/lib/bson/parser/calculate_size.js b/NodeAPI/node_modules/bson/lib/bson/parser/calculate_size.js
new file mode 100644
index 0000000000000000000000000000000000000000..7e0026ca6716c5cdc7403c7d6913f90c7b03eac3
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/parser/calculate_size.js
@@ -0,0 +1,255 @@
+'use strict';
+
+var Long = require('../long').Long,
+  Double = require('../double').Double,
+  Timestamp = require('../timestamp').Timestamp,
+  ObjectID = require('../objectid').ObjectID,
+  Symbol = require('../symbol').Symbol,
+  BSONRegExp = require('../regexp').BSONRegExp,
+  Code = require('../code').Code,
+  Decimal128 = require('../decimal128'),
+  MinKey = require('../min_key').MinKey,
+  MaxKey = require('../max_key').MaxKey,
+  DBRef = require('../db_ref').DBRef,
+  Binary = require('../binary').Binary;
+
+var normalizedFunctionString = require('./utils').normalizedFunctionString;
+
+// To ensure that 0.4 of node works correctly
+var isDate = function isDate(d) {
+  return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
+};
+
+var calculateObjectSize = function calculateObjectSize(
+  object,
+  serializeFunctions,
+  ignoreUndefined
+) {
+  var totalLength = 4 + 1;
+
+  if (Array.isArray(object)) {
+    for (var i = 0; i < object.length; i++) {
+      totalLength += calculateElement(
+        i.toString(),
+        object[i],
+        serializeFunctions,
+        true,
+        ignoreUndefined
+      );
+    }
+  } else {
+    // If we have toBSON defined, override the current object
+    if (object.toBSON) {
+      object = object.toBSON();
+    }
+
+    // Calculate size
+    for (var key in object) {
+      totalLength += calculateElement(key, object[key], serializeFunctions, false, ignoreUndefined);
+    }
+  }
+
+  return totalLength;
+};
+
+/**
+ * @ignore
+ * @api private
+ */
+function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) {
+  // If we have toBSON defined, override the current object
+  if (value && value.toBSON) {
+    value = value.toBSON();
+  }
+
+  switch (typeof value) {
+    case 'string':
+      return 1 + Buffer.byteLength(name, 'utf8') + 1 + 4 + Buffer.byteLength(value, 'utf8') + 1;
+    case 'number':
+      if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
+        if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
+          // 32 bit
+          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (4 + 1);
+        } else {
+          return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+        }
+      } else {
+        // 64 bit
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+      }
+    case 'undefined':
+      if (isArray || !ignoreUndefined)
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
+      return 0;
+    case 'boolean':
+      return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 1);
+    case 'object':
+      if (
+        value == null ||
+        value instanceof MinKey ||
+        value instanceof MaxKey ||
+        value['_bsontype'] === 'MinKey' ||
+        value['_bsontype'] === 'MaxKey'
+      ) {
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + 1;
+      } else if (value instanceof ObjectID || value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (12 + 1);
+      } else if (value instanceof Date || isDate(value)) {
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+      } else if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (1 + 4 + 1) + value.length
+        );
+      } else if (
+        value instanceof Long ||
+        value instanceof Double ||
+        value instanceof Timestamp ||
+        value['_bsontype'] === 'Long' ||
+        value['_bsontype'] === 'Double' ||
+        value['_bsontype'] === 'Timestamp'
+      ) {
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (8 + 1);
+      } else if (value instanceof Decimal128 || value['_bsontype'] === 'Decimal128') {
+        return (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (16 + 1);
+      } else if (value instanceof Code || value['_bsontype'] === 'Code') {
+        // Calculate size depending on the availability of a scope
+        if (value.scope != null && Object.keys(value.scope).length > 0) {
+          return (
+            (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+            1 +
+            4 +
+            4 +
+            Buffer.byteLength(value.code.toString(), 'utf8') +
+            1 +
+            calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined)
+          );
+        } else {
+          return (
+            (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+            1 +
+            4 +
+            Buffer.byteLength(value.code.toString(), 'utf8') +
+            1
+          );
+        }
+      } else if (value instanceof Binary || value['_bsontype'] === 'Binary') {
+        // Check what kind of subtype we have
+        if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
+          return (
+            (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+            (value.position + 1 + 4 + 1 + 4)
+          );
+        } else {
+          return (
+            (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) + (value.position + 1 + 4 + 1)
+          );
+        }
+      } else if (value instanceof Symbol || value['_bsontype'] === 'Symbol') {
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+          Buffer.byteLength(value.value, 'utf8') +
+          4 +
+          1 +
+          1
+        );
+      } else if (value instanceof DBRef || value['_bsontype'] === 'DBRef') {
+        // Set up correct object for serialization
+        var ordered_values = {
+          $ref: value.namespace,
+          $id: value.oid
+        };
+
+        // Add db reference if it exists
+        if (null != value.db) {
+          ordered_values['$db'] = value.db;
+        }
+
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+          1 +
+          calculateObjectSize(ordered_values, serializeFunctions, ignoreUndefined)
+        );
+      } else if (
+        value instanceof RegExp ||
+        Object.prototype.toString.call(value) === '[object RegExp]'
+      ) {
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+          1 +
+          Buffer.byteLength(value.source, 'utf8') +
+          1 +
+          (value.global ? 1 : 0) +
+          (value.ignoreCase ? 1 : 0) +
+          (value.multiline ? 1 : 0) +
+          1
+        );
+      } else if (value instanceof BSONRegExp || value['_bsontype'] === 'BSONRegExp') {
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+          1 +
+          Buffer.byteLength(value.pattern, 'utf8') +
+          1 +
+          Buffer.byteLength(value.options, 'utf8') +
+          1
+        );
+      } else {
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+          calculateObjectSize(value, serializeFunctions, ignoreUndefined) +
+          1
+        );
+      }
+    case 'function':
+      // WTF for 0.4.X where typeof /someregexp/ === 'function'
+      if (
+        value instanceof RegExp ||
+        Object.prototype.toString.call(value) === '[object RegExp]' ||
+        String.call(value) === '[object RegExp]'
+      ) {
+        return (
+          (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+          1 +
+          Buffer.byteLength(value.source, 'utf8') +
+          1 +
+          (value.global ? 1 : 0) +
+          (value.ignoreCase ? 1 : 0) +
+          (value.multiline ? 1 : 0) +
+          1
+        );
+      } else {
+        if (serializeFunctions && value.scope != null && Object.keys(value.scope).length > 0) {
+          return (
+            (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+            1 +
+            4 +
+            4 +
+            Buffer.byteLength(normalizedFunctionString(value), 'utf8') +
+            1 +
+            calculateObjectSize(value.scope, serializeFunctions, ignoreUndefined)
+          );
+        } else if (serializeFunctions) {
+          return (
+            (name != null ? Buffer.byteLength(name, 'utf8') + 1 : 0) +
+            1 +
+            4 +
+            Buffer.byteLength(normalizedFunctionString(value), 'utf8') +
+            1
+          );
+        }
+      }
+  }
+
+  return 0;
+}
+
+var BSON = {};
+
+// BSON MAX VALUES
+BSON.BSON_INT32_MAX = 0x7fffffff;
+BSON.BSON_INT32_MIN = -0x80000000;
+
+// JS MAX PRECISE VALUES
+BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+module.exports = calculateObjectSize;
diff --git a/NodeAPI/node_modules/bson/lib/bson/parser/deserializer.js b/NodeAPI/node_modules/bson/lib/bson/parser/deserializer.js
new file mode 100644
index 0000000000000000000000000000000000000000..be3c8654c4b371c7c42c05675b952938eb438424
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/parser/deserializer.js
@@ -0,0 +1,782 @@
+'use strict';
+
+var Long = require('../long').Long,
+  Double = require('../double').Double,
+  Timestamp = require('../timestamp').Timestamp,
+  ObjectID = require('../objectid').ObjectID,
+  Symbol = require('../symbol').Symbol,
+  Code = require('../code').Code,
+  MinKey = require('../min_key').MinKey,
+  MaxKey = require('../max_key').MaxKey,
+  Decimal128 = require('../decimal128'),
+  Int32 = require('../int_32'),
+  DBRef = require('../db_ref').DBRef,
+  BSONRegExp = require('../regexp').BSONRegExp,
+  Binary = require('../binary').Binary;
+
+var utils = require('./utils');
+
+var deserialize = function(buffer, options, isArray) {
+  options = options == null ? {} : options;
+  var index = options && options.index ? options.index : 0;
+  // Read the document size
+  var size =
+    buffer[index] |
+    (buffer[index + 1] << 8) |
+    (buffer[index + 2] << 16) |
+    (buffer[index + 3] << 24);
+
+  // Ensure buffer is valid size
+  if (size < 5 || buffer.length < size || size + index > buffer.length) {
+    throw new Error('corrupt bson message');
+  }
+
+  // Illegal end value
+  if (buffer[index + size - 1] !== 0) {
+    throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");
+  }
+
+  // Start deserializtion
+  return deserializeObject(buffer, index, options, isArray);
+};
+
+var deserializeObject = function(buffer, index, options, isArray) {
+  var evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions'];
+  var cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions'];
+  var cacheFunctionsCrc32 =
+    options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32'];
+
+  if (!cacheFunctionsCrc32) var crc32 = null;
+
+  var fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw'];
+
+  // Return raw bson buffer instead of parsing it
+  var raw = options['raw'] == null ? false : options['raw'];
+
+  // Return BSONRegExp objects instead of native regular expressions
+  var bsonRegExp = typeof options['bsonRegExp'] === 'boolean' ? options['bsonRegExp'] : false;
+
+  // Controls the promotion of values vs wrapper classes
+  var promoteBuffers = options['promoteBuffers'] == null ? false : options['promoteBuffers'];
+  var promoteLongs = options['promoteLongs'] == null ? true : options['promoteLongs'];
+  var promoteValues = options['promoteValues'] == null ? true : options['promoteValues'];
+
+  // Set the start index
+  var startIndex = index;
+
+  // Validate that we have at least 4 bytes of buffer
+  if (buffer.length < 5) throw new Error('corrupt bson message < 5 bytes long');
+
+  // Read the document size
+  var size =
+    buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24);
+
+  // Ensure buffer is valid size
+  if (size < 5 || size > buffer.length) throw new Error('corrupt bson message');
+
+  // Create holding object
+  var object = isArray ? [] : {};
+  // Used for arrays to skip having to perform utf8 decoding
+  var arrayIndex = 0;
+
+  var done = false;
+
+  // While we have more left data left keep parsing
+  // while (buffer[index + 1] !== 0) {
+  while (!done) {
+    // Read the type
+    var elementType = buffer[index++];
+    // If we get a zero it's the last byte, exit
+    if (elementType === 0) break;
+
+    // Get the start search index
+    var i = index;
+    // Locate the end of the c string
+    while (buffer[i] !== 0x00 && i < buffer.length) {
+      i++;
+    }
+
+    // If are at the end of the buffer there is a problem with the document
+    if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+    var name = isArray ? arrayIndex++ : buffer.toString('utf8', index, i);
+
+    index = i + 1;
+
+    if (elementType === BSON.BSON_DATA_STRING) {
+      var stringSize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      if (
+        stringSize <= 0 ||
+        stringSize > buffer.length - index ||
+        buffer[index + stringSize - 1] !== 0
+      )
+        throw new Error('bad string length in bson');
+      object[name] = buffer.toString('utf8', index, index + stringSize - 1);
+      index = index + stringSize;
+    } else if (elementType === BSON.BSON_DATA_OID) {
+      var oid = utils.allocBuffer(12);
+      buffer.copy(oid, 0, index, index + 12);
+      object[name] = new ObjectID(oid);
+      index = index + 12;
+    } else if (elementType === BSON.BSON_DATA_INT && promoteValues === false) {
+      object[name] = new Int32(
+        buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24)
+      );
+    } else if (elementType === BSON.BSON_DATA_INT) {
+      object[name] =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+    } else if (elementType === BSON.BSON_DATA_NUMBER && promoteValues === false) {
+      object[name] = new Double(buffer.readDoubleLE(index));
+      index = index + 8;
+    } else if (elementType === BSON.BSON_DATA_NUMBER) {
+      object[name] = buffer.readDoubleLE(index);
+      index = index + 8;
+    } else if (elementType === BSON.BSON_DATA_DATE) {
+      var lowBits =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      var highBits =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      object[name] = new Date(new Long(lowBits, highBits).toNumber());
+    } else if (elementType === BSON.BSON_DATA_BOOLEAN) {
+      if (buffer[index] !== 0 && buffer[index] !== 1) throw new Error('illegal boolean type value');
+      object[name] = buffer[index++] === 1;
+    } else if (elementType === BSON.BSON_DATA_OBJECT) {
+      var _index = index;
+      var objectSize =
+        buffer[index] |
+        (buffer[index + 1] << 8) |
+        (buffer[index + 2] << 16) |
+        (buffer[index + 3] << 24);
+      if (objectSize <= 0 || objectSize > buffer.length - index)
+        throw new Error('bad embedded document length in bson');
+
+      // We have a raw value
+      if (raw) {
+        object[name] = buffer.slice(index, index + objectSize);
+      } else {
+        object[name] = deserializeObject(buffer, _index, options, false);
+      }
+
+      index = index + objectSize;
+    } else if (elementType === BSON.BSON_DATA_ARRAY) {
+      _index = index;
+      objectSize =
+        buffer[index] |
+        (buffer[index + 1] << 8) |
+        (buffer[index + 2] << 16) |
+        (buffer[index + 3] << 24);
+      var arrayOptions = options;
+
+      // Stop index
+      var stopIndex = index + objectSize;
+
+      // All elements of array to be returned as raw bson
+      if (fieldsAsRaw && fieldsAsRaw[name]) {
+        arrayOptions = {};
+        for (var n in options) arrayOptions[n] = options[n];
+        arrayOptions['raw'] = true;
+      }
+
+      object[name] = deserializeObject(buffer, _index, arrayOptions, true);
+      index = index + objectSize;
+
+      if (buffer[index - 1] !== 0) throw new Error('invalid array terminator byte');
+      if (index !== stopIndex) throw new Error('corrupted array bson');
+    } else if (elementType === BSON.BSON_DATA_UNDEFINED) {
+      object[name] = undefined;
+    } else if (elementType === BSON.BSON_DATA_NULL) {
+      object[name] = null;
+    } else if (elementType === BSON.BSON_DATA_LONG) {
+      // Unpack the low and high bits
+      lowBits =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      highBits =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      var long = new Long(lowBits, highBits);
+      // Promote the long if possible
+      if (promoteLongs && promoteValues === true) {
+        object[name] =
+          long.lessThanOrEqual(JS_INT_MAX_LONG) && long.greaterThanOrEqual(JS_INT_MIN_LONG)
+            ? long.toNumber()
+            : long;
+      } else {
+        object[name] = long;
+      }
+    } else if (elementType === BSON.BSON_DATA_DECIMAL128) {
+      // Buffer to contain the decimal bytes
+      var bytes = utils.allocBuffer(16);
+      // Copy the next 16 bytes into the bytes buffer
+      buffer.copy(bytes, 0, index, index + 16);
+      // Update index
+      index = index + 16;
+      // Assign the new Decimal128 value
+      var decimal128 = new Decimal128(bytes);
+      // If we have an alternative mapper use that
+      object[name] = decimal128.toObject ? decimal128.toObject() : decimal128;
+    } else if (elementType === BSON.BSON_DATA_BINARY) {
+      var binarySize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      var totalBinarySize = binarySize;
+      var subType = buffer[index++];
+
+      // Did we have a negative binary size, throw
+      if (binarySize < 0) throw new Error('Negative binary type element size found');
+
+      // Is the length longer than the document
+      if (binarySize > buffer.length) throw new Error('Binary type size larger than document size');
+
+      // Decode as raw Buffer object if options specifies it
+      if (buffer['slice'] != null) {
+        // If we have subtype 2 skip the 4 bytes for the size
+        if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
+          binarySize =
+            buffer[index++] |
+            (buffer[index++] << 8) |
+            (buffer[index++] << 16) |
+            (buffer[index++] << 24);
+          if (binarySize < 0)
+            throw new Error('Negative binary type element size found for subtype 0x02');
+          if (binarySize > totalBinarySize - 4)
+            throw new Error('Binary type with subtype 0x02 contains to long binary size');
+          if (binarySize < totalBinarySize - 4)
+            throw new Error('Binary type with subtype 0x02 contains to short binary size');
+        }
+
+        if (promoteBuffers && promoteValues) {
+          object[name] = buffer.slice(index, index + binarySize);
+        } else {
+          object[name] = new Binary(buffer.slice(index, index + binarySize), subType);
+        }
+      } else {
+        var _buffer =
+          typeof Uint8Array !== 'undefined'
+            ? new Uint8Array(new ArrayBuffer(binarySize))
+            : new Array(binarySize);
+        // If we have subtype 2 skip the 4 bytes for the size
+        if (subType === Binary.SUBTYPE_BYTE_ARRAY) {
+          binarySize =
+            buffer[index++] |
+            (buffer[index++] << 8) |
+            (buffer[index++] << 16) |
+            (buffer[index++] << 24);
+          if (binarySize < 0)
+            throw new Error('Negative binary type element size found for subtype 0x02');
+          if (binarySize > totalBinarySize - 4)
+            throw new Error('Binary type with subtype 0x02 contains to long binary size');
+          if (binarySize < totalBinarySize - 4)
+            throw new Error('Binary type with subtype 0x02 contains to short binary size');
+        }
+
+        // Copy the data
+        for (i = 0; i < binarySize; i++) {
+          _buffer[i] = buffer[index + i];
+        }
+
+        if (promoteBuffers && promoteValues) {
+          object[name] = _buffer;
+        } else {
+          object[name] = new Binary(_buffer, subType);
+        }
+      }
+
+      // Update the index
+      index = index + binarySize;
+    } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === false) {
+      // Get the start search index
+      i = index;
+      // Locate the end of the c string
+      while (buffer[i] !== 0x00 && i < buffer.length) {
+        i++;
+      }
+      // If are at the end of the buffer there is a problem with the document
+      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+      // Return the C string
+      var source = buffer.toString('utf8', index, i);
+      // Create the regexp
+      index = i + 1;
+
+      // Get the start search index
+      i = index;
+      // Locate the end of the c string
+      while (buffer[i] !== 0x00 && i < buffer.length) {
+        i++;
+      }
+      // If are at the end of the buffer there is a problem with the document
+      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+      // Return the C string
+      var regExpOptions = buffer.toString('utf8', index, i);
+      index = i + 1;
+
+      // For each option add the corresponding one for javascript
+      var optionsArray = new Array(regExpOptions.length);
+
+      // Parse options
+      for (i = 0; i < regExpOptions.length; i++) {
+        switch (regExpOptions[i]) {
+          case 'm':
+            optionsArray[i] = 'm';
+            break;
+          case 's':
+            optionsArray[i] = 'g';
+            break;
+          case 'i':
+            optionsArray[i] = 'i';
+            break;
+        }
+      }
+
+      object[name] = new RegExp(source, optionsArray.join(''));
+    } else if (elementType === BSON.BSON_DATA_REGEXP && bsonRegExp === true) {
+      // Get the start search index
+      i = index;
+      // Locate the end of the c string
+      while (buffer[i] !== 0x00 && i < buffer.length) {
+        i++;
+      }
+      // If are at the end of the buffer there is a problem with the document
+      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+      // Return the C string
+      source = buffer.toString('utf8', index, i);
+      index = i + 1;
+
+      // Get the start search index
+      i = index;
+      // Locate the end of the c string
+      while (buffer[i] !== 0x00 && i < buffer.length) {
+        i++;
+      }
+      // If are at the end of the buffer there is a problem with the document
+      if (i >= buffer.length) throw new Error('Bad BSON Document: illegal CString');
+      // Return the C string
+      regExpOptions = buffer.toString('utf8', index, i);
+      index = i + 1;
+
+      // Set the object
+      object[name] = new BSONRegExp(source, regExpOptions);
+    } else if (elementType === BSON.BSON_DATA_SYMBOL) {
+      stringSize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      if (
+        stringSize <= 0 ||
+        stringSize > buffer.length - index ||
+        buffer[index + stringSize - 1] !== 0
+      )
+        throw new Error('bad string length in bson');
+      object[name] = new Symbol(buffer.toString('utf8', index, index + stringSize - 1));
+      index = index + stringSize;
+    } else if (elementType === BSON.BSON_DATA_TIMESTAMP) {
+      lowBits =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      highBits =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      object[name] = new Timestamp(lowBits, highBits);
+    } else if (elementType === BSON.BSON_DATA_MIN_KEY) {
+      object[name] = new MinKey();
+    } else if (elementType === BSON.BSON_DATA_MAX_KEY) {
+      object[name] = new MaxKey();
+    } else if (elementType === BSON.BSON_DATA_CODE) {
+      stringSize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      if (
+        stringSize <= 0 ||
+        stringSize > buffer.length - index ||
+        buffer[index + stringSize - 1] !== 0
+      )
+        throw new Error('bad string length in bson');
+      var functionString = buffer.toString('utf8', index, index + stringSize - 1);
+
+      // If we are evaluating the functions
+      if (evalFunctions) {
+        // If we have cache enabled let's look for the md5 of the function in the cache
+        if (cacheFunctions) {
+          var hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
+          // Got to do this to avoid V8 deoptimizing the call due to finding eval
+          object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
+        } else {
+          object[name] = isolateEval(functionString);
+        }
+      } else {
+        object[name] = new Code(functionString);
+      }
+
+      // Update parse index position
+      index = index + stringSize;
+    } else if (elementType === BSON.BSON_DATA_CODE_W_SCOPE) {
+      var totalSize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+
+      // Element cannot be shorter than totalSize + stringSize + documentSize + terminator
+      if (totalSize < 4 + 4 + 4 + 1) {
+        throw new Error('code_w_scope total size shorter minimum expected length');
+      }
+
+      // Get the code string size
+      stringSize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      // Check if we have a valid string
+      if (
+        stringSize <= 0 ||
+        stringSize > buffer.length - index ||
+        buffer[index + stringSize - 1] !== 0
+      )
+        throw new Error('bad string length in bson');
+
+      // Javascript function
+      functionString = buffer.toString('utf8', index, index + stringSize - 1);
+      // Update parse index position
+      index = index + stringSize;
+      // Parse the element
+      _index = index;
+      // Decode the size of the object document
+      objectSize =
+        buffer[index] |
+        (buffer[index + 1] << 8) |
+        (buffer[index + 2] << 16) |
+        (buffer[index + 3] << 24);
+      // Decode the scope object
+      var scopeObject = deserializeObject(buffer, _index, options, false);
+      // Adjust the index
+      index = index + objectSize;
+
+      // Check if field length is to short
+      if (totalSize < 4 + 4 + objectSize + stringSize) {
+        throw new Error('code_w_scope total size is to short, truncating scope');
+      }
+
+      // Check if totalSize field is to long
+      if (totalSize > 4 + 4 + objectSize + stringSize) {
+        throw new Error('code_w_scope total size is to long, clips outer document');
+      }
+
+      // If we are evaluating the functions
+      if (evalFunctions) {
+        // If we have cache enabled let's look for the md5 of the function in the cache
+        if (cacheFunctions) {
+          hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString;
+          // Got to do this to avoid V8 deoptimizing the call due to finding eval
+          object[name] = isolateEvalWithHash(functionCache, hash, functionString, object);
+        } else {
+          object[name] = isolateEval(functionString);
+        }
+
+        object[name].scope = scopeObject;
+      } else {
+        object[name] = new Code(functionString, scopeObject);
+      }
+    } else if (elementType === BSON.BSON_DATA_DBPOINTER) {
+      // Get the code string size
+      stringSize =
+        buffer[index++] |
+        (buffer[index++] << 8) |
+        (buffer[index++] << 16) |
+        (buffer[index++] << 24);
+      // Check if we have a valid string
+      if (
+        stringSize <= 0 ||
+        stringSize > buffer.length - index ||
+        buffer[index + stringSize - 1] !== 0
+      )
+        throw new Error('bad string length in bson');
+      // Namespace
+      var namespace = buffer.toString('utf8', index, index + stringSize - 1);
+      // Update parse index position
+      index = index + stringSize;
+
+      // Read the oid
+      var oidBuffer = utils.allocBuffer(12);
+      buffer.copy(oidBuffer, 0, index, index + 12);
+      oid = new ObjectID(oidBuffer);
+
+      // Update the index
+      index = index + 12;
+
+      // Split the namespace
+      var parts = namespace.split('.');
+      var db = parts.shift();
+      var collection = parts.join('.');
+      // Upgrade to DBRef type
+      object[name] = new DBRef(collection, oid, db);
+    } else {
+      throw new Error(
+        'Detected unknown BSON type ' +
+          elementType.toString(16) +
+          ' for fieldname "' +
+          name +
+          '", are you using the latest BSON parser'
+      );
+    }
+  }
+
+  // Check if the deserialization was against a valid array/object
+  if (size !== index - startIndex) {
+    if (isArray) throw new Error('corrupt array bson');
+    throw new Error('corrupt object bson');
+  }
+
+  // Check if we have a db ref object
+  if (object['$id'] != null) object = new DBRef(object['$ref'], object['$id'], object['$db']);
+  return object;
+};
+
+/**
+ * Ensure eval is isolated.
+ *
+ * @ignore
+ * @api private
+ */
+var isolateEvalWithHash = function(functionCache, hash, functionString, object) {
+  // Contains the value we are going to set
+  var value = null;
+
+  // Check for cache hit, eval if missing and return cached function
+  if (functionCache[hash] == null) {
+    eval('value = ' + functionString);
+    functionCache[hash] = value;
+  }
+  // Set the object
+  return functionCache[hash].bind(object);
+};
+
+/**
+ * Ensure eval is isolated.
+ *
+ * @ignore
+ * @api private
+ */
+var isolateEval = function(functionString) {
+  // Contains the value we are going to set
+  var value = null;
+  // Eval the function
+  eval('value = ' + functionString);
+  return value;
+};
+
+var BSON = {};
+
+/**
+ * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
+ *
+ * @ignore
+ * @api private
+ */
+var functionCache = (BSON.functionCache = {});
+
+/**
+ * Number BSON Type
+ *
+ * @classconstant BSON_DATA_NUMBER
+ **/
+BSON.BSON_DATA_NUMBER = 1;
+/**
+ * String BSON Type
+ *
+ * @classconstant BSON_DATA_STRING
+ **/
+BSON.BSON_DATA_STRING = 2;
+/**
+ * Object BSON Type
+ *
+ * @classconstant BSON_DATA_OBJECT
+ **/
+BSON.BSON_DATA_OBJECT = 3;
+/**
+ * Array BSON Type
+ *
+ * @classconstant BSON_DATA_ARRAY
+ **/
+BSON.BSON_DATA_ARRAY = 4;
+/**
+ * Binary BSON Type
+ *
+ * @classconstant BSON_DATA_BINARY
+ **/
+BSON.BSON_DATA_BINARY = 5;
+/**
+ * Binary BSON Type
+ *
+ * @classconstant BSON_DATA_UNDEFINED
+ **/
+BSON.BSON_DATA_UNDEFINED = 6;
+/**
+ * ObjectID BSON Type
+ *
+ * @classconstant BSON_DATA_OID
+ **/
+BSON.BSON_DATA_OID = 7;
+/**
+ * Boolean BSON Type
+ *
+ * @classconstant BSON_DATA_BOOLEAN
+ **/
+BSON.BSON_DATA_BOOLEAN = 8;
+/**
+ * Date BSON Type
+ *
+ * @classconstant BSON_DATA_DATE
+ **/
+BSON.BSON_DATA_DATE = 9;
+/**
+ * null BSON Type
+ *
+ * @classconstant BSON_DATA_NULL
+ **/
+BSON.BSON_DATA_NULL = 10;
+/**
+ * RegExp BSON Type
+ *
+ * @classconstant BSON_DATA_REGEXP
+ **/
+BSON.BSON_DATA_REGEXP = 11;
+/**
+ * Code BSON Type
+ *
+ * @classconstant BSON_DATA_DBPOINTER
+ **/
+BSON.BSON_DATA_DBPOINTER = 12;
+/**
+ * Code BSON Type
+ *
+ * @classconstant BSON_DATA_CODE
+ **/
+BSON.BSON_DATA_CODE = 13;
+/**
+ * Symbol BSON Type
+ *
+ * @classconstant BSON_DATA_SYMBOL
+ **/
+BSON.BSON_DATA_SYMBOL = 14;
+/**
+ * Code with Scope BSON Type
+ *
+ * @classconstant BSON_DATA_CODE_W_SCOPE
+ **/
+BSON.BSON_DATA_CODE_W_SCOPE = 15;
+/**
+ * 32 bit Integer BSON Type
+ *
+ * @classconstant BSON_DATA_INT
+ **/
+BSON.BSON_DATA_INT = 16;
+/**
+ * Timestamp BSON Type
+ *
+ * @classconstant BSON_DATA_TIMESTAMP
+ **/
+BSON.BSON_DATA_TIMESTAMP = 17;
+/**
+ * Long BSON Type
+ *
+ * @classconstant BSON_DATA_LONG
+ **/
+BSON.BSON_DATA_LONG = 18;
+/**
+ * Long BSON Type
+ *
+ * @classconstant BSON_DATA_DECIMAL128
+ **/
+BSON.BSON_DATA_DECIMAL128 = 19;
+/**
+ * MinKey BSON Type
+ *
+ * @classconstant BSON_DATA_MIN_KEY
+ **/
+BSON.BSON_DATA_MIN_KEY = 0xff;
+/**
+ * MaxKey BSON Type
+ *
+ * @classconstant BSON_DATA_MAX_KEY
+ **/
+BSON.BSON_DATA_MAX_KEY = 0x7f;
+
+/**
+ * Binary Default Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
+ **/
+BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
+/**
+ * Binary Function Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
+ **/
+BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
+/**
+ * Binary Byte Array Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
+ **/
+BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
+/**
+ * Binary UUID Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_UUID
+ **/
+BSON.BSON_BINARY_SUBTYPE_UUID = 3;
+/**
+ * Binary MD5 Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_MD5
+ **/
+BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
+/**
+ * Binary User Defined Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
+ **/
+BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
+
+// BSON MAX VALUES
+BSON.BSON_INT32_MAX = 0x7fffffff;
+BSON.BSON_INT32_MIN = -0x80000000;
+
+BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+// JS MAX PRECISE VALUES
+BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+// Internal long versions
+var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
+var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
+
+module.exports = deserialize;
diff --git a/NodeAPI/node_modules/bson/lib/bson/parser/serializer.js b/NodeAPI/node_modules/bson/lib/bson/parser/serializer.js
new file mode 100644
index 0000000000000000000000000000000000000000..fab9b6f3c4b0d7517038720c6d30c2b0ebd84769
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/parser/serializer.js
@@ -0,0 +1,1194 @@
+'use strict';
+
+var writeIEEE754 = require('../float_parser').writeIEEE754,
+  Long = require('../long').Long,
+  Map = require('../map'),
+  Binary = require('../binary').Binary;
+
+var normalizedFunctionString = require('./utils').normalizedFunctionString;
+
+// try {
+//   var _Buffer = Uint8Array;
+// } catch (e) {
+//   _Buffer = Buffer;
+// }
+
+var regexp = /\x00/; // eslint-disable-line no-control-regex
+var ignoreKeys = ['$db', '$ref', '$id', '$clusterTime'];
+
+// To ensure that 0.4 of node works correctly
+var isDate = function isDate(d) {
+  return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]';
+};
+
+var isRegExp = function isRegExp(d) {
+  return Object.prototype.toString.call(d) === '[object RegExp]';
+};
+
+var serializeString = function(buffer, key, value, index, isArray) {
+  // Encode String type
+  buffer[index++] = BSON.BSON_DATA_STRING;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes + 1;
+  buffer[index - 1] = 0;
+  // Write the string
+  var size = buffer.write(value, index + 4, 'utf8');
+  // Write the size of the string to buffer
+  buffer[index + 3] = ((size + 1) >> 24) & 0xff;
+  buffer[index + 2] = ((size + 1) >> 16) & 0xff;
+  buffer[index + 1] = ((size + 1) >> 8) & 0xff;
+  buffer[index] = (size + 1) & 0xff;
+  // Update index
+  index = index + 4 + size;
+  // Write zero
+  buffer[index++] = 0;
+  return index;
+};
+
+var serializeNumber = function(buffer, key, value, index, isArray) {
+  // We have an integer value
+  if (Math.floor(value) === value && value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
+    // If the value fits in 32 bits encode as int, if it fits in a double
+    // encode it as a double, otherwise long
+    if (value >= BSON.BSON_INT32_MIN && value <= BSON.BSON_INT32_MAX) {
+      // Set int type 32 bits or less
+      buffer[index++] = BSON.BSON_DATA_INT;
+      // Number of written bytes
+      var numberOfWrittenBytes = !isArray
+        ? buffer.write(key, index, 'utf8')
+        : buffer.write(key, index, 'ascii');
+      // Encode the name
+      index = index + numberOfWrittenBytes;
+      buffer[index++] = 0;
+      // Write the int value
+      buffer[index++] = value & 0xff;
+      buffer[index++] = (value >> 8) & 0xff;
+      buffer[index++] = (value >> 16) & 0xff;
+      buffer[index++] = (value >> 24) & 0xff;
+    } else if (value >= BSON.JS_INT_MIN && value <= BSON.JS_INT_MAX) {
+      // Encode as double
+      buffer[index++] = BSON.BSON_DATA_NUMBER;
+      // Number of written bytes
+      numberOfWrittenBytes = !isArray
+        ? buffer.write(key, index, 'utf8')
+        : buffer.write(key, index, 'ascii');
+      // Encode the name
+      index = index + numberOfWrittenBytes;
+      buffer[index++] = 0;
+      // Write float
+      writeIEEE754(buffer, value, index, 'little', 52, 8);
+      // Ajust index
+      index = index + 8;
+    } else {
+      // Set long type
+      buffer[index++] = BSON.BSON_DATA_LONG;
+      // Number of written bytes
+      numberOfWrittenBytes = !isArray
+        ? buffer.write(key, index, 'utf8')
+        : buffer.write(key, index, 'ascii');
+      // Encode the name
+      index = index + numberOfWrittenBytes;
+      buffer[index++] = 0;
+      var longVal = Long.fromNumber(value);
+      var lowBits = longVal.getLowBits();
+      var highBits = longVal.getHighBits();
+      // Encode low bits
+      buffer[index++] = lowBits & 0xff;
+      buffer[index++] = (lowBits >> 8) & 0xff;
+      buffer[index++] = (lowBits >> 16) & 0xff;
+      buffer[index++] = (lowBits >> 24) & 0xff;
+      // Encode high bits
+      buffer[index++] = highBits & 0xff;
+      buffer[index++] = (highBits >> 8) & 0xff;
+      buffer[index++] = (highBits >> 16) & 0xff;
+      buffer[index++] = (highBits >> 24) & 0xff;
+    }
+  } else {
+    // Encode as double
+    buffer[index++] = BSON.BSON_DATA_NUMBER;
+    // Number of written bytes
+    numberOfWrittenBytes = !isArray
+      ? buffer.write(key, index, 'utf8')
+      : buffer.write(key, index, 'ascii');
+    // Encode the name
+    index = index + numberOfWrittenBytes;
+    buffer[index++] = 0;
+    // Write float
+    writeIEEE754(buffer, value, index, 'little', 52, 8);
+    // Ajust index
+    index = index + 8;
+  }
+
+  return index;
+};
+
+var serializeNull = function(buffer, key, value, index, isArray) {
+  // Set long type
+  buffer[index++] = BSON.BSON_DATA_NULL;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  return index;
+};
+
+var serializeBoolean = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_BOOLEAN;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Encode the boolean value
+  buffer[index++] = value ? 1 : 0;
+  return index;
+};
+
+var serializeDate = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_DATE;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+
+  // Write the date
+  var dateInMilis = Long.fromNumber(value.getTime());
+  var lowBits = dateInMilis.getLowBits();
+  var highBits = dateInMilis.getHighBits();
+  // Encode low bits
+  buffer[index++] = lowBits & 0xff;
+  buffer[index++] = (lowBits >> 8) & 0xff;
+  buffer[index++] = (lowBits >> 16) & 0xff;
+  buffer[index++] = (lowBits >> 24) & 0xff;
+  // Encode high bits
+  buffer[index++] = highBits & 0xff;
+  buffer[index++] = (highBits >> 8) & 0xff;
+  buffer[index++] = (highBits >> 16) & 0xff;
+  buffer[index++] = (highBits >> 24) & 0xff;
+  return index;
+};
+
+var serializeRegExp = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_REGEXP;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  if (value.source && value.source.match(regexp) != null) {
+    throw Error('value ' + value.source + ' must not contain null bytes');
+  }
+  // Adjust the index
+  index = index + buffer.write(value.source, index, 'utf8');
+  // Write zero
+  buffer[index++] = 0x00;
+  // Write the parameters
+  if (value.global) buffer[index++] = 0x73; // s
+  if (value.ignoreCase) buffer[index++] = 0x69; // i
+  if (value.multiline) buffer[index++] = 0x6d; // m
+  // Add ending zero
+  buffer[index++] = 0x00;
+  return index;
+};
+
+var serializeBSONRegExp = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_REGEXP;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+
+  // Check the pattern for 0 bytes
+  if (value.pattern.match(regexp) != null) {
+    // The BSON spec doesn't allow keys with null bytes because keys are
+    // null-terminated.
+    throw Error('pattern ' + value.pattern + ' must not contain null bytes');
+  }
+
+  // Adjust the index
+  index = index + buffer.write(value.pattern, index, 'utf8');
+  // Write zero
+  buffer[index++] = 0x00;
+  // Write the options
+  index =
+    index +
+    buffer.write(
+      value.options
+        .split('')
+        .sort()
+        .join(''),
+      index,
+      'utf8'
+    );
+  // Add ending zero
+  buffer[index++] = 0x00;
+  return index;
+};
+
+var serializeMinMax = function(buffer, key, value, index, isArray) {
+  // Write the type of either min or max key
+  if (value === null) {
+    buffer[index++] = BSON.BSON_DATA_NULL;
+  } else if (value._bsontype === 'MinKey') {
+    buffer[index++] = BSON.BSON_DATA_MIN_KEY;
+  } else {
+    buffer[index++] = BSON.BSON_DATA_MAX_KEY;
+  }
+
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  return index;
+};
+
+var serializeObjectId = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_OID;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+
+  // Write the objectId into the shared buffer
+  if (typeof value.id === 'string') {
+    buffer.write(value.id, index, 'binary');
+  } else if (value.id && value.id.copy) {
+    value.id.copy(buffer, index, 0, 12);
+  } else {
+    throw new Error('object [' + JSON.stringify(value) + '] is not a valid ObjectId');
+  }
+
+  // Ajust index
+  return index + 12;
+};
+
+var serializeBuffer = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_BINARY;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Get size of the buffer (current write point)
+  var size = value.length;
+  // Write the size of the string to buffer
+  buffer[index++] = size & 0xff;
+  buffer[index++] = (size >> 8) & 0xff;
+  buffer[index++] = (size >> 16) & 0xff;
+  buffer[index++] = (size >> 24) & 0xff;
+  // Write the default subtype
+  buffer[index++] = BSON.BSON_BINARY_SUBTYPE_DEFAULT;
+  // Copy the content form the binary field to the buffer
+  value.copy(buffer, index, 0, size);
+  // Adjust the index
+  index = index + size;
+  return index;
+};
+
+var serializeObject = function(
+  buffer,
+  key,
+  value,
+  index,
+  checkKeys,
+  depth,
+  serializeFunctions,
+  ignoreUndefined,
+  isArray,
+  path
+) {
+  for (var i = 0; i < path.length; i++) {
+    if (path[i] === value) throw new Error('cyclic dependency detected');
+  }
+
+  // Push value to stack
+  path.push(value);
+  // Write the type
+  buffer[index++] = Array.isArray(value) ? BSON.BSON_DATA_ARRAY : BSON.BSON_DATA_OBJECT;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  var endIndex = serializeInto(
+    buffer,
+    value,
+    checkKeys,
+    index,
+    depth + 1,
+    serializeFunctions,
+    ignoreUndefined,
+    path
+  );
+  // Pop stack
+  path.pop();
+  // Write size
+  return endIndex;
+};
+
+var serializeDecimal128 = function(buffer, key, value, index, isArray) {
+  buffer[index++] = BSON.BSON_DATA_DECIMAL128;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Write the data from the value
+  value.bytes.copy(buffer, index, 0, 16);
+  return index + 16;
+};
+
+var serializeLong = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = value._bsontype === 'Long' ? BSON.BSON_DATA_LONG : BSON.BSON_DATA_TIMESTAMP;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Write the date
+  var lowBits = value.getLowBits();
+  var highBits = value.getHighBits();
+  // Encode low bits
+  buffer[index++] = lowBits & 0xff;
+  buffer[index++] = (lowBits >> 8) & 0xff;
+  buffer[index++] = (lowBits >> 16) & 0xff;
+  buffer[index++] = (lowBits >> 24) & 0xff;
+  // Encode high bits
+  buffer[index++] = highBits & 0xff;
+  buffer[index++] = (highBits >> 8) & 0xff;
+  buffer[index++] = (highBits >> 16) & 0xff;
+  buffer[index++] = (highBits >> 24) & 0xff;
+  return index;
+};
+
+var serializeInt32 = function(buffer, key, value, index, isArray) {
+  // Set int type 32 bits or less
+  buffer[index++] = BSON.BSON_DATA_INT;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Write the int value
+  buffer[index++] = value & 0xff;
+  buffer[index++] = (value >> 8) & 0xff;
+  buffer[index++] = (value >> 16) & 0xff;
+  buffer[index++] = (value >> 24) & 0xff;
+  return index;
+};
+
+var serializeDouble = function(buffer, key, value, index, isArray) {
+  // Encode as double
+  buffer[index++] = BSON.BSON_DATA_NUMBER;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Write float
+  writeIEEE754(buffer, value, index, 'little', 52, 8);
+  // Ajust index
+  index = index + 8;
+  return index;
+};
+
+var serializeFunction = function(buffer, key, value, index, checkKeys, depth, isArray) {
+  buffer[index++] = BSON.BSON_DATA_CODE;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Function string
+  var functionString = normalizedFunctionString(value);
+
+  // Write the string
+  var size = buffer.write(functionString, index + 4, 'utf8') + 1;
+  // Write the size of the string to buffer
+  buffer[index] = size & 0xff;
+  buffer[index + 1] = (size >> 8) & 0xff;
+  buffer[index + 2] = (size >> 16) & 0xff;
+  buffer[index + 3] = (size >> 24) & 0xff;
+  // Update index
+  index = index + 4 + size - 1;
+  // Write zero
+  buffer[index++] = 0;
+  return index;
+};
+
+var serializeCode = function(
+  buffer,
+  key,
+  value,
+  index,
+  checkKeys,
+  depth,
+  serializeFunctions,
+  ignoreUndefined,
+  isArray
+) {
+  if (value.scope && typeof value.scope === 'object') {
+    // Write the type
+    buffer[index++] = BSON.BSON_DATA_CODE_W_SCOPE;
+    // Number of written bytes
+    var numberOfWrittenBytes = !isArray
+      ? buffer.write(key, index, 'utf8')
+      : buffer.write(key, index, 'ascii');
+    // Encode the name
+    index = index + numberOfWrittenBytes;
+    buffer[index++] = 0;
+
+    // Starting index
+    var startIndex = index;
+
+    // Serialize the function
+    // Get the function string
+    var functionString = typeof value.code === 'string' ? value.code : value.code.toString();
+    // Index adjustment
+    index = index + 4;
+    // Write string into buffer
+    var codeSize = buffer.write(functionString, index + 4, 'utf8') + 1;
+    // Write the size of the string to buffer
+    buffer[index] = codeSize & 0xff;
+    buffer[index + 1] = (codeSize >> 8) & 0xff;
+    buffer[index + 2] = (codeSize >> 16) & 0xff;
+    buffer[index + 3] = (codeSize >> 24) & 0xff;
+    // Write end 0
+    buffer[index + 4 + codeSize - 1] = 0;
+    // Write the
+    index = index + codeSize + 4;
+
+    //
+    // Serialize the scope value
+    var endIndex = serializeInto(
+      buffer,
+      value.scope,
+      checkKeys,
+      index,
+      depth + 1,
+      serializeFunctions,
+      ignoreUndefined
+    );
+    index = endIndex - 1;
+
+    // Writ the total
+    var totalSize = endIndex - startIndex;
+
+    // Write the total size of the object
+    buffer[startIndex++] = totalSize & 0xff;
+    buffer[startIndex++] = (totalSize >> 8) & 0xff;
+    buffer[startIndex++] = (totalSize >> 16) & 0xff;
+    buffer[startIndex++] = (totalSize >> 24) & 0xff;
+    // Write trailing zero
+    buffer[index++] = 0;
+  } else {
+    buffer[index++] = BSON.BSON_DATA_CODE;
+    // Number of written bytes
+    numberOfWrittenBytes = !isArray
+      ? buffer.write(key, index, 'utf8')
+      : buffer.write(key, index, 'ascii');
+    // Encode the name
+    index = index + numberOfWrittenBytes;
+    buffer[index++] = 0;
+    // Function string
+    functionString = value.code.toString();
+    // Write the string
+    var size = buffer.write(functionString, index + 4, 'utf8') + 1;
+    // Write the size of the string to buffer
+    buffer[index] = size & 0xff;
+    buffer[index + 1] = (size >> 8) & 0xff;
+    buffer[index + 2] = (size >> 16) & 0xff;
+    buffer[index + 3] = (size >> 24) & 0xff;
+    // Update index
+    index = index + 4 + size - 1;
+    // Write zero
+    buffer[index++] = 0;
+  }
+
+  return index;
+};
+
+var serializeBinary = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_BINARY;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Extract the buffer
+  var data = value.value(true);
+  // Calculate size
+  var size = value.position;
+  // Add the deprecated 02 type 4 bytes of size to total
+  if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) size = size + 4;
+  // Write the size of the string to buffer
+  buffer[index++] = size & 0xff;
+  buffer[index++] = (size >> 8) & 0xff;
+  buffer[index++] = (size >> 16) & 0xff;
+  buffer[index++] = (size >> 24) & 0xff;
+  // Write the subtype to the buffer
+  buffer[index++] = value.sub_type;
+
+  // If we have binary type 2 the 4 first bytes are the size
+  if (value.sub_type === Binary.SUBTYPE_BYTE_ARRAY) {
+    size = size - 4;
+    buffer[index++] = size & 0xff;
+    buffer[index++] = (size >> 8) & 0xff;
+    buffer[index++] = (size >> 16) & 0xff;
+    buffer[index++] = (size >> 24) & 0xff;
+  }
+
+  // Write the data to the object
+  data.copy(buffer, index, 0, value.position);
+  // Adjust the index
+  index = index + value.position;
+  return index;
+};
+
+var serializeSymbol = function(buffer, key, value, index, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_SYMBOL;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+  // Write the string
+  var size = buffer.write(value.value, index + 4, 'utf8') + 1;
+  // Write the size of the string to buffer
+  buffer[index] = size & 0xff;
+  buffer[index + 1] = (size >> 8) & 0xff;
+  buffer[index + 2] = (size >> 16) & 0xff;
+  buffer[index + 3] = (size >> 24) & 0xff;
+  // Update index
+  index = index + 4 + size - 1;
+  // Write zero
+  buffer[index++] = 0x00;
+  return index;
+};
+
+var serializeDBRef = function(buffer, key, value, index, depth, serializeFunctions, isArray) {
+  // Write the type
+  buffer[index++] = BSON.BSON_DATA_OBJECT;
+  // Number of written bytes
+  var numberOfWrittenBytes = !isArray
+    ? buffer.write(key, index, 'utf8')
+    : buffer.write(key, index, 'ascii');
+
+  // Encode the name
+  index = index + numberOfWrittenBytes;
+  buffer[index++] = 0;
+
+  var startIndex = index;
+  var endIndex;
+
+  // Serialize object
+  if (null != value.db) {
+    endIndex = serializeInto(
+      buffer,
+      {
+        $ref: value.namespace,
+        $id: value.oid,
+        $db: value.db
+      },
+      false,
+      index,
+      depth + 1,
+      serializeFunctions
+    );
+  } else {
+    endIndex = serializeInto(
+      buffer,
+      {
+        $ref: value.namespace,
+        $id: value.oid
+      },
+      false,
+      index,
+      depth + 1,
+      serializeFunctions
+    );
+  }
+
+  // Calculate object size
+  var size = endIndex - startIndex;
+  // Write the size
+  buffer[startIndex++] = size & 0xff;
+  buffer[startIndex++] = (size >> 8) & 0xff;
+  buffer[startIndex++] = (size >> 16) & 0xff;
+  buffer[startIndex++] = (size >> 24) & 0xff;
+  // Set index
+  return endIndex;
+};
+
+var serializeInto = function serializeInto(
+  buffer,
+  object,
+  checkKeys,
+  startingIndex,
+  depth,
+  serializeFunctions,
+  ignoreUndefined,
+  path
+) {
+  startingIndex = startingIndex || 0;
+  path = path || [];
+
+  // Push the object to the path
+  path.push(object);
+
+  // Start place to serialize into
+  var index = startingIndex + 4;
+  // var self = this;
+
+  // Special case isArray
+  if (Array.isArray(object)) {
+    // Get object keys
+    for (var i = 0; i < object.length; i++) {
+      var key = '' + i;
+      var value = object[i];
+
+      // Is there an override value
+      if (value && value.toBSON) {
+        if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
+        value = value.toBSON();
+      }
+
+      var type = typeof value;
+      if (type === 'string') {
+        index = serializeString(buffer, key, value, index, true);
+      } else if (type === 'number') {
+        index = serializeNumber(buffer, key, value, index, true);
+      } else  if(type === 'bigint') {
+        throw new TypeError('Unsupported type BigInt, please use Decimal128');
+      } else if (type === 'boolean') {
+        index = serializeBoolean(buffer, key, value, index, true);
+      } else if (value instanceof Date || isDate(value)) {
+        index = serializeDate(buffer, key, value, index, true);
+      } else if (value === undefined) {
+        index = serializeNull(buffer, key, value, index, true);
+      } else if (value === null) {
+        index = serializeNull(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+        index = serializeObjectId(buffer, key, value, index, true);
+      } else if (Buffer.isBuffer(value)) {
+        index = serializeBuffer(buffer, key, value, index, true);
+      } else if (value instanceof RegExp || isRegExp(value)) {
+        index = serializeRegExp(buffer, key, value, index, true);
+      } else if (type === 'object' && value['_bsontype'] == null) {
+        index = serializeObject(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          ignoreUndefined,
+          true,
+          path
+        );
+      } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
+        index = serializeDecimal128(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
+        index = serializeLong(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'Double') {
+        index = serializeDouble(buffer, key, value, index, true);
+      } else if (typeof value === 'function' && serializeFunctions) {
+        index = serializeFunction(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          true
+        );
+      } else if (value['_bsontype'] === 'Code') {
+        index = serializeCode(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          ignoreUndefined,
+          true
+        );
+      } else if (value['_bsontype'] === 'Binary') {
+        index = serializeBinary(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'Symbol') {
+        index = serializeSymbol(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'DBRef') {
+        index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions, true);
+      } else if (value['_bsontype'] === 'BSONRegExp') {
+        index = serializeBSONRegExp(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'Int32') {
+        index = serializeInt32(buffer, key, value, index, true);
+      } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+        index = serializeMinMax(buffer, key, value, index, true);
+      } else if (typeof value['_bsontype'] !== 'undefined') {
+        throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
+      }
+    }
+  } else if (object instanceof Map) {
+    var iterator = object.entries();
+    var done = false;
+
+    while (!done) {
+      // Unpack the next entry
+      var entry = iterator.next();
+      done = entry.done;
+      // Are we done, then skip and terminate
+      if (done) continue;
+
+      // Get the entry values
+      key = entry.value[0];
+      value = entry.value[1];
+
+      // Check the type of the value
+      type = typeof value;
+
+      // Check the key and throw error if it's illegal
+      if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
+        if (key.match(regexp) != null) {
+          // The BSON spec doesn't allow keys with null bytes because keys are
+          // null-terminated.
+          throw Error('key ' + key + ' must not contain null bytes');
+        }
+
+        if (checkKeys) {
+          if ('$' === key[0]) {
+            throw Error('key ' + key + " must not start with '$'");
+          } else if (~key.indexOf('.')) {
+            throw Error('key ' + key + " must not contain '.'");
+          }
+        }
+      }
+
+      if (type === 'string') {
+        index = serializeString(buffer, key, value, index);
+      } else if (type === 'number') {
+        index = serializeNumber(buffer, key, value, index);
+      } else if(type === 'bigint') {
+        throw new TypeError('Unsupported type BigInt, please use Decimal128');
+      } else if (type === 'boolean') {
+        index = serializeBoolean(buffer, key, value, index);
+      } else if (value instanceof Date || isDate(value)) {
+        index = serializeDate(buffer, key, value, index);
+        // } else if (value === undefined && ignoreUndefined === true) {
+      } else if (value === null || (value === undefined && ignoreUndefined === false)) {
+        index = serializeNull(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+        index = serializeObjectId(buffer, key, value, index);
+      } else if (Buffer.isBuffer(value)) {
+        index = serializeBuffer(buffer, key, value, index);
+      } else if (value instanceof RegExp || isRegExp(value)) {
+        index = serializeRegExp(buffer, key, value, index);
+      } else if (type === 'object' && value['_bsontype'] == null) {
+        index = serializeObject(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          ignoreUndefined,
+          false,
+          path
+        );
+      } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
+        index = serializeDecimal128(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
+        index = serializeLong(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Double') {
+        index = serializeDouble(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Code') {
+        index = serializeCode(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          ignoreUndefined
+        );
+      } else if (typeof value === 'function' && serializeFunctions) {
+        index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
+      } else if (value['_bsontype'] === 'Binary') {
+        index = serializeBinary(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Symbol') {
+        index = serializeSymbol(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'DBRef') {
+        index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
+      } else if (value['_bsontype'] === 'BSONRegExp') {
+        index = serializeBSONRegExp(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Int32') {
+        index = serializeInt32(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+        index = serializeMinMax(buffer, key, value, index);
+      } else if (typeof value['_bsontype'] !== 'undefined') {
+        throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
+      }
+    }
+  } else {
+    // Did we provide a custom serialization method
+    if (object.toBSON) {
+      if (typeof object.toBSON !== 'function') throw new Error('toBSON is not a function');
+      object = object.toBSON();
+      if (object != null && typeof object !== 'object')
+        throw new Error('toBSON function did not return an object');
+    }
+
+    // Iterate over all the keys
+    for (key in object) {
+      value = object[key];
+      // Is there an override value
+      if (value && value.toBSON) {
+        if (typeof value.toBSON !== 'function') throw new Error('toBSON is not a function');
+        value = value.toBSON();
+      }
+
+      // Check the type of the value
+      type = typeof value;
+
+      // Check the key and throw error if it's illegal
+      if (typeof key === 'string' && ignoreKeys.indexOf(key) === -1) {
+        if (key.match(regexp) != null) {
+          // The BSON spec doesn't allow keys with null bytes because keys are
+          // null-terminated.
+          throw Error('key ' + key + ' must not contain null bytes');
+        }
+
+        if (checkKeys) {
+          if ('$' === key[0]) {
+            throw Error('key ' + key + " must not start with '$'");
+          } else if (~key.indexOf('.')) {
+            throw Error('key ' + key + " must not contain '.'");
+          }
+        }
+      }
+
+      if (type === 'string') {
+        index = serializeString(buffer, key, value, index);
+      } else if (type === 'number') {
+        index = serializeNumber(buffer, key, value, index);
+      } else if(type === 'bigint') {
+        throw new TypeError('Unsupported type BigInt, please use Decimal128');
+      } else if (type === 'boolean') {
+        index = serializeBoolean(buffer, key, value, index);
+      } else if (value instanceof Date || isDate(value)) {
+        index = serializeDate(buffer, key, value, index);
+      } else if (value === undefined) {
+        if (ignoreUndefined === false) index = serializeNull(buffer, key, value, index);
+      } else if (value === null) {
+        index = serializeNull(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'ObjectID' || value['_bsontype'] === 'ObjectId') {
+        index = serializeObjectId(buffer, key, value, index);
+      } else if (Buffer.isBuffer(value)) {
+        index = serializeBuffer(buffer, key, value, index);
+      } else if (value instanceof RegExp || isRegExp(value)) {
+        index = serializeRegExp(buffer, key, value, index);
+      } else if (type === 'object' && value['_bsontype'] == null) {
+        index = serializeObject(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          ignoreUndefined,
+          false,
+          path
+        );
+      } else if (type === 'object' && value['_bsontype'] === 'Decimal128') {
+        index = serializeDecimal128(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') {
+        index = serializeLong(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Double') {
+        index = serializeDouble(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Code') {
+        index = serializeCode(
+          buffer,
+          key,
+          value,
+          index,
+          checkKeys,
+          depth,
+          serializeFunctions,
+          ignoreUndefined
+        );
+      } else if (typeof value === 'function' && serializeFunctions) {
+        index = serializeFunction(buffer, key, value, index, checkKeys, depth, serializeFunctions);
+      } else if (value['_bsontype'] === 'Binary') {
+        index = serializeBinary(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Symbol') {
+        index = serializeSymbol(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'DBRef') {
+        index = serializeDBRef(buffer, key, value, index, depth, serializeFunctions);
+      } else if (value['_bsontype'] === 'BSONRegExp') {
+        index = serializeBSONRegExp(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'Int32') {
+        index = serializeInt32(buffer, key, value, index);
+      } else if (value['_bsontype'] === 'MinKey' || value['_bsontype'] === 'MaxKey') {
+        index = serializeMinMax(buffer, key, value, index);
+      } else if (typeof value['_bsontype'] !== 'undefined') {
+        throw new TypeError('Unrecognized or invalid _bsontype: ' + value['_bsontype']);
+      }
+    }
+  }
+
+  // Remove the path
+  path.pop();
+
+  // Final padding byte for object
+  buffer[index++] = 0x00;
+
+  // Final size
+  var size = index - startingIndex;
+  // Write the size of the object
+  buffer[startingIndex++] = size & 0xff;
+  buffer[startingIndex++] = (size >> 8) & 0xff;
+  buffer[startingIndex++] = (size >> 16) & 0xff;
+  buffer[startingIndex++] = (size >> 24) & 0xff;
+  return index;
+};
+
+var BSON = {};
+
+/**
+ * Contains the function cache if we have that enable to allow for avoiding the eval step on each deserialization, comparison is by md5
+ *
+ * @ignore
+ * @api private
+ */
+// var functionCache = (BSON.functionCache = {});
+
+/**
+ * Number BSON Type
+ *
+ * @classconstant BSON_DATA_NUMBER
+ **/
+BSON.BSON_DATA_NUMBER = 1;
+/**
+ * String BSON Type
+ *
+ * @classconstant BSON_DATA_STRING
+ **/
+BSON.BSON_DATA_STRING = 2;
+/**
+ * Object BSON Type
+ *
+ * @classconstant BSON_DATA_OBJECT
+ **/
+BSON.BSON_DATA_OBJECT = 3;
+/**
+ * Array BSON Type
+ *
+ * @classconstant BSON_DATA_ARRAY
+ **/
+BSON.BSON_DATA_ARRAY = 4;
+/**
+ * Binary BSON Type
+ *
+ * @classconstant BSON_DATA_BINARY
+ **/
+BSON.BSON_DATA_BINARY = 5;
+/**
+ * ObjectID BSON Type, deprecated
+ *
+ * @classconstant BSON_DATA_UNDEFINED
+ **/
+BSON.BSON_DATA_UNDEFINED = 6;
+/**
+ * ObjectID BSON Type
+ *
+ * @classconstant BSON_DATA_OID
+ **/
+BSON.BSON_DATA_OID = 7;
+/**
+ * Boolean BSON Type
+ *
+ * @classconstant BSON_DATA_BOOLEAN
+ **/
+BSON.BSON_DATA_BOOLEAN = 8;
+/**
+ * Date BSON Type
+ *
+ * @classconstant BSON_DATA_DATE
+ **/
+BSON.BSON_DATA_DATE = 9;
+/**
+ * null BSON Type
+ *
+ * @classconstant BSON_DATA_NULL
+ **/
+BSON.BSON_DATA_NULL = 10;
+/**
+ * RegExp BSON Type
+ *
+ * @classconstant BSON_DATA_REGEXP
+ **/
+BSON.BSON_DATA_REGEXP = 11;
+/**
+ * Code BSON Type
+ *
+ * @classconstant BSON_DATA_CODE
+ **/
+BSON.BSON_DATA_CODE = 13;
+/**
+ * Symbol BSON Type
+ *
+ * @classconstant BSON_DATA_SYMBOL
+ **/
+BSON.BSON_DATA_SYMBOL = 14;
+/**
+ * Code with Scope BSON Type
+ *
+ * @classconstant BSON_DATA_CODE_W_SCOPE
+ **/
+BSON.BSON_DATA_CODE_W_SCOPE = 15;
+/**
+ * 32 bit Integer BSON Type
+ *
+ * @classconstant BSON_DATA_INT
+ **/
+BSON.BSON_DATA_INT = 16;
+/**
+ * Timestamp BSON Type
+ *
+ * @classconstant BSON_DATA_TIMESTAMP
+ **/
+BSON.BSON_DATA_TIMESTAMP = 17;
+/**
+ * Long BSON Type
+ *
+ * @classconstant BSON_DATA_LONG
+ **/
+BSON.BSON_DATA_LONG = 18;
+/**
+ * Long BSON Type
+ *
+ * @classconstant BSON_DATA_DECIMAL128
+ **/
+BSON.BSON_DATA_DECIMAL128 = 19;
+/**
+ * MinKey BSON Type
+ *
+ * @classconstant BSON_DATA_MIN_KEY
+ **/
+BSON.BSON_DATA_MIN_KEY = 0xff;
+/**
+ * MaxKey BSON Type
+ *
+ * @classconstant BSON_DATA_MAX_KEY
+ **/
+BSON.BSON_DATA_MAX_KEY = 0x7f;
+/**
+ * Binary Default Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_DEFAULT
+ **/
+BSON.BSON_BINARY_SUBTYPE_DEFAULT = 0;
+/**
+ * Binary Function Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_FUNCTION
+ **/
+BSON.BSON_BINARY_SUBTYPE_FUNCTION = 1;
+/**
+ * Binary Byte Array Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY
+ **/
+BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2;
+/**
+ * Binary UUID Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_UUID
+ **/
+BSON.BSON_BINARY_SUBTYPE_UUID = 3;
+/**
+ * Binary MD5 Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_MD5
+ **/
+BSON.BSON_BINARY_SUBTYPE_MD5 = 4;
+/**
+ * Binary User Defined Type
+ *
+ * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED
+ **/
+BSON.BSON_BINARY_SUBTYPE_USER_DEFINED = 128;
+
+// BSON MAX VALUES
+BSON.BSON_INT32_MAX = 0x7fffffff;
+BSON.BSON_INT32_MIN = -0x80000000;
+
+BSON.BSON_INT64_MAX = Math.pow(2, 63) - 1;
+BSON.BSON_INT64_MIN = -Math.pow(2, 63);
+
+// JS MAX PRECISE VALUES
+BSON.JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double.
+BSON.JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double.
+
+// Internal long versions
+// var JS_INT_MAX_LONG = Long.fromNumber(0x20000000000000); // Any integer up to 2^53 can be precisely represented by a double.
+// var JS_INT_MIN_LONG = Long.fromNumber(-0x20000000000000); // Any integer down to -2^53 can be precisely represented by a double.
+
+module.exports = serializeInto;
diff --git a/NodeAPI/node_modules/bson/lib/bson/parser/utils.js b/NodeAPI/node_modules/bson/lib/bson/parser/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..6faa439694ec87c8076d53932b055ab95a266e45
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/parser/utils.js
@@ -0,0 +1,28 @@
+'use strict';
+
+/**
+ * Normalizes our expected stringified form of a function across versions of node
+ * @param {Function} fn The function to stringify
+ */
+function normalizedFunctionString(fn) {
+  return fn.toString().replace(/function *\(/, 'function (');
+}
+
+function newBuffer(item, encoding) {
+  return new Buffer(item, encoding);
+}
+
+function allocBuffer() {
+  return Buffer.alloc.apply(Buffer, arguments);
+}
+
+function toBuffer() {
+  return Buffer.from.apply(Buffer, arguments);
+}
+
+module.exports = {
+  normalizedFunctionString: normalizedFunctionString,
+  allocBuffer: typeof Buffer.alloc === 'function' ? allocBuffer : newBuffer,
+  toBuffer: typeof Buffer.from === 'function' ? toBuffer : newBuffer
+};
+
diff --git a/NodeAPI/node_modules/bson/lib/bson/regexp.js b/NodeAPI/node_modules/bson/lib/bson/regexp.js
new file mode 100644
index 0000000000000000000000000000000000000000..108f016665d5ed283d143528d8cfd111a835061b
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/regexp.js
@@ -0,0 +1,33 @@
+/**
+ * A class representation of the BSON RegExp type.
+ *
+ * @class
+ * @return {BSONRegExp} A MinKey instance
+ */
+function BSONRegExp(pattern, options) {
+  if (!(this instanceof BSONRegExp)) return new BSONRegExp();
+
+  // Execute
+  this._bsontype = 'BSONRegExp';
+  this.pattern = pattern || '';
+  this.options = options || '';
+
+  // Validate options
+  for (var i = 0; i < this.options.length; i++) {
+    if (
+      !(
+        this.options[i] === 'i' ||
+        this.options[i] === 'm' ||
+        this.options[i] === 'x' ||
+        this.options[i] === 'l' ||
+        this.options[i] === 's' ||
+        this.options[i] === 'u'
+      )
+    ) {
+      throw new Error('the regular expression options [' + this.options[i] + '] is not supported');
+    }
+  }
+}
+
+module.exports = BSONRegExp;
+module.exports.BSONRegExp = BSONRegExp;
diff --git a/NodeAPI/node_modules/bson/lib/bson/symbol.js b/NodeAPI/node_modules/bson/lib/bson/symbol.js
new file mode 100644
index 0000000000000000000000000000000000000000..ba20cabea0350660ed650981e758d9c2e278e041
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/symbol.js
@@ -0,0 +1,50 @@
+// Custom inspect property name / symbol.
+var inspect = Buffer ? require('util').inspect.custom || 'inspect' : 'inspect';
+
+/**
+ * A class representation of the BSON Symbol type.
+ *
+ * @class
+ * @deprecated
+ * @param {string} value the string representing the symbol.
+ * @return {Symbol}
+ */
+function Symbol(value) {
+  if (!(this instanceof Symbol)) return new Symbol(value);
+  this._bsontype = 'Symbol';
+  this.value = value;
+}
+
+/**
+ * Access the wrapped string value.
+ *
+ * @method
+ * @return {String} returns the wrapped string.
+ */
+Symbol.prototype.valueOf = function() {
+  return this.value;
+};
+
+/**
+ * @ignore
+ */
+Symbol.prototype.toString = function() {
+  return this.value;
+};
+
+/**
+ * @ignore
+ */
+Symbol.prototype[inspect] = function() {
+  return this.value;
+};
+
+/**
+ * @ignore
+ */
+Symbol.prototype.toJSON = function() {
+  return this.value;
+};
+
+module.exports = Symbol;
+module.exports.Symbol = Symbol;
diff --git a/NodeAPI/node_modules/bson/lib/bson/timestamp.js b/NodeAPI/node_modules/bson/lib/bson/timestamp.js
new file mode 100644
index 0000000000000000000000000000000000000000..dc61a6ccdb4cf570ebfbe6d511722e0565aa60a2
--- /dev/null
+++ b/NodeAPI/node_modules/bson/lib/bson/timestamp.js
@@ -0,0 +1,854 @@
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Copyright 2009 Google Inc. All Rights Reserved
+
+/**
+ * This type is for INTERNAL use in MongoDB only and should not be used in applications.
+ * The appropriate corresponding type is the JavaScript Date type.
+ * 
+ * Defines a Timestamp class for representing a 64-bit two's-complement
+ * integer value, which faithfully simulates the behavior of a Java "Timestamp". This
+ * implementation is derived from TimestampLib in GWT.
+ *
+ * Constructs a 64-bit two's-complement integer, given its low and high 32-bit
+ * values as *signed* integers.  See the from* functions below for more
+ * convenient ways of constructing Timestamps.
+ *
+ * The internal representation of a Timestamp is the two given signed, 32-bit values.
+ * We use 32-bit pieces because these are the size of integers on which
+ * Javascript performs bit-operations.  For operations like addition and
+ * multiplication, we split each number into 16-bit pieces, which can easily be
+ * multiplied within Javascript's floating-point representation without overflow
+ * or change in sign.
+ *
+ * In the algorithms below, we frequently reduce the negative case to the
+ * positive case by negating the input(s) and then post-processing the result.
+ * Note that we must ALWAYS check specially whether those values are MIN_VALUE
+ * (-2^63) because -MIN_VALUE == MIN_VALUE (since 2^63 cannot be represented as
+ * a positive number, it overflows back into a negative).  Not handling this
+ * case would often result in infinite recursion.
+ *
+ * @class
+ * @param {number} low  the low (signed) 32 bits of the Timestamp.
+ * @param {number} high the high (signed) 32 bits of the Timestamp.
+ */
+function Timestamp(low, high) {
+  if (!(this instanceof Timestamp)) return new Timestamp(low, high);
+  this._bsontype = 'Timestamp';
+  /**
+   * @type {number}
+   * @ignore
+   */
+  this.low_ = low | 0; // force into 32 signed bits.
+
+  /**
+   * @type {number}
+   * @ignore
+   */
+  this.high_ = high | 0; // force into 32 signed bits.
+}
+
+/**
+ * Return the int value.
+ *
+ * @return {number} the value, assuming it is a 32-bit integer.
+ */
+Timestamp.prototype.toInt = function() {
+  return this.low_;
+};
+
+/**
+ * Return the Number value.
+ *
+ * @method
+ * @return {number} the closest floating-point representation to this value.
+ */
+Timestamp.prototype.toNumber = function() {
+  return this.high_ * Timestamp.TWO_PWR_32_DBL_ + this.getLowBitsUnsigned();
+};
+
+/**
+ * Return the JSON value.
+ *
+ * @method
+ * @return {string} the JSON representation.
+ */
+Timestamp.prototype.toJSON = function() {
+  return this.toString();
+};
+
+/**
+ * Return the String value.
+ *
+ * @method
+ * @param {number} [opt_radix] the radix in which the text should be written.
+ * @return {string} the textual representation of this value.
+ */
+Timestamp.prototype.toString = function(opt_radix) {
+  var radix = opt_radix || 10;
+  if (radix < 2 || 36 < radix) {
+    throw Error('radix out of range: ' + radix);
+  }
+
+  if (this.isZero()) {
+    return '0';
+  }
+
+  if (this.isNegative()) {
+    if (this.equals(Timestamp.MIN_VALUE)) {
+      // We need to change the Timestamp value before it can be negated, so we remove
+      // the bottom-most digit in this base and then recurse to do the rest.
+      var radixTimestamp = Timestamp.fromNumber(radix);
+      var div = this.div(radixTimestamp);
+      var rem = div.multiply(radixTimestamp).subtract(this);
+      return div.toString(radix) + rem.toInt().toString(radix);
+    } else {
+      return '-' + this.negate().toString(radix);
+    }
+  }
+
+  // Do several (6) digits each time through the loop, so as to
+  // minimize the calls to the very expensive emulated div.
+  var radixToPower = Timestamp.fromNumber(Math.pow(radix, 6));
+
+  rem = this;
+  var result = '';
+
+  while (!rem.isZero()) {
+    var remDiv = rem.div(radixToPower);
+    var intval = rem.subtract(remDiv.multiply(radixToPower)).toInt();
+    var digits = intval.toString(radix);
+
+    rem = remDiv;
+    if (rem.isZero()) {
+      return digits + result;
+    } else {
+      while (digits.length < 6) {
+        digits = '0' + digits;
+      }
+      result = '' + digits + result;
+    }
+  }
+};
+
+/**
+ * Return the high 32-bits value.
+ *
+ * @method
+ * @return {number} the high 32-bits as a signed value.
+ */
+Timestamp.prototype.getHighBits = function() {
+  return this.high_;
+};
+
+/**
+ * Return the low 32-bits value.
+ *
+ * @method
+ * @return {number} the low 32-bits as a signed value.
+ */
+Timestamp.prototype.getLowBits = function() {
+  return this.low_;
+};
+
+/**
+ * Return the low unsigned 32-bits value.
+ *
+ * @method
+ * @return {number} the low 32-bits as an unsigned value.
+ */
+Timestamp.prototype.getLowBitsUnsigned = function() {
+  return this.low_ >= 0 ? this.low_ : Timestamp.TWO_PWR_32_DBL_ + this.low_;
+};
+
+/**
+ * Returns the number of bits needed to represent the absolute value of this Timestamp.
+ *
+ * @method
+ * @return {number} Returns the number of bits needed to represent the absolute value of this Timestamp.
+ */
+Timestamp.prototype.getNumBitsAbs = function() {
+  if (this.isNegative()) {
+    if (this.equals(Timestamp.MIN_VALUE)) {
+      return 64;
+    } else {
+      return this.negate().getNumBitsAbs();
+    }
+  } else {
+    var val = this.high_ !== 0 ? this.high_ : this.low_;
+    for (var bit = 31; bit > 0; bit--) {
+      if ((val & (1 << bit)) !== 0) {
+        break;
+      }
+    }
+    return this.high_ !== 0 ? bit + 33 : bit + 1;
+  }
+};
+
+/**
+ * Return whether this value is zero.
+ *
+ * @method
+ * @return {boolean} whether this value is zero.
+ */
+Timestamp.prototype.isZero = function() {
+  return this.high_ === 0 && this.low_ === 0;
+};
+
+/**
+ * Return whether this value is negative.
+ *
+ * @method
+ * @return {boolean} whether this value is negative.
+ */
+Timestamp.prototype.isNegative = function() {
+  return this.high_ < 0;
+};
+
+/**
+ * Return whether this value is odd.
+ *
+ * @method
+ * @return {boolean} whether this value is odd.
+ */
+Timestamp.prototype.isOdd = function() {
+  return (this.low_ & 1) === 1;
+};
+
+/**
+ * Return whether this Timestamp equals the other
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} whether this Timestamp equals the other
+ */
+Timestamp.prototype.equals = function(other) {
+  return this.high_ === other.high_ && this.low_ === other.low_;
+};
+
+/**
+ * Return whether this Timestamp does not equal the other.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} whether this Timestamp does not equal the other.
+ */
+Timestamp.prototype.notEquals = function(other) {
+  return this.high_ !== other.high_ || this.low_ !== other.low_;
+};
+
+/**
+ * Return whether this Timestamp is less than the other.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} whether this Timestamp is less than the other.
+ */
+Timestamp.prototype.lessThan = function(other) {
+  return this.compare(other) < 0;
+};
+
+/**
+ * Return whether this Timestamp is less than or equal to the other.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} whether this Timestamp is less than or equal to the other.
+ */
+Timestamp.prototype.lessThanOrEqual = function(other) {
+  return this.compare(other) <= 0;
+};
+
+/**
+ * Return whether this Timestamp is greater than the other.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} whether this Timestamp is greater than the other.
+ */
+Timestamp.prototype.greaterThan = function(other) {
+  return this.compare(other) > 0;
+};
+
+/**
+ * Return whether this Timestamp is greater than or equal to the other.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} whether this Timestamp is greater than or equal to the other.
+ */
+Timestamp.prototype.greaterThanOrEqual = function(other) {
+  return this.compare(other) >= 0;
+};
+
+/**
+ * Compares this Timestamp with the given one.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to compare against.
+ * @return {boolean} 0 if they are the same, 1 if the this is greater, and -1 if the given one is greater.
+ */
+Timestamp.prototype.compare = function(other) {
+  if (this.equals(other)) {
+    return 0;
+  }
+
+  var thisNeg = this.isNegative();
+  var otherNeg = other.isNegative();
+  if (thisNeg && !otherNeg) {
+    return -1;
+  }
+  if (!thisNeg && otherNeg) {
+    return 1;
+  }
+
+  // at this point, the signs are the same, so subtraction will not overflow
+  if (this.subtract(other).isNegative()) {
+    return -1;
+  } else {
+    return 1;
+  }
+};
+
+/**
+ * The negation of this value.
+ *
+ * @method
+ * @return {Timestamp} the negation of this value.
+ */
+Timestamp.prototype.negate = function() {
+  if (this.equals(Timestamp.MIN_VALUE)) {
+    return Timestamp.MIN_VALUE;
+  } else {
+    return this.not().add(Timestamp.ONE);
+  }
+};
+
+/**
+ * Returns the sum of this and the given Timestamp.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to add to this one.
+ * @return {Timestamp} the sum of this and the given Timestamp.
+ */
+Timestamp.prototype.add = function(other) {
+  // Divide each number into 4 chunks of 16 bits, and then sum the chunks.
+
+  var a48 = this.high_ >>> 16;
+  var a32 = this.high_ & 0xffff;
+  var a16 = this.low_ >>> 16;
+  var a00 = this.low_ & 0xffff;
+
+  var b48 = other.high_ >>> 16;
+  var b32 = other.high_ & 0xffff;
+  var b16 = other.low_ >>> 16;
+  var b00 = other.low_ & 0xffff;
+
+  var c48 = 0,
+    c32 = 0,
+    c16 = 0,
+    c00 = 0;
+  c00 += a00 + b00;
+  c16 += c00 >>> 16;
+  c00 &= 0xffff;
+  c16 += a16 + b16;
+  c32 += c16 >>> 16;
+  c16 &= 0xffff;
+  c32 += a32 + b32;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c48 += a48 + b48;
+  c48 &= 0xffff;
+  return Timestamp.fromBits((c16 << 16) | c00, (c48 << 16) | c32);
+};
+
+/**
+ * Returns the difference of this and the given Timestamp.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to subtract from this.
+ * @return {Timestamp} the difference of this and the given Timestamp.
+ */
+Timestamp.prototype.subtract = function(other) {
+  return this.add(other.negate());
+};
+
+/**
+ * Returns the product of this and the given Timestamp.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp to multiply with this.
+ * @return {Timestamp} the product of this and the other.
+ */
+Timestamp.prototype.multiply = function(other) {
+  if (this.isZero()) {
+    return Timestamp.ZERO;
+  } else if (other.isZero()) {
+    return Timestamp.ZERO;
+  }
+
+  if (this.equals(Timestamp.MIN_VALUE)) {
+    return other.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
+  } else if (other.equals(Timestamp.MIN_VALUE)) {
+    return this.isOdd() ? Timestamp.MIN_VALUE : Timestamp.ZERO;
+  }
+
+  if (this.isNegative()) {
+    if (other.isNegative()) {
+      return this.negate().multiply(other.negate());
+    } else {
+      return this.negate()
+        .multiply(other)
+        .negate();
+    }
+  } else if (other.isNegative()) {
+    return this.multiply(other.negate()).negate();
+  }
+
+  // If both Timestamps are small, use float multiplication
+  if (this.lessThan(Timestamp.TWO_PWR_24_) && other.lessThan(Timestamp.TWO_PWR_24_)) {
+    return Timestamp.fromNumber(this.toNumber() * other.toNumber());
+  }
+
+  // Divide each Timestamp into 4 chunks of 16 bits, and then add up 4x4 products.
+  // We can skip products that would overflow.
+
+  var a48 = this.high_ >>> 16;
+  var a32 = this.high_ & 0xffff;
+  var a16 = this.low_ >>> 16;
+  var a00 = this.low_ & 0xffff;
+
+  var b48 = other.high_ >>> 16;
+  var b32 = other.high_ & 0xffff;
+  var b16 = other.low_ >>> 16;
+  var b00 = other.low_ & 0xffff;
+
+  var c48 = 0,
+    c32 = 0,
+    c16 = 0,
+    c00 = 0;
+  c00 += a00 * b00;
+  c16 += c00 >>> 16;
+  c00 &= 0xffff;
+  c16 += a16 * b00;
+  c32 += c16 >>> 16;
+  c16 &= 0xffff;
+  c16 += a00 * b16;
+  c32 += c16 >>> 16;
+  c16 &= 0xffff;
+  c32 += a32 * b00;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c32 += a16 * b16;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c32 += a00 * b32;
+  c48 += c32 >>> 16;
+  c32 &= 0xffff;
+  c48 += a48 * b00 + a32 * b16 + a16 * b32 + a00 * b48;
+  c48 &= 0xffff;
+  return Timestamp.fromBits((c16 << 16) | c00, (c48 << 16) | c32);
+};
+
+/**
+ * Returns this Timestamp divided by the given one.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp by which to divide.
+ * @return {Timestamp} this Timestamp divided by the given one.
+ */
+Timestamp.prototype.div = function(other) {
+  if (other.isZero()) {
+    throw Error('division by zero');
+  } else if (this.isZero()) {
+    return Timestamp.ZERO;
+  }
+
+  if (this.equals(Timestamp.MIN_VALUE)) {
+    if (other.equals(Timestamp.ONE) || other.equals(Timestamp.NEG_ONE)) {
+      return Timestamp.MIN_VALUE; // recall that -MIN_VALUE == MIN_VALUE
+    } else if (other.equals(Timestamp.MIN_VALUE)) {
+      return Timestamp.ONE;
+    } else {
+      // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|.
+      var halfThis = this.shiftRight(1);
+      var approx = halfThis.div(other).shiftLeft(1);
+      if (approx.equals(Timestamp.ZERO)) {
+        return other.isNegative() ? Timestamp.ONE : Timestamp.NEG_ONE;
+      } else {
+        var rem = this.subtract(other.multiply(approx));
+        var result = approx.add(rem.div(other));
+        return result;
+      }
+    }
+  } else if (other.equals(Timestamp.MIN_VALUE)) {
+    return Timestamp.ZERO;
+  }
+
+  if (this.isNegative()) {
+    if (other.isNegative()) {
+      return this.negate().div(other.negate());
+    } else {
+      return this.negate()
+        .div(other)
+        .negate();
+    }
+  } else if (other.isNegative()) {
+    return this.div(other.negate()).negate();
+  }
+
+  // Repeat the following until the remainder is less than other:  find a
+  // floating-point that approximates remainder / other *from below*, add this
+  // into the result, and subtract it from the remainder.  It is critical that
+  // the approximate value is less than or equal to the real value so that the
+  // remainder never becomes negative.
+  var res = Timestamp.ZERO;
+  rem = this;
+  while (rem.greaterThanOrEqual(other)) {
+    // Approximate the result of division. This may be a little greater or
+    // smaller than the actual value.
+    approx = Math.max(1, Math.floor(rem.toNumber() / other.toNumber()));
+
+    // We will tweak the approximate result by changing it in the 48-th digit or
+    // the smallest non-fractional digit, whichever is larger.
+    var log2 = Math.ceil(Math.log(approx) / Math.LN2);
+    var delta = log2 <= 48 ? 1 : Math.pow(2, log2 - 48);
+
+    // Decrease the approximation until it is smaller than the remainder.  Note
+    // that if it is too large, the product overflows and is negative.
+    var approxRes = Timestamp.fromNumber(approx);
+    var approxRem = approxRes.multiply(other);
+    while (approxRem.isNegative() || approxRem.greaterThan(rem)) {
+      approx -= delta;
+      approxRes = Timestamp.fromNumber(approx);
+      approxRem = approxRes.multiply(other);
+    }
+
+    // We know the answer can't be zero... and actually, zero would cause
+    // infinite recursion since we would make no progress.
+    if (approxRes.isZero()) {
+      approxRes = Timestamp.ONE;
+    }
+
+    res = res.add(approxRes);
+    rem = rem.subtract(approxRem);
+  }
+  return res;
+};
+
+/**
+ * Returns this Timestamp modulo the given one.
+ *
+ * @method
+ * @param {Timestamp} other Timestamp by which to mod.
+ * @return {Timestamp} this Timestamp modulo the given one.
+ */
+Timestamp.prototype.modulo = function(other) {
+  return this.subtract(this.div(other).multiply(other));
+};
+
+/**
+ * The bitwise-NOT of this value.
+ *
+ * @method
+ * @return {Timestamp} the bitwise-NOT of this value.
+ */
+Timestamp.prototype.not = function() {
+  return Timestamp.fromBits(~this.low_, ~this.high_);
+};
+
+/**
+ * Returns the bitwise-AND of this Timestamp and the given one.
+ *
+ * @method
+ * @param {Timestamp} other the Timestamp with which to AND.
+ * @return {Timestamp} the bitwise-AND of this and the other.
+ */
+Timestamp.prototype.and = function(other) {
+  return Timestamp.fromBits(this.low_ & other.low_, this.high_ & other.high_);
+};
+
+/**
+ * Returns the bitwise-OR of this Timestamp and the given one.
+ *
+ * @method
+ * @param {Timestamp} other the Timestamp with which to OR.
+ * @return {Timestamp} the bitwise-OR of this and the other.
+ */
+Timestamp.prototype.or = function(other) {
+  return Timestamp.fromBits(this.low_ | other.low_, this.high_ | other.high_);
+};
+
+/**
+ * Returns the bitwise-XOR of this Timestamp and the given one.
+ *
+ * @method
+ * @param {Timestamp} other the Timestamp with which to XOR.
+ * @return {Timestamp} the bitwise-XOR of this and the other.
+ */
+Timestamp.prototype.xor = function(other) {
+  return Timestamp.fromBits(this.low_ ^ other.low_, this.high_ ^ other.high_);
+};
+
+/**
+ * Returns this Timestamp with bits shifted to the left by the given amount.
+ *
+ * @method
+ * @param {number} numBits the number of bits by which to shift.
+ * @return {Timestamp} this shifted to the left by the given amount.
+ */
+Timestamp.prototype.shiftLeft = function(numBits) {
+  numBits &= 63;
+  if (numBits === 0) {
+    return this;
+  } else {
+    var low = this.low_;
+    if (numBits < 32) {
+      var high = this.high_;
+      return Timestamp.fromBits(low << numBits, (high << numBits) | (low >>> (32 - numBits)));
+    } else {
+      return Timestamp.fromBits(0, low << (numBits - 32));
+    }
+  }
+};
+
+/**
+ * Returns this Timestamp with bits shifted to the right by the given amount.
+ *
+ * @method
+ * @param {number} numBits the number of bits by which to shift.
+ * @return {Timestamp} this shifted to the right by the given amount.
+ */
+Timestamp.prototype.shiftRight = function(numBits) {
+  numBits &= 63;
+  if (numBits === 0) {
+    return this;
+  } else {
+    var high = this.high_;
+    if (numBits < 32) {
+      var low = this.low_;
+      return Timestamp.fromBits((low >>> numBits) | (high << (32 - numBits)), high >> numBits);
+    } else {
+      return Timestamp.fromBits(high >> (numBits - 32), high >= 0 ? 0 : -1);
+    }
+  }
+};
+
+/**
+ * Returns this Timestamp with bits shifted to the right by the given amount, with the new top bits matching the current sign bit.
+ *
+ * @method
+ * @param {number} numBits the number of bits by which to shift.
+ * @return {Timestamp} this shifted to the right by the given amount, with zeros placed into the new leading bits.
+ */
+Timestamp.prototype.shiftRightUnsigned = function(numBits) {
+  numBits &= 63;
+  if (numBits === 0) {
+    return this;
+  } else {
+    var high = this.high_;
+    if (numBits < 32) {
+      var low = this.low_;
+      return Timestamp.fromBits((low >>> numBits) | (high << (32 - numBits)), high >>> numBits);
+    } else if (numBits === 32) {
+      return Timestamp.fromBits(high, 0);
+    } else {
+      return Timestamp.fromBits(high >>> (numBits - 32), 0);
+    }
+  }
+};
+
+/**
+ * Returns a Timestamp representing the given (32-bit) integer value.
+ *
+ * @method
+ * @param {number} value the 32-bit integer in question.
+ * @return {Timestamp} the corresponding Timestamp value.
+ */
+Timestamp.fromInt = function(value) {
+  if (-128 <= value && value < 128) {
+    var cachedObj = Timestamp.INT_CACHE_[value];
+    if (cachedObj) {
+      return cachedObj;
+    }
+  }
+
+  var obj = new Timestamp(value | 0, value < 0 ? -1 : 0);
+  if (-128 <= value && value < 128) {
+    Timestamp.INT_CACHE_[value] = obj;
+  }
+  return obj;
+};
+
+/**
+ * Returns a Timestamp representing the given value, provided that it is a finite number. Otherwise, zero is returned.
+ *
+ * @method
+ * @param {number} value the number in question.
+ * @return {Timestamp} the corresponding Timestamp value.
+ */
+Timestamp.fromNumber = function(value) {
+  if (isNaN(value) || !isFinite(value)) {
+    return Timestamp.ZERO;
+  } else if (value <= -Timestamp.TWO_PWR_63_DBL_) {
+    return Timestamp.MIN_VALUE;
+  } else if (value + 1 >= Timestamp.TWO_PWR_63_DBL_) {
+    return Timestamp.MAX_VALUE;
+  } else if (value < 0) {
+    return Timestamp.fromNumber(-value).negate();
+  } else {
+    return new Timestamp(
+      (value % Timestamp.TWO_PWR_32_DBL_) | 0,
+      (value / Timestamp.TWO_PWR_32_DBL_) | 0
+    );
+  }
+};
+
+/**
+ * Returns a Timestamp representing the 64-bit integer that comes by concatenating the given high and low bits. Each is assumed to use 32 bits.
+ *
+ * @method
+ * @param {number} lowBits the low 32-bits.
+ * @param {number} highBits the high 32-bits.
+ * @return {Timestamp} the corresponding Timestamp value.
+ */
+Timestamp.fromBits = function(lowBits, highBits) {
+  return new Timestamp(lowBits, highBits);
+};
+
+/**
+ * Returns a Timestamp representation of the given string, written using the given radix.
+ *
+ * @method
+ * @param {string} str the textual representation of the Timestamp.
+ * @param {number} opt_radix the radix in which the text is written.
+ * @return {Timestamp} the corresponding Timestamp value.
+ */
+Timestamp.fromString = function(str, opt_radix) {
+  if (str.length === 0) {
+    throw Error('number format error: empty string');
+  }
+
+  var radix = opt_radix || 10;
+  if (radix < 2 || 36 < radix) {
+    throw Error('radix out of range: ' + radix);
+  }
+
+  if (str.charAt(0) === '-') {
+    return Timestamp.fromString(str.substring(1), radix).negate();
+  } else if (str.indexOf('-') >= 0) {
+    throw Error('number format error: interior "-" character: ' + str);
+  }
+
+  // Do several (8) digits each time through the loop, so as to
+  // minimize the calls to the very expensive emulated div.
+  var radixToPower = Timestamp.fromNumber(Math.pow(radix, 8));
+
+  var result = Timestamp.ZERO;
+  for (var i = 0; i < str.length; i += 8) {
+    var size = Math.min(8, str.length - i);
+    var value = parseInt(str.substring(i, i + size), radix);
+    if (size < 8) {
+      var power = Timestamp.fromNumber(Math.pow(radix, size));
+      result = result.multiply(power).add(Timestamp.fromNumber(value));
+    } else {
+      result = result.multiply(radixToPower);
+      result = result.add(Timestamp.fromNumber(value));
+    }
+  }
+  return result;
+};
+
+// NOTE: Common constant values ZERO, ONE, NEG_ONE, etc. are defined below the
+// from* methods on which they depend.
+
+/**
+ * A cache of the Timestamp representations of small integer values.
+ * @type {Object}
+ * @ignore
+ */
+Timestamp.INT_CACHE_ = {};
+
+// NOTE: the compiler should inline these constant values below and then remove
+// these variables, so there should be no runtime penalty for these.
+
+/**
+ * Number used repeated below in calculations.  This must appear before the
+ * first call to any from* function below.
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_16_DBL_ = 1 << 16;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_24_DBL_ = 1 << 24;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_32_DBL_ = Timestamp.TWO_PWR_16_DBL_ * Timestamp.TWO_PWR_16_DBL_;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_31_DBL_ = Timestamp.TWO_PWR_32_DBL_ / 2;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_48_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_16_DBL_;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_64_DBL_ = Timestamp.TWO_PWR_32_DBL_ * Timestamp.TWO_PWR_32_DBL_;
+
+/**
+ * @type {number}
+ * @ignore
+ */
+Timestamp.TWO_PWR_63_DBL_ = Timestamp.TWO_PWR_64_DBL_ / 2;
+
+/** @type {Timestamp} */
+Timestamp.ZERO = Timestamp.fromInt(0);
+
+/** @type {Timestamp} */
+Timestamp.ONE = Timestamp.fromInt(1);
+
+/** @type {Timestamp} */
+Timestamp.NEG_ONE = Timestamp.fromInt(-1);
+
+/** @type {Timestamp} */
+Timestamp.MAX_VALUE = Timestamp.fromBits(0xffffffff | 0, 0x7fffffff | 0);
+
+/** @type {Timestamp} */
+Timestamp.MIN_VALUE = Timestamp.fromBits(0, 0x80000000 | 0);
+
+/**
+ * @type {Timestamp}
+ * @ignore
+ */
+Timestamp.TWO_PWR_24_ = Timestamp.fromInt(1 << 24);
+
+/**
+ * Expose.
+ */
+module.exports = Timestamp;
+module.exports.Timestamp = Timestamp;
diff --git a/NodeAPI/node_modules/bson/package.json b/NodeAPI/node_modules/bson/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..5dc76e8303508766ecb201914f93eab22023552a
--- /dev/null
+++ b/NodeAPI/node_modules/bson/package.json
@@ -0,0 +1,58 @@
+{
+  "name": "bson",
+  "description": "A bson parser for node.js and the browser",
+  "keywords": [
+    "mongodb",
+    "bson",
+    "parser"
+  ],
+  "files": [
+    "lib",
+    "index.js",
+    "browser_build",
+    "bower.json"
+  ],
+  "version": "1.1.6",
+  "author": "Christian Amor Kvalheim <christkv@gmail.com>",
+  "contributors": [],
+  "repository": "mongodb/js-bson",
+  "bugs": {
+    "mail": "node-mongodb-native@googlegroups.com",
+    "url": "https://github.com/mongodb/js-bson/issues"
+  },
+  "devDependencies": {
+    "benchmark": "1.0.0",
+    "colors": "1.1.0",
+    "nodeunit": "0.9.0",
+    "babel-core": "^6.14.0",
+    "babel-loader": "^6.2.5",
+    "babel-polyfill": "^6.13.0",
+    "babel-preset-es2015": "^6.14.0",
+    "babel-preset-stage-0": "^6.5.0",
+    "babel-register": "^6.14.0",
+    "conventional-changelog-cli": "^1.3.5",
+    "standard-version": "^9.1.1",
+    "webpack": "^1.13.2",
+    "webpack-polyfills-plugin": "0.0.9"
+  },
+  "config": {
+    "native": false
+  },
+  "main": "./index",
+  "directories": {
+    "lib": "./lib/bson"
+  },
+  "engines": {
+    "node": ">=0.6.19"
+  },
+  "scripts": {
+    "test": "nodeunit ./test/node",
+    "build": "webpack --config ./webpack.dist.config.js",
+    "changelog": "conventional-changelog -p angular -i HISTORY.md -s",
+    "lint": "eslint lib test",
+    "format": "prettier --print-width 100 --tab-width 2 --single-quote --write 'test/**/*.js' 'lib/**/*.js'",
+    "release": "standard-version -i HISTORY.md"
+  },
+  "browser": "lib/bson/bson.js",
+  "license": "Apache-2.0"
+}
diff --git a/NodeAPI/node_modules/denque/CHANGELOG.md b/NodeAPI/node_modules/denque/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..bb5ffb6f7fa09efd9947644e8fb59fde1d7e729e
--- /dev/null
+++ b/NodeAPI/node_modules/denque/CHANGELOG.md
@@ -0,0 +1,4 @@
+## 1.5.0
+
+ - feat: adds capacity option for circular buffers (#27)
+
diff --git a/NodeAPI/node_modules/denque/LICENSE b/NodeAPI/node_modules/denque/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..fd22a2dbe9c147eaae0b12ad85ac5988690982cb
--- /dev/null
+++ b/NodeAPI/node_modules/denque/LICENSE
@@ -0,0 +1,13 @@
+Copyright (c) 2018 Mike Diarmid (Salakar) <mike.diarmid@gmail.com>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this library except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/NodeAPI/node_modules/denque/README.md b/NodeAPI/node_modules/denque/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..6821e0d0a56f630411f4717a74ee58d5feb09382
--- /dev/null
+++ b/NodeAPI/node_modules/denque/README.md
@@ -0,0 +1,362 @@
+<p align="center">
+  <a href="https://invertase.io">
+    <img src="https://static.invertase.io/assets/invertase-logo-small.png"><br/>
+  </a>
+  <h2 align="center">Denque</h2>
+</p>
+
+<p align="center">
+  <a href="https://www.npmjs.com/package/denque"><img src="https://img.shields.io/npm/dm/denque.svg?style=flat-square" alt="NPM downloads"></a>
+  <a href="https://www.npmjs.com/package/denque"><img src="https://img.shields.io/npm/v/denque.svg?style=flat-square" alt="NPM version"></a>
+  <a href="https://travis-ci.org/Salakar/denque"><img src="https://travis-ci.org/invertase/denque.svg" alt="Build version"></a>
+  <a href="https://coveralls.io/github/invertase/denque?branch=master"><img src="https://coveralls.io/repos/github/invertase/denque/badge.svg?branch=master" alt="Build version"></a>  
+  <a href="/LICENSE"><img src="https://img.shields.io/npm/l/denque.svg?style=flat-square" alt="License"></a>
+  <a href="https://discord.gg/C9aK28N"><img src="https://img.shields.io/discord/295953187817521152.svg?logo=discord&style=flat-square&colorA=7289da&label=discord" alt="Chat"></a>
+  <a href="https://twitter.com/invertaseio"><img src="https://img.shields.io/twitter/follow/invertaseio.svg?style=social&label=Follow" alt="Follow on Twitter"></a>
+</p>
+
+Extremely fast and lightweight [double-ended queue](http://en.wikipedia.org/wiki/Double-ended_queue) implementation with zero dependencies.
+
+Double-ended queues can also be used as a:
+
+- [Stack](http://en.wikipedia.org/wiki/Stack_\(abstract_data_type\))
+- [Queue](http://en.wikipedia.org/wiki/Queue_\(data_structure\))
+
+This implementation is currently the fastest available, even faster than `double-ended-queue`, see the [benchmarks](#benchmarks)
+
+Every queue operation is done at a constant `O(1)` - including random access from `.peekAt(index)`.
+
+**Works on all node versions >= v0.10**
+
+# Quick Start
+
+    npm install denque
+
+```js
+const Denque = require("denque");
+
+const denque = new Denque([1,2,3,4]);
+denque.shift(); // 1
+denque.pop(); // 4
+```
+
+
+# API
+
+- [`new Denque()`](#new-denque---denque)
+- [`new Denque(Array items)`](#new-denquearray-items---denque)
+- [`push(item)`](#pushitem---int)
+- [`unshift(item)`](#unshiftitem---int)
+- [`pop()`](#pop---dynamic)
+- [`shift()`](#shift---dynamic)
+- [`toArray()`](#toarray---array)
+- [`peekBack()`](#peekback---dynamic)
+- [`peekFront()`](#peekfront---dynamic)
+- [`peekAt(int index)`](#peekAtint-index---dynamic)
+- [`remove(int index, int count)`](#remove)
+- [`removeOne(int index)`](#removeOne)
+- [`splice(int index, int count, item1, item2, ...)`](#splice)
+- [`isEmpty()`](#isempty---boolean)
+- [`clear()`](#clear---void)
+
+#### `new Denque()` -> `Denque`
+
+Creates an empty double-ended queue with initial capacity of 4.
+
+```js
+var denque = new Denque();
+denque.push(1);
+denque.push(2);
+denque.push(3);
+denque.shift(); //1
+denque.pop(); //3
+```
+
+<hr>
+
+#### `new Denque(Array items)` -> `Denque`
+
+Creates a double-ended queue from `items`.
+
+```js
+var denque = new Denque([1,2,3,4]);
+denque.shift(); // 1
+denque.pop(); // 4
+```
+
+<hr>
+
+
+#### `push(item)` -> `int`
+
+Push an item to the back of this queue. Returns the amount of items currently in the queue after the operation.
+
+```js
+var denque = new Denque();
+denque.push(1);
+denque.pop(); // 1
+denque.push(2);
+denque.push(3);
+denque.shift(); // 2
+denque.shift(); // 3
+```
+
+<hr>
+
+#### `unshift(item)` -> `int`
+
+Unshift an item to the front of this queue. Returns the amount of items currently in the queue after the operation.
+
+```js
+var denque = new Denque([2,3]);
+denque.unshift(1);
+denque.toString(); // "1,2,3"
+denque.unshift(-2);
+denque.toString(); // "-2,-1,0,1,2,3"
+```
+
+<hr>
+
+
+#### `pop()` -> `dynamic`
+
+Pop off the item at the back of this queue.
+
+Note: The item will be removed from the queue. If you simply want to see what's at the back of the queue use [`peekBack()`](#peekback---dynamic) or [`.peekAt(-1)`](#peekAtint-index---dynamic).
+
+If the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `pop()` return value -
+check the queue `.length` before popping.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.pop(); // 3
+denque.pop(); // 2
+denque.pop(); // 1
+denque.pop(); // undefined
+```
+
+**Aliases:** `removeBack`
+
+<hr>
+
+#### `shift()` -> `dynamic`
+
+Shifts off the item at the front of this queue.
+
+Note: The item will be removed from the queue. If you simply want to see what's at the front of the queue use [`peekFront()`](#peekfront---dynamic) or [`.peekAt(0)`](#peekAtint-index---dynamic).
+
+If the queue is empty, `undefined` is returned. If you need to differentiate between `undefined` values in the queue and `shift()` return value -
+check the queue `.length` before shifting.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.shift(); // 1
+denque.shift(); // 2
+denque.shift(); // 3
+denque.shift(); // undefined
+```
+
+<hr>
+
+#### `toArray()` -> `Array`
+
+Returns the items in the queue as an array. Starting from the item in the front of the queue and ending to the item at the back of the queue.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.push(4);
+denque.unshift(0);
+denque.toArray(); // [0,1,2,3,4]
+```
+
+<hr>
+
+#### `peekBack()` -> `dynamic`
+
+Returns the item that is at the back of this queue without removing it.
+
+If the queue is empty, `undefined` is returned.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.push(4);
+denque.peekBack(); // 4
+```
+
+<hr>
+
+#### `peekFront()` -> `dynamic`
+
+Returns the item that is at the front of this queue without removing it.
+
+If the queue is empty, `undefined` is returned.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.push(4);
+denque.peekFront(); // 1
+```
+
+<hr>
+
+#### `peekAt(int index)` -> `dynamic`
+
+Returns the item that is at the given `index` of this queue without removing it.
+
+The index is zero-based, so `.peekAt(0)` will return the item that is at the front, `.peekAt(1)` will return
+the item that comes after and so on.
+
+The index can be negative to read items at the back of the queue. `.peekAt(-1)` returns the item that is at the back of the queue,
+`.peekAt(-2)` will return the item that comes before and so on.
+
+Returns `undefined` if `index` is not a valid index into the queue.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.peekAt(0); //1
+denque.peekAt(1); //2
+denque.peekAt(2); //3
+
+denque.peekAt(-1); // 3
+denque.peekAt(-2); // 2
+denque.peekAt(-3); // 1
+```
+
+**Note**: The implementation has O(1) random access using `.peekAt()`.
+
+**Aliases:** `get`
+
+<hr>
+
+#### `remove(int index, int count)` -> `array`
+
+Remove number of items from the specified index from the list.
+
+Returns array of removed items.
+
+Returns undefined if the list is empty.
+
+```js
+var denque = new Denque([1,2,3,4,5,6,7]);
+denque.remove(0,3); //[1,2,3]
+denque.remove(1,2); //[5,6]
+var denque1 = new Denque([1,2,3,4,5,6,7]);
+denque1.remove(4, 100); //[5,6,7]
+```
+
+<hr>
+
+#### `removeOne(int index)` -> `dynamic`
+
+Remove and return the item at the specified index from the list.
+
+Returns undefined if the list is empty.
+
+```js
+var denque = new Denque([1,2,3,4,5,6,7]);
+denque.removeOne(4); // 5
+denque.removeOne(3); // 4
+denque1.removeOne(1); // 2
+```
+
+<hr>
+
+#### `splice(int index, int count, item1, item2, ...)` -> `array`
+
+Native splice implementation.
+
+Remove number of items from the specified index from the list and/or add new elements.
+
+Returns array of removed items or empty array if count == 0.
+
+Returns undefined if the list is empty.
+
+```js
+var denque = new Denque([1,2,3,4,5,6,7]);
+denque.splice(denque.length, 0, 8, 9, 10); // []
+denque.toArray() // [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
+denque.splice(3, 3, 44, 55, 66); // [4,5,6]
+denque.splice(5,4, 666,667,668,669); // [ 66, 7, 8, 9 ]
+denque.toArray() // [ 1, 2, 3, 44, 55, 666, 667, 668, 669, 10 ]
+```
+
+<hr>
+
+#### `isEmpty()` -> `boolean`
+
+Return `true` if this queue is empty, `false` otherwise.
+
+```js
+var denque = new Denque();
+denque.isEmpty(); // true
+denque.push(1);
+denque.isEmpty(); // false
+```
+
+<hr>
+
+#### `clear()` -> `void`
+
+Remove all items from this queue. Does not change the queue's capacity.
+
+```js
+var denque = new Denque([1,2,3]);
+denque.toString(); // "1,2,3"
+denque.clear();
+denque.toString(); // ""
+```
+<hr>
+
+
+## Benchmarks
+
+#### Platform info:
+```
+Darwin 17.0.0 x64
+Node.JS 9.4.0
+V8 6.2.414.46-node.17
+Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz × 8
+```
+
+#### 1000 items in queue
+
+ (3 x shift + 3 x push ops per 'op')
+
+    denque x 64,365,425 ops/sec ±0.69% (92 runs sampled)
+    double-ended-queue x 26,646,882 ops/sec ±0.47% (94 runs sampled)
+
+#### 2 million items in queue
+
+ (3 x shift + 3 x push ops per 'op')
+
+    denque x 61,994,249 ops/sec ±0.26% (95 runs sampled)
+    double-ended-queue x 26,363,500 ops/sec ±0.42% (91 runs sampled)
+
+#### Splice
+
+ (1 x splice per 'op') - initial size of 100,000 items
+
+    denque.splice x 925,749 ops/sec ±22.29% (77 runs sampled)
+    native array splice x 7,777 ops/sec ±8.35% (50 runs sampled)
+
+#### Remove
+
+ (1 x remove + 10 x push per 'op') - initial size of 100,000 items
+
+    denque.remove x 2,635,275 ops/sec ±0.37% (95 runs sampled)
+    native array splice - Fails to complete: "JavaScript heap out of memory"
+
+#### Remove One
+
+ (1 x removeOne + 10 x push per 'op') - initial size of 100,000 items
+
+    denque.removeOne x 1,088,240 ops/sec ±0.21% (93 runs sampled)
+    native array splice x 5,300 ops/sec ±0.41% (96 runs sampled)
+    
+---
+
+Built and maintained with 💛 by [Invertase](https://invertase.io).
+
+- [💼 Hire Us](https://invertase.io/hire-us)
+- [☕️ Sponsor Us](https://opencollective.com/react-native-firebase)
+- [👩‍💻 Work With Us](https://invertase.io/jobs)
diff --git a/NodeAPI/node_modules/denque/index.d.ts b/NodeAPI/node_modules/denque/index.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..05d7123f38152e14574e92b8a7083d1840022ff8
--- /dev/null
+++ b/NodeAPI/node_modules/denque/index.d.ts
@@ -0,0 +1,31 @@
+declare class Denque<T = any> {
+  constructor();
+  constructor(array: T[]);
+  constructor(array: T[], options: IDenqueOptions);
+
+  push(item: T): number;
+  unshift(item: T): number;
+  pop(): T | undefined;
+  removeBack(): T | undefined;
+  shift(): T | undefined;
+  peekBack(): T | undefined;
+  peekFront(): T | undefined;
+  peekAt(index: number): T | undefined;
+  get(index: number): T | undefined;
+  remove(index: number, count: number): T[];
+  removeOne(index: number): T | undefined;
+  splice(index: number, count: number, ...item: T[]): T[] | undefined;
+  isEmpty(): boolean;
+  clear(): void;
+
+  toString(): string;
+  toArray(): T[];
+
+  length: number;
+}
+
+interface IDenqueOptions {
+  capacity?: number
+}
+
+export = Denque;
diff --git a/NodeAPI/node_modules/denque/index.js b/NodeAPI/node_modules/denque/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..f664cd72b0b5e1526cb916cda33216fb83a9f458
--- /dev/null
+++ b/NodeAPI/node_modules/denque/index.js
@@ -0,0 +1,443 @@
+'use strict';
+
+/**
+ * Custom implementation of a double ended queue.
+ */
+function Denque(array, options) {
+  var options = options || {};
+
+  this._head = 0;
+  this._tail = 0;
+  this._capacity = options.capacity;
+  this._capacityMask = 0x3;
+  this._list = new Array(4);
+  if (Array.isArray(array)) {
+    this._fromArray(array);
+  }
+}
+
+/**
+ * -------------
+ *  PUBLIC API
+ * -------------
+ */
+
+/**
+ * Returns the item at the specified index from the list.
+ * 0 is the first element, 1 is the second, and so on...
+ * Elements at negative values are that many from the end: -1 is one before the end
+ * (the last element), -2 is two before the end (one before last), etc.
+ * @param index
+ * @returns {*}
+ */
+Denque.prototype.peekAt = function peekAt(index) {
+  var i = index;
+  // expect a number or return undefined
+  if ((i !== (i | 0))) {
+    return void 0;
+  }
+  var len = this.size();
+  if (i >= len || i < -len) return undefined;
+  if (i < 0) i += len;
+  i = (this._head + i) & this._capacityMask;
+  return this._list[i];
+};
+
+/**
+ * Alias for peekAt()
+ * @param i
+ * @returns {*}
+ */
+Denque.prototype.get = function get(i) {
+  return this.peekAt(i);
+};
+
+/**
+ * Returns the first item in the list without removing it.
+ * @returns {*}
+ */
+Denque.prototype.peek = function peek() {
+  if (this._head === this._tail) return undefined;
+  return this._list[this._head];
+};
+
+/**
+ * Alias for peek()
+ * @returns {*}
+ */
+Denque.prototype.peekFront = function peekFront() {
+  return this.peek();
+};
+
+/**
+ * Returns the item that is at the back of the queue without removing it.
+ * Uses peekAt(-1)
+ */
+Denque.prototype.peekBack = function peekBack() {
+  return this.peekAt(-1);
+};
+
+/**
+ * Returns the current length of the queue
+ * @return {Number}
+ */
+Object.defineProperty(Denque.prototype, 'length', {
+  get: function length() {
+    return this.size();
+  }
+});
+
+/**
+ * Return the number of items on the list, or 0 if empty.
+ * @returns {number}
+ */
+Denque.prototype.size = function size() {
+  if (this._head === this._tail) return 0;
+  if (this._head < this._tail) return this._tail - this._head;
+  else return this._capacityMask + 1 - (this._head - this._tail);
+};
+
+/**
+ * Add an item at the beginning of the list.
+ * @param item
+ */
+Denque.prototype.unshift = function unshift(item) {
+  if (item === undefined) return this.size();
+  var len = this._list.length;
+  this._head = (this._head - 1 + len) & this._capacityMask;
+  this._list[this._head] = item;
+  if (this._tail === this._head) this._growArray();
+  if (this._capacity && this.size() > this._capacity) this.pop();
+  if (this._head < this._tail) return this._tail - this._head;
+  else return this._capacityMask + 1 - (this._head - this._tail);
+};
+
+/**
+ * Remove and return the first item on the list,
+ * Returns undefined if the list is empty.
+ * @returns {*}
+ */
+Denque.prototype.shift = function shift() {
+  var head = this._head;
+  if (head === this._tail) return undefined;
+  var item = this._list[head];
+  this._list[head] = undefined;
+  this._head = (head + 1) & this._capacityMask;
+  if (head < 2 && this._tail > 10000 && this._tail <= this._list.length >>> 2) this._shrinkArray();
+  return item;
+};
+
+/**
+ * Add an item to the bottom of the list.
+ * @param item
+ */
+Denque.prototype.push = function push(item) {
+  if (item === undefined) return this.size();
+  var tail = this._tail;
+  this._list[tail] = item;
+  this._tail = (tail + 1) & this._capacityMask;
+  if (this._tail === this._head) {
+    this._growArray();
+  }
+  if (this._capacity && this.size() > this._capacity) {
+    this.shift();
+  }
+  if (this._head < this._tail) return this._tail - this._head;
+  else return this._capacityMask + 1 - (this._head - this._tail);
+};
+
+/**
+ * Remove and return the last item on the list.
+ * Returns undefined if the list is empty.
+ * @returns {*}
+ */
+Denque.prototype.pop = function pop() {
+  var tail = this._tail;
+  if (tail === this._head) return undefined;
+  var len = this._list.length;
+  this._tail = (tail - 1 + len) & this._capacityMask;
+  var item = this._list[this._tail];
+  this._list[this._tail] = undefined;
+  if (this._head < 2 && tail > 10000 && tail <= len >>> 2) this._shrinkArray();
+  return item;
+};
+
+/**
+ * Remove and return the item at the specified index from the list.
+ * Returns undefined if the list is empty.
+ * @param index
+ * @returns {*}
+ */
+Denque.prototype.removeOne = function removeOne(index) {
+  var i = index;
+  // expect a number or return undefined
+  if ((i !== (i | 0))) {
+    return void 0;
+  }
+  if (this._head === this._tail) return void 0;
+  var size = this.size();
+  var len = this._list.length;
+  if (i >= size || i < -size) return void 0;
+  if (i < 0) i += size;
+  i = (this._head + i) & this._capacityMask;
+  var item = this._list[i];
+  var k;
+  if (index < size / 2) {
+    for (k = index; k > 0; k--) {
+      this._list[i] = this._list[i = (i - 1 + len) & this._capacityMask];
+    }
+    this._list[i] = void 0;
+    this._head = (this._head + 1 + len) & this._capacityMask;
+  } else {
+    for (k = size - 1 - index; k > 0; k--) {
+      this._list[i] = this._list[i = ( i + 1 + len) & this._capacityMask];
+    }
+    this._list[i] = void 0;
+    this._tail = (this._tail - 1 + len) & this._capacityMask;
+  }
+  return item;
+};
+
+/**
+ * Remove number of items from the specified index from the list.
+ * Returns array of removed items.
+ * Returns undefined if the list is empty.
+ * @param index
+ * @param count
+ * @returns {array}
+ */
+Denque.prototype.remove = function remove(index, count) {
+  var i = index;
+  var removed;
+  var del_count = count;
+  // expect a number or return undefined
+  if ((i !== (i | 0))) {
+    return void 0;
+  }
+  if (this._head === this._tail) return void 0;
+  var size = this.size();
+  var len = this._list.length;
+  if (i >= size || i < -size || count < 1) return void 0;
+  if (i < 0) i += size;
+  if (count === 1 || !count) {
+    removed = new Array(1);
+    removed[0] = this.removeOne(i);
+    return removed;
+  }
+  if (i === 0 && i + count >= size) {
+    removed = this.toArray();
+    this.clear();
+    return removed;
+  }
+  if (i + count > size) count = size - i;
+  var k;
+  removed = new Array(count);
+  for (k = 0; k < count; k++) {
+    removed[k] = this._list[(this._head + i + k) & this._capacityMask];
+  }
+  i = (this._head + i) & this._capacityMask;
+  if (index + count === size) {
+    this._tail = (this._tail - count + len) & this._capacityMask;
+    for (k = count; k > 0; k--) {
+      this._list[i = (i + 1 + len) & this._capacityMask] = void 0;
+    }
+    return removed;
+  }
+  if (index === 0) {
+    this._head = (this._head + count + len) & this._capacityMask;
+    for (k = count - 1; k > 0; k--) {
+      this._list[i = (i + 1 + len) & this._capacityMask] = void 0;
+    }
+    return removed;
+  }
+  if (i < size / 2) {
+    this._head = (this._head + index + count + len) & this._capacityMask;
+    for (k = index; k > 0; k--) {
+      this.unshift(this._list[i = (i - 1 + len) & this._capacityMask]);
+    }
+    i = (this._head - 1 + len) & this._capacityMask;
+    while (del_count > 0) {
+      this._list[i = (i - 1 + len) & this._capacityMask] = void 0;
+      del_count--;
+    }
+    if (index < 0) this._tail = i;
+  } else {
+    this._tail = i;
+    i = (i + count + len) & this._capacityMask;
+    for (k = size - (count + index); k > 0; k--) {
+      this.push(this._list[i++]);
+    }
+    i = this._tail;
+    while (del_count > 0) {
+      this._list[i = (i + 1 + len) & this._capacityMask] = void 0;
+      del_count--;
+    }
+  }
+  if (this._head < 2 && this._tail > 10000 && this._tail <= len >>> 2) this._shrinkArray();
+  return removed;
+};
+
+/**
+ * Native splice implementation.
+ * Remove number of items from the specified index from the list and/or add new elements.
+ * Returns array of removed items or empty array if count == 0.
+ * Returns undefined if the list is empty.
+ *
+ * @param index
+ * @param count
+ * @param {...*} [elements]
+ * @returns {array}
+ */
+Denque.prototype.splice = function splice(index, count) {
+  var i = index;
+  // expect a number or return undefined
+  if ((i !== (i | 0))) {
+    return void 0;
+  }
+  var size = this.size();
+  if (i < 0) i += size;
+  if (i > size) return void 0;
+  if (arguments.length > 2) {
+    var k;
+    var temp;
+    var removed;
+    var arg_len = arguments.length;
+    var len = this._list.length;
+    var arguments_index = 2;
+    if (!size || i < size / 2) {
+      temp = new Array(i);
+      for (k = 0; k < i; k++) {
+        temp[k] = this._list[(this._head + k) & this._capacityMask];
+      }
+      if (count === 0) {
+        removed = [];
+        if (i > 0) {
+          this._head = (this._head + i + len) & this._capacityMask;
+        }
+      } else {
+        removed = this.remove(i, count);
+        this._head = (this._head + i + len) & this._capacityMask;
+      }
+      while (arg_len > arguments_index) {
+        this.unshift(arguments[--arg_len]);
+      }
+      for (k = i; k > 0; k--) {
+        this.unshift(temp[k - 1]);
+      }
+    } else {
+      temp = new Array(size - (i + count));
+      var leng = temp.length;
+      for (k = 0; k < leng; k++) {
+        temp[k] = this._list[(this._head + i + count + k) & this._capacityMask];
+      }
+      if (count === 0) {
+        removed = [];
+        if (i != size) {
+          this._tail = (this._head + i + len) & this._capacityMask;
+        }
+      } else {
+        removed = this.remove(i, count);
+        this._tail = (this._tail - leng + len) & this._capacityMask;
+      }
+      while (arguments_index < arg_len) {
+        this.push(arguments[arguments_index++]);
+      }
+      for (k = 0; k < leng; k++) {
+        this.push(temp[k]);
+      }
+    }
+    return removed;
+  } else {
+    return this.remove(i, count);
+  }
+};
+
+/**
+ * Soft clear - does not reset capacity.
+ */
+Denque.prototype.clear = function clear() {
+  this._head = 0;
+  this._tail = 0;
+};
+
+/**
+ * Returns true or false whether the list is empty.
+ * @returns {boolean}
+ */
+Denque.prototype.isEmpty = function isEmpty() {
+  return this._head === this._tail;
+};
+
+/**
+ * Returns an array of all queue items.
+ * @returns {Array}
+ */
+Denque.prototype.toArray = function toArray() {
+  return this._copyArray(false);
+};
+
+/**
+ * -------------
+ *   INTERNALS
+ * -------------
+ */
+
+/**
+ * Fills the queue with items from an array
+ * For use in the constructor
+ * @param array
+ * @private
+ */
+Denque.prototype._fromArray = function _fromArray(array) {
+  for (var i = 0; i < array.length; i++) this.push(array[i]);
+};
+
+/**
+ *
+ * @param fullCopy
+ * @returns {Array}
+ * @private
+ */
+Denque.prototype._copyArray = function _copyArray(fullCopy) {
+  var newArray = [];
+  var list = this._list;
+  var len = list.length;
+  var i;
+  if (fullCopy || this._head > this._tail) {
+    for (i = this._head; i < len; i++) newArray.push(list[i]);
+    for (i = 0; i < this._tail; i++) newArray.push(list[i]);
+  } else {
+    for (i = this._head; i < this._tail; i++) newArray.push(list[i]);
+  }
+  return newArray;
+};
+
+/**
+ * Grows the internal list array.
+ * @private
+ */
+Denque.prototype._growArray = function _growArray() {
+  if (this._head) {
+    // copy existing data, head to end, then beginning to tail.
+    this._list = this._copyArray(true);
+    this._head = 0;
+  }
+
+  // head is at 0 and array is now full, safe to extend
+  this._tail = this._list.length;
+
+  this._list.length *= 2;
+  this._capacityMask = (this._capacityMask << 1) | 1;
+};
+
+/**
+ * Shrinks the internal list array.
+ * @private
+ */
+Denque.prototype._shrinkArray = function _shrinkArray() {
+  this._list.length >>>= 1;
+  this._capacityMask >>>= 1;
+};
+
+
+module.exports = Denque;
diff --git a/NodeAPI/node_modules/denque/package.json b/NodeAPI/node_modules/denque/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..37b6298dee1888fa307d9da6a8a7768995632c97
--- /dev/null
+++ b/NodeAPI/node_modules/denque/package.json
@@ -0,0 +1,55 @@
+{
+  "name": "denque",
+  "version": "1.5.0",
+  "description": "The fastest javascript implementation of a double-ended queue. Maintains compatability with deque.",
+  "main": "index.js",
+  "engines": {
+    "node": ">=0.10"
+  },
+  "keywords": [
+    "data-structure",
+    "data-structures",
+    "queue",
+    "double",
+    "end",
+    "ended",
+    "deque",
+    "denque",
+    "double-ended-queue"
+  ],
+  "scripts": {
+    "test": "istanbul cover --report lcov _mocha && npm run typescript",
+    "coveralls": "cat ./coverage/lcov.info | coveralls",
+    "typescript": "tsc --project ./test/type/tsconfig.json",
+    "benchmark_thousand": "node benchmark/thousand",
+    "benchmark_2mil": "node benchmark/two_million",
+    "benchmark_splice": "node benchmark/splice",
+    "benchmark_remove": "node benchmark/remove",
+    "benchmark_removeOne": "node benchmark/removeOne"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/invertase/denque.git"
+  },
+  "license": "Apache-2.0",
+  "author": {
+    "name": "Invertase",
+    "email": "oss@invertase.io",
+    "url": "http://github.com/invertase/"
+  },
+  "contributors": [
+    "Mike Diarmid (Salakar) <mike@invertase.io>"
+  ],
+  "bugs": {
+    "url": "https://github.com/invertase/denque/issues"
+  },
+  "homepage": "https://github.com/invertase/denque#readme",
+  "devDependencies": {
+    "benchmark": "^2.1.4",
+    "coveralls": "^2.13.3",
+    "double-ended-queue": "^2.1.0-0",
+    "istanbul": "^0.4.5",
+    "mocha": "^3.5.3",
+    "typescript": "^3.4.1"
+  }
+}
diff --git a/NodeAPI/node_modules/isarray/.npmignore b/NodeAPI/node_modules/isarray/.npmignore
new file mode 100644
index 0000000000000000000000000000000000000000..3c3629e647f5ddf82548912e337bea9826b434af
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/NodeAPI/node_modules/isarray/.travis.yml b/NodeAPI/node_modules/isarray/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..cc4dba29d959a2da7b97f9edd3c7c91384b2ee5b
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - "0.8"
+  - "0.10"
diff --git a/NodeAPI/node_modules/isarray/Makefile b/NodeAPI/node_modules/isarray/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..787d56e1e982e48588bc199f36f0d50cb4724066
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/Makefile
@@ -0,0 +1,6 @@
+
+test:
+	@node_modules/.bin/tape test.js
+
+.PHONY: test
+
diff --git a/NodeAPI/node_modules/isarray/README.md b/NodeAPI/node_modules/isarray/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..16d2c59c6195f9a1ac9af37cb9d75f1a6b85ab01
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/README.md
@@ -0,0 +1,60 @@
+
+# isarray
+
+`Array#isArray` for older browsers.
+
+[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray)
+[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray)
+
+[![browser support](https://ci.testling.com/juliangruber/isarray.png)
+](https://ci.testling.com/juliangruber/isarray)
+
+## Usage
+
+```js
+var isArray = require('isarray');
+
+console.log(isArray([])); // => true
+console.log(isArray({})); // => false
+```
+
+## Installation
+
+With [npm](http://npmjs.org) do
+
+```bash
+$ npm install isarray
+```
+
+Then bundle for the browser with
+[browserify](https://github.com/substack/browserify).
+
+With [component](http://component.io) do
+
+```bash
+$ component install juliangruber/isarray
+```
+
+## License
+
+(MIT)
+
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/NodeAPI/node_modules/isarray/component.json b/NodeAPI/node_modules/isarray/component.json
new file mode 100644
index 0000000000000000000000000000000000000000..9e31b6838890159e397063bdd2ea7de80b4e4a42
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/component.json
@@ -0,0 +1,19 @@
+{
+  "name" : "isarray",
+  "description" : "Array#isArray for older browsers",
+  "version" : "0.0.1",
+  "repository" : "juliangruber/isarray",
+  "homepage": "https://github.com/juliangruber/isarray",
+  "main" : "index.js",
+  "scripts" : [
+    "index.js"
+  ],
+  "dependencies" : {},
+  "keywords": ["browser","isarray","array"],
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "license": "MIT"
+}
diff --git a/NodeAPI/node_modules/isarray/index.js b/NodeAPI/node_modules/isarray/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a57f63495943a07b3b08d17e0f9ef6793548c801
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/index.js
@@ -0,0 +1,5 @@
+var toString = {}.toString;
+
+module.exports = Array.isArray || function (arr) {
+  return toString.call(arr) == '[object Array]';
+};
diff --git a/NodeAPI/node_modules/isarray/package.json b/NodeAPI/node_modules/isarray/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..1a4317a9c41c73d52934337143b974a35074e6f2
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/package.json
@@ -0,0 +1,45 @@
+{
+  "name": "isarray",
+  "description": "Array#isArray for older browsers",
+  "version": "1.0.0",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/juliangruber/isarray.git"
+  },
+  "homepage": "https://github.com/juliangruber/isarray",
+  "main": "index.js",
+  "dependencies": {},
+  "devDependencies": {
+    "tape": "~2.13.4"
+  },
+  "keywords": [
+    "browser",
+    "isarray",
+    "array"
+  ],
+  "author": {
+    "name": "Julian Gruber",
+    "email": "mail@juliangruber.com",
+    "url": "http://juliangruber.com"
+  },
+  "license": "MIT",
+  "testling": {
+    "files": "test.js",
+    "browsers": [
+      "ie/8..latest",
+      "firefox/17..latest",
+      "firefox/nightly",
+      "chrome/22..latest",
+      "chrome/canary",
+      "opera/12..latest",
+      "opera/next",
+      "safari/5.1..latest",
+      "ipad/6.0..latest",
+      "iphone/6.0..latest",
+      "android-browser/4.2..latest"
+    ]
+  },
+  "scripts": {
+    "test": "tape test.js"
+  }
+}
diff --git a/NodeAPI/node_modules/isarray/test.js b/NodeAPI/node_modules/isarray/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..e0c3444d85d5c799bd70b2ee9df62ef56d9763ea
--- /dev/null
+++ b/NodeAPI/node_modules/isarray/test.js
@@ -0,0 +1,20 @@
+var isArray = require('./');
+var test = require('tape');
+
+test('is array', function(t){
+  t.ok(isArray([]));
+  t.notOk(isArray({}));
+  t.notOk(isArray(null));
+  t.notOk(isArray(false));
+
+  var obj = {};
+  obj[0] = true;
+  t.notOk(isArray(obj));
+
+  var arr = [];
+  arr.foo = 'bar';
+  t.ok(isArray(arr));
+
+  t.end();
+});
+
diff --git a/NodeAPI/node_modules/memory-pager/.travis.yml b/NodeAPI/node_modules/memory-pager/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..1c4ab31e974d37bcfd286980ffa53891b2e5b608
--- /dev/null
+++ b/NodeAPI/node_modules/memory-pager/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+  - '4'
+  - '6'
diff --git a/NodeAPI/node_modules/memory-pager/LICENSE b/NodeAPI/node_modules/memory-pager/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..56fce0895e13ffe83650a7274d79fbcfb80d3e2f
--- /dev/null
+++ b/NodeAPI/node_modules/memory-pager/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/NodeAPI/node_modules/memory-pager/README.md b/NodeAPI/node_modules/memory-pager/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..aed176140ca3a3d6ca2d73128a588600b3240299
--- /dev/null
+++ b/NodeAPI/node_modules/memory-pager/README.md
@@ -0,0 +1,65 @@
+# memory-pager
+
+Access memory using small fixed sized buffers instead of allocating a huge buffer.
+Useful if you are implementing sparse data structures (such as large bitfield).
+
+![travis](https://travis-ci.org/mafintosh/memory-pager.svg?branch=master)
+
+```
+npm install memory-pager
+```
+
+## Usage
+
+``` js
+var pager = require('paged-memory')
+
+var pages = pager(1024) // use 1kb per page
+
+var page = pages.get(10) // get page #10
+
+console.log(page.offset) // 10240
+console.log(page.buffer) // a blank 1kb buffer
+```
+
+## API
+
+#### `var pages = pager(pageSize)`
+
+Create a new pager. `pageSize` defaults to `1024`.
+
+#### `var page = pages.get(pageNumber, [noAllocate])`
+
+Get a page. The page will be allocated at first access.
+
+Optionally you can set the `noAllocate` flag which will make the
+method return undefined if no page has been allocated already
+
+A page looks like this
+
+``` js
+{
+  offset: byteOffset,
+  buffer: bufferWithPageSize
+}
+```
+
+#### `pages.set(pageNumber, buffer)`
+
+Explicitly set the buffer for a page.
+
+#### `pages.updated(page)`
+
+Mark a page as updated.
+
+#### `pages.lastUpdate()`
+
+Get the last page that was updated.
+
+#### `var buf = pages.toBuffer()`
+
+Concat all pages allocated pages into a single buffer
+
+## License
+
+MIT
diff --git a/NodeAPI/node_modules/memory-pager/index.js b/NodeAPI/node_modules/memory-pager/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..687f346f30e6e8e6f3247f06c4946643ae2baba8
--- /dev/null
+++ b/NodeAPI/node_modules/memory-pager/index.js
@@ -0,0 +1,160 @@
+module.exports = Pager
+
+function Pager (pageSize, opts) {
+  if (!(this instanceof Pager)) return new Pager(pageSize, opts)
+
+  this.length = 0
+  this.updates = []
+  this.path = new Uint16Array(4)
+  this.pages = new Array(32768)
+  this.maxPages = this.pages.length
+  this.level = 0
+  this.pageSize = pageSize || 1024
+  this.deduplicate = opts ? opts.deduplicate : null
+  this.zeros = this.deduplicate ? alloc(this.deduplicate.length) : null
+}
+
+Pager.prototype.updated = function (page) {
+  while (this.deduplicate && page.buffer[page.deduplicate] === this.deduplicate[page.deduplicate]) {
+    page.deduplicate++
+    if (page.deduplicate === this.deduplicate.length) {
+      page.deduplicate = 0
+      if (page.buffer.equals && page.buffer.equals(this.deduplicate)) page.buffer = this.deduplicate
+      break
+    }
+  }
+  if (page.updated || !this.updates) return
+  page.updated = true
+  this.updates.push(page)
+}
+
+Pager.prototype.lastUpdate = function () {
+  if (!this.updates || !this.updates.length) return null
+  var page = this.updates.pop()
+  page.updated = false
+  return page
+}
+
+Pager.prototype._array = function (i, noAllocate) {
+  if (i >= this.maxPages) {
+    if (noAllocate) return
+    grow(this, i)
+  }
+
+  factor(i, this.path)
+
+  var arr = this.pages
+
+  for (var j = this.level; j > 0; j--) {
+    var p = this.path[j]
+    var next = arr[p]
+
+    if (!next) {
+      if (noAllocate) return
+      next = arr[p] = new Array(32768)
+    }
+
+    arr = next
+  }
+
+  return arr
+}
+
+Pager.prototype.get = function (i, noAllocate) {
+  var arr = this._array(i, noAllocate)
+  var first = this.path[0]
+  var page = arr && arr[first]
+
+  if (!page && !noAllocate) {
+    page = arr[first] = new Page(i, alloc(this.pageSize))
+    if (i >= this.length) this.length = i + 1
+  }
+
+  if (page && page.buffer === this.deduplicate && this.deduplicate && !noAllocate) {
+    page.buffer = copy(page.buffer)
+    page.deduplicate = 0
+  }
+
+  return page
+}
+
+Pager.prototype.set = function (i, buf) {
+  var arr = this._array(i, false)
+  var first = this.path[0]
+
+  if (i >= this.length) this.length = i + 1
+
+  if (!buf || (this.zeros && buf.equals && buf.equals(this.zeros))) {
+    arr[first] = undefined
+    return
+  }
+
+  if (this.deduplicate && buf.equals && buf.equals(this.deduplicate)) {
+    buf = this.deduplicate
+  }
+
+  var page = arr[first]
+  var b = truncate(buf, this.pageSize)
+
+  if (page) page.buffer = b
+  else arr[first] = new Page(i, b)
+}
+
+Pager.prototype.toBuffer = function () {
+  var list = new Array(this.length)
+  var empty = alloc(this.pageSize)
+  var ptr = 0
+
+  while (ptr < list.length) {
+    var arr = this._array(ptr, true)
+    for (var i = 0; i < 32768 && ptr < list.length; i++) {
+      list[ptr++] = (arr && arr[i]) ? arr[i].buffer : empty
+    }
+  }
+
+  return Buffer.concat(list)
+}
+
+function grow (pager, index) {
+  while (pager.maxPages < index) {
+    var old = pager.pages
+    pager.pages = new Array(32768)
+    pager.pages[0] = old
+    pager.level++
+    pager.maxPages *= 32768
+  }
+}
+
+function truncate (buf, len) {
+  if (buf.length === len) return buf
+  if (buf.length > len) return buf.slice(0, len)
+  var cpy = alloc(len)
+  buf.copy(cpy)
+  return cpy
+}
+
+function alloc (size) {
+  if (Buffer.alloc) return Buffer.alloc(size)
+  var buf = new Buffer(size)
+  buf.fill(0)
+  return buf
+}
+
+function copy (buf) {
+  var cpy = Buffer.allocUnsafe ? Buffer.allocUnsafe(buf.length) : new Buffer(buf.length)
+  buf.copy(cpy)
+  return cpy
+}
+
+function Page (i, buf) {
+  this.offset = i * buf.length
+  this.buffer = buf
+  this.updated = false
+  this.deduplicate = 0
+}
+
+function factor (n, out) {
+  n = (n - (out[0] = (n & 32767))) / 32768
+  n = (n - (out[1] = (n & 32767))) / 32768
+  out[3] = ((n - (out[2] = (n & 32767))) / 32768) & 32767
+}
diff --git a/NodeAPI/node_modules/memory-pager/package.json b/NodeAPI/node_modules/memory-pager/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..f4847e8cd8415d5b70c907dc090e9803f352783d
--- /dev/null
+++ b/NodeAPI/node_modules/memory-pager/package.json
@@ -0,0 +1,24 @@
+{
+  "name": "memory-pager",
+  "version": "1.5.0",
+  "description": "Access memory using small fixed sized buffers",
+  "main": "index.js",
+  "dependencies": {},
+  "devDependencies": {
+    "standard": "^9.0.0",
+    "tape": "^4.6.3"
+  },
+  "scripts": {
+    "test": "standard && tape test.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/mafintosh/memory-pager.git"
+  },
+  "author": "Mathias Buus (@mafintosh)",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/mafintosh/memory-pager/issues"
+  },
+  "homepage": "https://github.com/mafintosh/memory-pager"
+}
diff --git a/NodeAPI/node_modules/memory-pager/test.js b/NodeAPI/node_modules/memory-pager/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..16382100376b99a29f748969ba419c1b200080d9
--- /dev/null
+++ b/NodeAPI/node_modules/memory-pager/test.js
@@ -0,0 +1,80 @@
+var tape = require('tape')
+var pager = require('./')
+
+tape('get page', function (t) {
+  var pages = pager(1024)
+
+  var page = pages.get(0)
+
+  t.same(page.offset, 0)
+  t.same(page.buffer, Buffer.alloc(1024))
+  t.end()
+})
+
+tape('get page twice', function (t) {
+  var pages = pager(1024)
+  t.same(pages.length, 0)
+
+  var page = pages.get(0)
+
+  t.same(page.offset, 0)
+  t.same(page.buffer, Buffer.alloc(1024))
+  t.same(pages.length, 1)
+
+  var other = pages.get(0)
+
+  t.same(other, page)
+  t.end()
+})
+
+tape('get no mutable page', function (t) {
+  var pages = pager(1024)
+
+  t.ok(!pages.get(141, true))
+  t.ok(pages.get(141))
+  t.ok(pages.get(141, true))
+
+  t.end()
+})
+
+tape('get far out page', function (t) {
+  var pages = pager(1024)
+
+  var page = pages.get(1000000)
+
+  t.same(page.offset, 1000000 * 1024)
+  t.same(page.buffer, Buffer.alloc(1024))
+  t.same(pages.length, 1000000 + 1)
+
+  var other = pages.get(1)
+
+  t.same(other.offset, 1024)
+  t.same(other.buffer, Buffer.alloc(1024))
+  t.same(pages.length, 1000000 + 1)
+  t.ok(other !== page)
+
+  t.end()
+})
+
+tape('updates', function (t) {
+  var pages = pager(1024)
+
+  t.same(pages.lastUpdate(), null)
+
+  var page = pages.get(10)
+
+  page.buffer[42] = 1
+  pages.updated(page)
+
+  t.same(pages.lastUpdate(), page)
+  t.same(pages.lastUpdate(), null)
+
+  page.buffer[42] = 2
+  pages.updated(page)
+  pages.updated(page)
+
+  t.same(pages.lastUpdate(), page)
+  t.same(pages.lastUpdate(), null)
+
+  t.end()
+})
diff --git a/NodeAPI/node_modules/mongodb/HISTORY.md b/NodeAPI/node_modules/mongodb/HISTORY.md
new file mode 100644
index 0000000000000000000000000000000000000000..ad939336b7afaac4827335fa0e371f4675a1b803
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/HISTORY.md
@@ -0,0 +1,2881 @@
+# Changelog
+
+All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+
+### [3.6.8](https://github.com/mongodb/node-mongodb-native/compare/v3.6.7...v3.6.8) (2021-05-21)
+
+
+### Bug Fixes
+
+* **cmap:** undo flipping of `beforeHandshake` flag for timeout errors ([#2813](https://github.com/mongodb/node-mongodb-native/issues/2813)) ([6e3bab3](https://github.com/mongodb/node-mongodb-native/commit/6e3bab32204ea905ab9b949edccb68556b50d382))
+
+### [3.6.7](https://github.com/mongodb/node-mongodb-native/compare/v3.6.6...v3.6.7) (2021-05-18)
+
+
+### Bug Fixes
+
+* **docs:** removing incorrect apm docs ([#2793](https://github.com/mongodb/node-mongodb-native/issues/2793)) ([971259a](https://github.com/mongodb/node-mongodb-native/commit/971259a868a8018e90ebc2f28d151eb7af3dd50a))
+* **NODE-3173:** Preserve sort key order for numeric string keys ([#2790](https://github.com/mongodb/node-mongodb-native/issues/2790)) ([730f43a](https://github.com/mongodb/node-mongodb-native/commit/730f43af6d9e53603af998353b720d8161426d8c))
+* **NODE-3176:** handle errors from MessageStream ([#2774](https://github.com/mongodb/node-mongodb-native/issues/2774)) ([f1afcc4](https://github.com/mongodb/node-mongodb-native/commit/f1afcc4efbc41ce436812a6bfa22843e939ab5cf))
+* **NODE-3192:** check clusterTime is defined before access ([#2806](https://github.com/mongodb/node-mongodb-native/issues/2806)) ([6ceace6](https://github.com/mongodb/node-mongodb-native/commit/6ceace6b245c42b8498fb1b13e7c37a97a46946d))
+* **NODE-3252:** state transistion from DISCONNECTED ([#2807](https://github.com/mongodb/node-mongodb-native/issues/2807)) ([5d8f649](https://github.com/mongodb/node-mongodb-native/commit/5d8f6493a0ba4b525434c0868e2ae12315b4c249))
+* **sdam:** topology no longer causes close event ([#2791](https://github.com/mongodb/node-mongodb-native/issues/2791)) ([16e7064](https://github.com/mongodb/node-mongodb-native/commit/16e70642f25954a03b91a2c2991cea96b8356de7))
+* invalid case on writeconcern makes skip check fail ([#2773](https://github.com/mongodb/node-mongodb-native/issues/2773)) ([b1363c2](https://github.com/mongodb/node-mongodb-native/commit/b1363c26db5da5003f9db43be7e8d6e9007d45bd))
+
+### [3.6.6](https://github.com/mongodb/node-mongodb-native/compare/v3.6.5...v3.6.6) (2021-04-06)
+
+
+### Bug Fixes
+
+* always close gridfs upload stream on finish ([#2758](https://github.com/mongodb/node-mongodb-native/issues/2758)) ([c976a01](https://github.com/mongodb/node-mongodb-native/commit/c976a01bf385941bee07fa7f021adf1d425109a8))
+* **csfle:** ensure that monitoring connections are not encrypted ([#2749](https://github.com/mongodb/node-mongodb-native/issues/2749)) ([86bddf1](https://github.com/mongodb/node-mongodb-native/commit/86bddf1ef516d6b8c752082e33c15624753579ab))
+* ensure cursor readPreference is applied to find operations ([#2751](https://github.com/mongodb/node-mongodb-native/issues/2751)) ([91ba19e](https://github.com/mongodb/node-mongodb-native/commit/91ba19efdc4713903584c6161cfdd7b91b0e61f9))
+* ensure monitor has rtt pinger in when calculating rtt ([#2757](https://github.com/mongodb/node-mongodb-native/issues/2757)) ([b94519b](https://github.com/mongodb/node-mongodb-native/commit/b94519ba894b4442d3dabbac59bd12784d8b7178))
+* no infinite loop on windows requiring optional deps ([f2a4ff8](https://github.com/mongodb/node-mongodb-native/commit/f2a4ff870178fbbe8de616c45891368665f29f4b))
+* **NODE-2995:** Add shared metadata MongoClient ([#2760](https://github.com/mongodb/node-mongodb-native/issues/2760)) ([9256242](https://github.com/mongodb/node-mongodb-native/commit/9256242d51c037059c0af5ada9639fc0a74ad033))
+* **NODE-3109:** prevent servername from being IP ([#2763](https://github.com/mongodb/node-mongodb-native/issues/2763)) ([312ffef](https://github.com/mongodb/node-mongodb-native/commit/312ffef18c66a0020f19bdc1d654987d9148d709))
+
+### [3.6.5](https://github.com/mongodb/node-mongodb-native/compare/v3.6.4...v3.6.5) (2021-03-16)
+
+
+### Bug Fixes
+
+* MongoError circular dependency warning ([#2734](https://github.com/mongodb/node-mongodb-native/issues/2734)) ([d67ffa7](https://github.com/mongodb/node-mongodb-native/commit/d67ffa7a2e3f86734c7e9b6944aab1d765b9e75e))
+* move session support check to operation layer ([#2739](https://github.com/mongodb/node-mongodb-native/issues/2739)) ([8b370a7](https://github.com/mongodb/node-mongodb-native/commit/8b370a7ad784f5759c964cdfaec62e06c896dc95))
+* session support detection spec compliance ([#2732](https://github.com/mongodb/node-mongodb-native/issues/2732)) ([9baec71](https://github.com/mongodb/node-mongodb-native/commit/9baec7128f612f2d9c290c85d24e33602f911499))
+* use emitWarning API for internal messages ([#2743](https://github.com/mongodb/node-mongodb-native/issues/2743)) ([8bd9777](https://github.com/mongodb/node-mongodb-native/commit/8bd9777b0aedd56b81675c3e79fae63432319982))
+
+### [3.6.4](https://github.com/mongodb/node-mongodb-native/compare/v3.6.3...v3.6.4) (2021-02-02)
+
+
+### Features
+
+* add explain support ([#2626](https://github.com/mongodb/node-mongodb-native/issues/2626)) ([a827807](https://github.com/mongodb/node-mongodb-native/commit/a8278070992d2de4134dc0841b4027a6cc745a93))
+* Deprecate top-level write concern option keys  ([#2624](https://github.com/mongodb/node-mongodb-native/issues/2624)) ([0516d93](https://github.com/mongodb/node-mongodb-native/commit/0516d93f74de4b58a99e8455e59678d4b09cd4a7))
+
+
+### Bug Fixes
+
+* Allow GridFS write stream to destroy ([#2702](https://github.com/mongodb/node-mongodb-native/issues/2702)) ([b5e9d67](https://github.com/mongodb/node-mongodb-native/commit/b5e9d67d5cd9b1912a349789cf2a122e00a46d1b))
+* awaitable isMaster timeout must respect connectTimeoutMS ([#2627](https://github.com/mongodb/node-mongodb-native/issues/2627)) ([b365c50](https://github.com/mongodb/node-mongodb-native/commit/b365c5061ded832e1682167edac58e8a04b05fc4))
+* don't add empty query string items to connection string ([8897259](https://github.com/mongodb/node-mongodb-native/commit/889725980ec1e3b4be4a74170bea0a3e3d23cf13))
+* don't reset monitor if we aren't streaming topology changes ([a10171b](https://github.com/mongodb/node-mongodb-native/commit/a10171b57d2414f6df2aa8ffe9c2d3938ad838d1))
+* dont parse tls/ssl file paths in uri ([#2718](https://github.com/mongodb/node-mongodb-native/issues/2718)) ([f89e4c1](https://github.com/mongodb/node-mongodb-native/commit/f89e4c1bd59c64664e8c9aa218bcb856be325d34))
+* hasAtomicOperator check respects toBSON transformation ([#2696](https://github.com/mongodb/node-mongodb-native/issues/2696)) ([60936dc](https://github.com/mongodb/node-mongodb-native/commit/60936dca74167de239d1bb51a23cc9870860bdc4))
+* honor ignoreUndefined on findAndModify commands ([#2671](https://github.com/mongodb/node-mongodb-native/issues/2671)) ([a25b67c](https://github.com/mongodb/node-mongodb-native/commit/a25b67c6ac13b6347cb78c4fc56613f3daf44300))
+* ignore ENOTFOUND during TXT record lookup ([2036fe7](https://github.com/mongodb/node-mongodb-native/commit/2036fe7b298b9678e29ede87c1035c748ff89fcd))
+* respect readPreference and writeConcern from connection string ([#2711](https://github.com/mongodb/node-mongodb-native/issues/2711)) ([b657c8c](https://github.com/mongodb/node-mongodb-native/commit/b657c8c4f3f86018cc4824f84cb22e1527d9f9af))
+* restore auto direct connection behavior ([#2719](https://github.com/mongodb/node-mongodb-native/issues/2719)) ([617d9de](https://github.com/mongodb/node-mongodb-native/commit/617d9dec5180c5f7b67bd8c944c168d4cbd27e1c))
+* support empty TXT records in legacy url parser ([2fa5c5f](https://github.com/mongodb/node-mongodb-native/commit/2fa5c5f2a113920baa8e67a1c0d65432690d37fc))
+* transition topology state before async calls ([#2637](https://github.com/mongodb/node-mongodb-native/issues/2637)) ([9df093c](https://github.com/mongodb/node-mongodb-native/commit/9df093c1d46e1f8616c7a979324923205ac3dcd2))
+* **cursor:** don't use other operation's session for cloned cursor operation ([#2705](https://github.com/mongodb/node-mongodb-native/issues/2705)) ([8082c89](https://github.com/mongodb/node-mongodb-native/commit/8082c89f8ef3624d22f4bdd6066b6f72c44f763d))
+* **find:** correctly translate timeout option into noCursorTimeout ([#2700](https://github.com/mongodb/node-mongodb-native/issues/2700)) ([e257e6b](https://github.com/mongodb/node-mongodb-native/commit/e257e6b19d810920bafc579e725e09bd0607b74b))
+
+<a name="3.6.3"></a>
+## [3.6.3](https://github.com/mongodb/node-mongodb-native/compare/v3.6.1...v3.6.3) (2020-11-06)
+
+
+### Bug Fixes
+
+* add peerDependenciesMeta to mark optional deps ([#2606](https://github.com/mongodb/node-mongodb-native/issues/2606)) ([186090e](https://github.com/mongodb/node-mongodb-native/commit/186090e))
+* adds topology discovery for sharded cluster ([f8fd310](https://github.com/mongodb/node-mongodb-native/commit/f8fd310))
+* allow event loop to process during wait queue processing ([#2537](https://github.com/mongodb/node-mongodb-native/issues/2537)) ([4e03dfa](https://github.com/mongodb/node-mongodb-native/commit/4e03dfa))
+* Change socket timeout default to 0 ([#2572](https://github.com/mongodb/node-mongodb-native/issues/2572)) ([89b77ed](https://github.com/mongodb/node-mongodb-native/commit/89b77ed))
+* connection leak if wait queue member cancelled ([cafaa1b](https://github.com/mongodb/node-mongodb-native/commit/cafaa1b))
+* correctly assign username to X509 auth command ([#2587](https://github.com/mongodb/node-mongodb-native/issues/2587)) ([9110a45](https://github.com/mongodb/node-mongodb-native/commit/9110a45))
+* correctly re-establishes pipe destinations ([a6e7caf](https://github.com/mongodb/node-mongodb-native/commit/a6e7caf))
+* Fix test filters and revert mocha version ([#2558](https://github.com/mongodb/node-mongodb-native/issues/2558)) ([0e5c45a](https://github.com/mongodb/node-mongodb-native/commit/0e5c45a))
+* move kerberos client setup from prepare to auth ([#2608](https://github.com/mongodb/node-mongodb-native/issues/2608)) ([033b6e7](https://github.com/mongodb/node-mongodb-native/commit/033b6e7))
+* permit waking async interval with unreliable clock ([e0e11bb](https://github.com/mongodb/node-mongodb-native/commit/e0e11bb))
+* remove geoNear deprecation ([4955a52](https://github.com/mongodb/node-mongodb-native/commit/4955a52))
+* revert use of setImmediate to process.nextTick ([#2611](https://github.com/mongodb/node-mongodb-native/issues/2611)) ([c9f9d5e](https://github.com/mongodb/node-mongodb-native/commit/c9f9d5e))
+* sets primary read preference for writes ([ddcd03d](https://github.com/mongodb/node-mongodb-native/commit/ddcd03d))
+* use options for readPreference in client ([6acced0](https://github.com/mongodb/node-mongodb-native/commit/6acced0))
+* user roles take single string & DDL readPreference tests ([967de13](https://github.com/mongodb/node-mongodb-native/commit/967de13))
+
+
+
+<a name="3.6.2"></a>
+## [3.6.2](https://github.com/mongodb/node-mongodb-native/compare/v3.6.1...v3.6.2) (2020-09-10)
+
+
+### Bug Fixes
+
+* allow event loop to process during wait queue processing ([#2537](https://github.com/mongodb/node-mongodb-native/issues/2537)) ([4e03dfa](https://github.com/mongodb/node-mongodb-native/commit/4e03dfa))
+
+
+
+<a name="3.6.1"></a>
+## [3.6.1](https://github.com/mongodb/node-mongodb-native/compare/v3.6.0...v3.6.1) (2020-09-02)
+
+
+### Bug Fixes
+
+* add host/port to cmap connection ([06a2444](https://github.com/mongodb/node-mongodb-native/commit/06a2444))
+* update full list of index options ([0af3191](https://github.com/mongodb/node-mongodb-native/commit/0af3191))
+
+
+### Features
+
+* **db:** deprecate createCollection strict mode ([4cc6bcc](https://github.com/mongodb/node-mongodb-native/commit/4cc6bcc))
+
+
+
+<a name="3.6.0-beta.0"></a>
+# [3.6.0-beta.0](https://github.com/mongodb/node-mongodb-native/compare/v3.5.5...v3.6.0-beta.0) (2020-04-14)
+
+### Bug Fixes
+
+* always return empty array for selection on unknown topology ([af57b57](https://github.com/mongodb/node-mongodb-native/commit/af57b57))
+* always return empty array for selection on unknown topology ([f9e786a](https://github.com/mongodb/node-mongodb-native/commit/f9e786a))
+* correctly use template string for connection string error message ([814e278](https://github.com/mongodb/node-mongodb-native/commit/814e278))
+* createCollection only uses listCollections in strict mode ([d368f12](https://github.com/mongodb/node-mongodb-native/commit/d368f12))
+* don't depend on private node api for `Timeout` wrapper ([e6dc1f4](https://github.com/mongodb/node-mongodb-native/commit/e6dc1f4))
+* don't throw if `withTransaction()` callback rejects with a null reason ([153646c](https://github.com/mongodb/node-mongodb-native/commit/153646c))
+* **cursor:** transforms should only be applied once to documents ([704f30a](https://github.com/mongodb/node-mongodb-native/commit/704f30a))
+* only consider MongoError subclasses for retryability ([265fe40](https://github.com/mongodb/node-mongodb-native/commit/265fe40))
+* **ChangeStream:** whitelist change stream resumable errors ([8a9c108](https://github.com/mongodb/node-mongodb-native/commit/8a9c108)), closes [#17](https://github.com/mongodb/node-mongodb-native/issues/17) [#18](https://github.com/mongodb/node-mongodb-native/issues/18)
+* **sdam:** use ObjectId comparison to track maxElectionId ([db991d6](https://github.com/mongodb/node-mongodb-native/commit/db991d6))
+* only mark server session dirty if the client session is alive ([611be8d](https://github.com/mongodb/node-mongodb-native/commit/611be8d))
+* pass options into `commandSupportsReadConcern` ([e855c83](https://github.com/mongodb/node-mongodb-native/commit/e855c83))
+* polyfill for util.promisify ([1c4cf6c](https://github.com/mongodb/node-mongodb-native/commit/1c4cf6c))
+* single `readPreferenceTags` should be parsed as an array ([a50611b](https://github.com/mongodb/node-mongodb-native/commit/a50611b))
+* store name of collection for more informative error messages ([979d41e](https://github.com/mongodb/node-mongodb-native/commit/979d41e))
+* support write concern provided as string in `fromOptions` ([637f428](https://github.com/mongodb/node-mongodb-native/commit/637f428))
+* use properly camel cased form of `mapReduce` for command ([c1ed2c1](https://github.com/mongodb/node-mongodb-native/commit/c1ed2c1))
+
+
+### Features
+
+* add MONGODB-AWS as a supported auth mechanism ([7f3cfba](https://github.com/mongodb/node-mongodb-native/commit/7f3cfba))
+* bump wire protocol version for 4.4 ([6d3f313](https://github.com/mongodb/node-mongodb-native/commit/6d3f313))
+* deprecate `oplogReplay` for find commands ([24155e7](https://github.com/mongodb/node-mongodb-native/commit/24155e7))
+* directConnection adds unify behavior for replica set discovery ([c5d60fc](https://github.com/mongodb/node-mongodb-native/commit/c5d60fc))
+* expand use of error labels for retryable writes ([c775a4a](https://github.com/mongodb/node-mongodb-native/commit/c775a4a))
+* support `allowDiskUse` for find commands ([dbc0b37](https://github.com/mongodb/node-mongodb-native/commit/dbc0b37))
+* support creating collections and indexes in transactions ([17e4c88](https://github.com/mongodb/node-mongodb-native/commit/17e4c88))
+* support passing a hint to findOneAndReplace/findOneAndUpdate ([faee15b](https://github.com/mongodb/node-mongodb-native/commit/faee15b))
+* support shorter SCRAM conversations ([6b9ff05](https://github.com/mongodb/node-mongodb-native/commit/6b9ff05))
+* use error labels for retryable writes in legacy topologies ([fefc165](https://github.com/mongodb/node-mongodb-native/commit/fefc165))
+
+
+
+
+<a name="3.5.7"></a>
+## [3.5.7](https://github.com/mongodb/node-mongodb-native/compare/v3.5.6...v3.5.7) (2020-04-29)
+
+
+### Bug Fixes
+
+* limit growth of server sessions through lazy acquisition ([3d05a6d](https://github.com/mongodb/node-mongodb-native/commit/3d05a6d))
+* remove circular dependency warnings on node 14 ([56a1b8a](https://github.com/mongodb/node-mongodb-native/commit/56a1b8a))
+
+
+
+<a name="3.5.6"></a>
+## [3.5.6](https://github.com/mongodb/node-mongodb-native/compare/v3.5.5...v3.5.6) (2020-04-14)
+
+### Bug Fixes
+
+* always return empty array for selection on unknown topology ([f9e786a](https://github.com/mongodb/node-mongodb-native/commit/f9e786a))
+* createCollection only uses listCollections in strict mode ([d368f12](https://github.com/mongodb/node-mongodb-native/commit/d368f12))
+* don't throw if `withTransaction()` callback rejects with a null reason ([153646c](https://github.com/mongodb/node-mongodb-native/commit/153646c))
+* only mark server session dirty if the client session is alive ([611be8d](https://github.com/mongodb/node-mongodb-native/commit/611be8d))
+* polyfill for util.promisify ([1c4cf6c](https://github.com/mongodb/node-mongodb-native/commit/1c4cf6c))
+* single `readPreferenceTags` should be parsed as an array ([a50611b](https://github.com/mongodb/node-mongodb-native/commit/a50611b))
+* **cursor:** transforms should only be applied once to documents ([704f30a](https://github.com/mongodb/node-mongodb-native/commit/704f30a))
+
+
+
+<a name="3.5.5"></a>
+## [3.5.5](https://github.com/mongodb/node-mongodb-native/compare/v3.5.4...v3.5.5) (2020-03-11)
+
+
+### Bug Fixes
+
+* correctly use template string for connection string error message ([6238c84](https://github.com/mongodb/node-mongodb-native/commit/6238c84))
+* don't depend on private node api for `Timeout` wrapper ([3ddaa3e](https://github.com/mongodb/node-mongodb-native/commit/3ddaa3e))
+* multiple concurrent attempts to process the queue may fail ([f69f51c](https://github.com/mongodb/node-mongodb-native/commit/f69f51c))
+* pass optional promise lib to maybePromise ([cde11ec](https://github.com/mongodb/node-mongodb-native/commit/cde11ec))
+* **cursor:** hasNext consumes documents on cursor with limit ([ef04d00](https://github.com/mongodb/node-mongodb-native/commit/ef04d00))
+
+
+
+<a name="3.5.4"></a>
+## [3.5.4](https://github.com/mongodb/node-mongodb-native/compare/v3.5.3...v3.5.4) (2020-02-25)
+
+
+### Bug Fixes
+
+* **cmap:** don't run min connection thread if no minimum specified ([2d1b713](https://github.com/mongodb/node-mongodb-native/commit/2d1b713))
+* **sdam:** use ObjectId comparison to track maxElectionId ([a1e0849](https://github.com/mongodb/node-mongodb-native/commit/a1e0849))
+* **topology:** ensure selection wait queue is always processed ([bf701d6](https://github.com/mongodb/node-mongodb-native/commit/bf701d6))
+* **topology:** enter `STATE_CLOSING` before draining waitQueue ([494dffb](https://github.com/mongodb/node-mongodb-native/commit/494dffb))
+* don't consume first document when calling `hasNext` on cursor ([bb359a1](https://github.com/mongodb/node-mongodb-native/commit/bb359a1))
+
+
+### Features
+
+* add utility helper for returning promises or using callbacks ([ac9e4c9](https://github.com/mongodb/node-mongodb-native/commit/ac9e4c9))
+
+
+
+<a name="3.5.3"></a>
+## [3.5.3](https://github.com/mongodb/node-mongodb-native/compare/v3.5.2...v3.5.3) (2020-02-12)
+
+
+### Bug Fixes
+
+* **message-stream:** support multiple inbound message packets ([8388443](https://github.com/mongodb/node-mongodb-native/commit/8388443))
+* **server:** non-timeout network errors transition to Unknown state ([fa4b01b](https://github.com/mongodb/node-mongodb-native/commit/fa4b01b))
+
+
+### Features
+
+* **connection:** support exhaust behavior at the transport level ([9ccf268](https://github.com/mongodb/node-mongodb-native/commit/9ccf268))
+
+
+
+<a name="3.5.2"></a>
+## [3.5.2](https://github.com/mongodb/node-mongodb-native/compare/v3.5.1...v3.5.2) (2020-01-20)
+
+
+### Bug Fixes
+
+* properly handle err messages in MongoDB 2.6 servers ([0f4ab38](https://github.com/mongodb/node-mongodb-native/commit/0f4ab38))
+* **topology:** always emit SDAM unrecoverable errors ([57f158f](https://github.com/mongodb/node-mongodb-native/commit/57f158f))
+
+
+
+<a name="3.5.1"></a>
+## [3.5.1](https://github.com/mongodb/node-mongodb-native/compare/v3.5.0...v3.5.1) (2020-01-17)
+
+
+### Bug Fixes
+
+* **cmap:** accept all node TLS options as pool options ([5995d1d](https://github.com/mongodb/node-mongodb-native/commit/5995d1d))
+* **cmap:** error wait queue members on failed connection creation ([d13b153](https://github.com/mongodb/node-mongodb-native/commit/d13b153))
+* **connect:** listen to `secureConnect` for tls connections ([f8bdb8d](https://github.com/mongodb/node-mongodb-native/commit/f8bdb8d))
+* **transactions:** use options helper to resolve read preference ([9698a76](https://github.com/mongodb/node-mongodb-native/commit/9698a76))
+* **uri_parser:** TLS uri variants imply `ssl=true` ([c8d182e](https://github.com/mongodb/node-mongodb-native/commit/c8d182e))
+
+
+
+<a name="3.5.0"></a>
+# [3.5.0](https://github.com/mongodb/node-mongodb-native/compare/v3.4.1...v3.5.0) (2020-01-14)
+
+
+### Bug Fixes
+
+* copy `ssl` option to pool connection options ([563ced6](https://github.com/mongodb/node-mongodb-native/commit/563ced6))
+* destroy connections marked as closed on checkIn / checkOut ([2bd17a6](https://github.com/mongodb/node-mongodb-native/commit/2bd17a6))
+* ensure sync errors are thrown, and don't callback twice ([cca5b49](https://github.com/mongodb/node-mongodb-native/commit/cca5b49))
+* ignore connection errors during pool destruction ([b8805dc](https://github.com/mongodb/node-mongodb-native/commit/b8805dc))
+* not all message payloads are arrays of Buffer ([e4df5f4](https://github.com/mongodb/node-mongodb-native/commit/e4df5f4))
+* recover on network error during initial connect ([a13dc68](https://github.com/mongodb/node-mongodb-native/commit/a13dc68))
+* remove servers with me mismatch in `updateRsFromPrimary` ([95a772e](https://github.com/mongodb/node-mongodb-native/commit/95a772e))
+* report the correct platform in client metadata ([35d0274](https://github.com/mongodb/node-mongodb-native/commit/35d0274))
+* reschedule monitoring before emitting heartbeat events ([7fcbeb5](https://github.com/mongodb/node-mongodb-native/commit/7fcbeb5))
+* socket timeout for handshake should be `connectTimeoutMS` ([c83af9a](https://github.com/mongodb/node-mongodb-native/commit/c83af9a))
+* timed out streams should be destroyed on `timeout` event ([5319ff9](https://github.com/mongodb/node-mongodb-native/commit/5319ff9))
+* use remote address for stream identifier ([f13c20b](https://github.com/mongodb/node-mongodb-native/commit/f13c20b))
+* used weighted RTT calculation for server selection ([d446be5](https://github.com/mongodb/node-mongodb-native/commit/d446be5))
+* **execute-operation:** don't swallow synchronous errors ([0a2d4e9](https://github.com/mongodb/node-mongodb-native/commit/0a2d4e9))
+* **gridfs:** make a copy of chunk before writing to server ([b4ec5b8](https://github.com/mongodb/node-mongodb-native/commit/b4ec5b8))
+
+
+### Features
+
+* add a `withConnection` helper to the connection pool ([d59dced](https://github.com/mongodb/node-mongodb-native/commit/d59dced))
+* include `connectionId` for APM with new CMAP connection pool ([9bd360c](https://github.com/mongodb/node-mongodb-native/commit/9bd360c))
+* integrate CMAP connection pool into unified topology ([9dd3939](https://github.com/mongodb/node-mongodb-native/commit/9dd3939))
+* introduce `MongoServerSelectionError` ([0cf7ec9](https://github.com/mongodb/node-mongodb-native/commit/0cf7ec9))
+* introduce a class for tracking stream specific attributes ([f6bf82c](https://github.com/mongodb/node-mongodb-native/commit/f6bf82c))
+* introduce a new `Monitor` type for server monitoring ([2bfe2a1](https://github.com/mongodb/node-mongodb-native/commit/2bfe2a1))
+* relay all CMAP events to MongoClient ([1aea4de](https://github.com/mongodb/node-mongodb-native/commit/1aea4de))
+* support socket timeouts on a per-connection level ([93e8ad0](https://github.com/mongodb/node-mongodb-native/commit/93e8ad0))
+
+
+
+<a name="3.4.1"></a>
+## [3.4.1](https://github.com/mongodb/node-mongodb-native/compare/v3.4.0...v3.4.1) (2019-12-19)
+
+
+### Bug Fixes
+
+* **bulk:** use original indexes as map for current op index ([20800ac](https://github.com/mongodb/node-mongodb-native/commit/20800ac))
+* always check for network errors during SCRAM conversation ([e46a70e](https://github.com/mongodb/node-mongodb-native/commit/e46a70e))
+
+
+
+<a name="3.4.0"></a>
+# [3.4.0](https://github.com/mongodb/node-mongodb-native/compare/v3.3.5...v3.4.0) (2019-12-10)
+
+
+### Bug Fixes
+
+* **bulk:** use operation index from input to report operation error ([f713b13](https://github.com/mongodb/node-mongodb-native/commit/f713b13))
+* **command:** only add TransientTransactionError label when in a transaction ([478d714](https://github.com/mongodb/node-mongodb-native/commit/478d714))
+* **compression:** recalculate opcode after determine OP_COMPRESSED ([022f51b](https://github.com/mongodb/node-mongodb-native/commit/022f51b))
+* **connect:** connect with family 0 instead of family 4 ([db07366](https://github.com/mongodb/node-mongodb-native/commit/db07366))
+* **connection:** timed out connections should not be half closed ([850f4f5](https://github.com/mongodb/node-mongodb-native/commit/850f4f5))
+* **cursor:** call `initialize` after session support check ([e50c51a](https://github.com/mongodb/node-mongodb-native/commit/e50c51a))
+* **encryption:** autoEncryption must error on mongodb < 4.2 ([c274615](https://github.com/mongodb/node-mongodb-native/commit/c274615))
+* **encryption:** do not attempt to merge autoEncryption options ([e27fdf9](https://github.com/mongodb/node-mongodb-native/commit/e27fdf9))
+* **encryption:** encryption uses smaller batch size ([cb78e69](https://github.com/mongodb/node-mongodb-native/commit/cb78e69))
+* **encryption:** respect bypassAutoEncryption ([e927499](https://github.com/mongodb/node-mongodb-native/commit/e927499))
+* **encryption:** respect user bson options when using autoEncryption ([cb7a3f7](https://github.com/mongodb/node-mongodb-native/commit/cb7a3f7))
+* add calculated duration to server as `roundTripTime` ([cb107a8](https://github.com/mongodb/node-mongodb-native/commit/cb107a8))
+* **mongodb+srv:** respect overriding SRV-provided properties ([ea83360](https://github.com/mongodb/node-mongodb-native/commit/ea83360))
+* **pool:** flush workItems after next tick to avoid dupe selection ([3ec49e5](https://github.com/mongodb/node-mongodb-native/commit/3ec49e5))
+* **pool:** support a `drain` event for use with unified topology ([da931ea](https://github.com/mongodb/node-mongodb-native/commit/da931ea))
+* **scram:** verify server digest, ensuring mutual authentication ([806cd62](https://github.com/mongodb/node-mongodb-native/commit/806cd62))
+* **srv-poller:** always provide a valid number for `intervalMS` ([afb125f](https://github.com/mongodb/node-mongodb-native/commit/afb125f))
+* **topology:** correct logic for checking for sessions support ([8d157c8](https://github.com/mongodb/node-mongodb-native/commit/8d157c8))
+* **topology:** don't drain iteration timers on server selection ([fed6a57](https://github.com/mongodb/node-mongodb-native/commit/fed6a57))
+
+
+### Features
+
+* add `MessageStream` for streamed wire protocol messaging ([8c44044](https://github.com/mongodb/node-mongodb-native/commit/8c44044))
+* introduce a modern `Connection` replacement for CMAP ([7890e48](https://github.com/mongodb/node-mongodb-native/commit/7890e48))
+* support connection establishment cancellation ([2014b7b](https://github.com/mongodb/node-mongodb-native/commit/2014b7b))
+* support driver info for drivers wrapping the node driver ([1b6670b](https://github.com/mongodb/node-mongodb-native/commit/1b6670b))
+
+
+
+<a name="3.3.5"></a>
+## [3.3.5](https://github.com/mongodb/node-mongodb-native/compare/v3.3.4...v3.3.5) (2019-11-26)
+
+
+### Bug Fixes
+
+* **bulk:** use operation index from input to report operation error ([08ee53e](https://github.com/mongodb/node-mongodb-native/commit/08ee53e))
+* **command:** only add TransientTransactionError label when in a transaction ([8bab074](https://github.com/mongodb/node-mongodb-native/commit/8bab074))
+* **connect:** connect with family 0 instead of family 4 ([7a41279](https://github.com/mongodb/node-mongodb-native/commit/7a41279))
+* **cursor:** call `initialize` after session support check ([3b076b3](https://github.com/mongodb/node-mongodb-native/commit/3b076b3))
+* **mongodb+srv:** respect overriding SRV-provided properties ([5ed4c07](https://github.com/mongodb/node-mongodb-native/commit/5ed4c07))
+* **pool:** support a `drain` event for use with unified topology ([3471c28](https://github.com/mongodb/node-mongodb-native/commit/3471c28))
+* **topology:** correct logic for checking for sessions support ([2d976bd](https://github.com/mongodb/node-mongodb-native/commit/2d976bd))
+* **topology:** don't drain iteration timers on server selection ([261f1e5](https://github.com/mongodb/node-mongodb-native/commit/261f1e5))
+
+
+### Features
+
+* support driver info for drivers wrapping the node driver ([d85c4a8](https://github.com/mongodb/node-mongodb-native/commit/d85c4a8))
+
+
+
+<a name="3.3.4"></a>
+## [3.3.4](https://github.com/mongodb/node-mongodb-native/compare/v3.3.3...v3.3.4) (2019-11-11)
+
+
+### Bug Fixes
+
+* **close:** the unified topology emits a close event on close now ([ee0db01](https://github.com/mongodb/node-mongodb-native/commit/ee0db01))
+* **connect:** prevent multiple callbacks in error scenarios ([5f6a787](https://github.com/mongodb/node-mongodb-native/commit/5f6a787))
+* **monitoring:** incorrect states used to determine rescheduling ([ec1e04c](https://github.com/mongodb/node-mongodb-native/commit/ec1e04c))
+* **pool:** don't reset a pool if we'not already connected ([32316e4](https://github.com/mongodb/node-mongodb-native/commit/32316e4))
+* **pool:** only transition to `DISCONNECTED` if reconnect enabled ([43d461e](https://github.com/mongodb/node-mongodb-native/commit/43d461e))
+* **replset:** don't leak servers failing to connect ([f209160](https://github.com/mongodb/node-mongodb-native/commit/f209160))
+* **replset:** use correct `topologyId` for event emission ([19549ff](https://github.com/mongodb/node-mongodb-native/commit/19549ff))
+* **sdam:** `minHeartbeatIntervalMS` => `minHeartbeatFrequencyMS` ([af9fb45](https://github.com/mongodb/node-mongodb-native/commit/af9fb45))
+* **sdam:** don't emit `close` every time a child server closes ([818055a](https://github.com/mongodb/node-mongodb-native/commit/818055a))
+* **sdam:** don't lose servers when they fail monitoring ([8a534bb](https://github.com/mongodb/node-mongodb-native/commit/8a534bb))
+* **sdam:** don't remove unknown servers in topology updates ([1147ebf](https://github.com/mongodb/node-mongodb-native/commit/1147ebf))
+* **sdam:** ignore server errors when closing/closed ([49d7235](https://github.com/mongodb/node-mongodb-native/commit/49d7235))
+* **server:** don't emit error in connect if closing/closed ([62ada2a](https://github.com/mongodb/node-mongodb-native/commit/62ada2a))
+* **server:** ensure state is transitioned to closed on connect fail ([a471707](https://github.com/mongodb/node-mongodb-native/commit/a471707))
+* **topology:** report unified topology as `nodejs` ([d126665](https://github.com/mongodb/node-mongodb-native/commit/d126665))
+* **topology:** set max listeners to infinity for db event relay ([edb1335](https://github.com/mongodb/node-mongodb-native/commit/edb1335))
+
+
+### Features
+
+* **sdam_viz:** add new tool for visualizing driver sdam changes ([738189a](https://github.com/mongodb/node-mongodb-native/commit/738189a))
+* **sdam_viz:** support legacy topologies in sdam_viz tool ([1a5537e](https://github.com/mongodb/node-mongodb-native/commit/1a5537e))
+* **update-hints:** add support for `hint` to all update methods ([720f5e5](https://github.com/mongodb/node-mongodb-native/commit/720f5e5))
+
+
+
+<a name="3.3.3"></a>
+## [3.3.3](https://github.com/mongodb/node-mongodb-native/compare/v3.3.2...v3.3.3) (2019-10-16)
+
+
+### Bug Fixes
+
+* **change_stream:** emit 'close' event if reconnecting failed ([f24c084](https://github.com/mongodb/node-mongodb-native/commit/f24c084))
+* **ChangeStream:** remove startAtOperationTime once we have resumeToken ([362afd8](https://github.com/mongodb/node-mongodb-native/commit/362afd8))
+* **connect:** Switch new Buffer(size) -> Buffer.alloc(size) ([da90c3a](https://github.com/mongodb/node-mongodb-native/commit/da90c3a))
+* **MongoClient:** only check own properties for valid options ([9cde4b9](https://github.com/mongodb/node-mongodb-native/commit/9cde4b9))
+* **mongos:** disconnect proxies which are not mongos instances ([ee53983](https://github.com/mongodb/node-mongodb-native/commit/ee53983))
+* **mongos:** force close servers during reconnect flow ([186263f](https://github.com/mongodb/node-mongodb-native/commit/186263f))
+* **monitoring:** correct spelling mistake for heartbeat event ([21aa117](https://github.com/mongodb/node-mongodb-native/commit/21aa117))
+* **replset:** correct server leak on initial connect ([da39d1e](https://github.com/mongodb/node-mongodb-native/commit/da39d1e))
+* **replset:** destroy primary before removing from replsetstate ([45ac09a](https://github.com/mongodb/node-mongodb-native/commit/45ac09a))
+* **replset:** destroy servers that are removed during SDAM flow ([9ea0190](https://github.com/mongodb/node-mongodb-native/commit/9ea0190))
+* **saslprep:** add in missing saslprep dependency ([41f1165](https://github.com/mongodb/node-mongodb-native/commit/41f1165))
+* **topology:** don't early abort server selection on network errors ([2b6a359](https://github.com/mongodb/node-mongodb-native/commit/2b6a359))
+* **topology:** don't emit server closed event on network error ([194dcf0](https://github.com/mongodb/node-mongodb-native/commit/194dcf0))
+* **topology:** include all BSON types in ctor for bson-ext support ([aa4c832](https://github.com/mongodb/node-mongodb-native/commit/aa4c832))
+* **topology:** respect the `force` parameter for topology close ([d6e8936](https://github.com/mongodb/node-mongodb-native/commit/d6e8936))
+
+### Features
+
+* **Update:** add the ability to specify a pipeline to an update command ([#2017](https://github.com/mongodb/node-mongodb-native/issues/2017)) ([44a4110](https://github.com/mongodb/node-mongodb-native/commit/44a4110))
+* **urlParser:** default useNewUrlParser to true ([52d76e3](https://github.com/mongodb/node-mongodb-native/commit/52d76e3))
+
+<a name="3.2.7"></a>
+## [3.2.7](https://github.com/mongodb/node-mongodb-native/compare/v3.2.6...v3.2.7) (2019-06-04)
+
+
+### Bug Fixes
+
+* **core:** updating core to version 3.2.7 ([2f91466](https://github.com/mongodb/node-mongodb-native/commit/2f91466))
+* **findOneAndReplace:** throw error if atomic operators provided for findOneAndReplace ([6a860a3](https://github.com/mongodb/node-mongodb-native/commit/6a860a3))
+
+
+
+<a name="3.3.2"></a>
+## [3.3.2](https://github.com/mongodb/node-mongodb-native/compare/v3.3.1...v3.3.2) (2019-08-28)
+
+
+### Bug Fixes
+
+* **change-stream:** default to server default batch size ([b3ae4c5](https://github.com/mongodb/node-mongodb-native/commit/b3ae4c5))
+* **execute-operation:** return promise on session support check ([a976c14](https://github.com/mongodb/node-mongodb-native/commit/a976c14))
+* **gridfs-stream:** ensure `close` is emitted after last chunk ([ae94cb9](https://github.com/mongodb/node-mongodb-native/commit/ae94cb9))
+
+
+
+<a name="3.3.1"></a>
+## [3.3.1](https://github.com/mongodb/node-mongodb-native/compare/v3.3.0...v3.3.1) (2019-08-23)
+
+
+### Bug Fixes
+
+* **find:** respect client-level provided read preference ([fec4f15](https://github.com/mongodb/node-mongodb-native/commit/fec4f15))
+* correct inverted defaults for unified topology ([cf598e1](https://github.com/mongodb/node-mongodb-native/commit/cf598e1))
+
+
+
+<a name="3.3.0"></a>
+# [3.3.0](https://github.com/mongodb/node-mongodb-native/compare/v3.3.0-alpha1...v3.3.0) (2019-08-13)
+
+
+### Bug Fixes
+
+* **aggregate-operation:** move type assertions to constructor ([25b27ff](https://github.com/mongodb/node-mongodb-native/commit/25b27ff))
+* **autoEncryption:** tear down mongocryptd client when main client closes ([fe2f57e](https://github.com/mongodb/node-mongodb-native/commit/fe2f57e))
+* **autoEncryption:** use new url parser for autoEncryption client ([d3670c2](https://github.com/mongodb/node-mongodb-native/commit/d3670c2))
+* **Bulk:** change BulkWriteError message to first item from writeErrors ([#2013](https://github.com/mongodb/node-mongodb-native/issues/2013)) ([6bcf1e4](https://github.com/mongodb/node-mongodb-native/commit/6bcf1e4))
+* **change_stream:** emit 'close' event if reconnecting failed ([41aba90](https://github.com/mongodb/node-mongodb-native/commit/41aba90))
+* **change_stream:** emit close event after cursor is closed during error ([c2d80b2](https://github.com/mongodb/node-mongodb-native/commit/c2d80b2))
+* **change-streams:** don't copy irrelevant resume options ([f190072](https://github.com/mongodb/node-mongodb-native/commit/f190072))
+* **changestream:** removes all event listeners on close ([30eeeb5](https://github.com/mongodb/node-mongodb-native/commit/30eeeb5))
+* **ChangeStream:** remove startAtOperationTime once we have resumeToken ([8d27e6e](https://github.com/mongodb/node-mongodb-native/commit/8d27e6e))
+* **ClientSessions:** initialize clientOptions and cluster time ([b95d64e](https://github.com/mongodb/node-mongodb-native/commit/b95d64e))
+* **connect:** don't treat 'connect' as an error event ([170a011](https://github.com/mongodb/node-mongodb-native/commit/170a011))
+* **connect:** fixed syntax issue in connect error handler ([ff7166d](https://github.com/mongodb/node-mongodb-native/commit/ff7166d))
+* **connections_stepdown_tests:** use correct version of mongo for tests ([ce2c9af](https://github.com/mongodb/node-mongodb-native/commit/ce2c9af))
+* **createCollection:** Db.createCollection should pass readConcern to new collection ([#2026](https://github.com/mongodb/node-mongodb-native/issues/2026)) ([6145d4b](https://github.com/mongodb/node-mongodb-native/commit/6145d4b))
+* **cursor:** do not truncate an existing Long ([317055b](https://github.com/mongodb/node-mongodb-native/commit/317055b)), closes [mongodb-js/mongodb-core#441](https://github.com/mongodb-js/mongodb-core/issues/441)
+* **distinct:** return full response if `full` option was specified ([95a7d05](https://github.com/mongodb/node-mongodb-native/commit/95a7d05))
+* **MongoClient:** allow Object.prototype items as db names ([dc6fc37](https://github.com/mongodb/node-mongodb-native/commit/dc6fc37))
+* **MongoClient:** only check own properties for valid options ([c9dc717](https://github.com/mongodb/node-mongodb-native/commit/c9dc717))
+* **OpMsg:** cap requestIds at 0x7fffffff ([c0e87d5](https://github.com/mongodb/node-mongodb-native/commit/c0e87d5))
+* **read-operations:** send sessions on all read operations ([4d45c8a](https://github.com/mongodb/node-mongodb-native/commit/4d45c8a))
+* **ReadPreference:** improve ReadPreference error message and remove irrelevant sharding test ([dd34ce4](https://github.com/mongodb/node-mongodb-native/commit/dd34ce4))
+* **ReadPreference:** only allow valid ReadPreference modes ([06bbef2](https://github.com/mongodb/node-mongodb-native/commit/06bbef2))
+* **replset:** correct legacy max staleness calculation ([2eab8aa](https://github.com/mongodb/node-mongodb-native/commit/2eab8aa))
+* **replset:** introduce a fixed-time server selection loop ([cf53299](https://github.com/mongodb/node-mongodb-native/commit/cf53299))
+* **server:** emit "first connect" error if initial connect fails due to ECONNREFUSED ([#2016](https://github.com/mongodb/node-mongodb-native/issues/2016)) ([5a7b15b](https://github.com/mongodb/node-mongodb-native/commit/5a7b15b))
+* **serverSelection:** make sure to pass session to serverSelection ([eb5cc6b](https://github.com/mongodb/node-mongodb-native/commit/eb5cc6b))
+* **sessions:** ensure an error is thrown when attempting sharded transactions ([3a1fdc1](https://github.com/mongodb/node-mongodb-native/commit/3a1fdc1))
+* **topology:** add new error for retryWrites on MMAPv1 ([392f5a6](https://github.com/mongodb/node-mongodb-native/commit/392f5a6))
+* don't check non-unified topologies for session support check ([2bccd3f](https://github.com/mongodb/node-mongodb-native/commit/2bccd3f))
+* maintain internal database name on collection rename ([884d46f](https://github.com/mongodb/node-mongodb-native/commit/884d46f))
+* only check for transaction state if session exists ([360975a](https://github.com/mongodb/node-mongodb-native/commit/360975a))
+* preserve aggregate explain support for legacy servers ([032b204](https://github.com/mongodb/node-mongodb-native/commit/032b204))
+* read concern only supported for `mapReduce` without inline ([51a36f3](https://github.com/mongodb/node-mongodb-native/commit/51a36f3))
+* reintroduce support for 2.6 listIndexes ([c3bfc05](https://github.com/mongodb/node-mongodb-native/commit/c3bfc05))
+* return `executeOperation` for explain, if promise is desired ([b4a7ad7](https://github.com/mongodb/node-mongodb-native/commit/b4a7ad7))
+* validate atomic operations in all update methods ([88bb77e](https://github.com/mongodb/node-mongodb-native/commit/88bb77e))
+* **transactions:** fix error message for attempting sharded ([eb5dfc9](https://github.com/mongodb/node-mongodb-native/commit/eb5dfc9))
+* **transactions:** fix sharded transaction error logic ([083e18a](https://github.com/mongodb/node-mongodb-native/commit/083e18a))
+
+
+### Features
+
+* **Aggregate:** support ReadConcern in aggregates with $out ([21cdcf0](https://github.com/mongodb/node-mongodb-native/commit/21cdcf0))
+* **AutoEncryption:** improve error message for missing mongodb-client-encryption ([583f29f](https://github.com/mongodb/node-mongodb-native/commit/583f29f))
+* **ChangeStream:** adds new resume functionality to ChangeStreams ([9ec9b8f](https://github.com/mongodb/node-mongodb-native/commit/9ec9b8f))
+* **ChangeStreamCursor:** introduce new cursor type for change streams ([8813eb0](https://github.com/mongodb/node-mongodb-native/commit/8813eb0))
+* **cryptdConnectionString:** makes mongocryptd uri configurable ([#2049](https://github.com/mongodb/node-mongodb-native/issues/2049)) ([a487be4](https://github.com/mongodb/node-mongodb-native/commit/a487be4))
+* **eachAsync:** dedupe async iteration with a common helper ([c296f3a](https://github.com/mongodb/node-mongodb-native/commit/c296f3a))
+* **execute-operation:** allow execution with server selection ([36bc1fd](https://github.com/mongodb/node-mongodb-native/commit/36bc1fd))
+* **pool:** add support for resetting the connection pool ([2d1ff40](https://github.com/mongodb/node-mongodb-native/commit/2d1ff40))
+* **sessions:** track dirty state of sessions, drop after use ([f61df16](https://github.com/mongodb/node-mongodb-native/commit/f61df16))
+* add concept of `data-bearing` type to `ServerDescription` ([852e14f](https://github.com/mongodb/node-mongodb-native/commit/852e14f))
+* **transaction:** allow applications to set maxTimeMS for commitTransaction ([b3948aa](https://github.com/mongodb/node-mongodb-native/commit/b3948aa))
+* **Update:** add the ability to specify a pipeline to an update command ([#2017](https://github.com/mongodb/node-mongodb-native/issues/2017)) ([dc1387e](https://github.com/mongodb/node-mongodb-native/commit/dc1387e))
+* add `known`, `data-bearing` filters to `TopologyDescription` ([d0ccb56](https://github.com/mongodb/node-mongodb-native/commit/d0ccb56))
+* perform selection before cursor operation execution if needed ([808cf37](https://github.com/mongodb/node-mongodb-native/commit/808cf37))
+* perform selection before operation execution if needed ([1a25876](https://github.com/mongodb/node-mongodb-native/commit/1a25876))
+* support explain operations in `CommandOperationV2` ([86f5ba5](https://github.com/mongodb/node-mongodb-native/commit/86f5ba5))
+* support operations passed to a `Cursor` or subclass ([b78bb89](https://github.com/mongodb/node-mongodb-native/commit/b78bb89))
+
+
+
+<a name="3.2.7"></a>
+## [3.2.7](https://github.com/mongodb/node-mongodb-native/compare/v3.2.6...v3.2.7) (2019-06-04)
+
+
+### Bug Fixes
+
+* **core:** updating core to version 3.2.7 ([2f91466](https://github.com/mongodb/node-mongodb-native/commit/2f91466))
+* **findOneAndReplace:** throw error if atomic operators provided for findOneAndReplace ([6a860a3](https://github.com/mongodb/node-mongodb-native/commit/6a860a3))
+
+
+
+<a name="3.2.6"></a>
+## [3.2.6](https://github.com/mongodb/node-mongodb-native/compare/v3.2.5...v3.2.6) (2019-05-24)
+
+
+
+<a name="3.2.5"></a>
+## [3.2.5](https://github.com/mongodb/node-mongodb-native/compare/v3.2.4...v3.2.5) (2019-05-17)
+
+
+### Bug Fixes
+
+* **core:** updating core to 3.2.5 ([a2766c1](https://github.com/mongodb/node-mongodb-native/commit/a2766c1))
+
+
+
+<a name="3.2.4"></a>
+## [3.2.4](https://github.com/mongodb/node-mongodb-native/compare/v3.2.2...v3.2.4) (2019-05-08)
+
+
+### Bug Fixes
+
+* **aggregation:** fix field name typo ([4235d04](https://github.com/mongodb/node-mongodb-native/commit/4235d04))
+* **async:** rewrote asyncGenerator in node < 10 syntax ([49c8cef](https://github.com/mongodb/node-mongodb-native/commit/49c8cef))
+* **BulkOp:** run unordered bulk ops in serial ([f548bd7](https://github.com/mongodb/node-mongodb-native/commit/f548bd7))
+* **bulkWrite:** fix issue with bulkWrite continuing w/ callback ([2a4a42c](https://github.com/mongodb/node-mongodb-native/commit/2a4a42c))
+* **docs:** correctly document that default for `sslValidate` is false ([1f8e7fa](https://github.com/mongodb/node-mongodb-native/commit/1f8e7fa))
+* **gridfs-stream:** honor chunk size ([9eeb114](https://github.com/mongodb/node-mongodb-native/commit/9eeb114))
+* **unified-topology:** only clone pool size if provided ([8dc2416](https://github.com/mongodb/node-mongodb-native/commit/8dc2416))
+
+
+### Features
+
+* update to mongodb-core v3.2.3 ([1c5357a](https://github.com/mongodb/node-mongodb-native/commit/1c5357a))
+* **core:** update to mongodb-core v3.2.4 ([2059260](https://github.com/mongodb/node-mongodb-native/commit/2059260))
+* **lib:** implement executeOperationV2 ([67d4edf](https://github.com/mongodb/node-mongodb-native/commit/67d4edf))
+
+
+
+<a name="3.2.3"></a>
+## [3.2.3](https://github.com/mongodb/node-mongodb-native/compare/v3.2.2...v3.2.3) (2019-04-05)
+
+
+### Bug Fixes
+
+* **aggregation:** fix field name typo ([4235d04](https://github.com/mongodb/node-mongodb-native/commit/4235d04))
+* **async:** rewrote asyncGenerator in node < 10 syntax ([49c8cef](https://github.com/mongodb/node-mongodb-native/commit/49c8cef))
+* **bulkWrite:** fix issue with bulkWrite continuing w/ callback ([2a4a42c](https://github.com/mongodb/node-mongodb-native/commit/2a4a42c))
+* **docs:** correctly document that default for `sslValidate` is false ([1f8e7fa](https://github.com/mongodb/node-mongodb-native/commit/1f8e7fa))
+
+
+### Features
+
+* update to mongodb-core v3.2.3 ([1c5357a](https://github.com/mongodb/node-mongodb-native/commit/1c5357a))
+
+
+
+<a name="3.2.2"></a>
+## [3.2.2](https://github.com/mongodb/node-mongodb-native/compare/v3.2.1...v3.2.2) (2019-03-22)
+
+
+### Bug Fixes
+
+* **asyncIterator:** stronger guard against importing async generator ([e0826fb](https://github.com/mongodb/node-mongodb-native/commit/e0826fb))
+
+
+### Features
+
+* update to mongodb-core v3.2.2 ([868cfc3](https://github.com/mongodb/node-mongodb-native/commit/868cfc3))
+
+
+
+<a name="3.2.1"></a>
+## [3.2.1](https://github.com/mongodb/node-mongodb-native/compare/v3.2.0...v3.2.1) (2019-03-21)
+
+
+### Features
+
+* **core:** update to mongodb-core v3.2.1 ([30b0100](https://github.com/mongodb/node-mongodb-native/commit/30b0100))
+
+
+
+<a name="3.2.0"></a>
+# [3.2.0](https://github.com/mongodb/node-mongodb-native/compare/v3.1.13...v3.2.0) (2019-03-21)
+
+
+### Bug Fixes
+
+* **aggregate:** do not send batchSize for aggregation with $out ([ddb8d90](https://github.com/mongodb/node-mongodb-native/commit/ddb8d90))
+* **bulkWrite:** always count undefined values in bson size for bulk ([436d340](https://github.com/mongodb/node-mongodb-native/commit/436d340))
+* **db_ops:** rename db to add user on ([79931af](https://github.com/mongodb/node-mongodb-native/commit/79931af))
+* **mongo_client_ops:** only skip authentication if no authMechanism is specified ([3b6957d](https://github.com/mongodb/node-mongodb-native/commit/3b6957d))
+* **mongo-client:** ensure close callback is called with client ([f39e881](https://github.com/mongodb/node-mongodb-native/commit/f39e881))
+
+
+### Features
+
+* **core:** pin to mongodb-core v3.2.0 ([22af15a](https://github.com/mongodb/node-mongodb-native/commit/22af15a))
+* **Cursor:** adds support for AsyncIterator in cursors ([b972c1e](https://github.com/mongodb/node-mongodb-native/commit/b972c1e))
+* **db:** add database-level aggregation ([b629b21](https://github.com/mongodb/node-mongodb-native/commit/b629b21))
+* **mongo-client:** remove deprecated `logout` and print warning ([542859d](https://github.com/mongodb/node-mongodb-native/commit/542859d))
+* **topology-base:** support passing callbacks to `close` method ([7c111e0](https://github.com/mongodb/node-mongodb-native/commit/7c111e0))
+* **transactions:** support pinning mongos for sharded txns ([3886127](https://github.com/mongodb/node-mongodb-native/commit/3886127))
+* **unified-sdam:** backport unified SDAM to master for v3.2.0 ([79f33ca](https://github.com/mongodb/node-mongodb-native/commit/79f33ca))
+
+
+
+<a name="3.1.13"></a>
+## [3.1.13](https://github.com/mongodb/node-mongodb-native/compare/v3.1.12...v3.1.13) (2019-01-23)
+
+
+### Bug Fixes
+
+* restore ability to webpack by removing `makeLazyLoader` ([050267d](https://github.com/mongodb/node-mongodb-native/commit/050267d))
+* **bulk:** honor ignoreUndefined in initializeUnorderedBulkOp ([e806be4](https://github.com/mongodb/node-mongodb-native/commit/e806be4))
+* **changeStream:** properly handle changeStream event mid-close ([#1902](https://github.com/mongodb/node-mongodb-native/issues/1902)) ([5ad9fa9](https://github.com/mongodb/node-mongodb-native/commit/5ad9fa9))
+* **db_ops:** ensure we async resolve errors in createCollection ([210c71d](https://github.com/mongodb/node-mongodb-native/commit/210c71d))
+
+
+
+<a name="3.1.12"></a>
+## [3.1.12](https://github.com/mongodb/node-mongodb-native/compare/v3.1.11...v3.1.12) (2019-01-16)
+
+
+### Features
+
+* **core:** update to mongodb-core v3.1.11 ([9bef6e7](https://github.com/mongodb/node-mongodb-native/commit/9bef6e7))
+
+
+
+<a name="3.1.11"></a>
+## [3.1.11](https://github.com/mongodb/node-mongodb-native/compare/v3.1.10...v3.1.11) (2019-01-15)
+
+
+### Bug Fixes
+
+* **bulk:** fix error propagation in empty bulk.execute ([a3adb3f](https://github.com/mongodb/node-mongodb-native/commit/a3adb3f))
+* **bulk:** make sure that any error in bulk write is propagated ([bedc2d2](https://github.com/mongodb/node-mongodb-native/commit/bedc2d2))
+* **bulk:** properly calculate batch size for bulk writes ([aafe71b](https://github.com/mongodb/node-mongodb-native/commit/aafe71b))
+* **operations:** do not call require in a hot path ([ff82ff4](https://github.com/mongodb/node-mongodb-native/commit/ff82ff4))
+
+
+
+<a name="3.1.10"></a>
+## [3.1.10](https://github.com/mongodb/node-mongodb-native/compare/v3.1.9...v3.1.10) (2018-11-16)
+
+
+### Bug Fixes
+
+* **auth:** remember to default to admin database ([c7dec28](https://github.com/mongodb/node-mongodb-native/commit/c7dec28))
+
+
+### Features
+
+* **core:** update to mongodb-core v3.1.9 ([bd3355b](https://github.com/mongodb/node-mongodb-native/commit/bd3355b))
+
+
+
+<a name="3.1.9"></a>
+## [3.1.9](https://github.com/mongodb/node-mongodb-native/compare/v3.1.8...v3.1.9) (2018-11-06)
+
+
+### Bug Fixes
+
+* **db:** move db constants to other file to avoid circular ref ([#1858](https://github.com/mongodb/node-mongodb-native/issues/1858)) ([239036f](https://github.com/mongodb/node-mongodb-native/commit/239036f))
+* **estimated-document-count:** support options other than maxTimeMs ([36c3c7d](https://github.com/mongodb/node-mongodb-native/commit/36c3c7d))
+
+
+### Features
+
+* **core:** update to mongodb-core v3.1.8 ([80d7c79](https://github.com/mongodb/node-mongodb-native/commit/80d7c79))
+
+
+
+<a name="3.1.8"></a>
+## [3.1.8](https://github.com/mongodb/node-mongodb-native/compare/v3.1.7...v3.1.8) (2018-10-10)
+
+
+### Bug Fixes
+
+* **connect:** use reported default databse from new uri parser ([811f8f8](https://github.com/mongodb/node-mongodb-native/commit/811f8f8))
+
+
+### Features
+
+* **core:** update to mongodb-core v3.1.7 ([dbfc905](https://github.com/mongodb/node-mongodb-native/commit/dbfc905))
+
+
+
+<a name="3.1.7"></a>
+## [3.1.7](https://github.com/mongodb/node-mongodb-native/compare/v3.1.6...v3.1.7) (2018-10-09)
+
+
+### Features
+
+* **core:** update mongodb-core to v3.1.6 ([61b054e](https://github.com/mongodb/node-mongodb-native/commit/61b054e))
+
+
+
+<a name="3.1.6"></a>
+## [3.1.6](https://github.com/mongodb/node-mongodb-native/compare/v3.1.5...v3.1.6) (2018-09-15)
+
+
+### Features
+
+* **core:** update to core v3.1.5 ([c5f823d](https://github.com/mongodb/node-mongodb-native/commit/c5f823d))
+
+
+
+<a name="3.1.5"></a>
+## [3.1.5](https://github.com/mongodb/node-mongodb-native/compare/v3.1.4...v3.1.5) (2018-09-14)
+
+
+### Bug Fixes
+
+* **cursor:** allow `$meta` based sort when passing an array to `sort()` ([f93a8c3](https://github.com/mongodb/node-mongodb-native/commit/f93a8c3))
+* **utils:** only set retryWrites to true for valid operations ([3b725ef](https://github.com/mongodb/node-mongodb-native/commit/3b725ef))
+
+
+### Features
+
+* **core:** bump core to v3.1.4 ([805d58a](https://github.com/mongodb/node-mongodb-native/commit/805d58a))
+
+
+
+<a name="3.1.4"></a>
+## [3.1.4](https://github.com/mongodb/node-mongodb-native/compare/v3.1.3...v3.1.4) (2018-08-25)
+
+
+### Bug Fixes
+
+* **buffer:** use safe-buffer polyfill to maintain compatibility ([327da95](https://github.com/mongodb/node-mongodb-native/commit/327da95))
+* **change-stream:** properly support resumablity in stream mode ([c43a34b](https://github.com/mongodb/node-mongodb-native/commit/c43a34b))
+* **connect:** correct replacement of topology on connect callback ([918a1e0](https://github.com/mongodb/node-mongodb-native/commit/918a1e0))
+* **cursor:** remove deprecated notice on forEach ([a474158](https://github.com/mongodb/node-mongodb-native/commit/a474158))
+* **url-parser:** bail early on validation when using domain socket ([3cb3da3](https://github.com/mongodb/node-mongodb-native/commit/3cb3da3))
+
+
+### Features
+
+* **client-ops:** allow bypassing creation of topologies on connect ([fe39b93](https://github.com/mongodb/node-mongodb-native/commit/fe39b93))
+* **core:** update mongodb-core to 3.1.3 ([a029047](https://github.com/mongodb/node-mongodb-native/commit/a029047))
+* **test:** use connection strings for all calls to `newClient` ([1dac18f](https://github.com/mongodb/node-mongodb-native/commit/1dac18f))
+
+
+
+<a name="3.1.3"></a>
+## [3.1.3](https://github.com/mongodb/node-mongodb-native/compare/v3.1.2...v3.1.3) (2018-08-13)
+
+
+### Features
+
+* **core:** update to mongodb-core 3.1.2 ([337cb79](https://github.com/mongodb/node-mongodb-native/commit/337cb79))
+
+
+
+<a name="3.1.2"></a>
+## [3.1.2](https://github.com/mongodb/node-mongodb-native/compare/v3.0.6...v3.1.2) (2018-08-13)
+
+
+### Bug Fixes
+
+* **aggregate:** support user-provided `batchSize` ([ad10dee](https://github.com/mongodb/node-mongodb-native/commit/ad10dee))
+* **buffer:** replace deprecated Buffer constructor ([759dd85](https://github.com/mongodb/node-mongodb-native/commit/759dd85))
+* **bulk:** fixing retryable writes for mass-change ops ([0604036](https://github.com/mongodb/node-mongodb-native/commit/0604036))
+* **bulk:** handle MongoWriteConcernErrors ([12ff392](https://github.com/mongodb/node-mongodb-native/commit/12ff392))
+* **change_stream:** do not check isGetMore if error[mongoErrorContextSymbol] is undefined ([#1720](https://github.com/mongodb/node-mongodb-native/issues/1720)) ([844c2c8](https://github.com/mongodb/node-mongodb-native/commit/844c2c8))
+* **change-stream:** fix change stream resuming with promises ([3063f00](https://github.com/mongodb/node-mongodb-native/commit/3063f00))
+* **client-ops:** return transform map to map rather than function ([cfb7d83](https://github.com/mongodb/node-mongodb-native/commit/cfb7d83))
+* **collection:** correctly shallow clone passed in options ([7727700](https://github.com/mongodb/node-mongodb-native/commit/7727700))
+* **collection:** countDocuments throws error when query doesn't match docs ([09c7d8e](https://github.com/mongodb/node-mongodb-native/commit/09c7d8e))
+* **collection:** depend on `resolveReadPreference` for inheritance ([a649e35](https://github.com/mongodb/node-mongodb-native/commit/a649e35))
+* **collection:** ensure findAndModify always use readPreference primary ([86344f4](https://github.com/mongodb/node-mongodb-native/commit/86344f4))
+* **collection:** isCapped returns false instead of undefined ([b8471f1](https://github.com/mongodb/node-mongodb-native/commit/b8471f1))
+* **collection:** only send bypassDocumentValidation if true ([fdb828b](https://github.com/mongodb/node-mongodb-native/commit/fdb828b))
+* **count-documents:** return callback on error case ([fca1185](https://github.com/mongodb/node-mongodb-native/commit/fca1185))
+* **cursor:** cursor count with collation fix ([71879c3](https://github.com/mongodb/node-mongodb-native/commit/71879c3))
+* **cursor:** cursor hasNext returns false when exhausted ([184b817](https://github.com/mongodb/node-mongodb-native/commit/184b817))
+* **cursor:** cursor.count not respecting parent readPreference ([5a9fdf0](https://github.com/mongodb/node-mongodb-native/commit/5a9fdf0))
+* **cursor:** set readPreference for cursor.count ([13d776f](https://github.com/mongodb/node-mongodb-native/commit/13d776f))
+* **db:** don't send session down to createIndex command ([559c195](https://github.com/mongodb/node-mongodb-native/commit/559c195))
+* **db:** throw readable error when creating `_id` with background: true ([b3ff3ed](https://github.com/mongodb/node-mongodb-native/commit/b3ff3ed))
+* **db_ops:** call collection.find() with correct parameters ([#1795](https://github.com/mongodb/node-mongodb-native/issues/1795)) ([36e92f1](https://github.com/mongodb/node-mongodb-native/commit/36e92f1))
+* **db_ops:** fix two incorrectly named variables ([15dc808](https://github.com/mongodb/node-mongodb-native/commit/15dc808))
+* **findOneAndUpdate:** ensure that update documents contain atomic operators ([eb68074](https://github.com/mongodb/node-mongodb-native/commit/eb68074))
+* **index:** export MongoNetworkError ([98ab29e](https://github.com/mongodb/node-mongodb-native/commit/98ab29e))
+* **mongo_client:** translate options for connectWithUrl ([78f6977](https://github.com/mongodb/node-mongodb-native/commit/78f6977))
+* **mongo-client:** pass arguments to ctor when new keyword is used ([d6c3417](https://github.com/mongodb/node-mongodb-native/commit/d6c3417))
+* **mongos:** bubble up close events after the first one ([#1713](https://github.com/mongodb/node-mongodb-native/issues/1713)) ([3e91d77](https://github.com/mongodb/node-mongodb-native/commit/3e91d77)), closes [Automattic/mongoose#6249](https://github.com/Automattic/mongoose/issues/6249) [#1685](https://github.com/mongodb/node-mongodb-native/issues/1685)
+* **parallelCollectionScan:** do not use implicit sessions on cursors ([2de470a](https://github.com/mongodb/node-mongodb-native/commit/2de470a))
+* **retryWrites:** fixes more bulk ops to not use retryWrites ([69e5254](https://github.com/mongodb/node-mongodb-native/commit/69e5254))
+* **server:** remove unnecessary print statement ([2bcbc12](https://github.com/mongodb/node-mongodb-native/commit/2bcbc12))
+* **teardown:** properly destroy a topology when initial connect fails ([b8d2f1d](https://github.com/mongodb/node-mongodb-native/commit/b8d2f1d))
+* **topology-base:** sending `endSessions` is always skipped now ([a276cbe](https://github.com/mongodb/node-mongodb-native/commit/a276cbe))
+* **txns:** omit writeConcern when in a transaction ([b88c938](https://github.com/mongodb/node-mongodb-native/commit/b88c938))
+* **utils:** restructure inheritance rules for read preferences ([6a7dac1](https://github.com/mongodb/node-mongodb-native/commit/6a7dac1))
+
+
+### Features
+
+* **auth:** add support for SCRAM-SHA-256 ([f53195d](https://github.com/mongodb/node-mongodb-native/commit/f53195d))
+* **changeStream:** Adding new 4.0 ChangeStream features ([2cb4894](https://github.com/mongodb/node-mongodb-native/commit/2cb4894))
+* **changeStream:** allow resuming on getMore errors ([4ba5adc](https://github.com/mongodb/node-mongodb-native/commit/4ba5adc))
+* **changeStream:** expanding changeStream resumable errors ([49fbafd](https://github.com/mongodb/node-mongodb-native/commit/49fbafd))
+* **ChangeStream:** update default startAtOperationTime ([50a9f65](https://github.com/mongodb/node-mongodb-native/commit/50a9f65))
+* **collection:** add colleciton level document mapping/unmapping ([d03335e](https://github.com/mongodb/node-mongodb-native/commit/d03335e))
+* **collection:** Implement new count API ([a5240ae](https://github.com/mongodb/node-mongodb-native/commit/a5240ae))
+* **Collection:** warn if callback is not function in find and findOne ([cddaba0](https://github.com/mongodb/node-mongodb-native/commit/cddaba0))
+* **core:** bump core dependency to v3.1.0 ([4937240](https://github.com/mongodb/node-mongodb-native/commit/4937240))
+* **cursor:** new cursor.transformStream method ([397fcd2](https://github.com/mongodb/node-mongodb-native/commit/397fcd2))
+* **deprecation:** create deprecation function ([4f907a0](https://github.com/mongodb/node-mongodb-native/commit/4f907a0))
+* **deprecation:** wrap deprecated functions ([a5d0f1d](https://github.com/mongodb/node-mongodb-native/commit/a5d0f1d))
+* **GridFS:** add option to disable md5 in file upload ([704a88e](https://github.com/mongodb/node-mongodb-native/commit/704a88e))
+* **listCollections:** add support for nameOnly option ([d2d0367](https://github.com/mongodb/node-mongodb-native/commit/d2d0367))
+* **parallelCollectionScan:** does not allow user to pass a session ([4da9e03](https://github.com/mongodb/node-mongodb-native/commit/4da9e03))
+* **read-preference:** add transaction to inheritance rules ([18ca41d](https://github.com/mongodb/node-mongodb-native/commit/18ca41d))
+* **read-preference:** unify means of read preference resolution ([#1738](https://github.com/mongodb/node-mongodb-native/issues/1738)) ([2995e11](https://github.com/mongodb/node-mongodb-native/commit/2995e11))
+* **urlParser:** use core URL parser ([c1c5d8d](https://github.com/mongodb/node-mongodb-native/commit/c1c5d8d))
+* **withSession:** add top level helper for session lifetime ([9976b86](https://github.com/mongodb/node-mongodb-native/commit/9976b86))
+
+
+### Reverts
+
+* **collection:** reverting collection-mapping features ([7298c76](https://github.com/mongodb/node-mongodb-native/commit/7298c76)), closes [#1698](https://github.com/mongodb/node-mongodb-native/issues/1698) [mongodb/js-bson#253](https://github.com/mongodb/js-bson/issues/253)
+
+
+
+<a name="3.1.1"></a>
+## [3.1.1](https://github.com/mongodb/node-mongodb-native/compare/v3.1.0...v3.1.1) (2018-07-05)
+
+
+### Bug Fixes
+
+* **client-ops:** return transform map to map rather than function ([b8b4bfa](https://github.com/mongodb/node-mongodb-native/commit/b8b4bfa))
+* **collection:** correctly shallow clone passed in options ([2e6c4fa](https://github.com/mongodb/node-mongodb-native/commit/2e6c4fa))
+* **collection:** countDocuments throws error when query doesn't match docs ([4e83556](https://github.com/mongodb/node-mongodb-native/commit/4e83556))
+* **server:** remove unnecessary print statement ([20e11b3](https://github.com/mongodb/node-mongodb-native/commit/20e11b3))
+
+
+
+<a name="3.1.0"></a>
+# [3.1.0](https://github.com/mongodb/node-mongodb-native/compare/v3.0.6...v3.1.0) (2018-06-27)
+
+
+### Bug Fixes
+
+* **aggregate:** support user-provided `batchSize` ([ad10dee](https://github.com/mongodb/node-mongodb-native/commit/ad10dee))
+* **bulk:** fixing retryable writes for mass-change ops ([0604036](https://github.com/mongodb/node-mongodb-native/commit/0604036))
+* **bulk:** handle MongoWriteConcernErrors ([12ff392](https://github.com/mongodb/node-mongodb-native/commit/12ff392))
+* **change_stream:** do not check isGetMore if error[mongoErrorContextSymbol] is undefined ([#1720](https://github.com/mongodb/node-mongodb-native/issues/1720)) ([844c2c8](https://github.com/mongodb/node-mongodb-native/commit/844c2c8))
+* **change-stream:** fix change stream resuming with promises ([3063f00](https://github.com/mongodb/node-mongodb-native/commit/3063f00))
+* **collection:** depend on `resolveReadPreference` for inheritance ([a649e35](https://github.com/mongodb/node-mongodb-native/commit/a649e35))
+* **collection:** only send bypassDocumentValidation if true ([fdb828b](https://github.com/mongodb/node-mongodb-native/commit/fdb828b))
+* **cursor:** cursor count with collation fix ([71879c3](https://github.com/mongodb/node-mongodb-native/commit/71879c3))
+* **cursor:** cursor hasNext returns false when exhausted ([184b817](https://github.com/mongodb/node-mongodb-native/commit/184b817))
+* **cursor:** cursor.count not respecting parent readPreference ([5a9fdf0](https://github.com/mongodb/node-mongodb-native/commit/5a9fdf0))
+* **db:** don't send session down to createIndex command ([559c195](https://github.com/mongodb/node-mongodb-native/commit/559c195))
+* **db:** throw readable error when creating `_id` with background: true ([b3ff3ed](https://github.com/mongodb/node-mongodb-native/commit/b3ff3ed))
+* **findOneAndUpdate:** ensure that update documents contain atomic operators ([eb68074](https://github.com/mongodb/node-mongodb-native/commit/eb68074))
+* **index:** export MongoNetworkError ([98ab29e](https://github.com/mongodb/node-mongodb-native/commit/98ab29e))
+* **mongo-client:** pass arguments to ctor when new keyword is used ([d6c3417](https://github.com/mongodb/node-mongodb-native/commit/d6c3417))
+* **mongos:** bubble up close events after the first one ([#1713](https://github.com/mongodb/node-mongodb-native/issues/1713)) ([3e91d77](https://github.com/mongodb/node-mongodb-native/commit/3e91d77)), closes [Automattic/mongoose#6249](https://github.com/Automattic/mongoose/issues/6249) [#1685](https://github.com/mongodb/node-mongodb-native/issues/1685)
+* **parallelCollectionScan:** do not use implicit sessions on cursors ([2de470a](https://github.com/mongodb/node-mongodb-native/commit/2de470a))
+* **retryWrites:** fixes more bulk ops to not use retryWrites ([69e5254](https://github.com/mongodb/node-mongodb-native/commit/69e5254))
+* **topology-base:** sending `endSessions` is always skipped now ([a276cbe](https://github.com/mongodb/node-mongodb-native/commit/a276cbe))
+* **txns:** omit writeConcern when in a transaction ([b88c938](https://github.com/mongodb/node-mongodb-native/commit/b88c938))
+* **utils:** restructure inheritance rules for read preferences ([6a7dac1](https://github.com/mongodb/node-mongodb-native/commit/6a7dac1))
+
+
+### Features
+
+* **auth:** add support for SCRAM-SHA-256 ([f53195d](https://github.com/mongodb/node-mongodb-native/commit/f53195d))
+* **changeStream:** Adding new 4.0 ChangeStream features ([2cb4894](https://github.com/mongodb/node-mongodb-native/commit/2cb4894))
+* **changeStream:** allow resuming on getMore errors ([4ba5adc](https://github.com/mongodb/node-mongodb-native/commit/4ba5adc))
+* **changeStream:** expanding changeStream resumable errors ([49fbafd](https://github.com/mongodb/node-mongodb-native/commit/49fbafd))
+* **ChangeStream:** update default startAtOperationTime ([50a9f65](https://github.com/mongodb/node-mongodb-native/commit/50a9f65))
+* **collection:** add colleciton level document mapping/unmapping ([d03335e](https://github.com/mongodb/node-mongodb-native/commit/d03335e))
+* **collection:** Implement new count API ([a5240ae](https://github.com/mongodb/node-mongodb-native/commit/a5240ae))
+* **Collection:** warn if callback is not function in find and findOne ([cddaba0](https://github.com/mongodb/node-mongodb-native/commit/cddaba0))
+* **core:** bump core dependency to v3.1.0 ([855bfdb](https://github.com/mongodb/node-mongodb-native/commit/855bfdb))
+* **cursor:** new cursor.transformStream method ([397fcd2](https://github.com/mongodb/node-mongodb-native/commit/397fcd2))
+* **GridFS:** add option to disable md5 in file upload ([704a88e](https://github.com/mongodb/node-mongodb-native/commit/704a88e))
+* **listCollections:** add support for nameOnly option ([d2d0367](https://github.com/mongodb/node-mongodb-native/commit/d2d0367))
+* **parallelCollectionScan:** does not allow user to pass a session ([4da9e03](https://github.com/mongodb/node-mongodb-native/commit/4da9e03))
+* **read-preference:** add transaction to inheritance rules ([18ca41d](https://github.com/mongodb/node-mongodb-native/commit/18ca41d))
+* **read-preference:** unify means of read preference resolution ([#1738](https://github.com/mongodb/node-mongodb-native/issues/1738)) ([2995e11](https://github.com/mongodb/node-mongodb-native/commit/2995e11))
+* **urlParser:** use core URL parser ([c1c5d8d](https://github.com/mongodb/node-mongodb-native/commit/c1c5d8d))
+* **withSession:** add top level helper for session lifetime ([9976b86](https://github.com/mongodb/node-mongodb-native/commit/9976b86))
+
+
+### Reverts
+
+* **collection:** reverting collection-mapping features ([7298c76](https://github.com/mongodb/node-mongodb-native/commit/7298c76)), closes [#1698](https://github.com/mongodb/node-mongodb-native/issues/1698) [mongodb/js-bson#253](https://github.com/mongodb/js-bson/issues/253)
+
+
+
+<a name="3.0.6"></a>
+## [3.0.6](https://github.com/mongodb/node-mongodb-native/compare/v3.0.5...v3.0.6) (2018-04-09)
+
+
+### Bug Fixes
+
+* **db:** ensure `dropDatabase` always uses primary read preference ([e62e5c9](https://github.com/mongodb/node-mongodb-native/commit/e62e5c9))
+* **driverBench:** driverBench has default options object now ([c557817](https://github.com/mongodb/node-mongodb-native/commit/c557817))
+
+
+### Features
+
+* **command-monitoring:** support enabling command monitoring ([5903680](https://github.com/mongodb/node-mongodb-native/commit/5903680))
+* **core:** update to mongodb-core v3.0.6 ([cfdd0ae](https://github.com/mongodb/node-mongodb-native/commit/cfdd0ae))
+* **driverBench:** Implementing DriverBench ([d10fbad](https://github.com/mongodb/node-mongodb-native/commit/d10fbad))
+
+
+
+<a name="3.0.5"></a>
+## [3.0.5](https://github.com/mongodb/node-mongodb-native/compare/v3.0.4...v3.0.5) (2018-03-23)
+
+
+### Bug Fixes
+
+* **AggregationCursor:** adding session tracking to AggregationCursor ([baca5b7](https://github.com/mongodb/node-mongodb-native/commit/baca5b7))
+* **Collection:** fix session leak in parallelCollectonScan ([3331ec9](https://github.com/mongodb/node-mongodb-native/commit/3331ec9))
+* **comments:** adding fixes for PR comments ([ee110ac](https://github.com/mongodb/node-mongodb-native/commit/ee110ac))
+* **url_parser:** support a default database on mongodb+srv uris ([6d39b2a](https://github.com/mongodb/node-mongodb-native/commit/6d39b2a))
+
+
+### Features
+
+* **sessions:** adding implicit cursor session support ([a81245b](https://github.com/mongodb/node-mongodb-native/commit/a81245b))
+
+
+
+<a name="3.0.4"></a>
+## [3.0.4](https://github.com/mongodb/node-mongodb-native/compare/v3.0.2...v3.0.4) (2018-03-05)
+
+
+### Bug Fixes
+
+* **collection:** fix error when calling remove with no args ([#1657](https://github.com/mongodb/node-mongodb-native/issues/1657)) ([4c9b0f8](https://github.com/mongodb/node-mongodb-native/commit/4c9b0f8))
+* **executeOperation:** don't mutate options passed to commands ([934a43a](https://github.com/mongodb/node-mongodb-native/commit/934a43a))
+* **jsdoc:** mark db.collection callback as optional + typo fix ([#1658](https://github.com/mongodb/node-mongodb-native/issues/1658)) ([c519b9b](https://github.com/mongodb/node-mongodb-native/commit/c519b9b))
+* **sessions:** move active session tracking to topology base ([#1665](https://github.com/mongodb/node-mongodb-native/issues/1665)) ([b1f296f](https://github.com/mongodb/node-mongodb-native/commit/b1f296f))
+* **utils:** fixes executeOperation to clean up sessions ([04e6ef6](https://github.com/mongodb/node-mongodb-native/commit/04e6ef6))
+
+
+### Features
+
+* **default-db:** use dbName from uri if none provided ([23b1938](https://github.com/mongodb/node-mongodb-native/commit/23b1938))
+* **mongodb-core:** update to mongodb-core 3.0.4 ([1fdbaa5](https://github.com/mongodb/node-mongodb-native/commit/1fdbaa5))
+
+
+
+<a name="3.0.3"></a>
+## [3.0.3](https://github.com/mongodb/node-mongodb-native/compare/v3.0.2...v3.0.3) (2018-02-23)
+
+
+### Bug Fixes
+
+* **collection:** fix error when calling remove with no args ([#1657](https://github.com/mongodb/node-mongodb-native/issues/1657)) ([4c9b0f8](https://github.com/mongodb/node-mongodb-native/commit/4c9b0f8))
+* **executeOperation:** don't mutate options passed to commands ([934a43a](https://github.com/mongodb/node-mongodb-native/commit/934a43a))
+* **jsdoc:** mark db.collection callback as optional + typo fix ([#1658](https://github.com/mongodb/node-mongodb-native/issues/1658)) ([c519b9b](https://github.com/mongodb/node-mongodb-native/commit/c519b9b))
+* **sessions:** move active session tracking to topology base ([#1665](https://github.com/mongodb/node-mongodb-native/issues/1665)) ([b1f296f](https://github.com/mongodb/node-mongodb-native/commit/b1f296f))
+
+
+
+<a name="3.0.2"></a>
+## [3.0.2](https://github.com/mongodb/node-mongodb-native/compare/v3.0.1...v3.0.2) (2018-01-29)
+
+
+### Bug Fixes
+
+* **collection:** ensure dynamic require of `db` is wrapped in parentheses ([efa78f0](https://github.com/mongodb/node-mongodb-native/commit/efa78f0))
+* **db:** only callback with MongoError NODE-1293 ([#1652](https://github.com/mongodb/node-mongodb-native/issues/1652)) ([45bc722](https://github.com/mongodb/node-mongodb-native/commit/45bc722))
+* **topology base:** allow more than 10 event listeners ([#1630](https://github.com/mongodb/node-mongodb-native/issues/1630)) ([d9fb750](https://github.com/mongodb/node-mongodb-native/commit/d9fb750))
+* **url parser:** preserve auth creds when composing conn string  ([#1640](https://github.com/mongodb/node-mongodb-native/issues/1640)) ([eddca5e](https://github.com/mongodb/node-mongodb-native/commit/eddca5e))
+
+
+### Features
+
+* **bulk:** forward 'checkKeys' option for ordered and unordered bulk operations ([421a6b2](https://github.com/mongodb/node-mongodb-native/commit/421a6b2))
+* **collection:** expose `dbName` property of collection ([6fd05c1](https://github.com/mongodb/node-mongodb-native/commit/6fd05c1))
+
+
+
+<a name="3.0.1"></a>
+## [3.0.1](https://github.com/mongodb/node-mongodb-native/compare/v3.0.0...v3.0.1) (2017-12-24)
+
+* update mongodb-core to 3.0.1
+
+<a name="3.0.0"></a>
+# [3.0.0](https://github.com/mongodb/node-mongodb-native/compare/v3.0.0-rc0...v3.0.0) (2017-12-24)
+
+
+### Bug Fixes
+
+* **aggregate:** remove support for inline results for aggregate ([#1620](https://github.com/mongodb/node-mongodb-native/issues/1620)) ([84457ec](https://github.com/mongodb/node-mongodb-native/commit/84457ec))
+* **topologies:** unify topologies connect API ([#1615](https://github.com/mongodb/node-mongodb-native/issues/1615)) ([0fb4658](https://github.com/mongodb/node-mongodb-native/commit/0fb4658))
+
+
+### Features
+
+* **keepAlive:** make keepAlive options consistent ([#1612](https://github.com/mongodb/node-mongodb-native/issues/1612)) ([f608f44](https://github.com/mongodb/node-mongodb-native/commit/f608f44))
+
+
+### BREAKING CHANGES
+
+* **topologies:** Function signature for `.connect` method on replset and mongos has changed. You shouldn't have been using this anyway, but if you were, you only should pass `options` and `callback`.
+
+Part of NODE-1089
+* **keepAlive:** option `keepAlive` is now split into boolean `keepAlive` and
+number `keepAliveInitialDelay`
+
+Fixes NODE-998
+
+
+
+<a name="3.0.0-rc0"></a>
+# [3.0.0-rc0](https://github.com/mongodb/node-mongodb-native/compare/v2.2.31...v3.0.0-rc0) (2017-12-05)
+
+
+### Bug Fixes
+
+* **aggregation:** ensure that the `cursor` key is always present ([f16f314](https://github.com/mongodb/node-mongodb-native/commit/f16f314))
+* **apm:** give users access to raw server responses ([88b206b](https://github.com/mongodb/node-mongodb-native/commit/88b206b))
+* **apm:** only rebuilt cursor if reply is non-null ([96052c8](https://github.com/mongodb/node-mongodb-native/commit/96052c8))
+* **apm:** rebuild lost `cursor` info on pre-OP_QUERY responses ([4242d49](https://github.com/mongodb/node-mongodb-native/commit/4242d49))
+* **bulk-unordered:** add check for ignoreUndefined ([f38641a](https://github.com/mongodb/node-mongodb-native/commit/f38641a))
+* **change stream examples:** use timeouts, cleanup ([c5fec5f](https://github.com/mongodb/node-mongodb-native/commit/c5fec5f))
+* **change-streams:** ensure a majority read concern on initial agg ([23011e9](https://github.com/mongodb/node-mongodb-native/commit/23011e9))
+* **changeStreams:** fixing node4 issue with util.inherits ([#1587](https://github.com/mongodb/node-mongodb-native/issues/1587)) ([168bb3d](https://github.com/mongodb/node-mongodb-native/commit/168bb3d))
+* **collection:** allow { upsert: 1 } for findOneAndUpdate() and update() ([5bcedd6](https://github.com/mongodb/node-mongodb-native/commit/5bcedd6))
+* **collection:** allow passing `noCursorTimeout` as an option to `find()` ([e9c4ffc](https://github.com/mongodb/node-mongodb-native/commit/e9c4ffc))
+* **collection:** make the parameters of findOne very explicit ([3054f1a](https://github.com/mongodb/node-mongodb-native/commit/3054f1a))
+* **cursor:** `hasNext` should propagate errors when using callback ([6339625](https://github.com/mongodb/node-mongodb-native/commit/6339625))
+* **cursor:** close readable on `null` response for dead cursor ([6aca2c5](https://github.com/mongodb/node-mongodb-native/commit/6aca2c5))
+* **dns txt records:** check options are set ([e5caf4f](https://github.com/mongodb/node-mongodb-native/commit/e5caf4f))
+* **docs:** Represent each valid option in docs in both places ([fde6e5d](https://github.com/mongodb/node-mongodb-native/commit/fde6e5d))
+* **grid-store:** add missing callback ([66a9a05](https://github.com/mongodb/node-mongodb-native/commit/66a9a05))
+* **grid-store:** move into callback scope ([b53f65f](https://github.com/mongodb/node-mongodb-native/commit/b53f65f))
+* **GridFS:**  fix TypeError: doc.data.length is not a function ([#1570](https://github.com/mongodb/node-mongodb-native/issues/1570)) ([22a4628](https://github.com/mongodb/node-mongodb-native/commit/22a4628))
+* **list-collections:** ensure default of primary ReadPreference ([4a0cfeb](https://github.com/mongodb/node-mongodb-native/commit/4a0cfeb))
+* **mongo client:** close client before calling done ([c828aab](https://github.com/mongodb/node-mongodb-native/commit/c828aab))
+* **mongo client:** do not connect if url parse error ([cd10084](https://github.com/mongodb/node-mongodb-native/commit/cd10084))
+* **mongo client:** send error to cb ([eafc9e2](https://github.com/mongodb/node-mongodb-native/commit/eafc9e2))
+* **mongo-client:** move to inside of callback ([68b0fca](https://github.com/mongodb/node-mongodb-native/commit/68b0fca))
+* **mongo-client:** options should not be passed to `connect` ([474ac65](https://github.com/mongodb/node-mongodb-native/commit/474ac65))
+* **tests:** migrate 2.x tests to 3.x ([3a5232a](https://github.com/mongodb/node-mongodb-native/commit/3a5232a))
+* **updateOne/updateMany:** ensure that update documents contain atomic operators ([8b4255a](https://github.com/mongodb/node-mongodb-native/commit/8b4255a))
+* **url parser:** add check for options as cb ([52b6039](https://github.com/mongodb/node-mongodb-native/commit/52b6039))
+* **url parser:** compare srv address and parent domains ([daa186d](https://github.com/mongodb/node-mongodb-native/commit/daa186d))
+* **url parser:** compare string from first period on ([9e5d77e](https://github.com/mongodb/node-mongodb-native/commit/9e5d77e))
+* **url parser:** default to ssl true for mongodb+srv ([0fbca4b](https://github.com/mongodb/node-mongodb-native/commit/0fbca4b))
+* **url parser:** error when multiple hostnames used ([c1aa681](https://github.com/mongodb/node-mongodb-native/commit/c1aa681))
+* **url parser:** keep original uri options and default to ssl true ([e876a72](https://github.com/mongodb/node-mongodb-native/commit/e876a72))
+* **url parser:** log instead of throw error for unsupported url options ([155de2d](https://github.com/mongodb/node-mongodb-native/commit/155de2d))
+* **url parser:** make sure uri has 3 parts ([aa9871b](https://github.com/mongodb/node-mongodb-native/commit/aa9871b))
+* **url parser:** only 1 txt record allowed with 2 possible options ([d9f4218](https://github.com/mongodb/node-mongodb-native/commit/d9f4218))
+* **url parser:** only check for multiple hostnames with srv protocol ([5542bcc](https://github.com/mongodb/node-mongodb-native/commit/5542bcc))
+* **url parser:** remove .only from test ([642e39e](https://github.com/mongodb/node-mongodb-native/commit/642e39e))
+* **url parser:** return callback ([6096afc](https://github.com/mongodb/node-mongodb-native/commit/6096afc))
+* **url parser:** support single text record with multiple strings ([356fa57](https://github.com/mongodb/node-mongodb-native/commit/356fa57))
+* **url parser:** try catch bug, not actually returning from try loop ([758892b](https://github.com/mongodb/node-mongodb-native/commit/758892b))
+* **url parser:** use warn instead of info ([40ed27d](https://github.com/mongodb/node-mongodb-native/commit/40ed27d))
+* **url-parser:** remove comment, send error to cb ([d44420b](https://github.com/mongodb/node-mongodb-native/commit/d44420b))
+
+
+### Features
+
+* **aggregate:** support hit field for aggregate command ([aa7da15](https://github.com/mongodb/node-mongodb-native/commit/aa7da15))
+* **aggregation:** adds support for comment in aggregation command ([#1571](https://github.com/mongodb/node-mongodb-native/issues/1571)) ([4ac475c](https://github.com/mongodb/node-mongodb-native/commit/4ac475c))
+* **aggregation:** fail aggregation on explain + readConcern/writeConcern ([e0ca1b4](https://github.com/mongodb/node-mongodb-native/commit/e0ca1b4))
+* **causal-consistency:** support `afterClusterTime` in readConcern ([a9097f7](https://github.com/mongodb/node-mongodb-native/commit/a9097f7))
+* **change-streams:** add support for change streams ([c02d25c](https://github.com/mongodb/node-mongodb-native/commit/c02d25c))
+* **collection:** updating find API ([f26362d](https://github.com/mongodb/node-mongodb-native/commit/f26362d))
+* **execute-operation:** implementation for common op execution ([67c344f](https://github.com/mongodb/node-mongodb-native/commit/67c344f))
+* **listDatabases:** add support for nameOnly option to listDatabases ([eb79b5a](https://github.com/mongodb/node-mongodb-native/commit/eb79b5a))
+* **maxTimeMS:** adding maxTimeMS option to createIndexes and dropIndexes ([90d4a63](https://github.com/mongodb/node-mongodb-native/commit/90d4a63))
+* **mongo-client:** implement `MongoClient.prototype.startSession` ([bce5adf](https://github.com/mongodb/node-mongodb-native/commit/bce5adf))
+* **retryable-writes:** add support for `retryWrites` cs option ([2321870](https://github.com/mongodb/node-mongodb-native/commit/2321870))
+* **sessions:** MongoClient will now track sessions and release ([6829f47](https://github.com/mongodb/node-mongodb-native/commit/6829f47))
+* **sessions:** support passing sessions via objects in all methods ([a531f05](https://github.com/mongodb/node-mongodb-native/commit/a531f05))
+* **shared:** add helper utilities for assertion and suite setup ([b6cc34e](https://github.com/mongodb/node-mongodb-native/commit/b6cc34e))
+* **ssl:** adds missing ssl options ssl options for `ciphers` and `ecdhCurve` ([441b7b1](https://github.com/mongodb/node-mongodb-native/commit/441b7b1))
+* **test-shared:** add `notEqual` assertion ([41d93fd](https://github.com/mongodb/node-mongodb-native/commit/41d93fd))
+* **test-shared:** add `strictEqual` assertion method ([cad8e19](https://github.com/mongodb/node-mongodb-native/commit/cad8e19))
+* **topologies:** expose underlaying `logicalSessionTimeoutMinutes' ([1609a37](https://github.com/mongodb/node-mongodb-native/commit/1609a37))
+* **url parser:** better error message for slash in hostname ([457bc29](https://github.com/mongodb/node-mongodb-native/commit/457bc29))
+
+
+### BREAKING CHANGES
+
+* **aggregation:** If you use aggregation, and try to use the explain flag while you
+have a readConcern or writeConcern, your query will fail
+* **collection:** `find` and `findOne` no longer support the `fields` parameter.
+You can achieve the same results as the `fields` parameter by
+either using `Cursor.prototype.project`, or by passing the `projection`
+property in on the `options` object. Additionally, `find` does not
+support individual options like `skip` and `limit` as positional
+parameters. You must pass in these parameters in the `options` object
+
+
+
+3.0.0 2017-??-??
+----------------
+* NODE-1043 URI-escaping authentication and hostname details in connection string
+
+2.2.31 2017-08-08
+-----------------
+* update mongodb-core to 2.2.15
+* allow auth option in MongoClient.connect
+* remove duplicate option `promoteLongs` from MongoClient's `connect`
+* bulk operations should not throw an error on empty batch
+
+2.2.30 2017-07-07
+-----------------
+* Update mongodb-core to 2.2.14
+* MongoClient
+  * add `appname` to list of valid option names
+  * added test for passing appname as option
+* NODE-1052 ensure user options are applied while parsing connection string uris
+
+2.2.29 2017-06-19
+-----------------
+* Update mongodb-core to 2.1.13
+  * NODE-1039 ensure we force destroy server instances, forcing queue to be flushed.
+  *  Use actual server type in standalone SDAM events.
+* Allow multiple map calls (Issue #1521, https://github.com/Robbilie).
+* Clone insertMany options before mutating (Issue #1522, https://github.com/vkarpov15).
+* NODE-1034 Fix GridStore issue caused by Node 8.0.0 breaking backward compatible fs.read API.
+* NODE-1026, use  operator instead of skip function in order to avoid useless fetch stage.
+
+2.2.28 2017-06-02
+-----------------
+* Update mongodb-core to 2.1.12
+  * NODE-1019 Set keepAlive to 300 seconds or 1/2 of socketTimeout if socketTimeout < keepAlive.
+  * Minor fix to report the correct state on error.
+  * NODE-1020 'family' was added to options to provide high priority for ipv6 addresses (Issue #1518, https://github.com/firej).
+  * Fix require_optional loading of bson-ext.
+  * Ensure no errors are thrown by replset if topology is destroyed before it finished connecting.
+  * NODE-999 SDAM fixes for Mongos and single Server event emitting.
+  * NODE-1014 Set socketTimeout to default to 360 seconds.
+  * NODE-1019 Set keepAlive to 300 seconds or 1/2 of socketTimeout if socketTimeout < keepAlive.
+* Just handle Collection name errors distinctly from general callback errors avoiding double callbacks in Db.collection.
+* NODE-999 SDAM fixes for Mongos and single Server event emitting.
+* NODE-1000 Added guard condition for upload.js checkDone function in case of race condition caused by late arriving chunk write.
+
+2.2.27 2017-05-22
+-----------------
+* Updated mongodb-core to 2.1.11
+    * NODE-987 Clear out old intervalIds on when calling topologyMonitor.
+    * NODE-987 Moved filtering to pingServer method and added test case.
+    * Check for connection destroyed just before writing out and flush out operations correctly if it is (Issue #179, https://github.com/jmholzinger).
+    * NODE-989 Refactored Replicaset monitoring to correcly monitor newly added servers, Also extracted setTimeout and setInterval to use custom wrappers Timeout and Interval.
+* NODE-985 Deprecated Db.authenticate and Admin.authenticate and moved auth methods into authenticate.js to ensure MongoClient.connect does not print deprecation warnings.
+* NODE-988 Merged readConcern and hint correctly on collection(...).find(...).count()
+* Fix passing the readConcern option to MongoClient.connect (Issue #1514, https://github.com/bausmeier).
+* NODE-996 Propegate all events up to a MongoClient instance.
+* Allow saving doc with null `_id` (Issue #1517, https://github.com/vkarpov15).
+* NODE-993 Expose hasNext for command cursor and add docs for both CommandCursor and Aggregation Cursor.
+
+2.2.26 2017-04-18
+-----------------
+* Updated mongodb-core to 2.1.10
+    * NODE-981 delegate auth to replset/mongos if inTopology is set.
+    * NODE-978 Wrap connection.end in try/catch for node 0.10.x issue causing exceptions to be thrown, Also surfaced getConnection for mongos and replset.
+    * Remove dynamic require (Issue #175, https://github.com/tellnes).
+    * NODE-696 Handle interrupted error for createIndexes.
+    * Fixed isse when user is executing find command using Server.command and it get interpreted as a wire protcol message, #172.
+    * NODE-966 promoteValues not being promoted correctly to getMore.
+    * Merged in fix for flushing out monitoring operations.
+* NODE-983 Add cursorId to aggregate and listCollections commands (Issue, #1510).
+* Mark group and profilingInfo as deprecated methods
+* NODE-956 DOCS Examples.
+* Update readable-stream to version 2.2.7.
+* NODE-978 Added test case to uncover connection.end issue for node 0.10.x.
+* NODE-972 Fix(db): don't remove database name if collectionName == dbName (Issue, #1502)
+* Fixed merging of writeConcerns on db.collection method.
+* NODE-970 mix in readPreference for strict mode listCollections callback.
+* NODE-966 added testcase for promoteValues being applied to getMore commands.
+* NODE-962 Merge in ignoreUndefined from collection level for find/findOne.
+* Remove multi option from updateMany tests/docs (Issue #1499, https://github.com/spratt).
+* NODE-963 Correctly handle cursor.count when using APM.
+
+2.2.25 2017-03-17
+-----------------
+* Don't rely on global toString() for checking if object (Issue #1494, https://github.com/vkarpov15).
+* Remove obsolete option uri_decode_auth (Issue #1488, https://github.com/kamagatos).
+* NODE-936 Correctly translate ReadPreference to CoreReadPreference for mongos queries.
+* Exposed BSONRegExp type.
+* NODE-950 push correct index for INSERT ops (https://github.com/mbroadst).
+* NODE-951 Added support for sslCRL option and added a test case for it.
+* NODE-953 Made batchSize issue general at cursor level.
+* NODE-954 Remove write concern from reindex helper as it will not be supported in 3.6.
+* Updated mongodb-core to 2.1.9.
+    * Return lastIsMaster correctly when connecting with secondaryOnlyConnectionAllowed is set to true and only a secondary is available in replica state.
+    * Clone options when passed to wireProtocol handler to avoid intermittent modifications causing errors.
+    * Ensure SSL error propegates better for Replset connections when there is a SSL validation error.
+    * NODE-957 Fixed issue where < batchSize not causing cursor to be closed on execution of first batch.
+    * NODE-958 Store reconnectConnection on pool object to allow destroy to close immediately.
+
+2.2.24 2017-02-14
+-----------------
+* NODE-935, NODE-931 Make MongoClient strict options validation optional and instead print annoying console.warn entries.
+
+2.2.23 2017-02-13
+-----------------
+* Updated mongodb-core to 2.1.8.
+  * NODE-925 ensure we reschedule operations while pool is < poolSize while pool is growing and there are no connections with not currently performing work.
+  * NODE-927 fixes issue where authentication was performed against arbiter instances.
+  * NODE-915 Normalize all host names to avoid comparison issues.
+  * Fixed issue where pool.destroy would never finish due to a single operation not being executed and keeping it open.
+* NODE-931 Validates all the options for MongoClient.connect and fixes missing connection settings.
+* NODE-929 Update SSL tutorial to correctly reflect the non-need for server/mongos/replset subobjects
+* Fix sensitive command check (Issue #1473, https://github.com/Annoraaq)
+
+2.2.22 2017-01-24
+-----------------
+* Updated mongodb-core to 2.1.7.
+  * NODE-919 ReplicaSet connection does not close immediately (Issue #156).
+  * NODE-901 Fixed bug when normalizing host names.
+  * NODE-909 Fixed readPreference issue caused by direct connection to primary.
+  * NODE-910 Fixed issue when bufferMaxEntries == 0 and read preference set to nearest.
+* Add missing unref implementations for replset, mongos (Issue #1455, https://github.com/zbjornson)
+
+2.2.21 2017-01-13
+-----------------
+* Updated mongodb-core to 2.1.6.
+  * NODE-908 Keep auth contexts in replset and mongos topology to ensure correct application of authentication credentials when primary is first server to be detected causing an immediate connect event to happen.
+
+2.2.20 2017-01-11
+-----------------
+* Updated mongodb-core to 2.1.5 to include bson 1.0.4 and bson-ext 1.0.4 due to Buffer.from being broken in early node 4.x versions.
+
+2.2.19 2017-01-03
+-----------------
+* Corrupted Npm release fix.
+
+2.2.18 2017-01-03
+-----------------
+* Updated mongodb-core to 2.1.4 to fix bson ObjectId toString issue with utils.inspect messing with toString parameters in node 6.
+
+2.2.17 2017-01-02
+-----------------
+* updated createCollection doc options and linked to create command.
+* Updated mongodb-core to 2.1.3.
+  * Monitoring operations are re-scheduled in pool if it cannot find a connection that does not already have scheduled work on it, this is to avoid the monitoring socket timeout being applied to any existing operations on the socket due to pipelining
+  * Moved replicaset monitoring away from serial mode and to parallel mode.
+  * updated bson and bson-ext dependencies to 1.0.2.
+
+2.2.16 2016-12-13
+-----------------
+* NODE-899 reversed upsertedId change to bring back old behavior.
+
+2.2.15 2016-12-10
+-----------------
+* Updated mongodb-core to 2.1.2.
+  * Delay topologyMonitoring on successful attemptReconnect as no need to run a full scan immediately.
+  * Emit reconnect event in primary joining when in connected status for a replicaset (Fixes mongoose reconnect issue).
+
+2.2.14 2016-12-08
+-----------------
+* Updated mongodb-core to 2.1.1.
+* NODE-892 Passthrough options.readPreference to mongodb-core ReplSet instance.
+
+2.2.13 2016-12-05
+-----------------
+* Updated mongodb-core to 2.1.0.
+* NODE-889 Fixed issue where legacy killcursor wire protocol messages would not be sent when APM is enabled.
+* Expose parserType as property on topology objects.
+
+2.2.12 2016-11-29
+-----------------
+* Updated mongodb-core to 2.0.14.
+  * Updated bson library to 0.5.7.
+  * Dont leak connection.workItems elments when killCursor is called (Issue #150, https://github.com/mdlavin).
+  * Remove unnecessary errors formatting (Issue #149, https://github.com/akryvomaz).
+  * Only check isConnected against availableConnections (Issue #142).
+  * NODE-838 Provide better error message on failed to connect on first retry for Mongos topology.
+  * Set default servername to host is not passed through for sni.
+  * Made monitoring happen on exclusive connection and using connectionTimeout to handle the wait time before failure (Issue #148).
+  * NODE-859 Make minimum value of maxStalenessSeconds 90 seconds.
+  * NODE-852 Fix Kerberos module deprecations on linux and windows and release new kerberos version.
+  * NODE-850 Update Max Staleness implementation.
+  * NODE-849 username no longer required for MONGODB-X509 auth.
+  * NODE-848 BSON Regex flags must be alphabetically ordered.
+  * NODE-846 Create notice for all third party libraries.
+  * NODE-843 Executing bulk operations overwrites write concern parameter.
+  * NODE-842 Re-sync SDAM and SDAM Monitoring tests from Specs repo.
+  * NODE-840 Resync CRUD spec tests.
+  * Unescapable while(true) loop (Issue #152).
+* NODE-864 close event not emits during network issues using single server topology.
+* Introduced maxStalenessSeconds.
+* NODE-840 Added CRUD specification test cases and fix minor issues with upserts reporting matchedCount > 0.
+* Don't ignore Db-level authSource when using auth method.  (https://github.com/donaldguy).
+
+2.2.11 2016-10-21
+-----------------
+* Updated mongodb-core to 2.0.13.
+  - Fire callback when topology was destroyed (Issue #147, https://github.com/vkarpov15).
+  - Refactoring to support pipelining ala 1.4.x branch will retaining the benefits of the growing/shrinking pool (Issue #146).
+  - Fix typo in serverHeartbeatFailed event name (Issue #143, https://github.com/jakesjews).
+  - NODE-798 Driver hangs on count command in replica set with one member (Issue #141, https://github.com/isayme).
+* Updated bson library to 0.5.6.
+  - Included cyclic dependency detection
+* Fix typo in serverHeartbeatFailed event name (Issue #1418, https://github.com/jakesjews).
+* NODE-824, readPreference "nearest" does not work when specified at collection level.
+* NODE-822, GridFSBucketWriteStream end method does not handle optional parameters.
+* NODE-823, GridFSBucketWriteStream end: callback is invoked with invalid parameters.
+* NODE-829, Using Start/End offset option in GridFSBucketReadStream doesn't return the right sized buffer.
+
+2.2.10 2016-09-15
+-----------------
+* Updated mongodb-core to 2.0.12.
+* fix debug logging message not printing server name.
+* fixed application metadata being sent by wrong ismaster.
+* NODE-812 Fixed mongos stall due to proxy monitoring ismaster failure causing reconnect.
+* NODE-818 Replicaset timeouts in initial connect sequence can "no primary found".
+* Updated bson library to 0.5.5.
+* Added DBPointer up conversion to DBRef.
+* MongoDB 3.4-RC Pass **appname** through MongoClient.connect uri or options to allow metadata to be passed.
+* MongoDB 3.4-RC Pass collation options on update, findOne, find, createIndex, aggregate.
+* MongoDB 3.4-RC Allow write concerns to be passed to all supporting server commands.
+* MongoDB 3.4-RC Allow passing of **servername** as SSL options to support SNI.
+
+2.2.9 2016-08-29
+----------------
+* Updated mongodb-core to 2.0.11.
+* NODE-803, Fixed issue in how the latency window is calculated for Mongos topology causing issues for single proxy connections.
+* Avoid timeout in attemptReconnect causing multiple attemptReconnect attempts to happen (Issue #134, https://github.com/dead-horse).
+* Ensure promoteBuffers is propegated in same fashion as promoteValues and promoteLongs.
+* Don't treat ObjectId as object for mapReduce scope (Issue #1397, https://github.com/vkarpov15).
+
+2.2.8 2016-08-23
+----------------
+* Updated mongodb-core to 2.0.10.
+* Added promoteValues flag (default to true) to allow user to specify they only want wrapped BSON values back instead of promotion to native types.
+* Do not close mongos proxy connection on failed ismaster check in ha process (Issue #130).
+
+2.2.7 2016-08-19
+----------------
+* If only a single mongos is provided in the seedlist, fix issue where it would be assigned as single standalone server instead of mongos topology (Issue #130).
+* Updated mongodb-core to 2.0.9.
+* Allow promoteLongs to be passed in through Response.parse method and overrides default set on the connection.
+* NODE-798 Driver hangs on count command in replica set with one member.
+* Allow promoteLongs to be passed in through Response.parse method and overrides default set on the connection.
+* Allow passing in servername for TLS connections for SNI support.
+
+2.2.6 2016-08-16
+----------------
+* Updated mongodb-core to 2.0.8.
+* Allow execution of store operations independent of having both a primary and secondary available (Issue #123).
+* Fixed command execution issue for mongos to ensure buffering of commands when no mongos available.
+* Allow passing in an array of tags to ReadPreference constructor (Issue #1382, https://github.com/vkarpov15)
+* Added hashed connection names and fullResult.
+* Updated bson library to 0.5.3.
+* Enable maxTimeMS in count, distinct, findAndModify.
+
+2.2.5 2016-07-28
+----------------
+* Updated mongodb-core to 2.0.7.
+* Allow primary to be returned when secondaryPreferred is passed (Issue #117, https://github.com/dhendo).
+* Added better warnings when passing in illegal seed list members to a Mongos topology.
+* Minor attemptReconnect bug that would cause multiple attemptReconnect to run in parallel.
+* Fix wrong opType passed to disconnectHandler.add (Issue #121, https://github.com/adrian-gierakowski)
+* Implemented domain backward comp support enabled via domainsEnabled options on Server/ReplSet/Mongos and MongoClient.connect.
+
+2.2.4 2016-07-19
+----------------
+* NPM corrupted upload fix.
+
+2.2.3 2016-07-19
+----------------
+* Updated mongodb-core to 2.0.6.
+* Destroy connection on socket timeout due to newer node versions not closing the socket.
+
+2.2.2 2016-07-15
+----------------
+* Updated mongodb-core to 2.0.5.
+* Minor fixes to handle faster MongoClient connectivity from the driver, allowing single server instances to detect if they are a proxy.
+* Added numberOfConsecutiveTimeouts to pool that will destroy the pool if the number of consecutive timeouts > reconnectTries.
+* Print warning if seedlist servers host name does not match the one provided in it's ismaster.me field for Replicaset members.
+* Fix issue where Replicaset connection would not succeeed if there the replicaset was a single primary server setup.
+
+2.2.1 2016-07-11
+----------------
+* Updated mongodb-core to 2.0.4.
+* handle situation where user is providing seedlist names that do not match host list. fix allows for a single full discovery connection sweep before erroring out.
+* NODE-747 Polyfill for Object.assign for 0.12.x or 0.10.x.
+* NODE-746 Improves replicaset errors for wrong setName.
+
+2.2.0 2016-07-05
+----------------
+* Updated mongodb-core to 2.0.3.
+* Moved all authentication and handling of growing/shrinking of pool connections into actual pool.
+* All authentication methods now handle both auth/reauthenticate and logout events.
+* Introduced logout method to get rid of onAll option for logout command.
+* Updated bson to 0.5.0 that includes Decimal128 support.
+* Fixed logger error serialization issue.
+* Documentation fixes.
+* Implemented Server Selection Specification test suite.
+* Added warning level to logger.
+* Added warning message when sockeTimeout < haInterval for Replset/Mongos.
+* Mongos emits close event on no proxies available or when reconnect attempt fails.
+* Replset emits close event when no servers available or when attemptReconnect fails to reconnect.
+* Don't throw in auth methods but return error in callback.
+
+2.1.21 2016-05-30
+-----------------
+* Updated mongodb-core to 1.3.21.
+* Pool gets stuck if a connection marked for immediateRelease times out (Issue #99, https://github.com/nbrachet).
+* Make authentication process retry up to authenticationRetries at authenticationRetryIntervalMS interval.
+* Made ismaster replicaset calls operate with connectTimeout or monitorSocketTimeout to lower impact of big socketTimeouts on monitoring performance.
+* Make sure connections mark as "immediateRelease" don't linger the inUserConnections list. Otherwise, after that connection times out, getAll() incorrectly returns more connections than are effectively present, causing the pool to not get restarted by reconnectServer. (Issue #99, https://github.com/nbrachet).
+* Make cursor getMore or killCursor correctly trigger pool reconnect to single server if pool has not been destroyed.
+* Make ismaster monitoring for single server connection default to avoid user confusion due to change in behavior.
+
+2.1.20 2016-05-25
+-----------------
+* Refactored MongoClient options handling to simplify the logic, unifying it.
+* NODE-707 Implemented openUploadStreamWithId on GridFS to allow for custom fileIds so users are able to customize shard key and shard distribution.
+* NODE-710 Allow setting driver loggerLevel and logger function from MongoClient options.
+* Updated mongodb-core to 1.3.20.
+* Minor fix for SSL errors on connection attempts, minor fix to reconnect handler for the server.
+* Don't write to socket before having registered the callback for commands, work around for windows issuing error events twice on node.js when socket gets destroyed by firewall.
+* Fix minor issue where connectingServers would not be removed correctly causing single server connections to not auto-reconnect.
+
+2.1.19 2016-05-17
+----------------
+* Handle situation where a server connection in a replicaset sometimes fails to be destroyed properly due to being in the middle of authentication when the destroy method is called on the replicaset causing it to be orphaned and never collected.
+* Ensure replicaset topology destroy is never called by SDAM.
+* Ensure all paths are correctly returned on inspectServer in replset.
+* Updated mongodb-core to 1.3.19 to fix minor connectivity issue on quick open/close of MongoClient connections on auth enabled mongodb Replicasets.
+
+2.1.18 2016-04-27
+-----------------
+* Updated mongodb-core to 1.3.18 to fix Node 6.0 issues.
+
+2.1.17 2016-04-26
+-----------------
+* Updated mongodb-core to 1.3.16 to work around issue with early versions of node 0.10.x due to missing unref method on ClearText streams.
+* INT-1308: Allow listIndexes to inherit readPreference from Collection or DB.
+* Fix timeout issue using new flags #1361.
+* Updated mongodb-core to 1.3.17.
+* Better handling of unique createIndex error.
+* Emit error only if db instance has an error listener.
+* DEFAULT authMechanism; don't throw error if explicitly set by user.
+
+2.1.16 2016-04-06
+-----------------
+* Updated mongodb-core to 1.3.16.
+
+2.1.15 2016-04-06
+-----------------
+* Updated mongodb-core to 1.3.15.
+* Set ssl, sslValidate etc to mongosOptions on url_parser (Issue #1352, https://github.com/rubenstolk).
+- NODE-687 Fixed issue where a server object failed to be destroyed if the replicaset state did not update successfully. This could leave active connections accumulating over time.
+- Fixed some situations where all connections are flushed due to a single connection in the connection pool closing.
+
+2.1.14 2016-03-29
+-----------------
+* Updated mongodb-core to 1.3.13.
+* Handle missing cursor on getMore when going through a mongos proxy by pinning to socket connection and not server.
+
+2.1.13 2016-03-29
+-----------------
+* Updated mongodb-core to 1.3.12.
+
+2.1.12 2016-03-29
+-----------------
+* Updated mongodb-core to 1.3.11.
+* Mongos setting acceptableLatencyMS exposed to control the latency women for mongos selection.
+* Mongos pickProxies fall back to closest mongos if no proxies meet latency window specified.
+* isConnected method for mongos uses same selection code as getServer.
+* Exceptions in cursor getServer trapped and correctly delegated to high level handler.
+
+2.1.11 2016-03-23
+-----------------
+* Updated mongodb-core to 1.3.10.
+* Introducing simplified connections settings.
+
+2.1.10 2016-03-21
+-----------------
+* Updated mongodb-core to 1.3.9.
+* Fixing issue that prevented mapReduce stats from being resolved (Issue #1351, https://github.com/davidgtonge)
+* Forwards SDAM monitoring events from mongodb-core.
+
+2.1.9 2016-03-16
+----------------
+* Updated mongodb-core to 1.3.7 to fix intermittent race condition that causes some users to experience big amounts of socket connections.
+* Makde bson parser in ordered/unordered bulk be directly from mongodb-core to avoid intermittent null error on mongoose.
+
+2.1.8 2016-03-14
+----------------
+* Updated mongodb-core to 1.3.5.
+* NODE-660 TypeError: Cannot read property 'noRelease' of undefined.
+* Harden MessageHandler in server.js to avoid issues where we cannot find a callback for an operation.
+* Ensure RequestId can never be larger than Max Number integer size.
+* NODE-661 typo in url_parser.js resulting in replSetServerOptions is not defined when connecting over ssl.
+* Confusing error with invalid partial index filter (Issue #1341, https://github.com/vkarpov15).
+* NODE-669 Should only error out promise for bulkWrite when error is a driver level error not a write error or write concern error.
+* NODE-662 shallow copy options on methods that are not currently doing it to avoid passed in options mutiation.
+* NODE-663 added lookup helper on aggregation cursor.
+* NODE-585 Result object specified incorrectly for findAndModify?.
+* NODE-666 harden validation for findAndModify CRUD methods.
+
+2.1.7 2016-02-09
+----------------
+* NODE-656 fixed corner case where cursor count command could be left without a connection available.
+* NODE-658 Work around issue that bufferMaxEntries:-1 for js gets interpreted wrongly due to double nature of Javascript numbers.
+* Fix: GridFS always returns the oldest version due to incorrect field name (Issue #1338, https://github.com/mdebruijne).
+* NODE-655 GridFS stream support for cancelling upload streams and download streams (Issue #1339, https://github.com/vkarpov15).
+* NODE-657 insertOne don`t return promise in some cases.
+* Added destroy alias for abort function on GridFSBucketWriteStream.
+
+2.1.6 2016-02-05
+----------------
+* Updated mongodb-core to 1.3.1.
+
+2.1.5 2016-02-04
+----------------
+* Updated mongodb-core to 1.3.0.
+* Added raw support for the command function on topologies.
+* Fixed issue where raw results that fell on batchSize boundaries failed (Issue #72)
+* Copy over all the properties to the callback returned from bindToDomain, (Issue #72)
+* Added connection hash id to be able to reference connection host/name without leaking it outside of driver.
+* NODE-638, Cannot authenticate database user with utf-8 password.
+* Refactored pool to be worker queue based, minimizing the impact a slow query have on throughput as long as # slow queries < # connections in the pool.
+* Pool now grows and shrinks correctly depending on demand not causing a full pool reconnect.
+* Improvements in monitoring of a Replicaset where in certain situations the inquiry process could get exited.
+* Switched to using Array.push instead of concat for use cases of a lot of documents.
+* Fixed issue where re-authentication could loose the credentials if whole Replicaset disconnected at once.
+* Added peer optional dependencies support using require_optional module.
+* Bug is listCollections for collection names that start with db name (Issue #1333, https://github.com/flyingfisher)
+* Emit error before closing stream (Issue #1335, https://github.com/eagleeye)
+
+2.1.4 2016-01-12
+----------------
+* Restricted node engine to >0.10.3 (https://jira.mongodb.org/browse/NODE-635).
+* Multiple database names ignored without a warning (https://jira.mongodb.org/browse/NODE-636, Issue #1324, https://github.com/yousefhamza).
+* Convert custom readPreference objects in collection.js (Issue #1326, https://github.com/Machyne).
+
+2.1.3 2016-01-04
+----------------
+* Updated mongodb-core to 1.2.31.
+* Allow connection to secondary if primaryPreferred or secondaryPreferred (Issue #70, https://github.com/leichter)
+
+2.1.2 2015-12-23
+----------------
+* Updated mongodb-core to 1.2.30.
+* Pool allocates size + 1 connections when using replicasets, reserving additional pool connection for monitoring exclusively.
+* Fixes bug when all replicaset members are down, that would cause it to fail to reconnect using the originally provided seedlist.
+
+2.1.1 2015-12-13
+----------------
+* Surfaced checkServerIdentity options for MongoClient, Server, ReplSet and Mongos to allow for control of the checkServerIdentity method available in Node.s 0.12.x or higher.
+* Added readPreference support to listCollections and listIndexes helpers.
+* Updated mongodb-core to 1.2.28.
+
+2.1.0 2015-12-06
+----------------
+* Implements the connection string specification, https://github.com/mongodb/specifications/blob/master/source/connection-string/connection-string-spec.rst.
+* Implements the new GridFS specification, https://github.com/mongodb/specifications/blob/master/source/gridfs/gridfs-spec.rst.
+* Full MongoDB 3.2 support.
+* NODE-601 Added maxAwaitTimeMS support for 3.2 getMore to allow for custom timeouts on tailable cursors.
+* Updated mongodb-core to 1.2.26.
+* Return destination in GridStore pipe function.
+* NODE-606 better error handling on destroyed topology for db.js methods.
+* Added isDestroyed method to server, replset and mongos topologies.
+* Upgraded test suite to run using mongodb-topology-manager.
+
+2.0.53 2015-12-23
+-----------------
+* Updated mongodb-core to 1.2.30.
+* Pool allocates size + 1 connections when using replicasets, reserving additional pool connection for monitoring exclusively.
+* Fixes bug when all replicaset members are down, that would cause it to fail to reconnect using the originally provided seedlist.
+
+2.0.52 2015-12-14
+-----------------
+* removed remove from Gridstore.close.
+
+2.0.51 2015-12-13
+-----------------
+* Surfaced checkServerIdentity options for MongoClient, Server, ReplSet and Mongos to allow for control of the checkServerIdentity method available in Node.s 0.12.x or higher.
+* Added readPreference support to listCollections and listIndexes helpers.
+* Updated mongodb-core to 1.2.28.
+
+2.0.50 2015-12-06
+-----------------
+* Updated mongodb-core to 1.2.26.
+
+2.0.49 2015-11-20
+-----------------
+* Updated mongodb-core to 1.2.24 with several fixes.
+  * Fix Automattic/mongoose#3481; flush callbacks on error, (Issue #57, https://github.com/vkarpov15).
+  * $explain query for wire protocol 2.6 and 2.4 does not set number of returned documents to -1 but to 0.
+  * ismaster runs against admin.$cmd instead of system.$cmd.
+  * Fixes to handle getMore command errors for MongoDB 3.2
+  * Allows the process to properly close upon a Db.close() call on the replica set by shutting down the haTimer and closing arbiter connections.
+
+2.0.48 2015-11-07
+-----------------
+* GridFS no longer performs any deletes when writing a brand new file that does not have any previous <db>.fs.chunks or <db>.fs.files documents.
+* Updated mongodb-core to 1.2.21.
+* Hardened the checking for replicaset equality checks.
+* OpReplay flag correctly set on Wire protocol query.
+* Mongos load balancing added, introduced localThresholdMS to control the feature.
+* Kerberos now a peerDependency, making it not install it by default in Node 5.0 or higher.
+
+2.0.47 2015-10-28
+-----------------
+* Updated mongodb-core to 1.2.20.
+* Fixed bug in arbiter connection capping code.
+* NODE-599 correctly handle arrays of server tags in order of priority.
+* Fix for 2.6 wire protocol handler related to readPreference handling.
+* Added maxAwaitTimeMS support for 3.2 getMore to allow for custom timeouts on tailable cursors.
+* Make CoreCursor check for $err before saying that 'next' succeeded (Issue #53, https://github.com/vkarpov15).
+
+2.0.46 2015-10-15
+-----------------
+* Updated mongodb-core to 1.2.19.
+* NODE-578 Order of sort fields is lost for numeric field names.
+* Expose BSON Map (ES6 Map or polyfill).
+* Minor fixes for APM support to pass extended APM test suite.
+
+2.0.45 2015-09-30
+-----------------
+* NODE-566 Fix issue with rewind on capped collections causing cursor state to be reset on connection loss.
+
+2.0.44 2015-09-28
+-----------------
+* Bug fixes for APM upconverting of legacy INSERT/UPDATE/REMOVE wire protocol messages.
+* NODE-562, fixed issue where a Replicaset MongoDB URI with a single seed and replSet name set would cause a single direct connection instead of topology discovery.
+* Updated mongodb-core to 1.2.14.
+* NODE-563 Introduced options.ignoreUndefined for db class and MongoClient db options, made serialize undefined to null default again but allowing for overrides on insert/update/delete operations.
+* Use handleCallback if result is an error for count queries. (Issue #1298, https://github.com/agclever)
+* Rewind cursor to correctly force reconnect on capped collections when first query comes back empty.
+* NODE-571 added code 59 to legacy server errors when SCRAM-SHA-1 mechanism fails.
+* NODE-572 Remove examples that use the second parameter to `find()`.
+
+2.0.43 2015-09-14
+-----------------
+* Propagate timeout event correctly to db instances.
+* Application Monitoring API (APM) implemented.
+* NOT providing replSet name in MongoClient connection URI will force single server connection. Fixes issue where it was impossible to directly connect to a replicaset member server.
+* Updated mongodb-core to 1.2.12.
+* NODE-541 Initial Support "read committed" isolation level where "committed" means confimed by the voting majority of a replica set.
+* GridStore doesn't share readPreference setting from connection string. (Issue #1295, https://github.com/zhangyaoxing)
+* fixed forceServerObjectId calls (Issue #1292, https://github.com/d-mon-)
+* Pass promise library through to DB function (Issue #1294, https://github.com/RovingCodeMonkey)
+
+2.0.42 2015-08-18
+-----------------
+* Added test case to exercise all non-crud methods on mongos topologies, fixed numberOfConnectedServers on mongos topology instance.
+
+2.0.41 2015-08-14
+-----------------
+* Added missing Mongos.prototype.parserType function.
+* Updated mongodb-core to 1.2.10.
+
+2.0.40 2015-07-14
+-----------------
+* Updated mongodb-core to 1.2.9 for 2.4 wire protocol error handler fix.
+* NODE-525 Reset connectionTimeout after it's overwritten by tls.connect.
+* NODE-518 connectTimeoutMS is doubled in 2.0.39.
+* NODE-506 Ensures that errors from bulk unordered and ordered are instanceof Error (Issue #1282, https://github.com/owenallenaz).
+* NODE-526 Unique index not throwing duplicate key error.
+* NODE-528 Ignore undefined fields in Collection.find().
+* NODE-527 The API example for collection.createIndex shows Db.createIndex functionality.
+
+2.0.39 2015-07-14
+-----------------
+* Updated mongodb-core to 1.2.6 for NODE-505.
+
+2.0.38 2015-07-14
+-----------------
+* NODE-505 Query fails to find records that have a 'result' property with an array value.
+
+2.0.37 2015-07-14
+-----------------
+* NODE-504 Collection * Default options when using promiseLibrary.
+* NODE-500 Accidental repeat of hostname in seed list multiplies total connections persistently.
+* Updated mongodb-core to 1.2.5 to fix NODE-492.
+
+2.0.36 2015-07-07
+-----------------
+* Fully promisified allowing the use of ES6 generators and libraries like co. Also allows for BYOP (Bring your own promises).
+* NODE-493 updated mongodb-core to 1.2.4 to ensure we cannot DDOS the mongod or mongos process on large connection pool sizes.
+
+2.0.35 2015-06-17
+-----------------
+* Upgraded to mongodb-core 1.2.2 including removing warnings when C++ bson parser is not available and a fix for SCRAM authentication.
+
+2.0.34 2015-06-17
+-----------------
+* Upgraded to mongodb-core 1.2.1 speeding up serialization and removing the need for the c++ bson extension.
+* NODE-486 fixed issue related to limit and skip when calling toArray in 2.0 driver.
+* NODE-483 throw error if capabilities of topology is queries before topology has performed connection setup.
+* NODE-482 fixed issue where MongoClient.connect would incorrectly identify a replset seed list server as a non replicaset member.
+* NODE-487 fixed issue where killcursor command was not being sent correctly on limit and skip queries.
+
+2.0.33 2015-05-20
+-----------------
+* Bumped mongodb-core to 1.1.32.
+
+2.0.32 2015-05-19
+-----------------
+* NODE-463 db.close immediately executes its callback.
+* Don't only emit server close event once (Issue #1276, https://github.com/vkarpov15).
+* NODE-464 Updated mongodb-core to 1.1.31 that uses a single socket connection to arbiters and hidden servers as well as emitting all event correctly.
+
+2.0.31 2015-05-08
+-----------------
+* NODE-461 Tripping on error "no chunks found for file, possibly corrupt" when there is no error.
+
+2.0.30 2015-05-07
+-----------------
+* NODE-460 fix; don't set authMechanism for user in db.authenticate() to avoid mongoose authentication issue.
+
+2.0.29 2015-05-07
+-----------------
+* NODE-444 Possible memory leak, too many listeners added.
+* NODE-459 Auth failure using Node 0.8.28, MongoDB 3.0.2 & mongodb-node-native 1.4.35.
+* Bumped mongodb-core to 1.1.26.
+
+2.0.28 2015-04-24
+-----------------
+* Bumped mongodb-core to 1.1.25
+* Added Cursor.prototype.setCursorOption to allow for setting node specific cursor options for tailable cursors.
+* NODE-430 Cursor.count() opts argument masked by var opts = {}
+* NODE-406 Implemented Cursor.prototype.map function tapping into MongoClient cursor transforms.
+* NODE-438 replaceOne is not returning the result.ops property as described in the docs.
+* NODE-433 _read, pipe and write all open gridstore automatically if not open.
+* NODE-426 ensure drain event is emitted after write function returns, fixes intermittent issues in writing files to gridstore.
+* NODE-440 GridStoreStream._read() doesn't check GridStore.read() error.
+* Always use readPreference = primary for findAndModify command (ignore passed in read preferences) (Issue #1274, https://github.com/vkarpov15).
+* Minor fix in GridStore.exists for dealing with regular expressions searches.
+
+2.0.27 2015-04-07
+-----------------
+* NODE-410 Correctly handle issue with pause/resume in Node 0.10.x that causes exceptions when using the Node 0.12.0 style streams.
+
+2.0.26 2015-04-07
+-----------------
+* Implements the Common Index specification Standard API at https://github.com/mongodb/specifications/blob/master/source/index-management.rst.
+* NODE-408 Expose GridStore.currentChunk.chunkNumber.
+
+2.0.25 2015-03-26
+-----------------
+* Upgraded mongodb-core to 1.1.21, making the C++ bson code an optional dependency to the bson module.
+
+2.0.24 2015-03-24
+-----------------
+* NODE-395 Socket Not Closing, db.close called before full set finished initalizing leading to server connections in progress not being closed properly.
+* Upgraded mongodb-core to 1.1.20.
+
+2.0.23 2015-03-21
+-----------------
+* NODE-380 Correctly return MongoError from toError method.
+* Fixed issue where addCursorFlag was not correctly setting the flag on the command for mongodb-core.
+* NODE-388 Changed length from method to property on order.js/unordered.js bulk operations.
+* Upgraded mongodb-core to 1.1.19.
+
+2.0.22 2015-03-16
+-----------------
+* NODE-377, fixed issue where tags would correctly be checked on secondary and nearest to filter out eligible server candidates.
+* Upgraded mongodb-core to 1.1.17.
+
+2.0.21 2015-03-06
+-----------------
+* Upgraded mongodb-core to 1.1.16 making sslValidate default to true to force validation on connection unless overriden by the user.
+
+2.0.20 2015-03-04
+-----------------
+* Updated mongodb-core 1.1.15 to relax pickserver method.
+
+2.0.19 2015-03-03
+-----------------
+* NODE-376 Fixes issue * Unordered batch incorrectly tracks batch size when switching batch types (Issue #1261, https://github.com/meirgottlieb)
+* NODE-379 Fixes bug in cursor.count() that causes the result to always be zero for dotted collection names (Issue #1262, https://github.com/vsivsi)
+* Expose MongoError from mongodb-core (Issue #1260, https://github.com/tjconcept)
+
+2.0.18 2015-02-27
+-----------------
+* Bumped mongodb-core 1.1.14 to ensure passives are correctly added as secondaries.
+
+2.0.17 2015-02-27
+-----------------
+* NODE-336 Added length function to ordered and unordered bulk operations to be able know the amount of current operations in bulk.
+* Bumped mongodb-core 1.1.13 to ensure passives are correctly added as secondaries.
+
+2.0.16 2015-02-16
+-----------------
+* listCollection now returns filtered result correctly removing db name for 2.6 or earlier servers.
+* Bumped mongodb-core 1.1.12 to correctly work for node 0.12.0 and io.js.
+* Add ability to get collection name from cursor (Issue #1253, https://github.com/vkarpov15)
+
+2.0.15 2015-02-02
+-----------------
+* Unified behavior of listCollections results so 3.0 and pre 3.0 return same type of results.
+* Bumped mongodb-core to 1.1.11 to support per document tranforms in cursors as well as relaxing the setName requirement.
+* NODE-360 Aggregation cursor and command correctly passing down the maxTimeMS property.
+* Added ~1.0 mongodb-tools module for test running.
+* Remove the required setName for replicaset connections, if not set it will pick the first setName returned.
+
+2.0.14 2015-01-21
+-----------------
+* Fixed some MongoClient.connect options pass through issues and added test coverage.
+* Bumped mongodb-core to 1.1.9 including fixes for io.js
+
+2.0.13 2015-01-09
+-----------------
+* Bumped mongodb-core to 1.1.8.
+* Optimized query path for performance, moving Object.defineProperty outside of constructors.
+
+2.0.12 2014-12-22
+-----------------
+* Minor fixes to listCollections to ensure correct querying of a collection when using a string.
+
+2.0.11 2014-12-19
+-----------------
+* listCollections filters out index namespaces on < 2.8 correctly
+* Bumped mongo-client to 1.1.7
+
+2.0.10 2014-12-18
+-----------------
+* NODE-328 fixed db.open return when no callback available issue and added test.
+* NODE-327 Refactored listCollections to return cursor to support 2.8.
+* NODE-327 Added listIndexes method and refactored internal methods to use the new command helper.
+* NODE-335 Cannot create index for nested objects fixed by relaxing key checking for createIndex helper.
+* Enable setting of connectTimeoutMS (Issue #1235, https://github.com/vkarpov15)
+* Bumped mongo-client to 1.1.6
+
+2.0.9 2014-12-01
+----------------
+* Bumped mongodb-core to 1.1.3 fixing global leaked variables and introducing strict across all classes.
+* All classes are now strict (Issue #1233)
+* NODE-324 Refactored insert/update/remove and all other crud opts to rely on internal methods to avoid any recursion.
+* Fixed recursion issues in debug logging due to JSON.stringify()
+* Documentation fixes (Issue #1232, https://github.com/wsmoak)
+* Fix writeConcern in Db.prototype.ensureIndex (Issue #1231, https://github.com/Qard)
+
+2.0.8 2014-11-28
+----------------
+* NODE-322 Finished up prototype refactoring of Db class.
+* NODE-322 Exposed Cursor in index.js for New Relic.
+
+2.0.7 2014-11-20
+----------------
+* Bumped mongodb-core to 1.1.2 fixing a UTF8 encoding issue for collection names.
+* NODE-318 collection.update error while setting a function with serializeFunctions option.
+* Documentation fixes.
+
+2.0.6 2014-11-14
+----------------
+* Refactored code to be prototype based instead of privileged methods.
+* Bumped mongodb-core to 1.1.1 to take advantage of the prototype based refactorings.
+* Implemented missing aspects of the CRUD specification.
+* Fixed documentation issues.
+* Fixed global leak REFERENCE_BY_ID in gridfs grid_store (Issue #1225, https://github.com/j)
+* Fix LearnBoost/mongoose#2313: don't let user accidentally clobber geoNear params (Issue #1223, https://github.com/vkarpov15)
+
+2.0.5 2014-10-29
+----------------
+* Minor fixes to documentation and generation of documentation.
+* NODE-306 (No results in aggregation cursor when collection name contains a dot), Merged code for cursor and aggregation cursor.
+
+2.0.4 2014-10-23
+----------------
+* Allow for single replicaset seed list with no setName specified (Issue #1220, https://github.com/imaman)
+* Made each rewind on each call allowing for re-using the cursor.
+* Fixed issue where incorrect iterations would happen on each for extensive batchSizes.
+* NODE-301 specifying maxTimeMS on find causes all fields to be omitted from result.
+
+2.0.3 2014-10-14
+----------------
+* NODE-297 Aggregate Broken for case of pipeline with no options.
+
+2.0.2 2014-10-08
+----------------
+* Bumped mongodb-core to 1.0.2.
+* Fixed bson module dependency issue by relying on the mongodb-core one.
+* Use findOne instead of find followed by nextObject (Issue #1216, https://github.com/sergeyksv)
+
+2.0.1 2014-10-07
+----------------
+* Dependency fix
+
+2.0.0 2014-10-07
+----------------
+* First release of 2.0 driver
+
+2.0.0-alpha2 2014-10-02
+-----------------------
+* CRUD API (insertOne, insertMany, updateOne, updateMany, removeOne, removeMany, bulkWrite, findOneAndDelete, findOneAndUpdate, findOneAndReplace)
+* Cluster Management Spec compatible.
+
+2.0.0-alpha1 2014-09-08
+-----------------------
+* Insert method allows only up 1000 pr batch for legacy as well as 2.6 mode
+* Streaming behavior is 0.10.x or higher with backwards compatibility using readable-stream npm package
+* Gridfs stream only available through .stream() method due to overlapping names on Gridstore object and streams in 0.10.x and higher of node
+* remove third result on update and remove and return the whole result document instead (getting rid of the weird 3 result parameters)
+    * Might break some application
+* Returns the actual mongodb-core result instead of just the number of records changed for insert/update/remove
+* MongoClient only has the connect method (no ability instantiate with Server, ReplSet or similar)
+* Removed Grid class
+* GridStore only supports w+ for metadata updates, no appending to file as it's not thread safe and can cause corruption of the data
+    + seek will fail if attempt to use with w or w+
+    + write will fail if attempted with w+ or r
+    + w+ only works for updating metadata on a file
+* Cursor toArray and each resets and re-runs the cursor
+* FindAndModify returns whole result document instead of just value
+* Extend cursor to allow for setting all the options via methods instead of dealing with the current messed up find
+* Removed db.dereference method
+* Removed db.cursorInfo method
+* Removed db.stats method
+* Removed db.collectionNames not needed anymore as it's just a specialized case of listCollections
+* Removed db.collectionInfo removed due to not being compatible with new storage engines in 2.8 as they need to use the listCollections command due to system collections not working for namespaces.
+* Added db.listCollections to replace several methods above
+
+1.4.10 2014-09-04
+-----------------
+* Fixed BSON and Kerberos compilation issues
+* Bumped BSON to ~0.2 always installing latest BSON 0.2.x series
+* Fixed Kerberos and bumped to 0.0.4
+
+1.4.9 2014-08-26
+----------------
+* Check _bsonType for Binary (Issue #1202, https://github.com/mchapman)
+* Remove duplicate Cursor constructor (Issue #1201, https://github.com/KenPowers)
+* Added missing parameter in the documentation (Issue #1199, https://github.com/wpjunior)
+* Documented third parameter on the update callback(Issue #1196, https://github.com/gabmontes)
+* NODE-240 Operations on SSL connection hang on node 0.11.x
+* NODE-235 writeResult is not being passed on when error occurs in insert
+* NODE-229 Allow count to work with query hints
+* NODE-233 collection.save() does not support fullResult
+* NODE-244 Should parseError also emit a `disconnected` event?
+* NODE-246 Cursors are inefficiently constructed and consequently cannot be promisified.
+* NODE-248 Crash with X509 auth
+* NODE-252 Uncaught Exception in Base.__executeAllServerSpecificErrorCallbacks
+* Bumped BSON parser to 0.2.12
+
+
+1.4.8 2014-08-01
+----------------
+* NODE-205 correctly emit authenticate event
+* NODE-210 ensure no undefined connection error when checking server state
+* NODE-212 correctly inherit socketTimeoutMS from replicaset when HA process adds new servers or reconnects to existing ones
+* NODE-220 don't throw error if ensureIndex errors out in Gridstore
+* Updated bson to 0.2.11 to ensure correct toBSON behavior when returning non object in nested classes
+* Fixed test running filters
+* Wrap debug log in a call to format (Issue #1187, https://github.com/andyroyle)
+* False option values should not trigger w:1 (Issue #1186, https://github.com/jsdevel)
+* Fix aggregatestream.close(Issue #1194, https://github.com/jonathanong)
+* Fixed parsing issue for w:0 in url parser when in connection string
+* Modified collection.geoNear to support a geoJSON point or legacy coordinate pair (Issue #1198, https://github.com/mmacmillan)
+
+1.4.7 2014-06-18
+----------------
+* Make callbacks to be executed in right domain when server comes back up (Issue #1184, https://github.com/anton-kotenko)
+* Fix issue where currentOp query against mongos would fail due to mongos passing through $readPreference field to mongod (CS-X)
+
+1.4.6 2014-06-12
+----------------
+* Added better support for MongoClient IP6 parsing (Issue #1181, https://github.com/micovery)
+* Remove options check on index creation (Issue #1179, Issue #1183, https://github.com/jdesboeufs, https://github.com/rubenvereecken)
+* Added missing type check before calling optional callback function (Issue #1180)
+
+1.4.5 2014-05-21
+----------------
+* Added fullResult flag to insert/update/remove which will pass raw result document back. Document contents will vary depending on the server version the driver is talking to. No attempt is made to coerce a joint response.
+* Fix to avoid MongoClient.connect hanging during auth when secondaries building indexes pre 2.6.
+* return the destination stream in GridStore.pipe (Issue #1176, https://github.com/iamdoron)
+
+1.4.4 2014-05-13
+----------------
+* Bumped BSON version to use the NaN 1.0 package, fixed strict comparison issue for ObjectID
+* Removed leaking global variable (Issue #1174, https://github.com/dainis)
+* MongoClient respects connectTimeoutMS for initial discovery process (NODE-185)
+* Fix bug with return messages larger than 16MB but smaller than max BSON Message Size (NODE-184)
+
+1.4.3 2014-05-01
+----------------
+* Clone options for commands to avoid polluting original options passed from Mongoose (Issue #1171, https://github.com/vkarpov15)
+* Made geoNear and geoHaystackSearch only clean out allowed options from command generation (Issue #1167)
+* Fixed typo for allowDiskUse (Issue #1168, https://github.com/joaofranca)
+* A 'mapReduce' function changed 'function' to instance '\<Object\>' of 'Code' class (Issue #1165, https://github.com/exabugs)
+* Made findAndModify set sort only when explicitly set (Issue #1163, https://github.com/sars)
+* Rewriting a gridStore file by id should use a new filename if provided (Issue #1169, https://github.com/vsivsi)
+
+1.4.2 2014-04-15
+----------------
+* Fix for inheritance of readPreferences from MongoClient NODE-168/NODE-169
+* Merged in fix for ping strategy to avoid hitting non-pinged servers (Issue #1161, https://github.com/vaseker)
+* Merged in fix for correct debug output for connection messages (Issue #1158, https://github.com/vaseker)
+* Fixed global variable leak (Issue #1160, https://github.com/vaseker)
+
+1.4.1 2014-04-09
+----------------
+* Correctly emit joined event when primary change
+* Add _id to documents correctly when using bulk operations
+
+1.4.0 2014-04-03
+----------------
+* All node exceptions will no longer be caught if on('error') is defined
+* Added X509 auth support
+* Fix for MongoClient connection timeout issue (NODE-97)
+* Pass through error messages from parseError instead of just text (Issue #1125)
+* Close db connection on error (Issue #1128, https://github.com/benighted)
+* Fixed documentation generation
+* Added aggregation cursor for 2.6 and emulated cursor for pre 2.6 (uses stream2)
+* New Bulk API implementation using write commands for 2.6 and down converts for pre 2.6
+* Insert/Update/Remove using new write commands when available
+* Added support for new roles based API's in 2.6 for addUser/removeUser
+* Added bufferMaxEntries to start failing if the buffer hits the specified number of entries
+* Upgraded BSON parser to version 0.2.7 to work with < 0.11.10 C++ API changes
+* Support for OP_LOG_REPLAY flag (NODE-94)
+* Fixes for SSL HA ping and discovery.
+* Uses createIndexes if available for ensureIndex/createIndex
+* Added parallelCollectionScan method to collection returning CommandCursor instances for cursors
+* Made CommandCursor behave as Readable stream.
+* Only Db honors readPreference settings, removed Server.js legacy readPreference settings due to user confusion.
+* Reconnect event emitted by ReplSet/Mongos/Server after reconnect and before replaying of buffered operations.
+* GridFS buildMongoObject returns error on illegal md5 (NODE-157, https://github.com/iantocristian)
+* Default GridFS chunk size changed to (255 * 1024) bytes to optimize for collections defaulting to power of 2 sizes on 2.6.
+* Refactored commands to all go through command function ensuring consistent command execution.
+* Fixed issues where readPreferences where not correctly passed to mongos.
+* Catch error == null and make err detection more prominent (NODE-130)
+* Allow reads from arbiter for single server connection (NODE-117)
+* Handle error coming back with no documents (NODE-130)
+* Correctly use close parameter in Gridstore.write() (NODE-125)
+* Throw an error on a bulk find with no selector (NODE-129, https://github.com/vkarpov15)
+* Use a shallow copy of options in find() (NODE-124, https://github.com/vkarpov15)
+* Fix statistical strategy (NODE-158, https://github.com/vkarpov15)
+* GridFS off-by-one bug in lastChunkNumber() causes uncaught throw and data loss (Issue #1154, https://github.com/vsivsi)
+* GridStore drops passed `aliases` option, always results in `null` value in GridFS files (Issue #1152, https://github.com/vsivsi)
+* Remove superfluous connect object copying in index.js (Issue #1145, https://github.com/thomseddon)
+* Do not return false when the connection buffer is still empty (Issue #1143, https://github.com/eknkc)
+* Check ReadPreference object on ReplSet.canRead (Issue #1142, https://github.com/eknkc)
+* Fix unpack error on _executeQueryCommand (Issue #1141, https://github.com/eknkc)
+* Close db on failed connect so node can exit (Issue #1128, https://github.com/benighted)
+* Fix global leak with _write_concern (Issue #1126, https://github.com/shanejonas)
+
+1.3.19 2013-08-21
+-----------------
+* Correctly rethrowing errors after change from event emission to callbacks, compatibility with 0.10.X domains without breaking 0.8.X support.
+* Small fix to return the entire findAndModify result as the third parameter (Issue #1068)
+* No removal of "close" event handlers on server reconnect, emits "reconnect" event when reconnection happens. Reconnect Only applies for single server connections as of now as semantics for ReplSet and Mongos is not clear (Issue #1056)
+
+1.3.18 2013-08-10
+-----------------
+* Fixed issue when throwing exceptions in MongoClient.connect/Db.open (Issue #1057)
+* Fixed an issue where _events is not cleaned up correctly causing a slow steady memory leak.
+
+1.3.17 2013-08-07
+-----------------
+* Ignore return commands that have no registered callback
+* Made collection.count not use the db.command function
+* Fix throw exception on ping command (Issue #1055)
+
+1.3.16 2013-08-02
+-----------------
+* Fixes connection issue where lots of connections would happen if a server is in recovery mode during connection (Issue #1050, NODE-50, NODE-51)
+* Bug in unlink mulit filename (Issue #1054)
+
+1.3.15 2013-08-01
+-----------------
+* Memory leak issue due to node Issue #4390 where _events[id] is set to undefined instead of deleted leading to leaks in the Event Emitter over time
+
+1.3.14 2013-08-01
+-----------------
+* Fixed issue with checkKeys where it would error on X.X
+
+1.3.13 2013-07-31
+-----------------
+* Added override for checkKeys on insert/update (Warning will expose you to injection attacks) (Issue #1046)
+* BSON size checking now done pre serialization (Issue #1037)
+* Added isConnected returns false when no connection Pool exists (Issue #1043)
+* Unified command handling to ensure same handling (Issue #1041, #1042)
+* Correctly emit "open" and "fullsetup" across all Db's associated with Mongos, ReplSet or Server (Issue #1040)
+* Correctly handles bug in authentication when attempting to connect to a recovering node in a replicaset.
+* Correctly remove recovering servers from available servers in replicaset. Piggybacks on the ping command.
+* Removed findAndModify chaining to be compliant with behavior in other official drivers and to fix a known mongos issue.
+* Fixed issue with Kerberos authentication on Windows for re-authentication.
+* Fixed Mongos failover behavior to correctly throw out old servers.
+* Ensure stored queries/write ops are executed correctly after connection timeout
+* Added promoteLongs option for to allow for overriding the promotion of Longs to Numbers and return the actual Long.
+
+1.3.12 2013-07-19
+-----------------
+* Fixed issue where timeouts sometimes would behave wrongly (Issue #1032)
+* Fixed bug with callback third parameter on some commands (Issue #1033)
+* Fixed possible issue where killcursor command might leave hanging functions
+* Fixed issue where Mongos was not correctly removing dead servers from the pool of eligable servers
+* Throw error if dbName or collection name contains null character (at command level and at collection level)
+* Updated bson parser to 0.2.1 with security fix and non-promotion of Long values to javascript Numbers (once a long always a long)
+
+1.3.11 2013-07-04
+-----------------
+* Fixed errors on geoNear and geoSearch (Issue #1024, https://github.com/ebensing)
+* Add driver version to export (Issue #1021, https://github.com/aheckmann)
+* Add text to readpreference obedient commands (Issue #1019)
+* Drivers should check the query failure bit even on getmore response (Issue #1018)
+* Map reduce has incorrect expectations of 'inline' value for 'out' option (Issue #1016, https://github.com/rcotter)
+* Support SASL PLAIN authentication (Issue #1009)
+* Ability to use different Service Name on the driver for Kerberos Authentication (Issue #1008)
+* Remove unnecessary octal literal to allow the code to run in strict mode (Issue #1005, https://github.com/jamesallardice)
+* Proper handling of recovering nodes (when they go into recovery and when they return from recovery, Issue #1027)
+
+1.3.10 2013-06-17
+-----------------
+* Guard against possible undefined in server::canCheckoutWriter (Issue #992, https://github.com/willyaranda)
+* Fixed some duplicate test names (Issue #993, https://github.com/kawanet)
+* Introduced write and read concerns for GridFS (Issue #996)
+* Fixed commands not correctly respecting Collection level read preference (Issue #995, #999)
+* Fixed issue with pool size on replicaset connections (Issue #1000)
+* Execute all query commands on master switch (Issue #1002, https://github.com/fogaztuc)
+
+1.3.9 2013-06-05
+----------------
+* Fixed memory leak when findAndModify errors out on w>1 and chained callbacks not properly cleaned up.
+
+1.3.8 2013-05-31
+----------------
+* Fixed issue with socket death on windows where it emits error event instead of close event (Issue #987)
+* Emit authenticate event on db after authenticate method has finished on db instance (Issue #984)
+* Allows creation of MongoClient and do new MongoClient().connect(..). Emits open event when connection correct allowing for apps to react on event.
+
+1.3.7 2013-05-29
+----------------
+* After reconnect, tailable getMores go on inconsistent connections (Issue #981, #982, https://github.com/glasser)
+* Updated Bson to 0.1.9 to fix ARM support (Issue #985)
+
+1.3.6 2013-05-21
+----------------
+* Fixed issue where single server reconnect attempt would throw due to missing options variable (Issue #979)
+* Fixed issue where difference in ismaster server name and seed list caused connections issues, (Issue #976)
+
+1.3.5 2013-05-14
+----------------
+* Fixed issue where HA for replicaset would pick the same broken connection when attempting to ping the replicaset causing the replicaset to never recover.
+
+1.3.4 2013-05-14
+----------------
+* Fixed bug where options not correctly passed in for uri parser (Issue #973, https://github.com/supershabam)
+* Fixed bug when passing a named index hint (Issue #974)
+
+1.3.3 2013-05-09
+----------------
+* Fixed auto-reconnect issue with single server instance.
+
+1.3.2 2013-05-08
+----------------
+* Fixes for an issue where replicaset would be pronounced dead when high priority primary caused double elections.
+
+1.3.1 2013-05-06
+----------------
+* Fix for replicaset consisting of primary/secondary/arbiter with priority applied failing to reconnect properly
+* Applied auth before server instance is set as connected when single server connection
+* Throw error if array of documents passed to save method
+
+1.3.0 2013-04-25
+----------------
+* Whole High availability handling for Replicaset, Server and Mongos connections refactored to ensure better handling of failover cases.
+* Fixed issue where findAndModify would not correctly skip issuing of chained getLastError (Issue #941)
+* Fixed throw error issue on errors with findAndModify during write out operation (Issue #939, https://github.com/autopulated)
+* Gridstore.prototype.writeFile now returns gridstore object correctly (Issue #938)
+* Kerberos support is now an optional module that allows for use of GSSAPI authentication using MongoDB Subscriber edition
+* Fixed issue where cursor.toArray could blow the stack on node 0.10.X (#950)
+
+1.2.14 2013-03-14
+-----------------
+* Refactored test suite to speed up running of replicaset tests
+* Fix of async error handling when error happens in callback (Issue #909, https://github.com/medikoo)
+* Corrected a slaveOk setting issue (Issue #906, #905)
+* Fixed HA issue where ping's would not go to correct server on HA server connection failure.
+* Uses setImmediate if on 0.10 otherwise nextTick for cursor stream
+* Fixed race condition in Cursor stream (NODE-31)
+* Fixed issues related to node 0.10 and process.nextTick now correctly using setImmediate where needed on node 0.10
+* Added support for maxMessageSizeBytes if available (DRIVERS-1)
+* Added support for authSource (2.4) to MongoClient URL and db.authenticate method (DRIVER-69/NODE-34)
+* Fixed issue in GridStore seek and GridStore read to correctly work on multiple seeks (Issue #895)
+
+1.2.13 2013-02-22
+-----------------
+* Allow strategy 'none' for repliaset if no strategy wanted (will default to round robin selection of servers on a set readPreference)
+* Fixed missing MongoErrors on some cursor methods (Issue #882)
+* Correctly returning a null for the db instance on MongoClient.connect when auth fails (Issue #890)
+* Added dropTarget option support for renameCollection/rename (Issue #891, help from https://github.com/jbottigliero)
+* Fixed issue where connection using MongoClient.connect would fail if first server did not exist (Issue #885)
+
+1.2.12 2013-02-13
+-----------------
+* Added limit/skip options to Collection.count (Issue #870)
+* Added applySkipLimit option to Cursor.count (Issue #870)
+* Enabled ping strategy as default for Replicaset if none specified (Issue #876)
+* Should correctly pick nearest server for SECONDARY/SECONDARY_PREFERRED/NEAREST (Issue #878)
+
+1.2.11 2013-01-29
+-----------------
+* Added fixes for handling type 2 binary due to PHP driver (Issue #864)
+* Moved callBackStore to Base class to have single unified store (Issue #866)
+* Ping strategy now reuses sockets unless they are closed by the server to avoid overhead
+
+1.2.10 2013-01-25
+-----------------
+* Merged in SSL support for 2.4 supporting certificate validation and presenting certificates to the server.
+* Only open a new HA socket when previous one dead (Issue #859, #857)
+* Minor fixes
+
+1.2.9 2013-01-15
+----------------
+* Fixed bug in SSL support for MongoClient/Db.connect when discovering servers (Issue #849)
+* Connection string with no db specified should default to admin db (Issue #848)
+* Support port passed as string to Server class (Issue #844)
+* Removed noOpen support for MongoClient/Db.connect as auto discovery of servers for Mongod/Mongos makes it not possible (Issue #842)
+* Included toError wrapper code moved to utils.js file (Issue #839, #840)
+* Rewrote cursor handling to avoid process.nextTick using trampoline instead to avoid stack overflow, speedup about 40%
+
+1.2.8 2013-01-07
+----------------
+* Accept function in a Map Reduce scope object not only a function string (Issue #826, https://github.com/aheckmann)
+* Typo in db.authenticate caused a check (for provided connection) to return false, causing a connection AND onAll=true to be passed into __executeQueryCommand downstream (Issue #831, https://github.com/m4tty)
+* Allow gridfs objects to use non ObjectID ids (Issue #825, https://github.com/nailgun)
+* Removed the double wrap, by not passing an Error object to the wrap function (Issue #832, https://github.com/m4tty)
+* Fix connection leak (gh-827) for HA replicaset health checks (Issue #833, https://github.com/aheckmann)
+* Modified findOne to use nextObject instead of toArray avoiding a nextTick operation (Issue #836)
+* Fixes for cursor stream to avoid multiple getmore issues when one in progress (Issue #818)
+* Fixes .open replaying all backed up commands correctly if called after operations performed, (Issue #829 and #823)
+
+1.2.7 2012-12-23
+----------------
+* Rolled back batches as they hang in certain situations
+* Fixes for NODE-25, keep reading from secondaries when primary goes down
+
+1.2.6 2012-12-21
+----------------
+* domain sockets shouldn't require a port arg (Issue #815, https://github.com/aheckmann)
+* Cannot read property 'info' of null (Issue #809, https://github.com/thesmart)
+* Cursor.each should work in batches (Issue #804, https://github.com/Swatinem)
+* Cursor readPreference bug for non-supported read preferences (Issue #817)
+
+1.2.5 2012-12-12
+----------------
+* Fixed ssl regression, added more test coverage (Issue #800)
+* Added better error reporting to the Db.connect if no valid serverConfig setup found (Issue #798)
+
+1.2.4 2012-12-11
+----------------
+* Fix to ensure authentication is correctly applied across all secondaries when using MongoClient.
+
+1.2.3 2012-12-10
+----------------
+* Fix for new replicaset members correctly authenticating when being added (Issue #791, https://github.com/m4tty)
+* Fixed seek issue in gridstore when using stream (Issue #790)
+
+1.2.2 2012-12-03
+----------------
+* Fix for journal write concern not correctly being passed under some circumstances.
+* Fixed correct behavior and re-auth for servers that get stepped down (Issue #779).
+
+1.2.1 2012-11-30
+----------------
+* Fix for double callback on insert with w:0 specified (Issue #783)
+* Small cleanup of urlparser.
+
+1.2.0 2012-11-27
+----------------
+* Honor connectTimeoutMS option for replicasets (Issue #750, https://github.com/aheckmann)
+* Fix ping strategy regression (Issue #738, https://github.com/aheckmann)
+* Small cleanup of code (Issue #753, https://github.com/sokra/node-mongodb-native)
+* Fixed index declaration using objects/arrays from other contexts (Issue #755, https://github.com/sokra/node-mongodb-native)
+* Intermittent (and rare) null callback exception when using ReplicaSets (Issue #752)
+* Force correct setting of read_secondary based on the read preference (Issue #741)
+* If using read preferences with secondaries queries will not fail if primary is down (Issue #744)
+* noOpen connection for Db.connect removed as not compatible with autodetection of Mongo type
+* Mongos connection with auth not working (Issue #737)
+* Use the connect method directly from the require. require('mongodb')("mongodb://localhost:27017/db")
+* new MongoClient introduced as the point of connecting to MongoDB's instead of the Db
+  * open/close/db/connect methods implemented
+* Implemented common URL connection format using MongoClient.connect allowing for simialar interface across all drivers.
+* Fixed a bug with aggregation helper not properly accepting readPreference
+
+1.1.11 2012-10-10
+-----------------
+* Removed strict mode and introduced normal handling of safe at DB level.
+
+1.1.10 2012-10-08
+-----------------
+* fix Admin.serverStatus (Issue #723, https://github.com/Contra)
+* logging on connection open/close(Issue #721, https://github.com/asiletto)
+* more fixes for windows bson install (Issue #724)
+
+1.1.9 2012-10-05
+----------------
+* Updated bson to 0.1.5 to fix build problem on sunos/windows.
+
+1.1.8 2012-10-01
+----------------
+* Fixed db.eval to correctly handle system.js global javascript functions (Issue #709)
+* Cleanup of non-closing connections (Issue #706)
+* More cleanup of connections under replicaset (Issue #707, https://github.com/elbert3)
+* Set keepalive on as default, override if not needed
+* Cleanup of jsbon install to correctly build without install.js script (https://github.com/shtylman)
+* Added domain socket support new Server("/tmp/mongodb.sock") style
+
+1.1.7 2012-09-10
+----------------
+* Protect against starting PingStrategy being called more than once (Issue #694, https://github.com/aheckmann)
+* Make PingStrategy interval configurable (was 1 second, relaxed to 5) (Issue #693, https://github.com/aheckmann)
+* Made PingStrategy api more consistant, callback to start/stop methods are optional (Issue #693, https://github.com/aheckmann)
+* Proper stopping of strategy on replicaset stop
+* Throw error when gridstore file is not found in read mode (Issue #702, https://github.com/jbrumwell)
+* Cursor stream resume now using nextTick to avoid duplicated records (Issue #696)
+
+1.1.6 2012-09-01
+----------------
+* Fix for readPreference NEAREST for replicasets (Issue #693, https://github.com/aheckmann)
+* Emit end correctly on stream cursor (Issue #692, https://github.com/Raynos)
+
+1.1.5 2012-08-29
+----------------
+* Fix for eval on replicaset Issue #684
+* Use helpful error msg when native parser not compiled (Issue #685, https://github.com/aheckmann)
+* Arbiter connect hotfix (Issue #681, https://github.com/fengmk2)
+* Upgraded bson parser to 0.1.2 using gyp, deprecated support for node 0.4.X
+* Added name parameter to createIndex/ensureIndex to be able to override index names larger than 128 bytes
+* Added exhaust option for find for feature completion (not recommended for normal use)
+* Added tailableRetryInterval to find for tailable cursors to allow to control getMore retry time interval
+* Fixes for read preferences when using MongoS to correctly handle no read preference set when iterating over a cursor (Issue #686)
+
+1.1.4 2012-08-12
+----------------
+* Added Mongos connection type with a fallback list for mongos proxies, supports ha (on by default) and will attempt to reconnect to failed proxies.
+* Documents can now have a toBSON method that lets the user control the serialization behavior for documents being saved.
+* Gridstore instance object now works as a readstream or writestream (thanks to code from Aaron heckmann (https://github.com/aheckmann/gridfs-stream)).
+* Fix gridfs readstream (Issue #607, https://github.com/tedeh).
+* Added disableDriverBSONSizeCheck property to Server.js for people who wish to push the inserts to the limit (Issue #609).
+* Fixed bug where collection.group keyf given as Code is processed as a regular object (Issue #608, https://github.com/rrusso2007).
+* Case mismatch between driver's ObjectID and mongo's ObjectId, allow both (Issue #618).
+* Cleanup map reduce (Issue #614, https://github.com/aheckmann).
+* Add proper error handling to gridfs (Issue #615, https://github.com/aheckmann).
+* Ensure cursor is using same connection for all operations to avoid potential jump of servers when using replicasets.
+* Date identification handled correctly in bson js parser when running in vm context.
+* Documentation updates
+* GridStore filename not set on read (Issue #621)
+* Optimizations on the C++ bson parser to fix a potential memory leak and avoid non-needed calls
+* Added support for awaitdata for tailable cursors (Issue #624)
+* Implementing read preference setting at collection and cursor level
+   * collection.find().setReadPreference(Server.SECONDARY_PREFERRED)
+   * db.collection("some", {readPreference:Server.SECONDARY})
+* Replicaset now returns when the master is discovered on db.open and lets the rest of the connections happen asynchronous.
+  * ReplSet/ReplSetServers emits "fullsetup" when all servers have been connected to
+* Prevent callback from executing more than once in getMore function (Issue #631, https://github.com/shankar0306)
+* Corrupt bson messages now errors out to all callbacks and closes up connections correctly, Issue #634
+* Replica set member status update when primary changes bug (Issue #635, https://github.com/alinsilvian)
+* Fixed auth to work better when multiple connections are involved.
+* Default connection pool size increased to 5 connections.
+* Fixes for the ReadStream class to work properly with 0.8 of Node.js
+* Added explain function support to aggregation helper
+* Added socketTimeoutMS and connectTimeoutMS to socket options for repl_set.js and server.js
+* Fixed addUser to correctly handle changes in 2.2 for getLastError authentication required
+* Added index to gridstore chunks on file_id (Issue #649, https://github.com/jacobbubu)
+* Fixed Always emit db events (Issue #657)
+* Close event not correctly resets DB openCalled variable to allow reconnect
+* Added open event on connection established for replicaset, mongos and server
+* Much faster BSON C++ parser thanks to Lucasfilm Singapore.
+* Refactoring of replicaset connection logic to simplify the code.
+* Add `options.connectArbiter` to decide connect arbiters or not (Issue #675)
+* Minor optimization for findAndModify when not using j,w or fsync for safe
+
+1.0.2 2012-05-15
+----------------
+* Reconnect functionality for replicaset fix for mongodb 2.0.5
+
+1.0.1 2012-05-12
+----------------
+* Passing back getLastError object as 3rd parameter on findAndModify command.
+* Fixed a bunch of performance regressions in objectId and cursor.
+* Fixed issue #600 allowing for single document delete to be passed in remove command.
+
+1.0.0 2012-04-25
+----------------
+* Fixes to handling of failover on server error
+* Only emits error messages if there are error listeners to avoid uncaught events
+* Server.isConnected using the server state variable not the connection pool state
+
+0.9.9.8 2012-04-12
+------------------
+* _id=0 is being turned into an ObjectID (Issue #551)
+* fix for error in GridStore write method (Issue #559)
+* Fix for reading a GridStore from arbitrary, non-chunk aligned offsets, added test (Issue #563, https://github.com/subroutine)
+* Modified limitRequest to allow negative limits to pass through to Mongo, added test (Issue #561)
+* Corrupt GridFS files when chunkSize < fileSize, fixed concurrency issue (Issue #555)
+* Handle dead tailable cursors (Issue #568, https://github.com/aheckmann)
+* Connection pools handles closing themselves down and clearing the state
+* Check bson size of documents against maxBsonSize and throw client error instead of server error, (Issue #553)
+* Returning update status document at the end of the callback for updates, (Issue #569)
+* Refactor use of Arguments object to gain performance (Issue #574, https://github.com/AaronAsAChimp)
+
+0.9.9.7 2012-03-16
+------------------
+* Stats not returned from map reduce with inline results (Issue #542)
+* Re-enable testing of whether or not the callback is called in the multi-chunk seek, fix small GridStore bug (Issue #543, https://github.com/pgebheim)
+* Streaming large files from GridFS causes truncation (Issue #540)
+* Make callback type checks agnostic to V8 context boundaries (Issue #545)
+* Correctly throw error if an attempt is made to execute an insert/update/remove/createIndex/ensureIndex with safe enabled and no callback
+* Db.open throws if the application attemps to call open again without calling close first
+
+0.9.9.6 2012-03-12
+------------------
+* BSON parser is externalized in it's own repository, currently using git master
+* Fixes for Replicaset connectivity issue (Issue #537)
+* Fixed issues with node 0.4.X vs 0.6.X (Issue #534)
+* Removed SimpleEmitter and replaced with standard EventEmitter
+* GridStore.seek fails to change chunks and call callback when in read mode (Issue #532)
+
+0.9.9.5 2012-03-07
+------------------
+* Merged in replSetGetStatus helper to admin class (Issue #515, https://github.com/mojodna)
+* Merged in serverStatus helper to admin class (Issue #516, https://github.com/mojodna)
+* Fixed memory leak in C++ bson parser (Issue #526)
+* Fix empty MongoError "message" property (Issue #530, https://github.com/aheckmann)
+* Cannot save files with the same file name to GridFS (Issue #531)
+
+0.9.9.4 2012-02-26
+------------------
+* bugfix for findAndModify: Error: corrupt bson message < 5 bytes long (Issue #519)
+
+0.9.9.3 2012-02-23
+------------------
+* document: save callback arguments are both undefined, (Issue #518)
+* Native BSON parser install error with npm, (Issue #517)
+
+0.9.9.2 2012-02-17
+------------------
+* Improved detection of Buffers using Buffer.isBuffer instead of instanceof.
+* Added wrap error around db.dropDatabase to catch all errors (Issue #512)
+* Added aggregate helper to collection, only for MongoDB >= 2.1
+
+0.9.9.1 2012-02-15
+------------------
+* Better handling of safe when using some commands such as createIndex, ensureIndex, addUser, removeUser, createCollection.
+* Mapreduce now throws error if out parameter is not specified.
+
+0.9.9 2012-02-13
+----------------
+* Added createFromTime method on ObjectID to allow for queries against _id more easily using the timestamp.
+* Db.close(true) now makes connection unusable as it's been force closed by app.
+* Fixed mapReduce and group functions to correctly send slaveOk on queries.
+* Fixes for find method to correctly work with find(query, fields, callback) (Issue #506).
+* A fix for connection error handling when using the SSL on MongoDB.
+
+0.9.8-7 2012-02-06
+------------------
+* Simplified findOne to use the find command instead of the custom code (Issue #498).
+* BSON JS parser not also checks for _bsonType variable in case BSON object is in weird scope (Issue #495).
+
+0.9.8-6 2012-02-04
+------------------
+* Removed the check for replicaset change code as it will never work with node.js.
+
+0.9.8-5 2012-02-02
+------------------
+* Added geoNear command to Collection.
+* Added geoHaystackSearch command to Collection.
+* Added indexes command to collection to retrieve the indexes on a Collection.
+* Added stats command to collection to retrieve the statistics on a Collection.
+* Added listDatabases command to admin object to allow retrieval of all available dbs.
+* Changed createCreateIndexCommand to work better with options.
+* Fixed dereference method on Db class to correctly dereference Db reference objects.
+* Moved connect object onto Db class(Db.connect) as well as keeping backward compatibility.
+* Removed writeBuffer method from gridstore, write handles switching automatically now.
+* Changed readBuffer to read on Gridstore, Gridstore now only supports Binary Buffers no Strings anymore.
+* Moved Long class to bson directory.
+
+0.9.8-4 2012-01-28
+------------------
+* Added reIndex command to collection and db level.
+* Added support for $returnKey, $maxScan, $min, $max, $showDiskLoc, $comment to cursor and find/findOne methods.
+* Added dropDups and v option to createIndex and ensureIndex.
+* Added isCapped method to Collection.
+* Added indexExists method to Collection.
+* Added findAndRemove method to Collection.
+* Fixed bug for replicaset connection when no active servers in the set.
+* Fixed bug for replicaset connections when errors occur during connection.
+* Merged in patch for BSON Number handling from Lee Salzman, did some small fixes and added test coverage.
+
+0.9.8-3 2012-01-21
+------------------
+* Workaround for issue with Object.defineProperty (Issue #484)
+* ObjectID generation with date does not set rest of fields to zero (Issue #482)
+
+0.9.8-2 2012-01-20
+------------------
+* Fixed a missing this in the ReplSetServers constructor.
+
+0.9.8-1 2012-01-17
+------------------
+* FindAndModify bug fix for duplicate errors (Issue #481)
+
+0.9.8 2012-01-17
+----------------
+* Replicasets now correctly adjusts to live changes in the replicaset configuration on the servers, reconnecting correctly.
+  * Set the interval for checking for changes setting the replicaSetCheckInterval property when creating the ReplSetServers instance or on db.serverConfig.replicaSetCheckInterval. (default 1000 miliseconds)
+* Fixes formattedOrderClause in collection.js to accept a plain hash as a parameter (Issue #469) https://github.com/tedeh
+* Removed duplicate code for formattedOrderClause and moved to utils module
+* Pass in poolSize for ReplSetServers to set default poolSize for new replicaset members
+* Bug fix for BSON JS deserializer. Isolating the eval functions in separate functions to avoid V8 deoptimizations
+* Correct handling of illegal BSON messages during deserialization
+* Fixed Infinite loop when reading GridFs file with no chunks (Issue #471)
+* Correctly update existing user password when using addUser (Issue #470)
+
+0.9.7.3-5 2012-01-04
+--------------------
+* Fix for RegExp serialization for 0.4.X where typeof /regexp/ == 'function' vs in 0.6.X typeof /regexp/ == 'object'
+* Don't allow keepAlive and setNoDelay for 0.4.X as it throws errors
+
+0.9.7.3-4 2012-01-04
+--------------------
+* Chased down potential memory leak on findAndModify, Issue #467 (node.js removeAllListeners leaves the key in the _events object, node.js bug on eventlistener?, leads to extremely slow memory leak on listener object)
+* Sanity checks for GridFS performance with benchmark added
+
+0.9.7.3-3 2012-01-04
+--------------------
+* Bug fixes for performance issues going form 0.9.6.X to 0.9.7.X on linux
+* BSON bug fixes for performance
+
+0.9.7.3-2 2012-01-02
+--------------------
+* Fixed up documentation to reflect the preferred way of instantiating bson types
+* GC bug fix for JS bson parser to avoid stop-and-go GC collection
+
+0.9.7.3-1 2012-01-02
+--------------------
+* Fix to make db.bson_serializer and db.bson_deserializer work as it did previously
+
+0.9.7.3 2011-12-30
+--------------------
+* Moved BSON_BINARY_SUBTYPE_DEFAULT from BSON object to Binary object and removed the BSON_BINARY_ prefixes
+* Removed Native BSON types, C++ parser uses JS types (faster due to cost of crossing the JS-C++ barrier for each call)
+* Added build fix for 0.4.X branch of Node.js where GetOwnPropertyNames is not defined in v8
+* Fix for wire protocol parser for corner situation where the message is larger than the maximum socket buffer in node.js (Issue #464, #461, #447)
+* Connection pool status set to connected on poolReady, isConnected returns false on anything but connected status (Issue #455)
+
+0.9.7.2-5 2011-12-22
+--------------------
+* Brand spanking new Streaming Cursor support Issue #458 (https://github.com/christkv/node-mongodb-native/pull/458) thanks to Mr Aaron Heckmann
+
+0.9.7.2-4 2011-12-21
+--------------------
+* Refactoring of callback code to work around performance regression on linux
+* Fixed group function to correctly use the command mode as default
+
+0.9.7.2-3 2011-12-18
+--------------------
+* Fixed error handling for findAndModify while still working for mongodb 1.8.6 (Issue #450).
+* Allow for force send query to primary, pass option (read:'primary') on find command.
+    * ``find({a:1}, {read:'primary'}).toArray(function(err, items) {});``
+
+0.9.7.2-2 2011-12-16
+--------------------
+* Fixes infinite streamRecords QueryFailure fix when using Mongos (Issue #442)
+
+0.9.7.2-1 2011-12-16
+--------------------
+* ~10% perf improvement for ObjectId#toHexString (Issue #448, https://github.com/aheckmann)
+* Only using process.nextTick on errors emitted on callbacks not on all parsing, reduces number of ticks in the driver
+* Changed parsing off bson messages to use process.nextTick to do bson parsing in batches if the message is over 10K as to yield more time to the event look increasing concurrency on big mongoreply messages with multiple documents
+
+0.9.7.2 2011-12-15
+------------------
+* Added SSL support for future version of mongodb (VERY VERY EXPERIMENTAL)
+    * pass in the ssl:true option to the server or replicaset server config to enable
+    * a bug either in mongodb or node.js does not allow for more than 1 connection pr db instance (poolSize:1).
+* Added getTimestamp() method to objectID that returns a date object
+* Added finalize function to collection.group
+    * function group (keys, condition, initial, reduce, finalize, command, callback)
+* Reaper no longer using setTimeout to handle reaping. Triggering is done in the general flow leading to predictable behavior.
+    * reaperInterval, set interval for reaper (default 10000 miliseconds)
+    * reaperTimeout, set timeout for calls (default 30000 miliseconds)
+    * reaper, enable/disable reaper (default false)
+* Work around for issues with findAndModify during high concurrency load, insure that the behavior is the same across the 1.8.X branch and 2.X branch of MongoDb
+* Reworked multiple db's sharing same connection pool to behave correctly on error, timeout and close
+* EnsureIndex command can be executed without a callback (Issue #438)
+* Eval function no accepts options including nolock (Issue #432)
+    * eval(code, parameters, options, callback) (where options = {nolock:true})
+
+0.9.7.1-4 2011-11-27
+--------------------
+* Replaced install.sh with install.js to install correctly on all supported os's
+
+0.9.7.1-3 2011-11-27
+--------------------
+* Fixes incorrect scope for ensureIndex error wrapping (Issue #419) https://github.com/ritch
+
+0.9.7.1-2 2011-11-27
+--------------------
+* Set statistical selection strategy as default for secondary choice.
+
+0.9.7.1-1 2011-11-27
+--------------------
+* Better handling of single server reconnect (fixes some bugs)
+* Better test coverage of single server failure
+* Correct handling of callbacks on replicaset servers when firewall dropping packets, correct reconnect
+
+0.9.7.1 2011-11-24
+------------------
+* Better handling of dead server for single server instances
+* FindOne and find treats selector == null as {}, Issue #403
+* Possible to pass in a strategy for the replicaset to pick secondary reader node
+    * parameter strategy
+        * ping (default), pings the servers and picks the one with the lowest ping time
+        * statistical, measures each request and pick the one with the lowest mean and std deviation
+* Set replicaset read preference replicaset.setReadPreference()
+    * Server.READ_PRIMARY (use primary server for reads)
+    * Server.READ_SECONDARY (from a secondary server (uses the strategy set))
+    * tags, {object of tags}
+* Added replay of commands issued to a closed connection when the connection is re-established
+* Fix isConnected and close on unopened connections. Issue #409, fix by (https://github.com/sethml)
+* Moved reaper to db.open instead of constructor (Issue #406)
+* Allows passing through of socket connection settings to Server or ReplSetServer under the option socketOptions
+    * timeout = set seconds before connection times out (default 0)
+    * noDelay = Disables the Nagle algorithm (default true)
+    * keepAlive = Set if keepAlive is used (default 0, which means no keepAlive, set higher than 0 for keepAlive)
+    * encoding = ['ascii', 'utf8', or 'base64'] (default null)
+* Fixes for handling of errors during shutdown off a socket connection
+* Correctly applies socket options including timeout
+* Cleanup of test management code to close connections correctly
+* Handle parser errors better, closing down the connection and emitting an error
+* Correctly emit errors from server.js only wrapping errors that are strings
+
+0.9.7 2011-11-10
+----------------
+* Added priority setting to replicaset manager
+* Added correct handling of passive servers in replicaset
+* Reworked socket code for simpler clearer handling
+* Correct handling of connections in test helpers
+* Added control of retries on failure
+    * control with parameters retryMiliSeconds and numberOfRetries when creating a db instance
+* Added reaper that will timeout and cleanup queries that never return
+    * control with parameters reaperInterval and reaperTimeout when creating a db instance
+* Refactored test helper classes for replicaset tests
+* Allows raw (no bson parser mode for insert, update, remove, find and findOne)
+    * control raw mode passing in option raw:true on the commands
+    * will return buffers with the binary bson objects
+* Fixed memory leak in cursor.toArray
+* Fixed bug in command creation for mongodb server with wrong scope of call
+* Added db(dbName) method to db.js to allow for reuse of connections against other databases
+* Serialization of functions in an object is off by default, override with parameter
+    * serializeFunctions [true/false] on db level, collection level or individual insert/update/findAndModify
+* Added Long.fromString to c++ class and fixed minor bug in the code (Test case for $gt operator on 64-bit integers, Issue #394)
+* FindOne and find now share same code execution and will work in the same manner, Issue #399
+* Fix for tailable cursors, Issue #384
+* Fix for Cursor rewind broken, Issue #389
+* Allow Gridstore.exist to query using regexp, Issue #387, fix by (https://github.com/kaij)
+* Updated documentation on https://github.com/christkv/node-mongodb-native
+* Fixed toJSON methods across all objects for BSON, Binary return Base64 Encoded data
+
+0.9.6-22 2011-10-15
+-------------------
+* Fixed bug in js bson parser that could cause wrong object size on serialization, Issue #370
+* Fixed bug in findAndModify that did not throw error on replicaset timeout, Issue #373
+
+0.9.6-21 2011-10-05
+-------------------
+* Reworked reconnect code to work correctly
+* Handling errors in different parts of the code to ensure that it does not lock the connection
+* Consistent error handling for Object.createFromHexString for JS and C++
+
+0.9.6-20 2011-10-04
+-------------------
+* Reworked bson.js parser to get rid off Array.shift() due to it allocating new memory for each call. Speedup varies between 5-15% depending on doc
+* Reworked bson.cc to throw error when trying to serialize js bson types
+* Added MinKey, MaxKey and Double support for JS and C++ parser
+* Reworked socket handling code to emit errors on unparsable messages
+* Added logger option for Db class, lets you pass in a function in the shape
+    {
+        log : function(message, object) {},
+        error : function(errorMessage, errorObject) {},
+        debug : function(debugMessage, object) {},
+    }
+
+  Usage is new Db(new Server(..), {logger: loggerInstance})
+
+0.9.6-19 2011-09-29
+-------------------
+* Fixing compatibility issues between C++ bson parser and js parser
+* Added Symbol support to C++ parser
+* Fixed socket handling bug for seldom misaligned message from mongodb
+* Correctly handles serialization of functions using the C++ bson parser
+
+0.9.6-18 2011-09-22
+-------------------
+* Fixed bug in waitForConnection that would lead to 100% cpu usage, Issue #352
+
+0.9.6-17 2011-09-21
+-------------------
+* Fixed broken exception test causing bamboo to hang
+* Handling correctly command+lastError when both return results as in findAndModify, Issue #351
+
+0.9.6-16 2011-09-14
+-------------------
+* Fixing a bunch of issues with compatibility with MongoDB 2.0.X branch. Some fairly big changes in behavior from 1.8.X to 2.0.X on the server.
+* Error Connection MongoDB V2.0.0 with Auth=true, Issue #348
+
+0.9.6-15 2011-09-09
+-------------------
+* Fixed issue where pools would not be correctly cleaned up after an error, Issue #345
+* Fixed authentication issue with secondary servers in Replicaset, Issue #334
+* Duplicate replica-set servers when omitting port, Issue #341
+* Fixing findAndModify to correctly work with Replicasets ensuring proper error handling, Issue #336
+* Merged in code from (https://github.com/aheckmann) that checks for global variable leaks
+
+0.9.6-14 2011-09-05
+-------------------
+* Minor fixes for error handling in cursor streaming (https://github.com/sethml), Issue #332
+* Minor doc fixes
+* Some more cursor sort tests added, Issue #333
+* Fixes to work with 0.5.X branch
+* Fix Db not removing reconnect listener from serverConfig, (https://github.com/sbrekken), Issue #337
+* Removed node_events.h includes (https://github.com/jannehietamaki), Issue #339
+* Implement correct safe/strict mode for findAndModify.
+
+0.9.6-13 2011-08-24
+-------------------
+* Db names correctly error checked for illegal characters
+
+0.9.6-12 2011-08-24
+-------------------
+* Nasty bug in GridFS if you changed the default chunk size
+* Fixed error handling bug in findOne
+
+0.9.6-11 2011-08-23
+-------------------
+* Timeout option not correctly making it to the cursor, Issue #320, Fix from (https://github.com/year2013)
+* Fixes for memory leaks when using buffers and C++ parser
+* Fixes to make tests pass on 0.5.X
+* Cleanup of bson.js to remove duplicated code paths
+* Fix for errors occurring in ensureIndex, Issue #326
+* Removing require.paths to make tests work with the 0.5.X branch
+
+0.9.6-10 2011-08-11
+-------------------
+* Specific type Double for capped collections (https://github.com/mbostock), Issue #312
+* Decorating Errors with all all object info from Mongo (https://github.com/laurie71), Issue #308
+* Implementing fixes for mongodb 1.9.1 and higher to make tests pass
+* Admin validateCollection now takes an options argument for you to pass in full option
+* Implemented keepGoing parameter for mongodb 1.9.1 or higher, Issue #310
+* Added test for read_secondary count issue, merged in fix from (https://github.com/year2013), Issue #317
+
+0.9.6-9
+-------
+* Bug fix for bson parsing the key '':'' correctly without crashing
+
+0.9.6-8
+-------
+* Changed to using node.js crypto library MD5 digest
+* Connect method support documented mongodb: syntax by (https://github.com/sethml)
+* Support Symbol type for BSON, serializes to it's own type Symbol, Issue #302, #288
+* Code object without scope serializing to correct BSON type
+* Lot's of fixes to avoid double callbacks (https://github.com/aheckmann) Issue #304
+* Long deserializes as Number for values in the range -2^53 to 2^53, Issue #305 (https://github.com/sethml)
+* Fixed C++ parser to reflect JS parser handling of long deserialization
+* Bson small optimizations
+
+0.9.6-7 2011-07-13
+------------------
+* JS Bson deserialization bug #287
+
+0.9.6-6 2011-07-12
+------------------
+* FindAndModify not returning error message as other methods Issue #277
+* Added test coverage for $push, $pushAll and $inc atomic operations
+* Correct Error handling for non 12/24 bit ids on Pure JS ObjectID class Issue #276
+* Fixed terrible deserialization bug in js bson code #285
+* Fix by andrewjstone to avoid throwing errors when this.primary not defined
+
+0.9.6-5 2011-07-06
+------------------
+* Rewritten BSON js parser now faster than the C parser on my core2duo laptop
+* Added option full to indexInformation to get all index info Issue #265
+* Passing in ObjectID for new Gridstore works correctly Issue #272
+
+0.9.6-4 2011-07-01
+------------------
+* Added test and bug fix for insert/update/remove without callback supplied
+
+0.9.6-3 2011-07-01
+------------------
+* Added simple grid class called Grid with put, get, delete methods
+* Fixed writeBuffer/readBuffer methods on GridStore so they work correctly
+* Automatic handling of buffers when using write method on GridStore
+* GridStore now accepts a ObjectID instead of file name for write and read methods
+* GridStore.list accepts id option to return of file ids instead of filenames
+* GridStore close method returns document for the file allowing user to reference _id field
+
+0.9.6-2 2011-06-30
+------------------
+* Fixes for reconnect logic for server object (replays auth correctly)
+* More testcases for auth
+* Fixes in error handling for replicaset
+* Fixed bug with safe parameter that would fail to execute safe when passing w or wtimeout
+* Fixed slaveOk bug for findOne method
+* Implemented auth support for replicaset and test cases
+* Fixed error when not passing in rs_name
+
+0.9.6-1 2011-06-25
+------------------
+* Fixes for test to run properly using c++ bson parser
+* Fixes for dbref in native parser (correctly handles ref without db component)
+* Connection fixes for replicasets to avoid runtime conditions in cygwin (https://github.com/vincentcr)
+* Fixes for timestamp in js bson parser (distinct timestamp type now)
+
+0.9.6 2011-06-21
+----------------
+* Worked around npm version handling bug
+* Race condition fix for cygwin (https://github.com/vincentcr)
+
+0.9.5-1 2011-06-21
+------------------
+* Extracted Timestamp as separate class for bson js parser to avoid instanceof problems
+* Fixed driver strict mode issue
+
+0.9.5 2011-06-20
+----------------
+* Replicaset support (failover and reading from secondary servers)
+* Removed ServerPair and ServerCluster
+* Added connection pool functionality
+* Fixed serious bug in C++ bson parser where bytes > 127 would generate 2 byte sequences
+* Allows for forcing the server to assign ObjectID's using the option {forceServerObjectId: true}
+
+0.6.8
+-----
+* Removed multiple message concept from bson
+* Changed db.open(db) to be db.open(err, db)
+
+0.1 2010-01-30
+--------------
+* Initial release support of driver using native node.js interface
+* Supports gridfs specification
+* Supports admin functionality
diff --git a/NodeAPI/node_modules/mongodb/LICENSE.md b/NodeAPI/node_modules/mongodb/LICENSE.md
new file mode 100644
index 0000000000000000000000000000000000000000..ad410e11302107da9aa47ce3d46bd5ad011c4c43
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/LICENSE.md
@@ -0,0 +1,201 @@
+Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "{}"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright {yyyy} {name of copyright owner}
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
\ No newline at end of file
diff --git a/NodeAPI/node_modules/mongodb/README.md b/NodeAPI/node_modules/mongodb/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..76f0b403826513bdace7276fac0b97711b5e1863
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/README.md
@@ -0,0 +1,493 @@
+# MongoDB NodeJS Driver
+
+[![npm](https://nodei.co/npm/mongodb.png?downloads=true&downloadRank=true)](https://nodei.co/npm/mongodb/)
+
+The official [MongoDB](https://www.mongodb.com/) driver for Node.js.
+
+**NOTE: v3.x released with breaking API changes. You can find a list of changes [here](CHANGES_3.0.0.md).**
+
+## Version 4.0
+
+**Looking for the latest?** We're working on the next major version of the driver, now in beta.
+Check out our [beta version 4.0 here](https://github.com/mongodb/node-mongodb-native/tree/4.0), which includes a full migration of the driver to TypeScript.
+
+## Quick Links
+
+| what          | where                                                |
+| ------------- | ---------------------------------------------------- |
+| documentation | http://mongodb.github.io/node-mongodb-native         |
+| api-doc       | http://mongodb.github.io/node-mongodb-native/3.6/api |
+| source        | https://github.com/mongodb/node-mongodb-native       |
+| mongodb       | http://www.mongodb.org                               |
+
+### Bugs / Feature Requests
+
+Think you’ve found a bug? Want to see a new feature in `node-mongodb-native`? Please open a
+case in our issue management tool, JIRA:
+
+- Create an account and login [jira.mongodb.org](https://jira.mongodb.org).
+- Navigate to the NODE project [jira.mongodb.org/browse/NODE](https://jira.mongodb.org/browse/NODE).
+- Click **Create Issue** - Please provide as much information as possible about the issue type and how to reproduce it.
+
+Bug reports in JIRA for all driver projects (i.e. NODE, PYTHON, CSHARP, JAVA) and the
+Core Server (i.e. SERVER) project are **public**.
+
+### Support / Feedback
+
+For issues with, questions about, or feedback for the Node.js driver, please look into our [support channels](https://docs.mongodb.com/manual/support). Please do not email any of the driver developers directly with issues or questions - you're more likely to get an answer on the [MongoDB Community Forums](https://community.mongodb.com/tags/c/drivers-odms-connectors/7/node-js-driver).
+
+### Change Log
+
+Change history can be found in [`HISTORY.md`](HISTORY.md).
+
+### Compatibility
+
+For version compatibility matrices, please refer to the following links:
+
+- [MongoDB](https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-mongodb-node)
+- [NodeJS](https://docs.mongodb.com/ecosystem/drivers/driver-compatibility-reference/#reference-compatibility-language-node)
+
+## Installation
+
+The recommended way to get started using the Node.js driver is by using `npm` (Node Package Manager) to install the dependency in your project.
+
+## MongoDB Driver
+
+Given that you have created your own project using `npm init` we install the MongoDB driver and its dependencies by executing the following `npm` command.
+
+```bash
+npm install mongodb --save
+```
+
+This will download the MongoDB driver and add a dependency entry in your `package.json` file.
+
+You can also use the [Yarn](https://yarnpkg.com/en) package manager.
+
+## Troubleshooting
+
+The MongoDB driver depends on several other packages. These are:
+
+- [bson](https://github.com/mongodb/js-bson)
+- [bson-ext](https://github.com/mongodb-js/bson-ext)
+- [kerberos](https://github.com/mongodb-js/kerberos)
+- [mongodb-client-encryption](https://github.com/mongodb/libmongocrypt#readme)
+
+The `kerberos` package is a C++ extension that requires a build environment to be installed on your system. You must be able to build Node.js itself in order to compile and install the `kerberos` module. Furthermore, the `kerberos` module requires the MIT Kerberos package to correctly compile on UNIX operating systems. Consult your UNIX operation system package manager for what libraries to install.
+
+**Windows already contains the SSPI API used for Kerberos authentication. However, you will need to install a full compiler tool chain using Visual Studio C++ to correctly install the Kerberos extension.**
+
+### Diagnosing on UNIX
+
+If you don’t have the build-essentials, this module won’t build. In the case of Linux, you will need gcc, g++, Node.js with all the headers and Python. The easiest way to figure out what’s missing is by trying to build the Kerberos project. You can do this by performing the following steps.
+
+```bash
+git clone https://github.com/mongodb-js/kerberos
+cd kerberos
+npm install
+```
+
+If all the steps complete, you have the right toolchain installed. If you get the error "node-gyp not found," you need to install `node-gyp` globally:
+
+```bash
+npm install -g node-gyp
+```
+
+If it correctly compiles and runs the tests you are golden. We can now try to install the `mongod` driver by performing the following command.
+
+```bash
+cd yourproject
+npm install mongodb --save
+```
+
+If it still fails the next step is to examine the npm log. Rerun the command but in this case in verbose mode.
+
+```bash
+npm --loglevel verbose install mongodb
+```
+
+This will print out all the steps npm is performing while trying to install the module.
+
+### Diagnosing on Windows
+
+A compiler tool chain known to work for compiling `kerberos` on Windows is the following.
+
+- Visual Studio C++ 2010 (do not use higher versions)
+- Windows 7 64bit SDK
+- Python 2.7 or higher
+
+Open the Visual Studio command prompt. Ensure `node.exe` is in your path and install `node-gyp`.
+
+```bash
+npm install -g node-gyp
+```
+
+Next, you will have to build the project manually to test it. Clone the repo, install dependencies and rebuild:
+
+```bash
+git clone https://github.com/christkv/kerberos.git
+cd kerberos
+npm install
+node-gyp rebuild
+```
+
+This should rebuild the driver successfully if you have everything set up correctly.
+
+### Other possible issues
+
+Your Python installation might be hosed making gyp break. Test your deployment environment first by trying to build Node.js itself on the server in question, as this should unearth any issues with broken packages (and there are a lot of broken packages out there).
+
+Another tip is to ensure your user has write permission to wherever the Node.js modules are being installed.
+
+## Quick Start
+
+This guide will show you how to set up a simple application using Node.js and MongoDB. Its scope is only how to set up the driver and perform the simple CRUD operations. For more in-depth coverage, see the [tutorials](docs/reference/content/tutorials/main.md).
+
+### Create the `package.json` file
+
+First, create a directory where your application will live.
+
+```bash
+mkdir myproject
+cd myproject
+```
+
+Enter the following command and answer the questions to create the initial structure for your new project:
+
+```bash
+npm init
+```
+
+Next, install the driver dependency.
+
+```bash
+npm install mongodb --save
+```
+
+You should see **NPM** download a lot of files. Once it's done you'll find all the downloaded packages under the **node_modules** directory.
+
+### Start a MongoDB Server
+
+For complete MongoDB installation instructions, see [the manual](https://docs.mongodb.org/manual/installation/).
+
+1. Download the right MongoDB version from [MongoDB](https://www.mongodb.org/downloads)
+2. Create a database directory (in this case under **/data**).
+3. Install and start a `mongod` process.
+
+```bash
+mongod --dbpath=/data
+```
+
+You should see the **mongod** process start up and print some status information.
+
+### Connect to MongoDB
+
+Create a new **app.js** file and add the following code to try out some basic CRUD
+operations using the MongoDB driver.
+
+Add code to connect to the server and the database **myproject**:
+
+```js
+const MongoClient = require('mongodb').MongoClient;
+const assert = require('assert');
+
+// Connection URL
+const url = 'mongodb://localhost:27017';
+
+// Database Name
+const dbName = 'myproject';
+const client = new MongoClient(url);
+// Use connect method to connect to the server
+client.connect(function(err) {
+  assert.equal(null, err);
+  console.log('Connected successfully to server');
+
+  const db = client.db(dbName);
+
+  client.close();
+});
+```
+
+Run your app from the command line with:
+
+```bash
+node app.js
+```
+
+The application should print **Connected successfully to server** to the console.
+
+### Insert a Document
+
+Add to **app.js** the following function which uses the **insertMany**
+method to add three documents to the **documents** collection.
+
+```js
+const insertDocuments = function(db, callback) {
+  // Get the documents collection
+  const collection = db.collection('documents');
+  // Insert some documents
+  collection.insertMany([{ a: 1 }, { a: 2 }, { a: 3 }], function(err, result) {
+    assert.equal(err, null);
+    assert.equal(3, result.result.n);
+    assert.equal(3, result.ops.length);
+    console.log('Inserted 3 documents into the collection');
+    callback(result);
+  });
+};
+```
+
+The **insert** command returns an object with the following fields:
+
+- **result** Contains the result document from MongoDB
+- **ops** Contains the documents inserted with added **\_id** fields
+- **connection** Contains the connection used to perform the insert
+
+Add the following code to call the **insertDocuments** function:
+
+```js
+const MongoClient = require('mongodb').MongoClient;
+const assert = require('assert');
+
+// Connection URL
+const url = 'mongodb://localhost:27017';
+
+// Database Name
+const dbName = 'myproject';
+
+// Use connect method to connect to the server
+MongoClient.connect(url, function(err, client) {
+  assert.equal(null, err);
+  console.log('Connected successfully to server');
+
+  const db = client.db(dbName);
+
+  insertDocuments(db, function() {
+    client.close();
+  });
+});
+```
+
+Run the updated **app.js** file:
+
+```bash
+node app.js
+```
+
+The operation returns the following output:
+
+```bash
+Connected successfully to server
+Inserted 3 documents into the collection
+```
+
+### Find All Documents
+
+Add a query that returns all the documents.
+
+```js
+const findDocuments = function(db, callback) {
+  // Get the documents collection
+  const collection = db.collection('documents');
+  // Find some documents
+  collection.find({}).toArray(function(err, docs) {
+    assert.equal(err, null);
+    console.log('Found the following records');
+    console.log(docs);
+    callback(docs);
+  });
+};
+```
+
+This query returns all the documents in the **documents** collection. Add the **findDocument** method to the **MongoClient.connect** callback:
+
+```js
+const MongoClient = require('mongodb').MongoClient;
+const assert = require('assert');
+
+// Connection URL
+const url = 'mongodb://localhost:27017';
+
+// Database Name
+const dbName = 'myproject';
+
+// Use connect method to connect to the server
+MongoClient.connect(url, function(err, client) {
+  assert.equal(null, err);
+  console.log('Connected correctly to server');
+
+  const db = client.db(dbName);
+
+  insertDocuments(db, function() {
+    findDocuments(db, function() {
+      client.close();
+    });
+  });
+});
+```
+
+### Find Documents with a Query Filter
+
+Add a query filter to find only documents which meet the query criteria.
+
+```js
+const findDocuments = function(db, callback) {
+  // Get the documents collection
+  const collection = db.collection('documents');
+  // Find some documents
+  collection.find({ a: 3 }).toArray(function(err, docs) {
+    assert.equal(err, null);
+    console.log('Found the following records');
+    console.log(docs);
+    callback(docs);
+  });
+};
+```
+
+Only the documents which match `'a' : 3` should be returned.
+
+### Update a document
+
+The following operation updates a document in the **documents** collection.
+
+```js
+const updateDocument = function(db, callback) {
+  // Get the documents collection
+  const collection = db.collection('documents');
+  // Update document where a is 2, set b equal to 1
+  collection.updateOne({ a: 2 }, { $set: { b: 1 } }, function(err, result) {
+    assert.equal(err, null);
+    assert.equal(1, result.result.n);
+    console.log('Updated the document with the field a equal to 2');
+    callback(result);
+  });
+};
+```
+
+The method updates the first document where the field **a** is equal to **2** by adding a new field **b** to the document set to **1**. Next, update the callback function from **MongoClient.connect** to include the update method.
+
+```js
+const MongoClient = require('mongodb').MongoClient;
+const assert = require('assert');
+
+// Connection URL
+const url = 'mongodb://localhost:27017';
+
+// Database Name
+const dbName = 'myproject';
+
+// Use connect method to connect to the server
+MongoClient.connect(url, function(err, client) {
+  assert.equal(null, err);
+  console.log('Connected successfully to server');
+
+  const db = client.db(dbName);
+
+  insertDocuments(db, function() {
+    updateDocument(db, function() {
+      client.close();
+    });
+  });
+});
+```
+
+### Remove a document
+
+Remove the document where the field **a** is equal to **3**.
+
+```js
+const removeDocument = function(db, callback) {
+  // Get the documents collection
+  const collection = db.collection('documents');
+  // Delete document where a is 3
+  collection.deleteOne({ a: 3 }, function(err, result) {
+    assert.equal(err, null);
+    assert.equal(1, result.result.n);
+    console.log('Removed the document with the field a equal to 3');
+    callback(result);
+  });
+};
+```
+
+Add the new method to the **MongoClient.connect** callback function.
+
+```js
+const MongoClient = require('mongodb').MongoClient;
+const assert = require('assert');
+
+// Connection URL
+const url = 'mongodb://localhost:27017';
+
+// Database Name
+const dbName = 'myproject';
+
+// Use connect method to connect to the server
+MongoClient.connect(url, function(err, client) {
+  assert.equal(null, err);
+  console.log('Connected successfully to server');
+
+  const db = client.db(dbName);
+
+  insertDocuments(db, function() {
+    updateDocument(db, function() {
+      removeDocument(db, function() {
+        client.close();
+      });
+    });
+  });
+});
+```
+
+### Index a Collection
+
+[Indexes](https://docs.mongodb.org/manual/indexes/) can improve your application's
+performance. The following function creates an index on the **a** field in the
+**documents** collection.
+
+```js
+const indexCollection = function(db, callback) {
+  db.collection('documents').createIndex({ a: 1 }, null, function(err, results) {
+    console.log(results);
+    callback();
+  });
+};
+```
+
+Add the `indexCollection` method to your app:
+
+```js
+const MongoClient = require('mongodb').MongoClient;
+const assert = require('assert');
+
+// Connection URL
+const url = 'mongodb://localhost:27017';
+
+const dbName = 'myproject';
+
+// Use connect method to connect to the server
+MongoClient.connect(url, function(err, client) {
+  assert.equal(null, err);
+  console.log('Connected successfully to server');
+
+  const db = client.db(dbName);
+
+  insertDocuments(db, function() {
+    indexCollection(db, function() {
+      client.close();
+    });
+  });
+});
+```
+
+For more detailed information, see the [tutorials](docs/reference/content/tutorials/main.md).
+
+## Next Steps
+
+- [MongoDB Documentation](http://mongodb.org)
+- [Read about Schemas](http://learnmongodbthehardway.com)
+- [Star us on GitHub](https://github.com/mongodb/node-mongodb-native)
+
+## License
+
+[Apache 2.0](LICENSE.md)
+
+© 2009-2012 Christian Amor Kvalheim
+© 2012-present MongoDB [Contributors](CONTRIBUTORS.md)
diff --git a/NodeAPI/node_modules/mongodb/index.js b/NodeAPI/node_modules/mongodb/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..4e9e6359e8692a1812ea5690a3e1e4252469255f
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/index.js
@@ -0,0 +1,73 @@
+'use strict';
+
+// Core module
+const core = require('./lib/core');
+const Instrumentation = require('./lib/apm');
+
+// Set up the connect function
+const connect = require('./lib/mongo_client').connect;
+
+// Expose error class
+connect.MongoError = core.MongoError;
+connect.MongoNetworkError = core.MongoNetworkError;
+connect.MongoTimeoutError = core.MongoTimeoutError;
+connect.MongoServerSelectionError = core.MongoServerSelectionError;
+connect.MongoParseError = core.MongoParseError;
+connect.MongoWriteConcernError = core.MongoWriteConcernError;
+connect.MongoBulkWriteError = require('./lib/bulk/common').BulkWriteError;
+connect.BulkWriteError = connect.MongoBulkWriteError;
+
+// Actual driver classes exported
+connect.Admin = require('./lib/admin');
+connect.MongoClient = require('./lib/mongo_client');
+connect.Db = require('./lib/db');
+connect.Collection = require('./lib/collection');
+connect.Server = require('./lib/topologies/server');
+connect.ReplSet = require('./lib/topologies/replset');
+connect.Mongos = require('./lib/topologies/mongos');
+connect.ReadPreference = core.ReadPreference;
+connect.GridStore = require('./lib/gridfs/grid_store');
+connect.Chunk = require('./lib/gridfs/chunk');
+connect.Logger = core.Logger;
+connect.AggregationCursor = require('./lib/aggregation_cursor');
+connect.CommandCursor = require('./lib/command_cursor');
+connect.Cursor = require('./lib/cursor');
+connect.GridFSBucket = require('./lib/gridfs-stream');
+// Exported to be used in tests not to be used anywhere else
+connect.CoreServer = core.Server;
+connect.CoreConnection = core.Connection;
+
+// BSON types exported
+connect.Binary = core.BSON.Binary;
+connect.Code = core.BSON.Code;
+connect.Map = core.BSON.Map;
+connect.DBRef = core.BSON.DBRef;
+connect.Double = core.BSON.Double;
+connect.Int32 = core.BSON.Int32;
+connect.Long = core.BSON.Long;
+connect.MinKey = core.BSON.MinKey;
+connect.MaxKey = core.BSON.MaxKey;
+connect.ObjectID = core.BSON.ObjectID;
+connect.ObjectId = core.BSON.ObjectID;
+connect.Symbol = core.BSON.Symbol;
+connect.Timestamp = core.BSON.Timestamp;
+connect.BSONRegExp = core.BSON.BSONRegExp;
+connect.Decimal128 = core.BSON.Decimal128;
+
+// Add connect method
+connect.connect = connect;
+
+// Set up the instrumentation method
+connect.instrument = function(options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  const instrumentation = new Instrumentation();
+  instrumentation.instrument(connect.MongoClient, callback);
+  return instrumentation;
+};
+
+// Set our exports to be the connect function
+module.exports = connect;
diff --git a/NodeAPI/node_modules/mongodb/lib/admin.js b/NodeAPI/node_modules/mongodb/lib/admin.js
new file mode 100644
index 0000000000000000000000000000000000000000..3c8164f9ed89e093c438405e41710935715f9e5a
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/admin.js
@@ -0,0 +1,296 @@
+'use strict';
+
+const applyWriteConcern = require('./utils').applyWriteConcern;
+
+const AddUserOperation = require('./operations/add_user');
+const ExecuteDbAdminCommandOperation = require('./operations/execute_db_admin_command');
+const RemoveUserOperation = require('./operations/remove_user');
+const ValidateCollectionOperation = require('./operations/validate_collection');
+const ListDatabasesOperation = require('./operations/list_databases');
+
+const executeOperation = require('./operations/execute_operation');
+
+/**
+ * @fileOverview The **Admin** class is an internal class that allows convenient access to
+ * the admin functionality and commands for MongoDB.
+ *
+ * **ADMIN Cannot directly be instantiated**
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ *
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   // Use the admin database for the operation
+ *   const adminDb = client.db(dbName).admin();
+ *
+ *   // List all the available databases
+ *   adminDb.listDatabases(function(err, dbs) {
+ *     test.equal(null, err);
+ *     test.ok(dbs.databases.length > 0);
+ *     client.close();
+ *   });
+ * });
+ */
+
+/**
+ * Create a new Admin instance (INTERNAL TYPE, do not instantiate directly)
+ * @class
+ * @return {Admin} a collection instance.
+ */
+function Admin(db, topology, promiseLibrary) {
+  if (!(this instanceof Admin)) return new Admin(db, topology);
+
+  // Internal state
+  this.s = {
+    db: db,
+    topology: topology,
+    promiseLibrary: promiseLibrary
+  };
+}
+
+/**
+ * The callback format for results
+ * @callback Admin~resultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {object} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Execute a command
+ * @method
+ * @param {object} command The command hash
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.command = function(command, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  options = args.length ? args.shift() : {};
+
+  const commandOperation = new ExecuteDbAdminCommandOperation(this.s.db, command, options);
+
+  return executeOperation(this.s.db.s.topology, commandOperation, callback);
+};
+
+/**
+ * Retrieve the server information for the current
+ * instance of the db client
+ *
+ * @param {Object} [options] optional parameters for this operation
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.buildInfo = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const cmd = { buildinfo: 1 };
+
+  const buildInfoOperation = new ExecuteDbAdminCommandOperation(this.s.db, cmd, options);
+
+  return executeOperation(this.s.db.s.topology, buildInfoOperation, callback);
+};
+
+/**
+ * Retrieve the server information for the current
+ * instance of the db client
+ *
+ * @param {Object} [options] optional parameters for this operation
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.serverInfo = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const cmd = { buildinfo: 1 };
+
+  const serverInfoOperation = new ExecuteDbAdminCommandOperation(this.s.db, cmd, options);
+
+  return executeOperation(this.s.db.s.topology, serverInfoOperation, callback);
+};
+
+/**
+ * Retrieve this db's server status.
+ *
+ * @param {Object} [options] optional parameters for this operation
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.serverStatus = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const serverStatusOperation = new ExecuteDbAdminCommandOperation(
+    this.s.db,
+    { serverStatus: 1 },
+    options
+  );
+
+  return executeOperation(this.s.db.s.topology, serverStatusOperation, callback);
+};
+
+/**
+ * Ping the MongoDB server and retrieve results
+ *
+ * @param {Object} [options] optional parameters for this operation
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.ping = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const cmd = { ping: 1 };
+
+  const pingOperation = new ExecuteDbAdminCommandOperation(this.s.db, cmd, options);
+
+  return executeOperation(this.s.db.s.topology, pingOperation, callback);
+};
+
+/**
+ * Add a user to the database.
+ * @method
+ * @param {string} username The username.
+ * @param {string} password The password.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {boolean} [options.fsync=false] **Deprecated** Specify a file sync write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {object} [options.customData] Custom data associated with the user (only Mongodb 2.6 or higher)
+ * @param {object[]} [options.roles] Roles associated with the created user (only Mongodb 2.6 or higher)
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.addUser = function(username, password, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 2);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+
+  // Special case where there is no password ($external users)
+  if (typeof username === 'string' && password != null && typeof password === 'object') {
+    options = password;
+    password = null;
+  }
+
+  options = args.length ? args.shift() : {};
+  options = Object.assign({}, options);
+  // Get the options
+  options = applyWriteConcern(options, { db: this.s.db });
+  // Set the db name to admin
+  options.dbName = 'admin';
+
+  const addUserOperation = new AddUserOperation(this.s.db, username, password, options);
+
+  return executeOperation(this.s.db.s.topology, addUserOperation, callback);
+};
+
+/**
+ * Remove a user from a database
+ * @method
+ * @param {string} username The username.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {boolean} [options.fsync=false] **Deprecated** Specify a file sync write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.removeUser = function(username, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+
+  options = args.length ? args.shift() : {};
+  options = Object.assign({}, options);
+  // Get the options
+  options = applyWriteConcern(options, { db: this.s.db });
+  // Set the db name
+  options.dbName = 'admin';
+
+  const removeUserOperation = new RemoveUserOperation(this.s.db, username, options);
+
+  return executeOperation(this.s.db.s.topology, removeUserOperation, callback);
+};
+
+/**
+ * Validate an existing collection
+ *
+ * @param {string} collectionName The name of the collection to validate.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.background] Validates a collection in the background, without interrupting read or write traffic (only in MongoDB 4.4+)
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.validateCollection = function(collectionName, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const validateCollectionOperation = new ValidateCollectionOperation(
+    this,
+    collectionName,
+    options
+  );
+
+  return executeOperation(this.s.db.s.topology, validateCollectionOperation, callback);
+};
+
+/**
+ * List the available databases
+ *
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.nameOnly=false] Whether the command should return only db names, or names and size info.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.listDatabases = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeOperation(
+    this.s.db.s.topology,
+    new ListDatabasesOperation(this.s.db, options),
+    callback
+  );
+};
+
+/**
+ * Get ReplicaSet status
+ *
+ * @param {Object} [options] optional parameters for this operation
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Admin~resultCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+Admin.prototype.replSetGetStatus = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const replSetGetStatusOperation = new ExecuteDbAdminCommandOperation(
+    this.s.db,
+    { replSetGetStatus: 1 },
+    options
+  );
+
+  return executeOperation(this.s.db.s.topology, replSetGetStatusOperation, callback);
+};
+
+module.exports = Admin;
diff --git a/NodeAPI/node_modules/mongodb/lib/aggregation_cursor.js b/NodeAPI/node_modules/mongodb/lib/aggregation_cursor.js
new file mode 100644
index 0000000000000000000000000000000000000000..9289733440ba9739d1ec6b39fa1035cacca605f9
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/aggregation_cursor.js
@@ -0,0 +1,369 @@
+'use strict';
+
+const MongoError = require('./core').MongoError;
+const Cursor = require('./cursor');
+const CursorState = require('./core/cursor').CursorState;
+
+/**
+ * @fileOverview The **AggregationCursor** class is an internal class that embodies an aggregation cursor on MongoDB
+ * allowing for iteration over the results returned from the underlying query. It supports
+ * one by one document iteration, conversion to an array or can be iterated as a Node 4.X
+ * or higher stream
+ *
+ * **AGGREGATIONCURSOR Cannot directly be instantiated**
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   // Create a collection we want to drop later
+ *   const col = client.db(dbName).collection('createIndexExample1');
+ *   // Insert a bunch of documents
+ *   col.insert([{a:1, b:1}
+ *     , {a:2, b:2}, {a:3, b:3}
+ *     , {a:4, b:4}], {w:1}, function(err, result) {
+ *     test.equal(null, err);
+ *     // Show that duplicate records got dropped
+ *     col.aggregation({}, {cursor: {}}).toArray(function(err, items) {
+ *       test.equal(null, err);
+ *       test.equal(4, items.length);
+ *       client.close();
+ *     });
+ *   });
+ * });
+ */
+
+/**
+ * Namespace provided by the browser.
+ * @external Readable
+ */
+
+/**
+ * Creates a new Aggregation Cursor instance (INTERNAL TYPE, do not instantiate directly)
+ * @class AggregationCursor
+ * @extends external:Readable
+ * @fires AggregationCursor#data
+ * @fires AggregationCursor#end
+ * @fires AggregationCursor#close
+ * @fires AggregationCursor#readable
+ * @return {AggregationCursor} an AggregationCursor instance.
+ */
+class AggregationCursor extends Cursor {
+  constructor(topology, operation, options) {
+    super(topology, operation, options);
+  }
+
+  /**
+   * Set the batch size for the cursor.
+   * @method
+   * @param {number} value The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+   * @throws {MongoError}
+   * @return {AggregationCursor}
+   */
+  batchSize(value) {
+    if (this.s.state === CursorState.CLOSED || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'batchSize requires an integer', driver: true });
+    }
+
+    this.operation.options.batchSize = value;
+    this.setCursorBatchSize(value);
+    return this;
+  }
+
+  /**
+   * Add a geoNear stage to the aggregation pipeline
+   * @method
+   * @param {object} document The geoNear stage document.
+   * @return {AggregationCursor}
+   */
+  geoNear(document) {
+    this.operation.addToPipeline({ $geoNear: document });
+    return this;
+  }
+
+  /**
+   * Add a group stage to the aggregation pipeline
+   * @method
+   * @param {object} document The group stage document.
+   * @return {AggregationCursor}
+   */
+  group(document) {
+    this.operation.addToPipeline({ $group: document });
+    return this;
+  }
+
+  /**
+   * Add a limit stage to the aggregation pipeline
+   * @method
+   * @param {number} value The state limit value.
+   * @return {AggregationCursor}
+   */
+  limit(value) {
+    this.operation.addToPipeline({ $limit: value });
+    return this;
+  }
+
+  /**
+   * Add a match stage to the aggregation pipeline
+   * @method
+   * @param {object} document The match stage document.
+   * @return {AggregationCursor}
+   */
+  match(document) {
+    this.operation.addToPipeline({ $match: document });
+    return this;
+  }
+
+  /**
+   * Add a maxTimeMS stage to the aggregation pipeline
+   * @method
+   * @param {number} value The state maxTimeMS value.
+   * @return {AggregationCursor}
+   */
+  maxTimeMS(value) {
+    this.operation.options.maxTimeMS = value;
+    return this;
+  }
+
+  /**
+   * Add a out stage to the aggregation pipeline
+   * @method
+   * @param {number} destination The destination name.
+   * @return {AggregationCursor}
+   */
+  out(destination) {
+    this.operation.addToPipeline({ $out: destination });
+    return this;
+  }
+
+  /**
+   * Add a project stage to the aggregation pipeline
+   * @method
+   * @param {object} document The project stage document.
+   * @return {AggregationCursor}
+   */
+  project(document) {
+    this.operation.addToPipeline({ $project: document });
+    return this;
+  }
+
+  /**
+   * Add a lookup stage to the aggregation pipeline
+   * @method
+   * @param {object} document The lookup stage document.
+   * @return {AggregationCursor}
+   */
+  lookup(document) {
+    this.operation.addToPipeline({ $lookup: document });
+    return this;
+  }
+
+  /**
+   * Add a redact stage to the aggregation pipeline
+   * @method
+   * @param {object} document The redact stage document.
+   * @return {AggregationCursor}
+   */
+  redact(document) {
+    this.operation.addToPipeline({ $redact: document });
+    return this;
+  }
+
+  /**
+   * Add a skip stage to the aggregation pipeline
+   * @method
+   * @param {number} value The state skip value.
+   * @return {AggregationCursor}
+   */
+  skip(value) {
+    this.operation.addToPipeline({ $skip: value });
+    return this;
+  }
+
+  /**
+   * Add a sort stage to the aggregation pipeline
+   * @method
+   * @param {object} document The sort stage document.
+   * @return {AggregationCursor}
+   */
+  sort(document) {
+    this.operation.addToPipeline({ $sort: document });
+    return this;
+  }
+
+  /**
+   * Add a unwind stage to the aggregation pipeline
+   * @method
+   * @param {(string|object)} field The unwind field name or stage document.
+   * @return {AggregationCursor}
+   */
+  unwind(field) {
+    this.operation.addToPipeline({ $unwind: field });
+    return this;
+  }
+
+  /**
+   * Return the cursor logger
+   * @method
+   * @return {Logger} return the cursor logger
+   * @ignore
+   */
+  getLogger() {
+    return this.logger;
+  }
+}
+
+// aliases
+AggregationCursor.prototype.get = AggregationCursor.prototype.toArray;
+
+/**
+ * AggregationCursor stream data event, fired for each document in the cursor.
+ *
+ * @event AggregationCursor#data
+ * @type {object}
+ */
+
+/**
+ * AggregationCursor stream end event
+ *
+ * @event AggregationCursor#end
+ * @type {null}
+ */
+
+/**
+ * AggregationCursor stream close event
+ *
+ * @event AggregationCursor#close
+ * @type {null}
+ */
+
+/**
+ * AggregationCursor stream readable event
+ *
+ * @event AggregationCursor#readable
+ * @type {null}
+ */
+
+/**
+ * Get the next available document from the cursor, returns null if no more documents are available.
+ * @function AggregationCursor.prototype.next
+ * @param {AggregationCursor~resultCallback} [callback] The result callback.
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * Check if there is any document still available in the cursor
+ * @function AggregationCursor.prototype.hasNext
+ * @param {AggregationCursor~resultCallback} [callback] The result callback.
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * The callback format for results
+ * @callback AggregationCursor~toArrayResultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {object[]} documents All the documents the satisfy the cursor.
+ */
+
+/**
+ * Returns an array of documents. The caller is responsible for making sure that there
+ * is enough memory to store the results. Note that the array only contain partial
+ * results when this cursor had been previously accessed. In that case,
+ * cursor.rewind() can be used to reset the cursor.
+ * @method AggregationCursor.prototype.toArray
+ * @param {AggregationCursor~toArrayResultCallback} [callback] The result callback.
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * The callback format for results
+ * @callback AggregationCursor~resultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {(object|null)} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Iterates over all the documents for this cursor. As with **{cursor.toArray}**,
+ * not all of the elements will be iterated if this cursor had been previously accessed.
+ * In that case, **{cursor.rewind}** can be used to reset the cursor. However, unlike
+ * **{cursor.toArray}**, the cursor will only hold a maximum of batch size elements
+ * at any given time if batch size is specified. Otherwise, the caller is responsible
+ * for making sure that the entire result can fit the memory.
+ * @method AggregationCursor.prototype.each
+ * @deprecated
+ * @param {AggregationCursor~resultCallback} callback The result callback.
+ * @throws {MongoError}
+ * @return {null}
+ */
+
+/**
+ * Close the cursor, sending a AggregationCursor command and emitting close.
+ * @method AggregationCursor.prototype.close
+ * @param {AggregationCursor~resultCallback} [callback] The result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * Is the cursor closed
+ * @method AggregationCursor.prototype.isClosed
+ * @return {boolean}
+ */
+
+/**
+ * Execute the explain for the cursor
+ *
+ * For backwards compatibility, a verbosity of true is interpreted as "allPlansExecution"
+ * and false as "queryPlanner". Prior to server version 3.6, aggregate()
+ * ignores the verbosity parameter and executes in "queryPlanner".
+ *
+ * @method AggregationCursor.prototype.explain
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [verbosity=true] - An optional mode in which to run the explain.
+ * @param {AggregationCursor~resultCallback} [callback] The result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * Clone the cursor
+ * @function AggregationCursor.prototype.clone
+ * @return {AggregationCursor}
+ */
+
+/**
+ * Resets the cursor
+ * @function AggregationCursor.prototype.rewind
+ * @return {AggregationCursor}
+ */
+
+/**
+ * The callback format for the forEach iterator method
+ * @callback AggregationCursor~iteratorCallback
+ * @param {Object} doc An emitted document for the iterator
+ */
+
+/**
+ * The callback error format for the forEach iterator method
+ * @callback AggregationCursor~endCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ */
+
+/**
+ * Iterates over all the documents for this cursor using the iterator, callback pattern.
+ * @method AggregationCursor.prototype.forEach
+ * @param {AggregationCursor~iteratorCallback} iterator The iteration callback.
+ * @param {AggregationCursor~endCallback} callback The end callback.
+ * @throws {MongoError}
+ * @return {null}
+ */
+
+module.exports = AggregationCursor;
diff --git a/NodeAPI/node_modules/mongodb/lib/apm.js b/NodeAPI/node_modules/mongodb/lib/apm.js
new file mode 100644
index 0000000000000000000000000000000000000000..f78e4aaff621ac70a0dc46896a84aa4ee16042cd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/apm.js
@@ -0,0 +1,31 @@
+'use strict';
+const EventEmitter = require('events').EventEmitter;
+
+class Instrumentation extends EventEmitter {
+  constructor() {
+    super();
+  }
+
+  instrument(MongoClient, callback) {
+    // store a reference to the original functions
+    this.$MongoClient = MongoClient;
+    const $prototypeConnect = (this.$prototypeConnect = MongoClient.prototype.connect);
+
+    const instrumentation = this;
+    MongoClient.prototype.connect = function(callback) {
+      this.s.options.monitorCommands = true;
+      this.on('commandStarted', event => instrumentation.emit('started', event));
+      this.on('commandSucceeded', event => instrumentation.emit('succeeded', event));
+      this.on('commandFailed', event => instrumentation.emit('failed', event));
+      return $prototypeConnect.call(this, callback);
+    };
+
+    if (typeof callback === 'function') callback(null, this);
+  }
+
+  uninstrument() {
+    this.$MongoClient.prototype.connect = this.$prototypeConnect;
+  }
+}
+
+module.exports = Instrumentation;
diff --git a/NodeAPI/node_modules/mongodb/lib/async/.eslintrc b/NodeAPI/node_modules/mongodb/lib/async/.eslintrc
new file mode 100644
index 0000000000000000000000000000000000000000..93b2f6437a31fec752b758c178b05fcb34ec6a64
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/async/.eslintrc
@@ -0,0 +1,5 @@
+{
+  "parserOptions": {
+    "ecmaVersion": 2018
+  }
+}
diff --git a/NodeAPI/node_modules/mongodb/lib/async/async_iterator.js b/NodeAPI/node_modules/mongodb/lib/async/async_iterator.js
new file mode 100644
index 0000000000000000000000000000000000000000..6021aadf9ec41dc5e3bd2b713aad2208f0cdda20
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/async/async_iterator.js
@@ -0,0 +1,33 @@
+'use strict';
+
+// async function* asyncIterator() {
+//   while (true) {
+//     const value = await this.next();
+//     if (!value) {
+//       await this.close();
+//       return;
+//     }
+
+//     yield value;
+//   }
+// }
+
+// TODO: change this to the async generator function above
+function asyncIterator() {
+  const cursor = this;
+
+  return {
+    next: function() {
+      return Promise.resolve()
+        .then(() => cursor.next())
+        .then(value => {
+          if (!value) {
+            return cursor.close().then(() => ({ value, done: true }));
+          }
+          return { value, done: false };
+        });
+    }
+  };
+}
+
+exports.asyncIterator = asyncIterator;
diff --git a/NodeAPI/node_modules/mongodb/lib/bulk/common.js b/NodeAPI/node_modules/mongodb/lib/bulk/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..cfc661e02f295bb939308bb98f4603047d53d73f
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/bulk/common.js
@@ -0,0 +1,1374 @@
+'use strict';
+
+const Long = require('../core').BSON.Long;
+const MongoError = require('../core').MongoError;
+const ObjectID = require('../core').BSON.ObjectID;
+const BSON = require('../core').BSON;
+const MongoWriteConcernError = require('../core').MongoWriteConcernError;
+const emitWarningOnce = require('../utils').emitWarningOnce;
+const toError = require('../utils').toError;
+const handleCallback = require('../utils').handleCallback;
+const applyRetryableWrites = require('../utils').applyRetryableWrites;
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const executeLegacyOperation = require('../utils').executeLegacyOperation;
+const isPromiseLike = require('../utils').isPromiseLike;
+const hasAtomicOperators = require('../utils').hasAtomicOperators;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+
+// Error codes
+const WRITE_CONCERN_ERROR = 64;
+
+// Insert types
+const INSERT = 1;
+const UPDATE = 2;
+const REMOVE = 3;
+
+const bson = new BSON([
+  BSON.Binary,
+  BSON.Code,
+  BSON.DBRef,
+  BSON.Decimal128,
+  BSON.Double,
+  BSON.Int32,
+  BSON.Long,
+  BSON.Map,
+  BSON.MaxKey,
+  BSON.MinKey,
+  BSON.ObjectId,
+  BSON.BSONRegExp,
+  BSON.Symbol,
+  BSON.Timestamp
+]);
+
+/**
+ * Keeps the state of a unordered batch so we can rewrite the results
+ * correctly after command execution
+ * @ignore
+ */
+class Batch {
+  constructor(batchType, originalZeroIndex) {
+    this.originalZeroIndex = originalZeroIndex;
+    this.currentIndex = 0;
+    this.originalIndexes = [];
+    this.batchType = batchType;
+    this.operations = [];
+    this.size = 0;
+    this.sizeBytes = 0;
+  }
+}
+
+/**
+ * @classdesc
+ * The result of a bulk write.
+ */
+class BulkWriteResult {
+  /**
+   * Create a new BulkWriteResult instance
+   *
+   * **NOTE:** Internal Type, do not instantiate directly
+   */
+  constructor(bulkResult) {
+    this.result = bulkResult;
+  }
+
+  /** Number of documents inserted. */
+  get insertedCount() {
+    return typeof this.result.nInserted !== 'number' ? 0 : this.result.nInserted;
+  }
+  /** Number of documents matched for update. */
+  get matchedCount() {
+    return typeof this.result.nMatched !== 'number' ? 0 : this.result.nMatched;
+  }
+  /** Number of documents modified. */
+  get modifiedCount() {
+    return typeof this.result.nModified !== 'number' ? 0 : this.result.nModified;
+  }
+  /** Number of documents deleted. */
+  get deletedCount() {
+    return typeof this.result.nRemoved !== 'number' ? 0 : this.result.nRemoved;
+  }
+  /** Number of documents upserted. */
+  get upsertedCount() {
+    return !this.result.upserted ? 0 : this.result.upserted.length;
+  }
+
+  /** Upserted document generated Id's, hash key is the index of the originating operation */
+  get upsertedIds() {
+    const upserted = {};
+    for (const doc of !this.result.upserted ? [] : this.result.upserted) {
+      upserted[doc.index] = doc._id;
+    }
+    return upserted;
+  }
+
+  /** Inserted document generated Id's, hash key is the index of the originating operation */
+  get insertedIds() {
+    const inserted = {};
+    for (const doc of !this.result.insertedIds ? [] : this.result.insertedIds) {
+      inserted[doc.index] = doc._id;
+    }
+    return inserted;
+  }
+
+  /**
+   * Evaluates to true if the bulk operation correctly executes
+   * @type {boolean}
+   */
+  get ok() {
+    return this.result.ok;
+  }
+
+  /**
+   * The number of inserted documents
+   * @type {number}
+   */
+  get nInserted() {
+    return this.result.nInserted;
+  }
+
+  /**
+   * Number of upserted documents
+   * @type {number}
+   */
+  get nUpserted() {
+    return this.result.nUpserted;
+  }
+
+  /**
+   * Number of matched documents
+   * @type {number}
+   */
+  get nMatched() {
+    return this.result.nMatched;
+  }
+
+  /**
+   * Number of documents updated physically on disk
+   * @type {number}
+   */
+  get nModified() {
+    return this.result.nModified;
+  }
+
+  /**
+   * Number of removed documents
+   * @type {number}
+   */
+  get nRemoved() {
+    return this.result.nRemoved;
+  }
+
+  /**
+   * Returns an array of all inserted ids
+   *
+   * @return {object[]}
+   */
+  getInsertedIds() {
+    return this.result.insertedIds;
+  }
+
+  /**
+   * Returns an array of all upserted ids
+   *
+   * @return {object[]}
+   */
+  getUpsertedIds() {
+    return this.result.upserted;
+  }
+
+  /**
+   * Returns the upserted id at the given index
+   *
+   * @param {number} index the number of the upserted id to return, returns undefined if no result for passed in index
+   * @return {object}
+   */
+  getUpsertedIdAt(index) {
+    return this.result.upserted[index];
+  }
+
+  /**
+   * Returns raw internal result
+   *
+   * @return {object}
+   */
+  getRawResponse() {
+    return this.result;
+  }
+
+  /**
+   * Returns true if the bulk operation contains a write error
+   *
+   * @return {boolean}
+   */
+  hasWriteErrors() {
+    return this.result.writeErrors.length > 0;
+  }
+
+  /**
+   * Returns the number of write errors off the bulk operation
+   *
+   * @return {number}
+   */
+  getWriteErrorCount() {
+    return this.result.writeErrors.length;
+  }
+
+  /**
+   * Returns a specific write error object
+   *
+   * @param {number} index of the write error to return, returns null if there is no result for passed in index
+   * @return {WriteError}
+   */
+  getWriteErrorAt(index) {
+    if (index < this.result.writeErrors.length) {
+      return this.result.writeErrors[index];
+    }
+    return null;
+  }
+
+  /**
+   * Retrieve all write errors
+   *
+   * @return {WriteError[]}
+   */
+  getWriteErrors() {
+    return this.result.writeErrors;
+  }
+
+  /**
+   * Retrieve lastOp if available
+   *
+   * @return {object}
+   */
+  getLastOp() {
+    return this.result.lastOp;
+  }
+
+  /**
+   * Retrieve the write concern error if any
+   *
+   * @return {WriteConcernError}
+   */
+  getWriteConcernError() {
+    if (this.result.writeConcernErrors.length === 0) {
+      return null;
+    } else if (this.result.writeConcernErrors.length === 1) {
+      // Return the error
+      return this.result.writeConcernErrors[0];
+    } else {
+      // Combine the errors
+      let errmsg = '';
+      for (let i = 0; i < this.result.writeConcernErrors.length; i++) {
+        const err = this.result.writeConcernErrors[i];
+        errmsg = errmsg + err.errmsg;
+
+        // TODO: Something better
+        if (i === 0) errmsg = errmsg + ' and ';
+      }
+
+      return new WriteConcernError({ errmsg: errmsg, code: WRITE_CONCERN_ERROR });
+    }
+  }
+
+  /**
+   * @return {object}
+   */
+  toJSON() {
+    return this.result;
+  }
+
+  /**
+   * @return {string}
+   */
+  toString() {
+    return `BulkWriteResult(${this.toJSON(this.result)})`;
+  }
+
+  /**
+   * @return {boolean}
+   */
+  isOk() {
+    return this.result.ok === 1;
+  }
+}
+
+/**
+ * @classdesc An error representing a failure by the server to apply the requested write concern to the bulk operation.
+ */
+class WriteConcernError {
+  /**
+   * Create a new WriteConcernError instance
+   *
+   * **NOTE:** Internal Type, do not instantiate directly
+   */
+  constructor(err) {
+    this.err = err;
+  }
+
+  /**
+   * Write concern error code.
+   * @type {number}
+   */
+  get code() {
+    return this.err.code;
+  }
+
+  /**
+   * Write concern error message.
+   * @type {string}
+   */
+  get errmsg() {
+    return this.err.errmsg;
+  }
+
+  /**
+   * @return {object}
+   */
+  toJSON() {
+    return { code: this.err.code, errmsg: this.err.errmsg };
+  }
+
+  /**
+   * @return {string}
+   */
+  toString() {
+    return `WriteConcernError(${this.err.errmsg})`;
+  }
+}
+
+/**
+ * @classdesc An error that occurred during a BulkWrite on the server.
+ */
+class WriteError {
+  /**
+   * Create a new WriteError instance
+   *
+   * **NOTE:** Internal Type, do not instantiate directly
+   */
+  constructor(err) {
+    this.err = err;
+  }
+
+  /**
+   * WriteError code.
+   * @type {number}
+   */
+  get code() {
+    return this.err.code;
+  }
+
+  /**
+   * WriteError original bulk operation index.
+   * @type {number}
+   */
+  get index() {
+    return this.err.index;
+  }
+
+  /**
+   * WriteError message.
+   * @type {string}
+   */
+  get errmsg() {
+    return this.err.errmsg;
+  }
+
+  /**
+   * Returns the underlying operation that caused the error
+   * @return {object}
+   */
+  getOperation() {
+    return this.err.op;
+  }
+
+  /**
+   * @return {object}
+   */
+  toJSON() {
+    return { code: this.err.code, index: this.err.index, errmsg: this.err.errmsg, op: this.err.op };
+  }
+
+  /**
+   * @return {string}
+   */
+  toString() {
+    return `WriteError(${JSON.stringify(this.toJSON())})`;
+  }
+}
+
+/**
+ * Merges results into shared data structure
+ * @ignore
+ */
+function mergeBatchResults(batch, bulkResult, err, result) {
+  // If we have an error set the result to be the err object
+  if (err) {
+    result = err;
+  } else if (result && result.result) {
+    result = result.result;
+  } else if (result == null) {
+    return;
+  }
+
+  // Do we have a top level error stop processing and return
+  if (result.ok === 0 && bulkResult.ok === 1) {
+    bulkResult.ok = 0;
+
+    const writeError = {
+      index: 0,
+      code: result.code || 0,
+      errmsg: result.message,
+      op: batch.operations[0]
+    };
+
+    bulkResult.writeErrors.push(new WriteError(writeError));
+    return;
+  } else if (result.ok === 0 && bulkResult.ok === 0) {
+    return;
+  }
+
+  // Deal with opTime if available
+  if (result.opTime || result.lastOp) {
+    const opTime = result.lastOp || result.opTime;
+    let lastOpTS = null;
+    let lastOpT = null;
+
+    // We have a time stamp
+    if (opTime && opTime._bsontype === 'Timestamp') {
+      if (bulkResult.lastOp == null) {
+        bulkResult.lastOp = opTime;
+      } else if (opTime.greaterThan(bulkResult.lastOp)) {
+        bulkResult.lastOp = opTime;
+      }
+    } else {
+      // Existing TS
+      if (bulkResult.lastOp) {
+        lastOpTS =
+          typeof bulkResult.lastOp.ts === 'number'
+            ? Long.fromNumber(bulkResult.lastOp.ts)
+            : bulkResult.lastOp.ts;
+        lastOpT =
+          typeof bulkResult.lastOp.t === 'number'
+            ? Long.fromNumber(bulkResult.lastOp.t)
+            : bulkResult.lastOp.t;
+      }
+
+      // Current OpTime TS
+      const opTimeTS = typeof opTime.ts === 'number' ? Long.fromNumber(opTime.ts) : opTime.ts;
+      const opTimeT = typeof opTime.t === 'number' ? Long.fromNumber(opTime.t) : opTime.t;
+
+      // Compare the opTime's
+      if (bulkResult.lastOp == null) {
+        bulkResult.lastOp = opTime;
+      } else if (opTimeTS.greaterThan(lastOpTS)) {
+        bulkResult.lastOp = opTime;
+      } else if (opTimeTS.equals(lastOpTS)) {
+        if (opTimeT.greaterThan(lastOpT)) {
+          bulkResult.lastOp = opTime;
+        }
+      }
+    }
+  }
+
+  // If we have an insert Batch type
+  if (batch.batchType === INSERT && result.n) {
+    bulkResult.nInserted = bulkResult.nInserted + result.n;
+  }
+
+  // If we have an insert Batch type
+  if (batch.batchType === REMOVE && result.n) {
+    bulkResult.nRemoved = bulkResult.nRemoved + result.n;
+  }
+
+  let nUpserted = 0;
+
+  // We have an array of upserted values, we need to rewrite the indexes
+  if (Array.isArray(result.upserted)) {
+    nUpserted = result.upserted.length;
+
+    for (let i = 0; i < result.upserted.length; i++) {
+      bulkResult.upserted.push({
+        index: result.upserted[i].index + batch.originalZeroIndex,
+        _id: result.upserted[i]._id
+      });
+    }
+  } else if (result.upserted) {
+    nUpserted = 1;
+
+    bulkResult.upserted.push({
+      index: batch.originalZeroIndex,
+      _id: result.upserted
+    });
+  }
+
+  // If we have an update Batch type
+  if (batch.batchType === UPDATE && result.n) {
+    const nModified = result.nModified;
+    bulkResult.nUpserted = bulkResult.nUpserted + nUpserted;
+    bulkResult.nMatched = bulkResult.nMatched + (result.n - nUpserted);
+
+    if (typeof nModified === 'number') {
+      bulkResult.nModified = bulkResult.nModified + nModified;
+    } else {
+      bulkResult.nModified = null;
+    }
+  }
+
+  if (Array.isArray(result.writeErrors)) {
+    for (let i = 0; i < result.writeErrors.length; i++) {
+      const writeError = {
+        index: batch.originalIndexes[result.writeErrors[i].index],
+        code: result.writeErrors[i].code,
+        errmsg: result.writeErrors[i].errmsg,
+        op: batch.operations[result.writeErrors[i].index]
+      };
+
+      bulkResult.writeErrors.push(new WriteError(writeError));
+    }
+  }
+
+  if (result.writeConcernError) {
+    bulkResult.writeConcernErrors.push(new WriteConcernError(result.writeConcernError));
+  }
+}
+
+function executeCommands(bulkOperation, options, callback) {
+  if (bulkOperation.s.batches.length === 0) {
+    return handleCallback(callback, null, new BulkWriteResult(bulkOperation.s.bulkResult));
+  }
+
+  const batch = bulkOperation.s.batches.shift();
+
+  function resultHandler(err, result) {
+    // Error is a driver related error not a bulk op error, terminate
+    if (((err && err.driver) || (err && err.message)) && !(err instanceof MongoWriteConcernError)) {
+      return handleCallback(callback, err);
+    }
+
+    // If we have and error
+    if (err) err.ok = 0;
+    if (err instanceof MongoWriteConcernError) {
+      return handleMongoWriteConcernError(batch, bulkOperation.s.bulkResult, err, callback);
+    }
+
+    // Merge the results together
+    const writeResult = new BulkWriteResult(bulkOperation.s.bulkResult);
+    const mergeResult = mergeBatchResults(batch, bulkOperation.s.bulkResult, err, result);
+    if (mergeResult != null) {
+      return handleCallback(callback, null, writeResult);
+    }
+
+    if (bulkOperation.handleWriteError(callback, writeResult)) return;
+
+    // Execute the next command in line
+    executeCommands(bulkOperation, options, callback);
+  }
+
+  bulkOperation.finalOptionsHandler({ options, batch, resultHandler }, callback);
+}
+
+/**
+ * handles write concern error
+ *
+ * @ignore
+ * @param {object} batch
+ * @param {object} bulkResult
+ * @param {boolean} ordered
+ * @param {WriteConcernError} err
+ * @param {function} callback
+ */
+function handleMongoWriteConcernError(batch, bulkResult, err, callback) {
+  mergeBatchResults(batch, bulkResult, null, err.result);
+
+  const wrappedWriteConcernError = new WriteConcernError({
+    errmsg: err.result.writeConcernError.errmsg,
+    code: err.result.writeConcernError.result
+  });
+  return handleCallback(
+    callback,
+    new BulkWriteError(toError(wrappedWriteConcernError), new BulkWriteResult(bulkResult)),
+    null
+  );
+}
+
+/**
+ * @classdesc An error indicating an unsuccessful Bulk Write
+ */
+class BulkWriteError extends MongoError {
+  /**
+   * Creates a new BulkWriteError
+   *
+   * @param {Error|string|object} message The error message
+   * @param {BulkWriteResult} result The result of the bulk write operation
+   * @extends {MongoError}
+   */
+  constructor(error, result) {
+    const message = error.err || error.errmsg || error.errMessage || error;
+    super(message);
+
+    Object.assign(this, error);
+
+    this.name = 'BulkWriteError';
+    this.result = result;
+  }
+
+  /** Number of documents inserted. */
+  get insertedCount() {
+    return this.result.insertedCount;
+  }
+  /** Number of documents matched for update. */
+  get matchedCount() {
+    return this.result.matchedCount;
+  }
+  /** Number of documents modified. */
+  get modifiedCount() {
+    return this.result.modifiedCount;
+  }
+  /** Number of documents deleted. */
+  get deletedCount() {
+    return this.result.deletedCount;
+  }
+  /** Number of documents upserted. */
+  get upsertedCount() {
+    return this.result.upsertedCount;
+  }
+  /** Inserted document generated Id's, hash key is the index of the originating operation */
+  get insertedIds() {
+    return this.result.insertedIds;
+  }
+  /** Upserted document generated Id's, hash key is the index of the originating operation */
+  get upsertedIds() {
+    return this.result.upsertedIds;
+  }
+}
+
+/**
+ * @classdesc A builder object that is returned from {@link BulkOperationBase#find}.
+ * Is used to build a write operation that involves a query filter.
+ */
+class FindOperators {
+  /**
+   * Creates a new FindOperators object.
+   *
+   * **NOTE:** Internal Type, do not instantiate directly
+   * @param {OrderedBulkOperation|UnorderedBulkOperation} bulkOperation
+   */
+  constructor(bulkOperation) {
+    this.s = bulkOperation.s;
+  }
+
+  /**
+   * Add a multiple update operation to the bulk operation
+   *
+   * @method
+   * @param {object} updateDocument An update field for an update operation. See {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-u u documentation}
+   * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+   * @throws {MongoError} If operation cannot be added to bulk write
+   * @return {OrderedBulkOperation|UnorderedBulkOperation} A reference to the parent BulkOperation
+   */
+  update(updateDocument) {
+    // Perform upsert
+    const upsert = typeof this.s.currentOp.upsert === 'boolean' ? this.s.currentOp.upsert : false;
+
+    // Establish the update command
+    const document = {
+      q: this.s.currentOp.selector,
+      u: updateDocument,
+      multi: true,
+      upsert: upsert
+    };
+
+    if (updateDocument.hint) {
+      document.hint = updateDocument.hint;
+    }
+
+    // Clear out current Op
+    this.s.currentOp = null;
+    return this.s.options.addToOperationsList(this, UPDATE, document);
+  }
+
+  /**
+   * Add a single update operation to the bulk operation
+   *
+   * @method
+   * @param {object} updateDocument An update field for an update operation. See {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-u u documentation}
+   * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+   * @throws {MongoError} If operation cannot be added to bulk write
+   * @return {OrderedBulkOperation|UnorderedBulkOperation} A reference to the parent BulkOperation
+   */
+  updateOne(updateDocument) {
+    // Perform upsert
+    const upsert = typeof this.s.currentOp.upsert === 'boolean' ? this.s.currentOp.upsert : false;
+
+    // Establish the update command
+    const document = {
+      q: this.s.currentOp.selector,
+      u: updateDocument,
+      multi: false,
+      upsert: upsert
+    };
+
+    if (updateDocument.hint) {
+      document.hint = updateDocument.hint;
+    }
+
+    if (!hasAtomicOperators(updateDocument)) {
+      throw new TypeError('Update document requires atomic operators');
+    }
+
+    // Clear out current Op
+    this.s.currentOp = null;
+    return this.s.options.addToOperationsList(this, UPDATE, document);
+  }
+
+  /**
+   * Add a replace one operation to the bulk operation
+   *
+   * @method
+   * @param {object} replacement the new document to replace the existing one with
+   * @throws {MongoError} If operation cannot be added to bulk write
+   * @return {OrderedBulkOperation|UnorderedBulkOperation} A reference to the parent BulkOperation
+   */
+  replaceOne(replacement) {
+    // Perform upsert
+    const upsert = typeof this.s.currentOp.upsert === 'boolean' ? this.s.currentOp.upsert : false;
+
+    // Establish the update command
+    const document = {
+      q: this.s.currentOp.selector,
+      u: replacement,
+      multi: false,
+      upsert: upsert
+    };
+
+    if (replacement.hint) {
+      document.hint = replacement.hint;
+    }
+
+    if (hasAtomicOperators(replacement)) {
+      throw new TypeError('Replacement document must not use atomic operators');
+    }
+
+    // Clear out current Op
+    this.s.currentOp = null;
+    return this.s.options.addToOperationsList(this, UPDATE, document);
+  }
+
+  /**
+   * Upsert modifier for update bulk operation, noting that this operation is an upsert.
+   *
+   * @method
+   * @throws {MongoError} If operation cannot be added to bulk write
+   * @return {FindOperators} reference to self
+   */
+  upsert() {
+    this.s.currentOp.upsert = true;
+    return this;
+  }
+
+  /**
+   * Add a delete one operation to the bulk operation
+   *
+   * @method
+   * @throws {MongoError} If operation cannot be added to bulk write
+   * @return {OrderedBulkOperation|UnorderedBulkOperation} A reference to the parent BulkOperation
+   */
+  deleteOne() {
+    // Establish the update command
+    const document = {
+      q: this.s.currentOp.selector,
+      limit: 1
+    };
+
+    // Clear out current Op
+    this.s.currentOp = null;
+    return this.s.options.addToOperationsList(this, REMOVE, document);
+  }
+
+  /**
+   * Add a delete many operation to the bulk operation
+   *
+   * @method
+   * @throws {MongoError} If operation cannot be added to bulk write
+   * @return {OrderedBulkOperation|UnorderedBulkOperation} A reference to the parent BulkOperation
+   */
+  delete() {
+    // Establish the update command
+    const document = {
+      q: this.s.currentOp.selector,
+      limit: 0
+    };
+
+    // Clear out current Op
+    this.s.currentOp = null;
+    return this.s.options.addToOperationsList(this, REMOVE, document);
+  }
+
+  /**
+   * backwards compatability for deleteOne
+   * @deprecated
+   */
+  removeOne() {
+    emitWarningOnce('bulk operation `removeOne` has been deprecated, please use `deleteOne`');
+    return this.deleteOne();
+  }
+
+  /**
+   * backwards compatability for delete
+   * @deprecated
+   */
+  remove() {
+    emitWarningOnce('bulk operation `remove` has been deprecated, please use `delete`');
+    return this.delete();
+  }
+}
+
+/**
+ * @classdesc Parent class to OrderedBulkOperation and UnorderedBulkOperation
+ *
+ * **NOTE:** Internal Type, do not instantiate directly
+ */
+class BulkOperationBase {
+  /**
+   * Create a new OrderedBulkOperation or UnorderedBulkOperation instance
+   * @property {number} length Get the number of operations in the bulk.
+   */
+  constructor(topology, collection, options, isOrdered) {
+    // determine whether bulkOperation is ordered or unordered
+    this.isOrdered = isOrdered;
+
+    options = options == null ? {} : options;
+    // TODO Bring from driver information in isMaster
+    // Get the namespace for the write operations
+    const namespace = collection.s.namespace;
+    // Used to mark operation as executed
+    const executed = false;
+
+    // Current item
+    const currentOp = null;
+
+    // Handle to the bson serializer, used to calculate running sizes
+    const bson = topology.bson;
+    // Set max byte size
+    const isMaster = topology.lastIsMaster();
+
+    // If we have autoEncryption on, batch-splitting must be done on 2mb chunks, but single documents
+    // over 2mb are still allowed
+    const usingAutoEncryption = !!(topology.s.options && topology.s.options.autoEncrypter);
+    const maxBsonObjectSize =
+      isMaster && isMaster.maxBsonObjectSize ? isMaster.maxBsonObjectSize : 1024 * 1024 * 16;
+    const maxBatchSizeBytes = usingAutoEncryption ? 1024 * 1024 * 2 : maxBsonObjectSize;
+    const maxWriteBatchSize =
+      isMaster && isMaster.maxWriteBatchSize ? isMaster.maxWriteBatchSize : 1000;
+
+    // Calculates the largest possible size of an Array key, represented as a BSON string
+    // element. This calculation:
+    //     1 byte for BSON type
+    //     # of bytes = length of (string representation of (maxWriteBatchSize - 1))
+    //   + 1 bytes for null terminator
+    const maxKeySize = (maxWriteBatchSize - 1).toString(10).length + 2;
+
+    // Final options for retryable writes and write concern
+    let finalOptions = Object.assign({}, options);
+    finalOptions = applyRetryableWrites(finalOptions, collection.s.db);
+    finalOptions = applyWriteConcern(finalOptions, { collection: collection }, options);
+    const writeConcern = finalOptions.writeConcern;
+
+    // Get the promiseLibrary
+    const promiseLibrary = options.promiseLibrary || Promise;
+
+    // Final results
+    const bulkResult = {
+      ok: 1,
+      writeErrors: [],
+      writeConcernErrors: [],
+      insertedIds: [],
+      nInserted: 0,
+      nUpserted: 0,
+      nMatched: 0,
+      nModified: 0,
+      nRemoved: 0,
+      upserted: []
+    };
+
+    // Internal state
+    this.s = {
+      // Final result
+      bulkResult: bulkResult,
+      // Current batch state
+      currentBatch: null,
+      currentIndex: 0,
+      // ordered specific
+      currentBatchSize: 0,
+      currentBatchSizeBytes: 0,
+      // unordered specific
+      currentInsertBatch: null,
+      currentUpdateBatch: null,
+      currentRemoveBatch: null,
+      batches: [],
+      // Write concern
+      writeConcern: writeConcern,
+      // Max batch size options
+      maxBsonObjectSize,
+      maxBatchSizeBytes,
+      maxWriteBatchSize,
+      maxKeySize,
+      // Namespace
+      namespace: namespace,
+      // BSON
+      bson: bson,
+      // Topology
+      topology: topology,
+      // Options
+      options: finalOptions,
+      // Current operation
+      currentOp: currentOp,
+      // Executed
+      executed: executed,
+      // Collection
+      collection: collection,
+      // Promise Library
+      promiseLibrary: promiseLibrary,
+      // Fundamental error
+      err: null,
+      // check keys
+      checkKeys: typeof options.checkKeys === 'boolean' ? options.checkKeys : true
+    };
+
+    // bypass Validation
+    if (options.bypassDocumentValidation === true) {
+      this.s.bypassDocumentValidation = true;
+    }
+  }
+
+  /**
+   * Add a single insert document to the bulk operation
+   *
+   * @param {object} document the document to insert
+   * @throws {MongoError}
+   * @return {BulkOperationBase} A reference to self
+   *
+   * @example
+   * const bulkOp = collection.initializeOrderedBulkOp();
+   * // Adds three inserts to the bulkOp.
+   * bulkOp
+   *   .insert({ a: 1 })
+   *   .insert({ b: 2 })
+   *   .insert({ c: 3 });
+   * await bulkOp.execute();
+   */
+  insert(document) {
+    if (this.s.collection.s.db.options.forceServerObjectId !== true && document._id == null)
+      document._id = new ObjectID();
+    return this.s.options.addToOperationsList(this, INSERT, document);
+  }
+
+  /**
+   * Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne.
+   * Returns a builder object used to complete the definition of the operation.
+   *
+   * @method
+   * @param {object} selector The selector for the bulk operation. See {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-q q documentation}
+   * @throws {MongoError} if a selector is not specified
+   * @return {FindOperators} A helper object with which the write operation can be defined.
+   *
+   * @example
+   * const bulkOp = collection.initializeOrderedBulkOp();
+   *
+   * // Add an updateOne to the bulkOp
+   * bulkOp.find({ a: 1 }).updateOne({ $set: { b: 2 } });
+   *
+   * // Add an updateMany to the bulkOp
+   * bulkOp.find({ c: 3 }).update({ $set: { d: 4 } });
+   *
+   * // Add an upsert
+   * bulkOp.find({ e: 5 }).upsert().updateOne({ $set: { f: 6 } });
+   *
+   * // Add a deletion
+   * bulkOp.find({ g: 7 }).deleteOne();
+   *
+   * // Add a multi deletion
+   * bulkOp.find({ h: 8 }).delete();
+   *
+   * // Add a replaceOne
+   * bulkOp.find({ i: 9 }).replaceOne({ j: 10 });
+   *
+   * // Update using a pipeline (requires Mongodb 4.2 or higher)
+   * bulk.find({ k: 11, y: { $exists: true }, z: { $exists: true } }).updateOne([
+   *   { $set: { total: { $sum: [ '$y', '$z' ] } } }
+   * ]);
+   *
+   * // All of the ops will now be executed
+   * await bulkOp.execute();
+   */
+  find(selector) {
+    if (!selector) {
+      throw toError('Bulk find operation must specify a selector');
+    }
+
+    // Save a current selector
+    this.s.currentOp = {
+      selector: selector
+    };
+
+    return new FindOperators(this);
+  }
+
+  /**
+   * Specifies a raw operation to perform in the bulk write.
+   *
+   * @method
+   * @param {object} op The raw operation to perform.
+   * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+   * @return {BulkOperationBase} A reference to self
+   */
+  raw(op) {
+    const key = Object.keys(op)[0];
+
+    // Set up the force server object id
+    const forceServerObjectId =
+      typeof this.s.options.forceServerObjectId === 'boolean'
+        ? this.s.options.forceServerObjectId
+        : this.s.collection.s.db.options.forceServerObjectId;
+
+    // Update operations
+    if (
+      (op.updateOne && op.updateOne.q) ||
+      (op.updateMany && op.updateMany.q) ||
+      (op.replaceOne && op.replaceOne.q)
+    ) {
+      op[key].multi = op.updateOne || op.replaceOne ? false : true;
+      return this.s.options.addToOperationsList(this, UPDATE, op[key]);
+    }
+
+    // Crud spec update format
+    if (op.updateOne || op.updateMany || op.replaceOne) {
+      if (op.replaceOne && hasAtomicOperators(op[key].replacement)) {
+        throw new TypeError('Replacement document must not use atomic operators');
+      } else if ((op.updateOne || op.updateMany) && !hasAtomicOperators(op[key].update)) {
+        throw new TypeError('Update document requires atomic operators');
+      }
+
+      const multi = op.updateOne || op.replaceOne ? false : true;
+      const operation = {
+        q: op[key].filter,
+        u: op[key].update || op[key].replacement,
+        multi: multi
+      };
+
+      if (op[key].hint) {
+        operation.hint = op[key].hint;
+      }
+
+      if (this.isOrdered) {
+        operation.upsert = op[key].upsert ? true : false;
+        if (op.collation) operation.collation = op.collation;
+      } else {
+        if (op[key].upsert) operation.upsert = true;
+      }
+      if (op[key].arrayFilters) {
+        // TODO: this check should be done at command construction against a connection, not a topology
+        if (maxWireVersion(this.s.topology) < 6) {
+          throw new TypeError('arrayFilters are only supported on MongoDB 3.6+');
+        }
+
+        operation.arrayFilters = op[key].arrayFilters;
+      }
+
+      return this.s.options.addToOperationsList(this, UPDATE, operation);
+    }
+
+    // Remove operations
+    if (
+      op.removeOne ||
+      op.removeMany ||
+      (op.deleteOne && op.deleteOne.q) ||
+      (op.deleteMany && op.deleteMany.q)
+    ) {
+      op[key].limit = op.removeOne ? 1 : 0;
+      return this.s.options.addToOperationsList(this, REMOVE, op[key]);
+    }
+
+    // Crud spec delete operations, less efficient
+    if (op.deleteOne || op.deleteMany) {
+      const limit = op.deleteOne ? 1 : 0;
+      const operation = { q: op[key].filter, limit: limit };
+      if (op[key].hint) {
+        operation.hint = op[key].hint;
+      }
+      if (this.isOrdered) {
+        if (op.collation) operation.collation = op.collation;
+      }
+      return this.s.options.addToOperationsList(this, REMOVE, operation);
+    }
+
+    // Insert operations
+    if (op.insertOne && op.insertOne.document == null) {
+      if (forceServerObjectId !== true && op.insertOne._id == null)
+        op.insertOne._id = new ObjectID();
+      return this.s.options.addToOperationsList(this, INSERT, op.insertOne);
+    } else if (op.insertOne && op.insertOne.document) {
+      if (forceServerObjectId !== true && op.insertOne.document._id == null)
+        op.insertOne.document._id = new ObjectID();
+      return this.s.options.addToOperationsList(this, INSERT, op.insertOne.document);
+    }
+
+    if (op.insertMany) {
+      emitWarningOnce(
+        'bulk operation `insertMany` has been deprecated; use multiple `insertOne` ops instead'
+      );
+      for (let i = 0; i < op.insertMany.length; i++) {
+        if (forceServerObjectId !== true && op.insertMany[i]._id == null)
+          op.insertMany[i]._id = new ObjectID();
+        this.s.options.addToOperationsList(this, INSERT, op.insertMany[i]);
+      }
+
+      return;
+    }
+
+    // No valid type of operation
+    throw toError(
+      'bulkWrite only supports insertOne, insertMany, updateOne, updateMany, removeOne, removeMany, deleteOne, deleteMany'
+    );
+  }
+
+  /**
+   * helper function to assist with promiseOrCallback behavior
+   * @ignore
+   * @param {*} err
+   * @param {*} callback
+   */
+  _handleEarlyError(err, callback) {
+    if (typeof callback === 'function') {
+      callback(err, null);
+      return;
+    }
+
+    return this.s.promiseLibrary.reject(err);
+  }
+
+  /**
+   * An internal helper method. Do not invoke directly. Will be going away in the future
+   *
+   * @ignore
+   * @method
+   * @param {class} bulk either OrderedBulkOperation or UnorderdBulkOperation
+   * @param {object} writeConcern
+   * @param {object} options
+   * @param {function} callback
+   */
+  bulkExecute(_writeConcern, options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = options || {};
+
+    if (typeof _writeConcern === 'function') {
+      callback = _writeConcern;
+    } else if (_writeConcern && typeof _writeConcern === 'object') {
+      this.s.writeConcern = _writeConcern;
+    }
+
+    if (this.s.executed) {
+      const executedError = toError('batch cannot be re-executed');
+      return this._handleEarlyError(executedError, callback);
+    }
+
+    // If we have current batch
+    if (this.isOrdered) {
+      if (this.s.currentBatch) this.s.batches.push(this.s.currentBatch);
+    } else {
+      if (this.s.currentInsertBatch) this.s.batches.push(this.s.currentInsertBatch);
+      if (this.s.currentUpdateBatch) this.s.batches.push(this.s.currentUpdateBatch);
+      if (this.s.currentRemoveBatch) this.s.batches.push(this.s.currentRemoveBatch);
+    }
+    // If we have no operations in the bulk raise an error
+    if (this.s.batches.length === 0) {
+      const emptyBatchError = toError('Invalid Operation, no operations specified');
+      return this._handleEarlyError(emptyBatchError, callback);
+    }
+    return { options, callback };
+  }
+
+  /**
+   * The callback format for results
+   * @callback BulkOperationBase~resultCallback
+   * @param {MongoError} error An error instance representing the error during the execution.
+   * @param {BulkWriteResult} result The bulk write result.
+   */
+
+  /**
+   * Execute the bulk operation
+   *
+   * @method
+   * @param {WriteConcern} [_writeConcern] Optional write concern. Can also be specified through options.
+   * @param {object} [options] Optional settings.
+   * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+   * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+   * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+   * @param {boolean} [options.fsync=false] **Deprecated** Specify a file sync write concern. Use writeConcern instead.
+   * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+   * @param {BulkOperationBase~resultCallback} [callback] A callback that will be invoked when bulkWrite finishes/errors
+   * @throws {MongoError} Throws error if the bulk object has already been executed
+   * @throws {MongoError} Throws error if the bulk object does not have any operations
+   * @return {Promise|void} returns Promise if no callback passed
+   */
+  execute(_writeConcern, options, callback) {
+    const ret = this.bulkExecute(_writeConcern, options, callback);
+    if (!ret || isPromiseLike(ret)) {
+      return ret;
+    }
+
+    options = ret.options;
+    callback = ret.callback;
+
+    return executeLegacyOperation(this.s.topology, executeCommands, [this, options, callback]);
+  }
+
+  /**
+   * Handles final options before executing command
+   *
+   * An internal method. Do not invoke. Will not be accessible in the future
+   *
+   * @ignore
+   * @param {object} config
+   * @param {object} config.options
+   * @param {number} config.batch
+   * @param {function} config.resultHandler
+   * @param {function} callback
+   */
+  finalOptionsHandler(config, callback) {
+    const finalOptions = Object.assign({ ordered: this.isOrdered }, config.options);
+    if (this.s.writeConcern != null) {
+      finalOptions.writeConcern = this.s.writeConcern;
+    }
+
+    if (finalOptions.bypassDocumentValidation !== true) {
+      delete finalOptions.bypassDocumentValidation;
+    }
+
+    // Set an operationIf if provided
+    if (this.operationId) {
+      config.resultHandler.operationId = this.operationId;
+    }
+
+    // Serialize functions
+    if (this.s.options.serializeFunctions) {
+      finalOptions.serializeFunctions = true;
+    }
+
+    // Ignore undefined
+    if (this.s.options.ignoreUndefined) {
+      finalOptions.ignoreUndefined = true;
+    }
+
+    // Is the bypassDocumentValidation options specific
+    if (this.s.bypassDocumentValidation === true) {
+      finalOptions.bypassDocumentValidation = true;
+    }
+
+    // Is the checkKeys option disabled
+    if (this.s.checkKeys === false) {
+      finalOptions.checkKeys = false;
+    }
+
+    if (finalOptions.retryWrites) {
+      if (config.batch.batchType === UPDATE) {
+        finalOptions.retryWrites =
+          finalOptions.retryWrites && !config.batch.operations.some(op => op.multi);
+      }
+
+      if (config.batch.batchType === REMOVE) {
+        finalOptions.retryWrites =
+          finalOptions.retryWrites && !config.batch.operations.some(op => op.limit === 0);
+      }
+    }
+
+    try {
+      if (config.batch.batchType === INSERT) {
+        this.s.topology.insert(
+          this.s.namespace,
+          config.batch.operations,
+          finalOptions,
+          config.resultHandler
+        );
+      } else if (config.batch.batchType === UPDATE) {
+        this.s.topology.update(
+          this.s.namespace,
+          config.batch.operations,
+          finalOptions,
+          config.resultHandler
+        );
+      } else if (config.batch.batchType === REMOVE) {
+        this.s.topology.remove(
+          this.s.namespace,
+          config.batch.operations,
+          finalOptions,
+          config.resultHandler
+        );
+      }
+    } catch (err) {
+      // Force top level error
+      err.ok = 0;
+      // Merge top level error and return
+      handleCallback(callback, null, mergeBatchResults(config.batch, this.s.bulkResult, err, null));
+    }
+  }
+
+  /**
+   * Handles the write error before executing commands
+   *
+   * An internal helper method. Do not invoke directly. Will be going away in the future
+   *
+   * @ignore
+   * @param {function} callback
+   * @param {BulkWriteResult} writeResult
+   * @param {class} self either OrderedBulkOperation or UnorderedBulkOperation
+   */
+  handleWriteError(callback, writeResult) {
+    if (this.s.bulkResult.writeErrors.length > 0) {
+      const msg = this.s.bulkResult.writeErrors[0].errmsg
+        ? this.s.bulkResult.writeErrors[0].errmsg
+        : 'write operation failed';
+
+      handleCallback(
+        callback,
+        new BulkWriteError(
+          toError({
+            message: msg,
+            code: this.s.bulkResult.writeErrors[0].code,
+            writeErrors: this.s.bulkResult.writeErrors
+          }),
+          writeResult
+        ),
+        null
+      );
+      return true;
+    }
+
+    if (writeResult.getWriteConcernError()) {
+      handleCallback(
+        callback,
+        new BulkWriteError(toError(writeResult.getWriteConcernError()), writeResult),
+        null
+      );
+      return true;
+    }
+  }
+}
+
+Object.defineProperty(BulkOperationBase.prototype, 'length', {
+  enumerable: true,
+  get: function() {
+    return this.s.currentIndex;
+  }
+});
+
+// Exports symbols
+module.exports = {
+  Batch,
+  BulkOperationBase,
+  bson,
+  INSERT: INSERT,
+  UPDATE: UPDATE,
+  REMOVE: REMOVE,
+  BulkWriteError
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/bulk/ordered.js b/NodeAPI/node_modules/mongodb/lib/bulk/ordered.js
new file mode 100644
index 0000000000000000000000000000000000000000..a976bed2106b1ae077d6961fb618d324523478da
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/bulk/ordered.js
@@ -0,0 +1,110 @@
+'use strict';
+
+const common = require('./common');
+const BulkOperationBase = common.BulkOperationBase;
+const Batch = common.Batch;
+const bson = common.bson;
+const utils = require('../utils');
+const toError = utils.toError;
+
+/**
+ * Add to internal list of Operations
+ *
+ * @ignore
+ * @param {OrderedBulkOperation} bulkOperation
+ * @param {number} docType number indicating the document type
+ * @param {object} document
+ * @return {OrderedBulkOperation}
+ */
+function addToOperationsList(bulkOperation, docType, document) {
+  // Get the bsonSize
+  const bsonSize = bson.calculateObjectSize(document, {
+    checkKeys: false,
+
+    // Since we don't know what the user selected for BSON options here,
+    // err on the safe side, and check the size with ignoreUndefined: false.
+    ignoreUndefined: false
+  });
+
+  // Throw error if the doc is bigger than the max BSON size
+  if (bsonSize >= bulkOperation.s.maxBsonObjectSize)
+    throw toError('document is larger than the maximum size ' + bulkOperation.s.maxBsonObjectSize);
+
+  // Create a new batch object if we don't have a current one
+  if (bulkOperation.s.currentBatch == null)
+    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);
+
+  const maxKeySize = bulkOperation.s.maxKeySize;
+
+  // Check if we need to create a new batch
+  if (
+    // New batch if we exceed the max batch op size
+    bulkOperation.s.currentBatchSize + 1 >= bulkOperation.s.maxWriteBatchSize ||
+    // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc,
+    // since we can't sent an empty batch
+    (bulkOperation.s.currentBatchSize > 0 &&
+      bulkOperation.s.currentBatchSizeBytes + maxKeySize + bsonSize >=
+        bulkOperation.s.maxBatchSizeBytes) ||
+    // New batch if the new op does not have the same op type as the current batch
+    bulkOperation.s.currentBatch.batchType !== docType
+  ) {
+    // Save the batch to the execution stack
+    bulkOperation.s.batches.push(bulkOperation.s.currentBatch);
+
+    // Create a new batch
+    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);
+
+    // Reset the current size trackers
+    bulkOperation.s.currentBatchSize = 0;
+    bulkOperation.s.currentBatchSizeBytes = 0;
+  }
+
+  if (docType === common.INSERT) {
+    bulkOperation.s.bulkResult.insertedIds.push({
+      index: bulkOperation.s.currentIndex,
+      _id: document._id
+    });
+  }
+
+  // We have an array of documents
+  if (Array.isArray(document)) {
+    throw toError('operation passed in cannot be an Array');
+  }
+
+  bulkOperation.s.currentBatch.originalIndexes.push(bulkOperation.s.currentIndex);
+  bulkOperation.s.currentBatch.operations.push(document);
+  bulkOperation.s.currentBatchSize += 1;
+  bulkOperation.s.currentBatchSizeBytes += maxKeySize + bsonSize;
+  bulkOperation.s.currentIndex += 1;
+
+  // Return bulkOperation
+  return bulkOperation;
+}
+
+/**
+ * Create a new OrderedBulkOperation instance (INTERNAL TYPE, do not instantiate directly)
+ * @class
+ * @extends BulkOperationBase
+ * @property {number} length Get the number of operations in the bulk.
+ * @return {OrderedBulkOperation} a OrderedBulkOperation instance.
+ */
+class OrderedBulkOperation extends BulkOperationBase {
+  constructor(topology, collection, options) {
+    options = options || {};
+    options = Object.assign(options, { addToOperationsList });
+
+    super(topology, collection, options, true);
+  }
+}
+
+/**
+ * Returns an unordered batch object
+ * @ignore
+ */
+function initializeOrderedBulkOp(topology, collection, options) {
+  return new OrderedBulkOperation(topology, collection, options);
+}
+
+initializeOrderedBulkOp.OrderedBulkOperation = OrderedBulkOperation;
+module.exports = initializeOrderedBulkOp;
+module.exports.Bulk = OrderedBulkOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/bulk/unordered.js b/NodeAPI/node_modules/mongodb/lib/bulk/unordered.js
new file mode 100644
index 0000000000000000000000000000000000000000..c126c5bbeab7b4ae8b3711d3431ae078b6522855
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/bulk/unordered.js
@@ -0,0 +1,131 @@
+'use strict';
+
+const common = require('./common');
+const BulkOperationBase = common.BulkOperationBase;
+const Batch = common.Batch;
+const bson = common.bson;
+const utils = require('../utils');
+const toError = utils.toError;
+
+/**
+ * Add to internal list of Operations
+ *
+ * @ignore
+ * @param {UnorderedBulkOperation} bulkOperation
+ * @param {number} docType number indicating the document type
+ * @param {object} document
+ * @return {UnorderedBulkOperation}
+ */
+function addToOperationsList(bulkOperation, docType, document) {
+  // Get the bsonSize
+  const bsonSize = bson.calculateObjectSize(document, {
+    checkKeys: false,
+
+    // Since we don't know what the user selected for BSON options here,
+    // err on the safe side, and check the size with ignoreUndefined: false.
+    ignoreUndefined: false
+  });
+  // Throw error if the doc is bigger than the max BSON size
+  if (bsonSize >= bulkOperation.s.maxBsonObjectSize)
+    throw toError('document is larger than the maximum size ' + bulkOperation.s.maxBsonObjectSize);
+  // Holds the current batch
+  bulkOperation.s.currentBatch = null;
+  // Get the right type of batch
+  if (docType === common.INSERT) {
+    bulkOperation.s.currentBatch = bulkOperation.s.currentInsertBatch;
+  } else if (docType === common.UPDATE) {
+    bulkOperation.s.currentBatch = bulkOperation.s.currentUpdateBatch;
+  } else if (docType === common.REMOVE) {
+    bulkOperation.s.currentBatch = bulkOperation.s.currentRemoveBatch;
+  }
+
+  const maxKeySize = bulkOperation.s.maxKeySize;
+
+  // Create a new batch object if we don't have a current one
+  if (bulkOperation.s.currentBatch == null)
+    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);
+
+  // Check if we need to create a new batch
+  if (
+    // New batch if we exceed the max batch op size
+    bulkOperation.s.currentBatch.size + 1 >= bulkOperation.s.maxWriteBatchSize ||
+    // New batch if we exceed the maxBatchSizeBytes. Only matters if batch already has a doc,
+    // since we can't sent an empty batch
+    (bulkOperation.s.currentBatch.size > 0 &&
+      bulkOperation.s.currentBatch.sizeBytes + maxKeySize + bsonSize >=
+        bulkOperation.s.maxBatchSizeBytes) ||
+    // New batch if the new op does not have the same op type as the current batch
+    bulkOperation.s.currentBatch.batchType !== docType
+  ) {
+    // Save the batch to the execution stack
+    bulkOperation.s.batches.push(bulkOperation.s.currentBatch);
+
+    // Create a new batch
+    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);
+  }
+
+  // We have an array of documents
+  if (Array.isArray(document)) {
+    throw toError('operation passed in cannot be an Array');
+  }
+
+  bulkOperation.s.currentBatch.operations.push(document);
+  bulkOperation.s.currentBatch.originalIndexes.push(bulkOperation.s.currentIndex);
+  bulkOperation.s.currentIndex = bulkOperation.s.currentIndex + 1;
+
+  // Save back the current Batch to the right type
+  if (docType === common.INSERT) {
+    bulkOperation.s.currentInsertBatch = bulkOperation.s.currentBatch;
+    bulkOperation.s.bulkResult.insertedIds.push({
+      index: bulkOperation.s.bulkResult.insertedIds.length,
+      _id: document._id
+    });
+  } else if (docType === common.UPDATE) {
+    bulkOperation.s.currentUpdateBatch = bulkOperation.s.currentBatch;
+  } else if (docType === common.REMOVE) {
+    bulkOperation.s.currentRemoveBatch = bulkOperation.s.currentBatch;
+  }
+
+  // Update current batch size
+  bulkOperation.s.currentBatch.size += 1;
+  bulkOperation.s.currentBatch.sizeBytes += maxKeySize + bsonSize;
+
+  // Return bulkOperation
+  return bulkOperation;
+}
+
+/**
+ * Create a new UnorderedBulkOperation instance (INTERNAL TYPE, do not instantiate directly)
+ * @class
+ * @extends BulkOperationBase
+ * @property {number} length Get the number of operations in the bulk.
+ * @return {UnorderedBulkOperation} a UnorderedBulkOperation instance.
+ */
+class UnorderedBulkOperation extends BulkOperationBase {
+  constructor(topology, collection, options) {
+    options = options || {};
+    options = Object.assign(options, { addToOperationsList });
+
+    super(topology, collection, options, false);
+  }
+
+  handleWriteError(callback, writeResult) {
+    if (this.s.batches.length) {
+      return false;
+    }
+
+    return super.handleWriteError(callback, writeResult);
+  }
+}
+
+/**
+ * Returns an unordered batch object
+ * @ignore
+ */
+function initializeUnorderedBulkOp(topology, collection, options) {
+  return new UnorderedBulkOperation(topology, collection, options);
+}
+
+initializeUnorderedBulkOp.UnorderedBulkOperation = UnorderedBulkOperation;
+module.exports = initializeUnorderedBulkOp;
+module.exports.Bulk = UnorderedBulkOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/change_stream.js b/NodeAPI/node_modules/mongodb/lib/change_stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..b226702ed808833bf1bb2c9a9a988566157deec2
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/change_stream.js
@@ -0,0 +1,623 @@
+'use strict';
+
+const Denque = require('denque');
+const EventEmitter = require('events');
+const isResumableError = require('./error').isResumableError;
+const MongoError = require('./core').MongoError;
+const Cursor = require('./cursor');
+const relayEvents = require('./core/utils').relayEvents;
+const maxWireVersion = require('./core/utils').maxWireVersion;
+const maybePromise = require('./utils').maybePromise;
+const now = require('./utils').now;
+const calculateDurationInMs = require('./utils').calculateDurationInMs;
+const AggregateOperation = require('./operations/aggregate');
+
+const kResumeQueue = Symbol('resumeQueue');
+
+const CHANGE_STREAM_OPTIONS = ['resumeAfter', 'startAfter', 'startAtOperationTime', 'fullDocument'];
+const CURSOR_OPTIONS = ['batchSize', 'maxAwaitTimeMS', 'collation', 'readPreference'].concat(
+  CHANGE_STREAM_OPTIONS
+);
+
+const CHANGE_DOMAIN_TYPES = {
+  COLLECTION: Symbol('Collection'),
+  DATABASE: Symbol('Database'),
+  CLUSTER: Symbol('Cluster')
+};
+
+/**
+ * @typedef ResumeToken
+ * @description Represents the logical starting point for a new or resuming {@link ChangeStream} on the server.
+ * @see https://docs.mongodb.com/master/changeStreams/#change-stream-resume-token
+ */
+
+/**
+ * @typedef OperationTime
+ * @description Represents a specific point in time on a server. Can be retrieved by using {@link Db#command}
+ * @see https://docs.mongodb.com/manual/reference/method/db.runCommand/#response
+ */
+
+/**
+ * @typedef ChangeStreamOptions
+ * @description Options that can be passed to a ChangeStream. Note that startAfter, resumeAfter, and startAtOperationTime are all mutually exclusive, and the server will error if more than one is specified.
+ * @property {string} [fullDocument='default'] Allowed values: ‘default’, ‘updateLookup’. When set to ‘updateLookup’, the change stream will include both a delta describing the changes to the document, as well as a copy of the entire document that was changed from some time after the change occurred.
+ * @property {number} [maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a change stream query.
+ * @property {ResumeToken} [resumeAfter] Allows you to start a changeStream after a specified event. See {@link https://docs.mongodb.com/master/changeStreams/#resumeafter-for-change-streams|ChangeStream documentation}.
+ * @property {ResumeToken} [startAfter] Similar to resumeAfter, but will allow you to start after an invalidated event. See {@link https://docs.mongodb.com/master/changeStreams/#startafter-for-change-streams|ChangeStream documentation}.
+ * @property {OperationTime} [startAtOperationTime] Will start the changeStream after the specified operationTime.
+ * @property {number} [batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @property {object} [collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @property {ReadPreference} [readPreference] The read preference. Defaults to the read preference of the database or collection. See {@link https://docs.mongodb.com/manual/reference/read-preference|read preference documentation}.
+ */
+
+/**
+ * Creates a new Change Stream instance. Normally created using {@link Collection#watch|Collection.watch()}.
+ * @class ChangeStream
+ * @since 3.0.0
+ * @param {(MongoClient|Db|Collection)} parent The parent object that created this change stream
+ * @param {Array} pipeline An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents
+ * @param {ChangeStreamOptions} [options] Optional settings
+ * @fires ChangeStream#close
+ * @fires ChangeStream#change
+ * @fires ChangeStream#end
+ * @fires ChangeStream#error
+ * @fires ChangeStream#resumeTokenChanged
+ * @return {ChangeStream} a ChangeStream instance.
+ */
+class ChangeStream extends EventEmitter {
+  constructor(parent, pipeline, options) {
+    super();
+    const Collection = require('./collection');
+    const Db = require('./db');
+    const MongoClient = require('./mongo_client');
+
+    this.pipeline = pipeline || [];
+    this.options = options || {};
+
+    this.parent = parent;
+    this.namespace = parent.s.namespace;
+    if (parent instanceof Collection) {
+      this.type = CHANGE_DOMAIN_TYPES.COLLECTION;
+      this.topology = parent.s.db.serverConfig;
+    } else if (parent instanceof Db) {
+      this.type = CHANGE_DOMAIN_TYPES.DATABASE;
+      this.topology = parent.serverConfig;
+    } else if (parent instanceof MongoClient) {
+      this.type = CHANGE_DOMAIN_TYPES.CLUSTER;
+      this.topology = parent.topology;
+    } else {
+      throw new TypeError(
+        'parent provided to ChangeStream constructor is not an instance of Collection, Db, or MongoClient'
+      );
+    }
+
+    this.promiseLibrary = parent.s.promiseLibrary;
+    if (!this.options.readPreference && parent.s.readPreference) {
+      this.options.readPreference = parent.s.readPreference;
+    }
+
+    this[kResumeQueue] = new Denque();
+
+    // Create contained Change Stream cursor
+    this.cursor = createChangeStreamCursor(this, options);
+
+    this.closed = false;
+
+    // Listen for any `change` listeners being added to ChangeStream
+    this.on('newListener', eventName => {
+      if (eventName === 'change' && this.cursor && this.listenerCount('change') === 0) {
+        this.cursor.on('data', change => processNewChange(this, change));
+      }
+    });
+
+    // Listen for all `change` listeners being removed from ChangeStream
+    this.on('removeListener', eventName => {
+      if (eventName === 'change' && this.listenerCount('change') === 0 && this.cursor) {
+        this.cursor.removeAllListeners('data');
+      }
+    });
+  }
+
+  /**
+   * @property {ResumeToken} resumeToken
+   * The cached resume token that will be used to resume
+   * after the most recently returned change.
+   */
+  get resumeToken() {
+    return this.cursor.resumeToken;
+  }
+
+  /**
+   * Check if there is any document still available in the Change Stream
+   * @function ChangeStream.prototype.hasNext
+   * @param {ChangeStream~resultCallback} [callback] The result callback.
+   * @throws {MongoError}
+   * @returns {Promise|void} returns Promise if no callback passed
+   */
+  hasNext(callback) {
+    return maybePromise(this.parent, callback, cb => {
+      getCursor(this, (err, cursor) => {
+        if (err) return cb(err); // failed to resume, raise an error
+        cursor.hasNext(cb);
+      });
+    });
+  }
+
+  /**
+   * Get the next available document from the Change Stream, returns null if no more documents are available.
+   * @function ChangeStream.prototype.next
+   * @param {ChangeStream~resultCallback} [callback] The result callback.
+   * @throws {MongoError}
+   * @returns {Promise|void} returns Promise if no callback passed
+   */
+  next(callback) {
+    return maybePromise(this.parent, callback, cb => {
+      getCursor(this, (err, cursor) => {
+        if (err) return cb(err); // failed to resume, raise an error
+        cursor.next((error, change) => {
+          if (error) {
+            this[kResumeQueue].push(() => this.next(cb));
+            processError(this, error, cb);
+            return;
+          }
+          processNewChange(this, change, cb);
+        });
+      });
+    });
+  }
+
+  /**
+   * Is the change stream closed
+   * @method ChangeStream.prototype.isClosed
+   * @return {boolean}
+   */
+  isClosed() {
+    return this.closed || (this.cursor && this.cursor.isClosed());
+  }
+
+  /**
+   * Close the Change Stream
+   * @method ChangeStream.prototype.close
+   * @param {ChangeStream~resultCallback} [callback] The result callback.
+   * @return {Promise} returns Promise if no callback passed
+   */
+  close(callback) {
+    return maybePromise(this.parent, callback, cb => {
+      if (this.closed) return cb();
+
+      // flag the change stream as explicitly closed
+      this.closed = true;
+
+      if (!this.cursor) return cb();
+
+      // Tidy up the existing cursor
+      const cursor = this.cursor;
+
+      return cursor.close(err => {
+        ['data', 'close', 'end', 'error'].forEach(event => cursor.removeAllListeners(event));
+        this.cursor = undefined;
+
+        return cb(err);
+      });
+    });
+  }
+
+  /**
+   * This method pulls all the data out of a readable stream, and writes it to the supplied destination, automatically managing the flow so that the destination is not overwhelmed by a fast readable stream.
+   * @method
+   * @param {Writable} destination The destination for writing data
+   * @param {object} [options] {@link https://nodejs.org/api/stream.html#stream_readable_pipe_destination_options|Pipe options}
+   * @return {null}
+   */
+  pipe(destination, options) {
+    if (!this.pipeDestinations) {
+      this.pipeDestinations = [];
+    }
+    this.pipeDestinations.push(destination);
+    return this.cursor.pipe(destination, options);
+  }
+
+  /**
+   * This method will remove the hooks set up for a previous pipe() call.
+   * @param {Writable} [destination] The destination for writing data
+   * @return {null}
+   */
+  unpipe(destination) {
+    if (this.pipeDestinations && this.pipeDestinations.indexOf(destination) > -1) {
+      this.pipeDestinations.splice(this.pipeDestinations.indexOf(destination), 1);
+    }
+    return this.cursor.unpipe(destination);
+  }
+
+  /**
+   * Return a modified Readable stream including a possible transform method.
+   * @method
+   * @param {object} [options] Optional settings.
+   * @param {function} [options.transform] A transformation method applied to each document emitted by the stream.
+   * @return {Cursor}
+   */
+  stream(options) {
+    this.streamOptions = options;
+    return this.cursor.stream(options);
+  }
+
+  /**
+   * This method will cause a stream in flowing mode to stop emitting data events. Any data that becomes available will remain in the internal buffer.
+   * @return {null}
+   */
+  pause() {
+    return this.cursor.pause();
+  }
+
+  /**
+   * This method will cause the readable stream to resume emitting data events.
+   * @return {null}
+   */
+  resume() {
+    return this.cursor.resume();
+  }
+}
+
+class ChangeStreamCursor extends Cursor {
+  constructor(topology, operation, options) {
+    super(topology, operation, options);
+
+    options = options || {};
+    this._resumeToken = null;
+    this.startAtOperationTime = options.startAtOperationTime;
+
+    if (options.startAfter) {
+      this.resumeToken = options.startAfter;
+    } else if (options.resumeAfter) {
+      this.resumeToken = options.resumeAfter;
+    }
+  }
+
+  set resumeToken(token) {
+    this._resumeToken = token;
+    this.emit('resumeTokenChanged', token);
+  }
+
+  get resumeToken() {
+    return this._resumeToken;
+  }
+
+  get resumeOptions() {
+    const result = {};
+    for (const optionName of CURSOR_OPTIONS) {
+      if (this.options[optionName]) result[optionName] = this.options[optionName];
+    }
+
+    if (this.resumeToken || this.startAtOperationTime) {
+      ['resumeAfter', 'startAfter', 'startAtOperationTime'].forEach(key => delete result[key]);
+
+      if (this.resumeToken) {
+        const resumeKey =
+          this.options.startAfter && !this.hasReceived ? 'startAfter' : 'resumeAfter';
+        result[resumeKey] = this.resumeToken;
+      } else if (this.startAtOperationTime && maxWireVersion(this.server) >= 7) {
+        result.startAtOperationTime = this.startAtOperationTime;
+      }
+    }
+
+    return result;
+  }
+
+  cacheResumeToken(resumeToken) {
+    if (this.bufferedCount() === 0 && this.cursorState.postBatchResumeToken) {
+      this.resumeToken = this.cursorState.postBatchResumeToken;
+    } else {
+      this.resumeToken = resumeToken;
+    }
+    this.hasReceived = true;
+  }
+
+  _processBatch(batchName, response) {
+    const cursor = response.cursor;
+    if (cursor.postBatchResumeToken) {
+      this.cursorState.postBatchResumeToken = cursor.postBatchResumeToken;
+
+      if (cursor[batchName].length === 0) {
+        this.resumeToken = cursor.postBatchResumeToken;
+      }
+    }
+  }
+
+  _initializeCursor(callback) {
+    super._initializeCursor((err, result) => {
+      if (err || result == null) {
+        callback(err, result);
+        return;
+      }
+
+      const response = result.documents[0];
+
+      if (
+        this.startAtOperationTime == null &&
+        this.resumeAfter == null &&
+        this.startAfter == null &&
+        maxWireVersion(this.server) >= 7
+      ) {
+        this.startAtOperationTime = response.operationTime;
+      }
+
+      this._processBatch('firstBatch', response);
+
+      this.emit('init', result);
+      this.emit('response');
+      callback(err, result);
+    });
+  }
+
+  _getMore(callback) {
+    super._getMore((err, response) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      this._processBatch('nextBatch', response);
+
+      this.emit('more', response);
+      this.emit('response');
+      callback(err, response);
+    });
+  }
+}
+
+/**
+ * @event ChangeStreamCursor#response
+ * internal event DO NOT USE
+ * @ignore
+ */
+
+// Create a new change stream cursor based on self's configuration
+function createChangeStreamCursor(self, options) {
+  const changeStreamStageOptions = { fullDocument: options.fullDocument || 'default' };
+  applyKnownOptions(changeStreamStageOptions, options, CHANGE_STREAM_OPTIONS);
+  if (self.type === CHANGE_DOMAIN_TYPES.CLUSTER) {
+    changeStreamStageOptions.allChangesForCluster = true;
+  }
+
+  const pipeline = [{ $changeStream: changeStreamStageOptions }].concat(self.pipeline);
+  const cursorOptions = applyKnownOptions({}, options, CURSOR_OPTIONS);
+
+  const changeStreamCursor = new ChangeStreamCursor(
+    self.topology,
+    new AggregateOperation(self.parent, pipeline, options),
+    cursorOptions
+  );
+
+  relayEvents(changeStreamCursor, self, ['resumeTokenChanged', 'end', 'close']);
+
+  /**
+   * Fired for each new matching change in the specified namespace. Attaching a `change`
+   * event listener to a Change Stream will switch the stream into flowing mode. Data will
+   * then be passed as soon as it is available.
+   *
+   * @event ChangeStream#change
+   * @type {object}
+   */
+  if (self.listenerCount('change') > 0) {
+    changeStreamCursor.on('data', function(change) {
+      processNewChange(self, change);
+    });
+  }
+
+  /**
+   * Change stream close event
+   *
+   * @event ChangeStream#close
+   * @type {null}
+   */
+
+  /**
+   * Change stream end event
+   *
+   * @event ChangeStream#end
+   * @type {null}
+   */
+
+  /**
+   * Emitted each time the change stream stores a new resume token.
+   *
+   * @event ChangeStream#resumeTokenChanged
+   * @type {ResumeToken}
+   */
+
+  /**
+   * Fired when the stream encounters an error.
+   *
+   * @event ChangeStream#error
+   * @type {Error}
+   */
+  changeStreamCursor.on('error', function(error) {
+    processError(self, error);
+  });
+
+  if (self.pipeDestinations) {
+    const cursorStream = changeStreamCursor.stream(self.streamOptions);
+    for (let pipeDestination of self.pipeDestinations) {
+      cursorStream.pipe(pipeDestination);
+    }
+  }
+
+  return changeStreamCursor;
+}
+
+function applyKnownOptions(target, source, optionNames) {
+  optionNames.forEach(name => {
+    if (source[name]) {
+      target[name] = source[name];
+    }
+  });
+
+  return target;
+}
+
+// This method performs a basic server selection loop, satisfying the requirements of
+// ChangeStream resumability until the new SDAM layer can be used.
+const SELECTION_TIMEOUT = 30000;
+function waitForTopologyConnected(topology, options, callback) {
+  setTimeout(() => {
+    if (options && options.start == null) {
+      options.start = now();
+    }
+
+    const start = options.start || now();
+    const timeout = options.timeout || SELECTION_TIMEOUT;
+    const readPreference = options.readPreference;
+    if (topology.isConnected({ readPreference })) {
+      return callback();
+    }
+
+    if (calculateDurationInMs(start) > timeout) {
+      return callback(new MongoError('Timed out waiting for connection'));
+    }
+
+    waitForTopologyConnected(topology, options, callback);
+  }, 500); // this is an arbitrary wait time to allow SDAM to transition
+}
+
+function processNewChange(changeStream, change, callback) {
+  const cursor = changeStream.cursor;
+
+  // a null change means the cursor has been notified, implicitly closing the change stream
+  if (change == null) {
+    changeStream.closed = true;
+  }
+
+  if (changeStream.closed) {
+    if (callback) callback(new MongoError('ChangeStream is closed'));
+    return;
+  }
+
+  if (change && !change._id) {
+    const noResumeTokenError = new Error(
+      'A change stream document has been received that lacks a resume token (_id).'
+    );
+
+    if (!callback) return changeStream.emit('error', noResumeTokenError);
+    return callback(noResumeTokenError);
+  }
+
+  // cache the resume token
+  cursor.cacheResumeToken(change._id);
+
+  // wipe the startAtOperationTime if there was one so that there won't be a conflict
+  // between resumeToken and startAtOperationTime if we need to reconnect the cursor
+  changeStream.options.startAtOperationTime = undefined;
+
+  // Return the change
+  if (!callback) return changeStream.emit('change', change);
+  return callback(undefined, change);
+}
+
+function processError(changeStream, error, callback) {
+  const topology = changeStream.topology;
+  const cursor = changeStream.cursor;
+
+  // If the change stream has been closed explictly, do not process error.
+  if (changeStream.closed) {
+    if (callback) callback(new MongoError('ChangeStream is closed'));
+    return;
+  }
+
+  // if the resume succeeds, continue with the new cursor
+  function resumeWithCursor(newCursor) {
+    changeStream.cursor = newCursor;
+    processResumeQueue(changeStream);
+  }
+
+  // otherwise, raise an error and close the change stream
+  function unresumableError(err) {
+    if (!callback) {
+      changeStream.emit('error', err);
+      changeStream.emit('close');
+    }
+    processResumeQueue(changeStream, err);
+    changeStream.closed = true;
+  }
+
+  if (cursor && isResumableError(error, maxWireVersion(cursor.server))) {
+    changeStream.cursor = undefined;
+
+    // stop listening to all events from old cursor
+    ['data', 'close', 'end', 'error'].forEach(event => cursor.removeAllListeners(event));
+
+    // close internal cursor, ignore errors
+    cursor.close();
+
+    waitForTopologyConnected(topology, { readPreference: cursor.options.readPreference }, err => {
+      // if the topology can't reconnect, close the stream
+      if (err) return unresumableError(err);
+
+      // create a new cursor, preserving the old cursor's options
+      const newCursor = createChangeStreamCursor(changeStream, cursor.resumeOptions);
+
+      // attempt to continue in emitter mode
+      if (!callback) return resumeWithCursor(newCursor);
+
+      // attempt to continue in iterator mode
+      newCursor.hasNext(err => {
+        // if there's an error immediately after resuming, close the stream
+        if (err) return unresumableError(err);
+        resumeWithCursor(newCursor);
+      });
+    });
+    return;
+  }
+
+  if (!callback) return changeStream.emit('error', error);
+  return callback(error);
+}
+
+/**
+ * Safely provides a cursor across resume attempts
+ *
+ * @param {ChangeStream} changeStream the parent ChangeStream
+ * @param {function} callback gets the cursor or error
+ * @param {ChangeStreamCursor} [oldCursor] when resuming from an error, carry over options from previous cursor
+ */
+function getCursor(changeStream, callback) {
+  if (changeStream.isClosed()) {
+    callback(new MongoError('ChangeStream is closed.'));
+    return;
+  }
+
+  // if a cursor exists and it is open, return it
+  if (changeStream.cursor) {
+    callback(undefined, changeStream.cursor);
+    return;
+  }
+
+  // no cursor, queue callback until topology reconnects
+  changeStream[kResumeQueue].push(callback);
+}
+
+/**
+ * Drain the resume queue when a new has become available
+ *
+ * @param {ChangeStream} changeStream the parent ChangeStream
+ * @param {ChangeStreamCursor?} changeStream.cursor the new cursor
+ * @param {Error} [err] error getting a new cursor
+ */
+function processResumeQueue(changeStream, err) {
+  while (changeStream[kResumeQueue].length) {
+    const request = changeStream[kResumeQueue].pop();
+    if (changeStream.isClosed() && !err) {
+      request(new MongoError('Change Stream is not open.'));
+      return;
+    }
+    request(err, changeStream.cursor);
+  }
+}
+
+/**
+ * The callback format for results
+ * @callback ChangeStream~resultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {(object|null)} result The result object if the command was executed successfully.
+ */
+
+module.exports = ChangeStream;
diff --git a/NodeAPI/node_modules/mongodb/lib/cmap/connection.js b/NodeAPI/node_modules/mongodb/lib/cmap/connection.js
new file mode 100644
index 0000000000000000000000000000000000000000..81925b962188c216bed2be049a03690ad45f5a4e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cmap/connection.js
@@ -0,0 +1,388 @@
+'use strict';
+
+const EventEmitter = require('events');
+const MessageStream = require('./message_stream');
+const MongoError = require('../core/error').MongoError;
+const MongoNetworkError = require('../core/error').MongoNetworkError;
+const MongoNetworkTimeoutError = require('../core/error').MongoNetworkTimeoutError;
+const MongoWriteConcernError = require('../core/error').MongoWriteConcernError;
+const CommandResult = require('../core/connection/command_result');
+const StreamDescription = require('./stream_description').StreamDescription;
+const wp = require('../core/wireprotocol');
+const apm = require('../core/connection/apm');
+const updateSessionFromResponse = require('../core/sessions').updateSessionFromResponse;
+const uuidV4 = require('../core/utils').uuidV4;
+const now = require('../utils').now;
+const calculateDurationInMs = require('../utils').calculateDurationInMs;
+
+const kStream = Symbol('stream');
+const kQueue = Symbol('queue');
+const kMessageStream = Symbol('messageStream');
+const kGeneration = Symbol('generation');
+const kLastUseTime = Symbol('lastUseTime');
+const kClusterTime = Symbol('clusterTime');
+const kDescription = Symbol('description');
+const kIsMaster = Symbol('ismaster');
+const kAutoEncrypter = Symbol('autoEncrypter');
+
+class Connection extends EventEmitter {
+  constructor(stream, options) {
+    super(options);
+
+    this.id = options.id;
+    this.address = streamIdentifier(stream);
+    this.bson = options.bson;
+    this.socketTimeout = typeof options.socketTimeout === 'number' ? options.socketTimeout : 0;
+    this.host = options.host || 'localhost';
+    this.port = options.port || 27017;
+    this.monitorCommands =
+      typeof options.monitorCommands === 'boolean' ? options.monitorCommands : false;
+    this.closed = false;
+    this.destroyed = false;
+
+    this[kDescription] = new StreamDescription(this.address, options);
+    this[kGeneration] = options.generation;
+    this[kLastUseTime] = now();
+
+    // retain a reference to an `AutoEncrypter` if present
+    if (options.autoEncrypter) {
+      this[kAutoEncrypter] = options.autoEncrypter;
+    }
+
+    // setup parser stream and message handling
+    this[kQueue] = new Map();
+    this[kMessageStream] = new MessageStream(options);
+    this[kMessageStream].on('message', messageHandler(this));
+    this[kStream] = stream;
+    stream.on('error', () => {
+      /* ignore errors, listen to `close` instead */
+    });
+
+    this[kMessageStream].on('error', error => this.handleIssue({ destroy: error }));
+    stream.on('close', () => this.handleIssue({ isClose: true }));
+    stream.on('timeout', () => this.handleIssue({ isTimeout: true, destroy: true }));
+
+    // hook the message stream up to the passed in stream
+    stream.pipe(this[kMessageStream]);
+    this[kMessageStream].pipe(stream);
+  }
+
+  get description() {
+    return this[kDescription];
+  }
+
+  get ismaster() {
+    return this[kIsMaster];
+  }
+
+  // the `connect` method stores the result of the handshake ismaster on the connection
+  set ismaster(response) {
+    this[kDescription].receiveResponse(response);
+
+    // TODO: remove this, and only use the `StreamDescription` in the future
+    this[kIsMaster] = response;
+  }
+
+  get generation() {
+    return this[kGeneration] || 0;
+  }
+
+  get idleTime() {
+    return calculateDurationInMs(this[kLastUseTime]);
+  }
+
+  get clusterTime() {
+    return this[kClusterTime];
+  }
+
+  get stream() {
+    return this[kStream];
+  }
+
+  markAvailable() {
+    this[kLastUseTime] = now();
+  }
+
+  /**
+   * @param {{ isTimeout?: boolean; isClose?: boolean; destroy?: boolean | Error }} issue
+   */
+  handleIssue(issue) {
+    if (this.closed) {
+      return;
+    }
+
+    if (issue.destroy) {
+      this[kStream].destroy(typeof issue.destroy === 'boolean' ? undefined : issue.destroy);
+    }
+
+    this.closed = true;
+
+    for (const idAndOp of this[kQueue]) {
+      const op = idAndOp[1];
+      if (issue.isTimeout) {
+        op.cb(
+          new MongoNetworkTimeoutError(`connection ${this.id} to ${this.address} timed out`, {
+            beforeHandshake: this.ismaster == null
+          })
+        );
+      } else if (issue.isClose) {
+        op.cb(new MongoNetworkError(`connection ${this.id} to ${this.address} closed`));
+      } else {
+        op.cb(typeof issue.destroy === 'boolean' ? undefined : issue.destroy);
+      }
+    }
+
+    this[kQueue].clear();
+    this.emit('close');
+  }
+
+  destroy(options, callback) {
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+
+    options = Object.assign({ force: false }, options);
+    if (this[kStream] == null || this.destroyed) {
+      this.destroyed = true;
+      if (typeof callback === 'function') {
+        callback();
+      }
+
+      return;
+    }
+
+    if (options.force) {
+      this[kStream].destroy();
+      this.destroyed = true;
+      if (typeof callback === 'function') {
+        callback();
+      }
+
+      return;
+    }
+
+    this[kStream].end(err => {
+      this.destroyed = true;
+      if (typeof callback === 'function') {
+        callback(err);
+      }
+    });
+  }
+
+  // Wire protocol methods
+  command(ns, cmd, options, callback) {
+    wp.command(makeServerTrampoline(this), ns, cmd, options, callback);
+  }
+
+  query(ns, cmd, cursorState, options, callback) {
+    wp.query(makeServerTrampoline(this), ns, cmd, cursorState, options, callback);
+  }
+
+  getMore(ns, cursorState, batchSize, options, callback) {
+    wp.getMore(makeServerTrampoline(this), ns, cursorState, batchSize, options, callback);
+  }
+
+  killCursors(ns, cursorState, callback) {
+    wp.killCursors(makeServerTrampoline(this), ns, cursorState, callback);
+  }
+
+  insert(ns, ops, options, callback) {
+    wp.insert(makeServerTrampoline(this), ns, ops, options, callback);
+  }
+
+  update(ns, ops, options, callback) {
+    wp.update(makeServerTrampoline(this), ns, ops, options, callback);
+  }
+
+  remove(ns, ops, options, callback) {
+    wp.remove(makeServerTrampoline(this), ns, ops, options, callback);
+  }
+}
+
+/// This lets us emulate a legacy `Server` instance so we can work with the existing wire
+/// protocol methods. Eventually, the operation executor will return a `Connection` to execute
+/// against.
+function makeServerTrampoline(connection) {
+  const server = {
+    description: connection.description,
+    clusterTime: connection[kClusterTime],
+    s: {
+      bson: connection.bson,
+      pool: { write: write.bind(connection), isConnected: () => true }
+    }
+  };
+
+  if (connection[kAutoEncrypter]) {
+    server.autoEncrypter = connection[kAutoEncrypter];
+  }
+
+  return server;
+}
+
+function messageHandler(conn) {
+  return function messageHandler(message) {
+    // always emit the message, in case we are streaming
+    conn.emit('message', message);
+    if (!conn[kQueue].has(message.responseTo)) {
+      return;
+    }
+
+    const operationDescription = conn[kQueue].get(message.responseTo);
+    const callback = operationDescription.cb;
+
+    // SERVER-45775: For exhaust responses we should be able to use the same requestId to
+    // track response, however the server currently synthetically produces remote requests
+    // making the `responseTo` change on each response
+    conn[kQueue].delete(message.responseTo);
+    if (message.moreToCome) {
+      // requeue the callback for next synthetic request
+      conn[kQueue].set(message.requestId, operationDescription);
+    } else if (operationDescription.socketTimeoutOverride) {
+      conn[kStream].setTimeout(conn.socketTimeout);
+    }
+
+    try {
+      // Pass in the entire description because it has BSON parsing options
+      message.parse(operationDescription);
+    } catch (err) {
+      callback(new MongoError(err));
+      return;
+    }
+
+    if (message.documents[0]) {
+      const document = message.documents[0];
+      const session = operationDescription.session;
+      if (session) {
+        updateSessionFromResponse(session, document);
+      }
+
+      if (document.$clusterTime) {
+        conn[kClusterTime] = document.$clusterTime;
+        conn.emit('clusterTimeReceived', document.$clusterTime);
+      }
+
+      if (operationDescription.command) {
+        if (document.writeConcernError) {
+          callback(new MongoWriteConcernError(document.writeConcernError, document));
+          return;
+        }
+
+        if (document.ok === 0 || document.$err || document.errmsg || document.code) {
+          callback(new MongoError(document));
+          return;
+        }
+      }
+    }
+
+    // NODE-2382: reenable in our glorious non-leaky abstraction future
+    // callback(null, operationDescription.fullResult ? message : message.documents[0]);
+
+    callback(
+      undefined,
+      new CommandResult(
+        operationDescription.fullResult ? message : message.documents[0],
+        conn,
+        message
+      )
+    );
+  };
+}
+
+function streamIdentifier(stream) {
+  if (typeof stream.address === 'function') {
+    return `${stream.remoteAddress}:${stream.remotePort}`;
+  }
+
+  return uuidV4().toString('hex');
+}
+
+// Not meant to be called directly, the wire protocol methods call this assuming it is a `Pool` instance
+function write(command, options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+  }
+
+  options = options || {};
+  const operationDescription = {
+    requestId: command.requestId,
+    cb: callback,
+    session: options.session,
+    fullResult: typeof options.fullResult === 'boolean' ? options.fullResult : false,
+    noResponse: typeof options.noResponse === 'boolean' ? options.noResponse : false,
+    documentsReturnedIn: options.documentsReturnedIn,
+    command: !!options.command,
+
+    // for BSON parsing
+    promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true,
+    promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true,
+    promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false,
+    raw: typeof options.raw === 'boolean' ? options.raw : false
+  };
+
+  if (this[kDescription] && this[kDescription].compressor) {
+    operationDescription.agreedCompressor = this[kDescription].compressor;
+
+    if (this[kDescription].zlibCompressionLevel) {
+      operationDescription.zlibCompressionLevel = this[kDescription].zlibCompressionLevel;
+    }
+  }
+
+  if (typeof options.socketTimeout === 'number') {
+    operationDescription.socketTimeoutOverride = true;
+    this[kStream].setTimeout(options.socketTimeout);
+  }
+
+  // if command monitoring is enabled we need to modify the callback here
+  if (this.monitorCommands) {
+    this.emit('commandStarted', new apm.CommandStartedEvent(this, command));
+
+    operationDescription.started = now();
+    operationDescription.cb = (err, reply) => {
+      if (err) {
+        this.emit(
+          'commandFailed',
+          new apm.CommandFailedEvent(this, command, err, operationDescription.started)
+        );
+      } else {
+        if (reply && reply.result && (reply.result.ok === 0 || reply.result.$err)) {
+          this.emit(
+            'commandFailed',
+            new apm.CommandFailedEvent(this, command, reply.result, operationDescription.started)
+          );
+        } else {
+          this.emit(
+            'commandSucceeded',
+            new apm.CommandSucceededEvent(this, command, reply, operationDescription.started)
+          );
+        }
+      }
+
+      if (typeof callback === 'function') {
+        callback(err, reply);
+      }
+    };
+  }
+
+  if (!operationDescription.noResponse) {
+    this[kQueue].set(operationDescription.requestId, operationDescription);
+  }
+
+  try {
+    this[kMessageStream].writeCommand(command, operationDescription);
+  } catch (e) {
+    if (!operationDescription.noResponse) {
+      this[kQueue].delete(operationDescription.requestId);
+      operationDescription.cb(e);
+      return;
+    }
+  }
+
+  if (operationDescription.noResponse) {
+    operationDescription.cb();
+  }
+}
+
+module.exports = {
+  Connection
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/cmap/connection_pool.js b/NodeAPI/node_modules/mongodb/lib/cmap/connection_pool.js
new file mode 100644
index 0000000000000000000000000000000000000000..4500d9a280fe955b9fec5a5a15f17ca62e3699c0
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cmap/connection_pool.js
@@ -0,0 +1,591 @@
+'use strict';
+
+const Denque = require('denque');
+const EventEmitter = require('events').EventEmitter;
+const Logger = require('../core/connection/logger');
+const makeCounter = require('../utils').makeCounter;
+const MongoError = require('../core/error').MongoError;
+const Connection = require('./connection').Connection;
+const eachAsync = require('../core/utils').eachAsync;
+const connect = require('../core/connection/connect');
+const relayEvents = require('../core/utils').relayEvents;
+
+const errors = require('./errors');
+const PoolClosedError = errors.PoolClosedError;
+const WaitQueueTimeoutError = errors.WaitQueueTimeoutError;
+
+const events = require('./events');
+const ConnectionPoolCreatedEvent = events.ConnectionPoolCreatedEvent;
+const ConnectionPoolClosedEvent = events.ConnectionPoolClosedEvent;
+const ConnectionCreatedEvent = events.ConnectionCreatedEvent;
+const ConnectionReadyEvent = events.ConnectionReadyEvent;
+const ConnectionClosedEvent = events.ConnectionClosedEvent;
+const ConnectionCheckOutStartedEvent = events.ConnectionCheckOutStartedEvent;
+const ConnectionCheckOutFailedEvent = events.ConnectionCheckOutFailedEvent;
+const ConnectionCheckedOutEvent = events.ConnectionCheckedOutEvent;
+const ConnectionCheckedInEvent = events.ConnectionCheckedInEvent;
+const ConnectionPoolClearedEvent = events.ConnectionPoolClearedEvent;
+
+const kLogger = Symbol('logger');
+const kConnections = Symbol('connections');
+const kPermits = Symbol('permits');
+const kMinPoolSizeTimer = Symbol('minPoolSizeTimer');
+const kGeneration = Symbol('generation');
+const kConnectionCounter = Symbol('connectionCounter');
+const kCancellationToken = Symbol('cancellationToken');
+const kWaitQueue = Symbol('waitQueue');
+const kCancelled = Symbol('cancelled');
+
+const VALID_POOL_OPTIONS = new Set([
+  // `connect` options
+  'ssl',
+  'bson',
+  'connectionType',
+  'monitorCommands',
+  'socketTimeout',
+  'credentials',
+  'compression',
+
+  // node Net options
+  'host',
+  'port',
+  'localAddress',
+  'localPort',
+  'family',
+  'hints',
+  'lookup',
+  'path',
+
+  // node TLS options
+  'ca',
+  'cert',
+  'sigalgs',
+  'ciphers',
+  'clientCertEngine',
+  'crl',
+  'dhparam',
+  'ecdhCurve',
+  'honorCipherOrder',
+  'key',
+  'privateKeyEngine',
+  'privateKeyIdentifier',
+  'maxVersion',
+  'minVersion',
+  'passphrase',
+  'pfx',
+  'secureOptions',
+  'secureProtocol',
+  'sessionIdContext',
+  'allowHalfOpen',
+  'rejectUnauthorized',
+  'pskCallback',
+  'ALPNProtocols',
+  'servername',
+  'checkServerIdentity',
+  'session',
+  'minDHSize',
+  'secureContext',
+
+  // spec options
+  'maxPoolSize',
+  'minPoolSize',
+  'maxIdleTimeMS',
+  'waitQueueTimeoutMS'
+]);
+
+function resolveOptions(options, defaults) {
+  const newOptions = Array.from(VALID_POOL_OPTIONS).reduce((obj, key) => {
+    if (Object.prototype.hasOwnProperty.call(options, key)) {
+      obj[key] = options[key];
+    }
+
+    return obj;
+  }, {});
+
+  return Object.freeze(Object.assign({}, defaults, newOptions));
+}
+
+/**
+ * Configuration options for drivers wrapping the node driver.
+ *
+ * @typedef {Object} ConnectionPoolOptions
+ * @property
+ * @property {string} [host] The host to connect to
+ * @property {number} [port] The port to connect to
+ * @property {bson} [bson] The BSON instance to use for new connections
+ * @property {number} [maxPoolSize=100] The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections.
+ * @property {number} [minPoolSize=0] The minimum number of connections that MUST exist at any moment in a single connection pool.
+ * @property {number} [maxIdleTimeMS] The maximum amount of time a connection should remain idle in the connection pool before being marked idle.
+ * @property {number} [waitQueueTimeoutMS=0] The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit.
+ */
+
+/**
+ * A pool of connections which dynamically resizes, and emit events related to pool activity
+ *
+ * @property {number} generation An integer representing the SDAM generation of the pool
+ * @property {number} totalConnectionCount An integer expressing how many total connections (active + in use) the pool currently has
+ * @property {number} availableConnectionCount An integer expressing how many connections are currently available in the pool.
+ * @property {string} address The address of the endpoint the pool is connected to
+ *
+ * @emits ConnectionPool#connectionPoolCreated
+ * @emits ConnectionPool#connectionPoolClosed
+ * @emits ConnectionPool#connectionCreated
+ * @emits ConnectionPool#connectionReady
+ * @emits ConnectionPool#connectionClosed
+ * @emits ConnectionPool#connectionCheckOutStarted
+ * @emits ConnectionPool#connectionCheckOutFailed
+ * @emits ConnectionPool#connectionCheckedOut
+ * @emits ConnectionPool#connectionCheckedIn
+ * @emits ConnectionPool#connectionPoolCleared
+ */
+class ConnectionPool extends EventEmitter {
+  /**
+   * Create a new Connection Pool
+   *
+   * @param {ConnectionPoolOptions} options
+   */
+  constructor(options) {
+    super();
+    options = options || {};
+
+    this.closed = false;
+    this.options = resolveOptions(options, {
+      connectionType: Connection,
+      maxPoolSize: typeof options.maxPoolSize === 'number' ? options.maxPoolSize : 100,
+      minPoolSize: typeof options.minPoolSize === 'number' ? options.minPoolSize : 0,
+      maxIdleTimeMS: typeof options.maxIdleTimeMS === 'number' ? options.maxIdleTimeMS : 0,
+      waitQueueTimeoutMS:
+        typeof options.waitQueueTimeoutMS === 'number' ? options.waitQueueTimeoutMS : 0,
+      autoEncrypter: options.autoEncrypter,
+      metadata: options.metadata
+    });
+
+    if (options.minSize > options.maxSize) {
+      throw new TypeError(
+        'Connection pool minimum size must not be greater than maxiumum pool size'
+      );
+    }
+
+    this[kLogger] = Logger('ConnectionPool', options);
+    this[kConnections] = new Denque();
+    this[kPermits] = this.options.maxPoolSize;
+    this[kMinPoolSizeTimer] = undefined;
+    this[kGeneration] = 0;
+    this[kConnectionCounter] = makeCounter(1);
+    this[kCancellationToken] = new EventEmitter();
+    this[kCancellationToken].setMaxListeners(Infinity);
+    this[kWaitQueue] = new Denque();
+
+    process.nextTick(() => {
+      this.emit('connectionPoolCreated', new ConnectionPoolCreatedEvent(this));
+      ensureMinPoolSize(this);
+    });
+  }
+
+  get address() {
+    return `${this.options.host}:${this.options.port}`;
+  }
+
+  get generation() {
+    return this[kGeneration];
+  }
+
+  get totalConnectionCount() {
+    return this[kConnections].length + (this.options.maxPoolSize - this[kPermits]);
+  }
+
+  get availableConnectionCount() {
+    return this[kConnections].length;
+  }
+
+  get waitQueueSize() {
+    return this[kWaitQueue].length;
+  }
+
+  /**
+   * Check a connection out of this pool. The connection will continue to be tracked, but no reference to it
+   * will be held by the pool. This means that if a connection is checked out it MUST be checked back in or
+   * explicitly destroyed by the new owner.
+   *
+   * @param {ConnectionPool~checkOutCallback} callback
+   */
+  checkOut(callback) {
+    this.emit('connectionCheckOutStarted', new ConnectionCheckOutStartedEvent(this));
+
+    if (this.closed) {
+      this.emit('connectionCheckOutFailed', new ConnectionCheckOutFailedEvent(this, 'poolClosed'));
+      callback(new PoolClosedError(this));
+      return;
+    }
+
+    const waitQueueMember = { callback };
+
+    const pool = this;
+    const waitQueueTimeoutMS = this.options.waitQueueTimeoutMS;
+    if (waitQueueTimeoutMS) {
+      waitQueueMember.timer = setTimeout(() => {
+        waitQueueMember[kCancelled] = true;
+        waitQueueMember.timer = undefined;
+
+        pool.emit('connectionCheckOutFailed', new ConnectionCheckOutFailedEvent(pool, 'timeout'));
+        waitQueueMember.callback(new WaitQueueTimeoutError(pool));
+      }, waitQueueTimeoutMS);
+    }
+
+    this[kWaitQueue].push(waitQueueMember);
+    process.nextTick(() => processWaitQueue(this));
+  }
+
+  /**
+   * Check a connection into the pool.
+   *
+   * @param {Connection} connection The connection to check in
+   */
+  checkIn(connection) {
+    const poolClosed = this.closed;
+    const stale = connectionIsStale(this, connection);
+    const willDestroy = !!(poolClosed || stale || connection.closed);
+
+    if (!willDestroy) {
+      connection.markAvailable();
+      this[kConnections].push(connection);
+    }
+
+    this.emit('connectionCheckedIn', new ConnectionCheckedInEvent(this, connection));
+
+    if (willDestroy) {
+      const reason = connection.closed ? 'error' : poolClosed ? 'poolClosed' : 'stale';
+      destroyConnection(this, connection, reason);
+    }
+
+    process.nextTick(() => processWaitQueue(this));
+  }
+
+  /**
+   * Clear the pool
+   *
+   * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a
+   * previous generation will eventually be pruned during subsequent checkouts.
+   */
+  clear() {
+    this[kGeneration] += 1;
+    this.emit('connectionPoolCleared', new ConnectionPoolClearedEvent(this));
+  }
+
+  /**
+   * Close the pool
+   *
+   * @param {object} [options] Optional settings
+   * @param {boolean} [options.force] Force close connections
+   * @param {Function} callback
+   */
+  close(options, callback) {
+    if (typeof options === 'function') {
+      callback = options;
+    }
+
+    options = Object.assign({ force: false }, options);
+    if (this.closed) {
+      return callback();
+    }
+
+    // immediately cancel any in-flight connections
+    this[kCancellationToken].emit('cancel');
+
+    // drain the wait queue
+    while (this.waitQueueSize) {
+      const waitQueueMember = this[kWaitQueue].pop();
+      clearTimeout(waitQueueMember.timer);
+      if (!waitQueueMember[kCancelled]) {
+        waitQueueMember.callback(new MongoError('connection pool closed'));
+      }
+    }
+
+    // clear the min pool size timer
+    if (this[kMinPoolSizeTimer]) {
+      clearTimeout(this[kMinPoolSizeTimer]);
+    }
+
+    // end the connection counter
+    if (typeof this[kConnectionCounter].return === 'function') {
+      this[kConnectionCounter].return();
+    }
+
+    // mark the pool as closed immediately
+    this.closed = true;
+
+    eachAsync(
+      this[kConnections].toArray(),
+      (conn, cb) => {
+        this.emit('connectionClosed', new ConnectionClosedEvent(this, conn, 'poolClosed'));
+        conn.destroy(options, cb);
+      },
+      err => {
+        this[kConnections].clear();
+        this.emit('connectionPoolClosed', new ConnectionPoolClosedEvent(this));
+        callback(err);
+      }
+    );
+  }
+
+  /**
+   * Runs a lambda with an implicitly checked out connection, checking that connection back in when the lambda
+   * has completed by calling back.
+   *
+   * NOTE: please note the required signature of `fn`
+   *
+   * @param {ConnectionPool~withConnectionCallback} fn A function which operates on a managed connection
+   * @param {Function} callback The original callback
+   * @return {Promise}
+   */
+  withConnection(fn, callback) {
+    this.checkOut((err, conn) => {
+      // don't callback with `err` here, we might want to act upon it inside `fn`
+
+      fn(err, conn, (fnErr, result) => {
+        if (typeof callback === 'function') {
+          if (fnErr) {
+            callback(fnErr);
+          } else {
+            callback(undefined, result);
+          }
+        }
+
+        if (conn) {
+          this.checkIn(conn);
+        }
+      });
+    });
+  }
+}
+
+function ensureMinPoolSize(pool) {
+  if (pool.closed || pool.options.minPoolSize === 0) {
+    return;
+  }
+
+  const minPoolSize = pool.options.minPoolSize;
+  for (let i = pool.totalConnectionCount; i < minPoolSize; ++i) {
+    createConnection(pool);
+  }
+
+  pool[kMinPoolSizeTimer] = setTimeout(() => ensureMinPoolSize(pool), 10);
+}
+
+function connectionIsStale(pool, connection) {
+  return connection.generation !== pool[kGeneration];
+}
+
+function connectionIsIdle(pool, connection) {
+  return !!(pool.options.maxIdleTimeMS && connection.idleTime > pool.options.maxIdleTimeMS);
+}
+
+function createConnection(pool, callback) {
+  const connectOptions = Object.assign(
+    {
+      id: pool[kConnectionCounter].next().value,
+      generation: pool[kGeneration]
+    },
+    pool.options
+  );
+
+  pool[kPermits]--;
+  connect(connectOptions, pool[kCancellationToken], (err, connection) => {
+    if (err) {
+      pool[kPermits]++;
+      pool[kLogger].debug(`connection attempt failed with error [${JSON.stringify(err)}]`);
+      if (typeof callback === 'function') {
+        callback(err);
+      }
+
+      return;
+    }
+
+    // The pool might have closed since we started trying to create a connection
+    if (pool.closed) {
+      connection.destroy({ force: true });
+      return;
+    }
+
+    // forward all events from the connection to the pool
+    relayEvents(connection, pool, [
+      'commandStarted',
+      'commandFailed',
+      'commandSucceeded',
+      'clusterTimeReceived'
+    ]);
+
+    pool.emit('connectionCreated', new ConnectionCreatedEvent(pool, connection));
+
+    connection.markAvailable();
+    pool.emit('connectionReady', new ConnectionReadyEvent(pool, connection));
+
+    // if a callback has been provided, check out the connection immediately
+    if (typeof callback === 'function') {
+      callback(undefined, connection);
+      return;
+    }
+
+    // otherwise add it to the pool for later acquisition, and try to process the wait queue
+    pool[kConnections].push(connection);
+    process.nextTick(() => processWaitQueue(pool));
+  });
+}
+
+function destroyConnection(pool, connection, reason) {
+  pool.emit('connectionClosed', new ConnectionClosedEvent(pool, connection, reason));
+
+  // allow more connections to be created
+  pool[kPermits]++;
+
+  // destroy the connection
+  process.nextTick(() => connection.destroy());
+}
+
+function processWaitQueue(pool) {
+  if (pool.closed) {
+    return;
+  }
+
+  while (pool.waitQueueSize) {
+    const waitQueueMember = pool[kWaitQueue].peekFront();
+    if (waitQueueMember[kCancelled]) {
+      pool[kWaitQueue].shift();
+      continue;
+    }
+
+    if (!pool.availableConnectionCount) {
+      break;
+    }
+
+    const connection = pool[kConnections].shift();
+    const isStale = connectionIsStale(pool, connection);
+    const isIdle = connectionIsIdle(pool, connection);
+    if (!isStale && !isIdle && !connection.closed) {
+      pool.emit('connectionCheckedOut', new ConnectionCheckedOutEvent(pool, connection));
+      clearTimeout(waitQueueMember.timer);
+      pool[kWaitQueue].shift();
+      waitQueueMember.callback(undefined, connection);
+      return;
+    }
+
+    const reason = connection.closed ? 'error' : isStale ? 'stale' : 'idle';
+    destroyConnection(pool, connection, reason);
+  }
+
+  const maxPoolSize = pool.options.maxPoolSize;
+  if (pool.waitQueueSize && (maxPoolSize <= 0 || pool.totalConnectionCount < maxPoolSize)) {
+    createConnection(pool, (err, connection) => {
+      const waitQueueMember = pool[kWaitQueue].shift();
+      if (waitQueueMember == null || waitQueueMember[kCancelled]) {
+        if (err == null) {
+          pool[kConnections].push(connection);
+        }
+
+        return;
+      }
+
+      if (err) {
+        pool.emit('connectionCheckOutFailed', new ConnectionCheckOutFailedEvent(pool, err));
+      } else {
+        pool.emit('connectionCheckedOut', new ConnectionCheckedOutEvent(pool, connection));
+      }
+
+      clearTimeout(waitQueueMember.timer);
+      waitQueueMember.callback(err, connection);
+    });
+
+    return;
+  }
+}
+
+/**
+ * A callback provided to `withConnection`
+ *
+ * @callback ConnectionPool~withConnectionCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Connection} connection The managed connection which was checked out of the pool.
+ * @param {Function} callback A function to call back after connection management is complete
+ */
+
+/**
+ * A callback provided to `checkOut`
+ *
+ * @callback ConnectionPool~checkOutCallback
+ * @param {MongoError} error An error instance representing the error during checkout
+ * @param {Connection} connection A connection from the pool
+ */
+
+/**
+ * Emitted once when the connection pool is created
+ *
+ * @event ConnectionPool#connectionPoolCreated
+ * @type {PoolCreatedEvent}
+ */
+
+/**
+ * Emitted once when the connection pool is closed
+ *
+ * @event ConnectionPool#connectionPoolClosed
+ * @type {PoolClosedEvent}
+ */
+
+/**
+ * Emitted each time a connection is created
+ *
+ * @event ConnectionPool#connectionCreated
+ * @type {ConnectionCreatedEvent}
+ */
+
+/**
+ * Emitted when a connection becomes established, and is ready to use
+ *
+ * @event ConnectionPool#connectionReady
+ * @type {ConnectionReadyEvent}
+ */
+
+/**
+ * Emitted when a connection is closed
+ *
+ * @event ConnectionPool#connectionClosed
+ * @type {ConnectionClosedEvent}
+ */
+
+/**
+ * Emitted when an attempt to check out a connection begins
+ *
+ * @event ConnectionPool#connectionCheckOutStarted
+ * @type {ConnectionCheckOutStartedEvent}
+ */
+
+/**
+ * Emitted when an attempt to check out a connection fails
+ *
+ * @event ConnectionPool#connectionCheckOutFailed
+ * @type {ConnectionCheckOutFailedEvent}
+ */
+
+/**
+ * Emitted each time a connection is successfully checked out of the connection pool
+ *
+ * @event ConnectionPool#connectionCheckedOut
+ * @type {ConnectionCheckedOutEvent}
+ */
+
+/**
+ * Emitted each time a connection is successfully checked into the connection pool
+ *
+ * @event ConnectionPool#connectionCheckedIn
+ * @type {ConnectionCheckedInEvent}
+ */
+
+/**
+ * Emitted each time the connection pool is cleared and it's generation incremented
+ *
+ * @event ConnectionPool#connectionPoolCleared
+ * @type {PoolClearedEvent}
+ */
+
+module.exports = {
+  ConnectionPool
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/cmap/errors.js b/NodeAPI/node_modules/mongodb/lib/cmap/errors.js
new file mode 100644
index 0000000000000000000000000000000000000000..d9330195e7445cc670f4e59d55417063046dbec3
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cmap/errors.js
@@ -0,0 +1,35 @@
+'use strict';
+const MongoError = require('../core/error').MongoError;
+
+/**
+ * An error indicating a connection pool is closed
+ *
+ * @property {string} address The address of the connection pool
+ * @extends MongoError
+ */
+class PoolClosedError extends MongoError {
+  constructor(pool) {
+    super('Attempted to check out a connection from closed connection pool');
+    this.name = 'MongoPoolClosedError';
+    this.address = pool.address;
+  }
+}
+
+/**
+ * An error thrown when a request to check out a connection times out
+ *
+ * @property {string} address The address of the connection pool
+ * @extends MongoError
+ */
+class WaitQueueTimeoutError extends MongoError {
+  constructor(pool) {
+    super('Timed out while checking out a connection from connection pool');
+    this.name = 'MongoWaitQueueTimeoutError';
+    this.address = pool.address;
+  }
+}
+
+module.exports = {
+  PoolClosedError,
+  WaitQueueTimeoutError
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/cmap/events.js b/NodeAPI/node_modules/mongodb/lib/cmap/events.js
new file mode 100644
index 0000000000000000000000000000000000000000..dcc8b6752b9873e445d15cb95ea96671aa4f8fbd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cmap/events.js
@@ -0,0 +1,154 @@
+'use strict';
+
+/**
+ * The base class for all monitoring events published from the connection pool
+ *
+ * @property {number} time A timestamp when the event was created
+ * @property {string} address The address (host/port pair) of the pool
+ */
+class ConnectionPoolMonitoringEvent {
+  constructor(pool) {
+    this.time = new Date();
+    this.address = pool.address;
+  }
+}
+
+/**
+ * An event published when a connection pool is created
+ *
+ * @property {Object} options The options used to create this connection pool
+ */
+class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool) {
+    super(pool);
+    this.options = pool.options;
+  }
+}
+
+/**
+ * An event published when a connection pool is closed
+ */
+class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool) {
+    super(pool);
+  }
+}
+
+/**
+ * An event published when a connection pool creates a new connection
+ *
+ * @property {number} connectionId A monotonically increasing, per-pool id for the newly created connection
+ */
+class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool, connection) {
+    super(pool);
+    this.connectionId = connection.id;
+  }
+}
+
+/**
+ * An event published when a connection is ready for use
+ *
+ * @property {number} connectionId The id of the connection
+ */
+class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool, connection) {
+    super(pool);
+    this.connectionId = connection.id;
+  }
+}
+
+/**
+ * An event published when a connection is closed
+ *
+ * @property {number} connectionId The id of the connection
+ * @property {string} reason The reason the connection was closed
+ */
+class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool, connection, reason) {
+    super(pool);
+    this.connectionId = connection.id;
+    this.reason = reason || 'unknown';
+  }
+}
+
+/**
+ * An event published when a request to check a connection out begins
+ */
+class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool) {
+    super(pool);
+  }
+}
+
+/**
+ * An event published when a request to check a connection out fails
+ *
+ * @property {string} reason The reason the attempt to check out failed
+ */
+class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool, reason) {
+    super(pool);
+    this.reason = reason;
+  }
+}
+
+/**
+ * An event published when a connection is checked out of the connection pool
+ *
+ * @property {number} connectionId The id of the connection
+ */
+class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool, connection) {
+    super(pool);
+    this.connectionId = connection.id;
+  }
+}
+
+/**
+ * An event published when a connection is checked into the connection pool
+ *
+ * @property {number} connectionId The id of the connection
+ */
+class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool, connection) {
+    super(pool);
+    this.connectionId = connection.id;
+  }
+}
+
+/**
+ * An event published when a connection pool is cleared
+ */
+class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent {
+  constructor(pool) {
+    super(pool);
+  }
+}
+
+const CMAP_EVENT_NAMES = [
+  'connectionPoolCreated',
+  'connectionPoolClosed',
+  'connectionCreated',
+  'connectionReady',
+  'connectionClosed',
+  'connectionCheckOutStarted',
+  'connectionCheckOutFailed',
+  'connectionCheckedOut',
+  'connectionCheckedIn',
+  'connectionPoolCleared'
+];
+
+module.exports = {
+  CMAP_EVENT_NAMES,
+  ConnectionPoolCreatedEvent,
+  ConnectionPoolClosedEvent,
+  ConnectionCreatedEvent,
+  ConnectionReadyEvent,
+  ConnectionClosedEvent,
+  ConnectionCheckOutStartedEvent,
+  ConnectionCheckOutFailedEvent,
+  ConnectionCheckedOutEvent,
+  ConnectionCheckedInEvent,
+  ConnectionPoolClearedEvent
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/cmap/message_stream.js b/NodeAPI/node_modules/mongodb/lib/cmap/message_stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..c8f458e53a0a106fe4159ae7f3cc0a353a71b8ab
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cmap/message_stream.js
@@ -0,0 +1,196 @@
+'use strict';
+
+const Duplex = require('stream').Duplex;
+const BufferList = require('bl');
+const MongoParseError = require('../core/error').MongoParseError;
+const decompress = require('../core/wireprotocol/compression').decompress;
+const Response = require('../core/connection/commands').Response;
+const BinMsg = require('../core/connection/msg').BinMsg;
+const MongoError = require('../core/error').MongoError;
+const OP_COMPRESSED = require('../core/wireprotocol/shared').opcodes.OP_COMPRESSED;
+const OP_MSG = require('../core/wireprotocol/shared').opcodes.OP_MSG;
+const MESSAGE_HEADER_SIZE = require('../core/wireprotocol/shared').MESSAGE_HEADER_SIZE;
+const COMPRESSION_DETAILS_SIZE = require('../core/wireprotocol/shared').COMPRESSION_DETAILS_SIZE;
+const opcodes = require('../core/wireprotocol/shared').opcodes;
+const compress = require('../core/wireprotocol/compression').compress;
+const compressorIDs = require('../core/wireprotocol/compression').compressorIDs;
+const uncompressibleCommands = require('../core/wireprotocol/compression').uncompressibleCommands;
+const Msg = require('../core/connection/msg').Msg;
+
+const kDefaultMaxBsonMessageSize = 1024 * 1024 * 16 * 4;
+const kBuffer = Symbol('buffer');
+
+/**
+ * A duplex stream that is capable of reading and writing raw wire protocol messages, with
+ * support for optional compression
+ */
+class MessageStream extends Duplex {
+  constructor(options) {
+    options = options || {};
+    super(options);
+
+    this.bson = options.bson;
+    this.maxBsonMessageSize = options.maxBsonMessageSize || kDefaultMaxBsonMessageSize;
+
+    this[kBuffer] = new BufferList();
+  }
+
+  _write(chunk, _, callback) {
+    const buffer = this[kBuffer];
+    buffer.append(chunk);
+
+    processIncomingData(this, callback);
+  }
+
+  _read(/* size */) {
+    // NOTE: This implementation is empty because we explicitly push data to be read
+    //       when `writeMessage` is called.
+    return;
+  }
+
+  writeCommand(command, operationDescription) {
+    // TODO: agreed compressor should live in `StreamDescription`
+    const shouldCompress = operationDescription && !!operationDescription.agreedCompressor;
+    if (!shouldCompress || !canCompress(command)) {
+      const data = command.toBin();
+      this.push(Array.isArray(data) ? Buffer.concat(data) : data);
+      return;
+    }
+
+    // otherwise, compress the message
+    const concatenatedOriginalCommandBuffer = Buffer.concat(command.toBin());
+    const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE);
+
+    // Extract information needed for OP_COMPRESSED from the uncompressed message
+    const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12);
+
+    // Compress the message body
+    compress({ options: operationDescription }, messageToBeCompressed, (err, compressedMessage) => {
+      if (err) {
+        operationDescription.cb(err, null);
+        return;
+      }
+
+      // Create the msgHeader of OP_COMPRESSED
+      const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE);
+      msgHeader.writeInt32LE(
+        MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length,
+        0
+      ); // messageLength
+      msgHeader.writeInt32LE(command.requestId, 4); // requestID
+      msgHeader.writeInt32LE(0, 8); // responseTo (zero)
+      msgHeader.writeInt32LE(opcodes.OP_COMPRESSED, 12); // opCode
+
+      // Create the compression details of OP_COMPRESSED
+      const compressionDetails = Buffer.alloc(COMPRESSION_DETAILS_SIZE);
+      compressionDetails.writeInt32LE(originalCommandOpCode, 0); // originalOpcode
+      compressionDetails.writeInt32LE(messageToBeCompressed.length, 4); // Size of the uncompressed compressedMessage, excluding the MsgHeader
+      compressionDetails.writeUInt8(compressorIDs[operationDescription.agreedCompressor], 8); // compressorID
+
+      this.push(Buffer.concat([msgHeader, compressionDetails, compressedMessage]));
+    });
+  }
+}
+
+// Return whether a command contains an uncompressible command term
+// Will return true if command contains no uncompressible command terms
+function canCompress(command) {
+  const commandDoc = command instanceof Msg ? command.command : command.query;
+  const commandName = Object.keys(commandDoc)[0];
+  return !uncompressibleCommands.has(commandName);
+}
+
+function processIncomingData(stream, callback) {
+  const buffer = stream[kBuffer];
+  if (buffer.length < 4) {
+    callback();
+    return;
+  }
+
+  const sizeOfMessage = buffer.readInt32LE(0);
+  if (sizeOfMessage < 0) {
+    callback(new MongoParseError(`Invalid message size: ${sizeOfMessage}`));
+    return;
+  }
+
+  if (sizeOfMessage > stream.maxBsonMessageSize) {
+    callback(
+      new MongoParseError(
+        `Invalid message size: ${sizeOfMessage}, max allowed: ${stream.maxBsonMessageSize}`
+      )
+    );
+    return;
+  }
+
+  if (sizeOfMessage > buffer.length) {
+    callback();
+    return;
+  }
+
+  const message = buffer.slice(0, sizeOfMessage);
+  buffer.consume(sizeOfMessage);
+
+  const messageHeader = {
+    length: message.readInt32LE(0),
+    requestId: message.readInt32LE(4),
+    responseTo: message.readInt32LE(8),
+    opCode: message.readInt32LE(12)
+  };
+
+  let ResponseType = messageHeader.opCode === OP_MSG ? BinMsg : Response;
+  const responseOptions = stream.responseOptions;
+  if (messageHeader.opCode !== OP_COMPRESSED) {
+    const messageBody = message.slice(MESSAGE_HEADER_SIZE);
+    stream.emit(
+      'message',
+      new ResponseType(stream.bson, message, messageHeader, messageBody, responseOptions)
+    );
+
+    if (buffer.length >= 4) {
+      processIncomingData(stream, callback);
+    } else {
+      callback();
+    }
+
+    return;
+  }
+
+  messageHeader.fromCompressed = true;
+  messageHeader.opCode = message.readInt32LE(MESSAGE_HEADER_SIZE);
+  messageHeader.length = message.readInt32LE(MESSAGE_HEADER_SIZE + 4);
+  const compressorID = message[MESSAGE_HEADER_SIZE + 8];
+  const compressedBuffer = message.slice(MESSAGE_HEADER_SIZE + 9);
+
+  // recalculate based on wrapped opcode
+  ResponseType = messageHeader.opCode === OP_MSG ? BinMsg : Response;
+
+  decompress(compressorID, compressedBuffer, (err, messageBody) => {
+    if (err) {
+      callback(err);
+      return;
+    }
+
+    if (messageBody.length !== messageHeader.length) {
+      callback(
+        new MongoError(
+          'Decompressing a compressed message from the server failed. The message is corrupt.'
+        )
+      );
+
+      return;
+    }
+
+    stream.emit(
+      'message',
+      new ResponseType(stream.bson, message, messageHeader, messageBody, responseOptions)
+    );
+
+    if (buffer.length >= 4) {
+      processIncomingData(stream, callback);
+    } else {
+      callback();
+    }
+  });
+}
+
+module.exports = MessageStream;
diff --git a/NodeAPI/node_modules/mongodb/lib/cmap/stream_description.js b/NodeAPI/node_modules/mongodb/lib/cmap/stream_description.js
new file mode 100644
index 0000000000000000000000000000000000000000..e806a5f65222c4b80c714995bb3fa2bcd39d6ef1
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cmap/stream_description.js
@@ -0,0 +1,45 @@
+'use strict';
+const parseServerType = require('../core/sdam/server_description').parseServerType;
+
+const RESPONSE_FIELDS = [
+  'minWireVersion',
+  'maxWireVersion',
+  'maxBsonObjectSize',
+  'maxMessageSizeBytes',
+  'maxWriteBatchSize',
+  '__nodejs_mock_server__'
+];
+
+class StreamDescription {
+  constructor(address, options) {
+    this.address = address;
+    this.type = parseServerType(null);
+    this.minWireVersion = undefined;
+    this.maxWireVersion = undefined;
+    this.maxBsonObjectSize = 16777216;
+    this.maxMessageSizeBytes = 48000000;
+    this.maxWriteBatchSize = 100000;
+    this.compressors =
+      options && options.compression && Array.isArray(options.compression.compressors)
+        ? options.compression.compressors
+        : [];
+  }
+
+  receiveResponse(response) {
+    this.type = parseServerType(response);
+
+    RESPONSE_FIELDS.forEach(field => {
+      if (typeof response[field] !== 'undefined') {
+        this[field] = response[field];
+      }
+    });
+
+    if (response.compression) {
+      this.compressor = this.compressors.filter(c => response.compression.indexOf(c) !== -1)[0];
+    }
+  }
+}
+
+module.exports = {
+  StreamDescription
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/collection.js b/NodeAPI/node_modules/mongodb/lib/collection.js
new file mode 100644
index 0000000000000000000000000000000000000000..09b8304b684503b9de451368c9fdeeaed7775d97
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/collection.js
@@ -0,0 +1,2240 @@
+'use strict';
+
+const deprecate = require('util').deprecate;
+const deprecateOptions = require('./utils').deprecateOptions;
+const emitWarningOnce = require('./utils').emitWarningOnce;
+const checkCollectionName = require('./utils').checkCollectionName;
+const ObjectID = require('./core').BSON.ObjectID;
+const MongoError = require('./core').MongoError;
+const normalizeHintField = require('./utils').normalizeHintField;
+const decorateCommand = require('./utils').decorateCommand;
+const decorateWithCollation = require('./utils').decorateWithCollation;
+const decorateWithReadConcern = require('./utils').decorateWithReadConcern;
+const formattedOrderClause = require('./utils').formattedOrderClause;
+const ReadPreference = require('./core').ReadPreference;
+const unordered = require('./bulk/unordered');
+const ordered = require('./bulk/ordered');
+const ChangeStream = require('./change_stream');
+const executeLegacyOperation = require('./utils').executeLegacyOperation;
+const WriteConcern = require('./write_concern');
+const ReadConcern = require('./read_concern');
+const MongoDBNamespace = require('./utils').MongoDBNamespace;
+const AggregationCursor = require('./aggregation_cursor');
+const CommandCursor = require('./command_cursor');
+
+// Operations
+const ensureIndex = require('./operations/collection_ops').ensureIndex;
+const group = require('./operations/collection_ops').group;
+const parallelCollectionScan = require('./operations/collection_ops').parallelCollectionScan;
+const removeDocuments = require('./operations/common_functions').removeDocuments;
+const save = require('./operations/collection_ops').save;
+const updateDocuments = require('./operations/common_functions').updateDocuments;
+
+const AggregateOperation = require('./operations/aggregate');
+const BulkWriteOperation = require('./operations/bulk_write');
+const CountDocumentsOperation = require('./operations/count_documents');
+const CreateIndexesOperation = require('./operations/create_indexes');
+const DeleteManyOperation = require('./operations/delete_many');
+const DeleteOneOperation = require('./operations/delete_one');
+const DistinctOperation = require('./operations/distinct');
+const DropCollectionOperation = require('./operations/drop').DropCollectionOperation;
+const DropIndexOperation = require('./operations/drop_index');
+const DropIndexesOperation = require('./operations/drop_indexes');
+const EstimatedDocumentCountOperation = require('./operations/estimated_document_count');
+const FindOperation = require('./operations/find');
+const FindOneOperation = require('./operations/find_one');
+const FindAndModifyOperation = require('./operations/find_and_modify');
+const FindOneAndDeleteOperation = require('./operations/find_one_and_delete');
+const FindOneAndReplaceOperation = require('./operations/find_one_and_replace');
+const FindOneAndUpdateOperation = require('./operations/find_one_and_update');
+const GeoHaystackSearchOperation = require('./operations/geo_haystack_search');
+const IndexesOperation = require('./operations/indexes');
+const IndexExistsOperation = require('./operations/index_exists');
+const IndexInformationOperation = require('./operations/index_information');
+const InsertManyOperation = require('./operations/insert_many');
+const InsertOneOperation = require('./operations/insert_one');
+const IsCappedOperation = require('./operations/is_capped');
+const ListIndexesOperation = require('./operations/list_indexes');
+const MapReduceOperation = require('./operations/map_reduce');
+const OptionsOperation = require('./operations/options_operation');
+const RenameOperation = require('./operations/rename');
+const ReIndexOperation = require('./operations/re_index');
+const ReplaceOneOperation = require('./operations/replace_one');
+const StatsOperation = require('./operations/stats');
+const UpdateManyOperation = require('./operations/update_many');
+const UpdateOneOperation = require('./operations/update_one');
+
+const executeOperation = require('./operations/execute_operation');
+
+/**
+ * @fileOverview The **Collection** class is an internal class that embodies a MongoDB collection
+ * allowing for insert/update/remove/find and other command operation on that MongoDB collection.
+ *
+ * **COLLECTION Cannot directly be instantiated**
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   // Create a collection we want to drop later
+ *   const col = client.db(dbName).collection('createIndexExample1');
+ *   // Show that duplicate records got dropped
+ *   col.find({}).toArray(function(err, items) {
+ *     test.equal(null, err);
+ *     test.equal(4, items.length);
+ *     client.close();
+ *   });
+ * });
+ */
+
+const mergeKeys = ['ignoreUndefined'];
+
+/**
+ * Create a new Collection instance (INTERNAL TYPE, do not instantiate directly)
+ * @class
+ */
+function Collection(db, topology, dbName, name, pkFactory, options) {
+  checkCollectionName(name);
+
+  // Unpack variables
+  const internalHint = null;
+  const slaveOk = options == null || options.slaveOk == null ? db.slaveOk : options.slaveOk;
+  const serializeFunctions =
+    options == null || options.serializeFunctions == null
+      ? db.s.options.serializeFunctions
+      : options.serializeFunctions;
+  const raw = options == null || options.raw == null ? db.s.options.raw : options.raw;
+  const promoteLongs =
+    options == null || options.promoteLongs == null
+      ? db.s.options.promoteLongs
+      : options.promoteLongs;
+  const promoteValues =
+    options == null || options.promoteValues == null
+      ? db.s.options.promoteValues
+      : options.promoteValues;
+  const promoteBuffers =
+    options == null || options.promoteBuffers == null
+      ? db.s.options.promoteBuffers
+      : options.promoteBuffers;
+  const collectionHint = null;
+
+  const namespace = new MongoDBNamespace(dbName, name);
+
+  // Get the promiseLibrary
+  const promiseLibrary = options.promiseLibrary || Promise;
+
+  // Set custom primary key factory if provided
+  pkFactory = pkFactory == null ? ObjectID : pkFactory;
+
+  // Internal state
+  this.s = {
+    // Set custom primary key factory if provided
+    pkFactory: pkFactory,
+    // Db
+    db: db,
+    // Topology
+    topology: topology,
+    // Options
+    options: options,
+    // Namespace
+    namespace: namespace,
+    // Read preference
+    readPreference: ReadPreference.fromOptions(options),
+    // SlaveOK
+    slaveOk: slaveOk,
+    // Serialize functions
+    serializeFunctions: serializeFunctions,
+    // Raw
+    raw: raw,
+    // promoteLongs
+    promoteLongs: promoteLongs,
+    // promoteValues
+    promoteValues: promoteValues,
+    // promoteBuffers
+    promoteBuffers: promoteBuffers,
+    // internalHint
+    internalHint: internalHint,
+    // collectionHint
+    collectionHint: collectionHint,
+    // Promise library
+    promiseLibrary: promiseLibrary,
+    // Read Concern
+    readConcern: ReadConcern.fromOptions(options),
+    // Write Concern
+    writeConcern: WriteConcern.fromOptions(options)
+  };
+}
+
+/**
+ * The name of the database this collection belongs to
+ * @member {string} dbName
+ * @memberof Collection#
+ * @readonly
+ */
+Object.defineProperty(Collection.prototype, 'dbName', {
+  enumerable: true,
+  get: function() {
+    return this.s.namespace.db;
+  }
+});
+
+/**
+ * The name of this collection
+ * @member {string} collectionName
+ * @memberof Collection#
+ * @readonly
+ */
+Object.defineProperty(Collection.prototype, 'collectionName', {
+  enumerable: true,
+  get: function() {
+    return this.s.namespace.collection;
+  }
+});
+
+/**
+ * The namespace of this collection, in the format `${this.dbName}.${this.collectionName}`
+ * @member {string} namespace
+ * @memberof Collection#
+ * @readonly
+ */
+Object.defineProperty(Collection.prototype, 'namespace', {
+  enumerable: true,
+  get: function() {
+    return this.s.namespace.toString();
+  }
+});
+
+/**
+ * The current readConcern of the collection. If not explicitly defined for
+ * this collection, will be inherited from the parent DB
+ * @member {ReadConcern} [readConcern]
+ * @memberof Collection#
+ * @readonly
+ */
+Object.defineProperty(Collection.prototype, 'readConcern', {
+  enumerable: true,
+  get: function() {
+    if (this.s.readConcern == null) {
+      return this.s.db.readConcern;
+    }
+    return this.s.readConcern;
+  }
+});
+
+/**
+ * The current readPreference of the collection. If not explicitly defined for
+ * this collection, will be inherited from the parent DB
+ * @member {ReadPreference} [readPreference]
+ * @memberof Collection#
+ * @readonly
+ */
+Object.defineProperty(Collection.prototype, 'readPreference', {
+  enumerable: true,
+  get: function() {
+    if (this.s.readPreference == null) {
+      return this.s.db.readPreference;
+    }
+
+    return this.s.readPreference;
+  }
+});
+
+/**
+ * The current writeConcern of the collection. If not explicitly defined for
+ * this collection, will be inherited from the parent DB
+ * @member {WriteConcern} [writeConcern]
+ * @memberof Collection#
+ * @readonly
+ */
+Object.defineProperty(Collection.prototype, 'writeConcern', {
+  enumerable: true,
+  get: function() {
+    if (this.s.writeConcern == null) {
+      return this.s.db.writeConcern;
+    }
+    return this.s.writeConcern;
+  }
+});
+
+/**
+ * The current index hint for the collection
+ * @member {object} [hint]
+ * @memberof Collection#
+ */
+Object.defineProperty(Collection.prototype, 'hint', {
+  enumerable: true,
+  get: function() {
+    return this.s.collectionHint;
+  },
+  set: function(v) {
+    this.s.collectionHint = normalizeHintField(v);
+  }
+});
+
+const DEPRECATED_FIND_OPTIONS = ['maxScan', 'fields', 'snapshot', 'oplogReplay'];
+
+/**
+ * Creates a cursor for a query that can be used to iterate over results from MongoDB
+ * @method
+ * @param {object} [query={}] The cursor query object.
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.limit=0] Sets the limit of documents returned in the query.
+ * @param {(array|object)} [options.sort] Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc.
+ * @param {object} [options.projection] The fields to return in the query. Object of fields to either include or exclude (one of, not both), {'a':1, 'b': 1} **or** {'a': 0, 'b': 0}
+ * @param {object} [options.fields] **Deprecated** Use `options.projection` instead
+ * @param {number} [options.skip=0] Set to skip N documents ahead in your query (useful for pagination).
+ * @param {Object} [options.hint] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1}
+ * @param {boolean} [options.snapshot=false] DEPRECATED: Snapshot query.
+ * @param {boolean} [options.timeout=false] Specify if the cursor can timeout.
+ * @param {boolean} [options.tailable=false] Specify if the cursor is tailable.
+ * @param {boolean} [options.awaitData=false] Specify if the cursor is a a tailable-await cursor. Requires `tailable` to be true
+ * @param {number} [options.batchSize=1000] Set the batchSize for the getMoreCommand when iterating over the query results.
+ * @param {boolean} [options.returnKey=false] Only return the index key.
+ * @param {number} [options.maxScan] DEPRECATED: Limit the number of items to scan.
+ * @param {number} [options.min] Set index bounds.
+ * @param {number} [options.max] Set index bounds.
+ * @param {boolean} [options.showDiskLoc=false] Show disk location of results.
+ * @param {string} [options.comment] You can put a $comment field on a query to make looking in the profiler logs simpler.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query. Requires `tailable` and `awaitData` to be true
+ * @param {boolean} [options.noCursorTimeout] The server normally times out idle cursors after an inactivity period (10 minutes) to prevent excess memory use. Set this option to prevent that.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {boolean} [options.allowDiskUse] Enables writing to temporary files on the server.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @throws {MongoError}
+ * @return {Cursor}
+ */
+Collection.prototype.find = deprecateOptions(
+  {
+    name: 'collection.find',
+    deprecatedOptions: DEPRECATED_FIND_OPTIONS,
+    optionsIndex: 1
+  },
+  function(query, options, callback) {
+    if (typeof callback === 'object') {
+      // TODO(MAJOR): throw in the future
+      emitWarningOnce('Third parameter to `find()` must be a callback or undefined');
+    }
+
+    let selector = query;
+    // figuring out arguments
+    if (typeof callback !== 'function') {
+      if (typeof options === 'function') {
+        callback = options;
+        options = undefined;
+      } else if (options == null) {
+        callback = typeof selector === 'function' ? selector : undefined;
+        selector = typeof selector === 'object' ? selector : undefined;
+      }
+    }
+
+    // Ensure selector is not null
+    selector = selector == null ? {} : selector;
+    // Validate correctness off the selector
+    const object = selector;
+    if (Buffer.isBuffer(object)) {
+      const object_size = object[0] | (object[1] << 8) | (object[2] << 16) | (object[3] << 24);
+      if (object_size !== object.length) {
+        const error = new Error(
+          'query selector raw message size does not match message header size [' +
+            object.length +
+            '] != [' +
+            object_size +
+            ']'
+        );
+        error.name = 'MongoError';
+        throw error;
+      }
+    }
+
+    // Check special case where we are using an objectId
+    if (selector != null && selector._bsontype === 'ObjectID') {
+      selector = { _id: selector };
+    }
+
+    if (!options) options = {};
+
+    let projection = options.projection || options.fields;
+
+    if (projection && !Buffer.isBuffer(projection) && Array.isArray(projection)) {
+      projection = projection.length
+        ? projection.reduce((result, field) => {
+            result[field] = 1;
+            return result;
+          }, {})
+        : { _id: 1 };
+    }
+
+    // Make a shallow copy of options
+    let newOptions = Object.assign({}, options);
+
+    // Make a shallow copy of the collection options
+    for (let key in this.s.options) {
+      if (mergeKeys.indexOf(key) !== -1) {
+        newOptions[key] = this.s.options[key];
+      }
+    }
+
+    // Unpack options
+    newOptions.skip = options.skip ? options.skip : 0;
+    newOptions.limit = options.limit ? options.limit : 0;
+    newOptions.raw = typeof options.raw === 'boolean' ? options.raw : this.s.raw;
+    newOptions.hint =
+      options.hint != null ? normalizeHintField(options.hint) : this.s.collectionHint;
+    newOptions.timeout = typeof options.timeout === 'undefined' ? undefined : options.timeout;
+    // // If we have overridden slaveOk otherwise use the default db setting
+    newOptions.slaveOk = options.slaveOk != null ? options.slaveOk : this.s.db.slaveOk;
+
+    // Add read preference if needed
+    newOptions.readPreference = ReadPreference.resolve(this, newOptions);
+
+    // Set slave ok to true if read preference different from primary
+    if (
+      newOptions.readPreference != null &&
+      (newOptions.readPreference !== 'primary' || newOptions.readPreference.mode !== 'primary')
+    ) {
+      newOptions.slaveOk = true;
+    }
+
+    // Ensure the query is an object
+    if (selector != null && typeof selector !== 'object') {
+      throw MongoError.create({ message: 'query selector must be an object', driver: true });
+    }
+
+    // Build the find command
+    const findCommand = {
+      find: this.s.namespace.toString(),
+      limit: newOptions.limit,
+      skip: newOptions.skip,
+      query: selector
+    };
+
+    if (typeof options.allowDiskUse === 'boolean') {
+      findCommand.allowDiskUse = options.allowDiskUse;
+    }
+
+    // Ensure we use the right await data option
+    if (typeof newOptions.awaitdata === 'boolean') {
+      newOptions.awaitData = newOptions.awaitdata;
+    }
+
+    // Translate to new command option noCursorTimeout
+    if (typeof newOptions.timeout === 'boolean') newOptions.noCursorTimeout = !newOptions.timeout;
+
+    decorateCommand(findCommand, newOptions, ['session', 'collation']);
+
+    if (projection) findCommand.fields = projection;
+
+    // Add db object to the new options
+    newOptions.db = this.s.db;
+
+    // Add the promise library
+    newOptions.promiseLibrary = this.s.promiseLibrary;
+
+    // Set raw if available at collection level
+    if (newOptions.raw == null && typeof this.s.raw === 'boolean') newOptions.raw = this.s.raw;
+    // Set promoteLongs if available at collection level
+    if (newOptions.promoteLongs == null && typeof this.s.promoteLongs === 'boolean')
+      newOptions.promoteLongs = this.s.promoteLongs;
+    if (newOptions.promoteValues == null && typeof this.s.promoteValues === 'boolean')
+      newOptions.promoteValues = this.s.promoteValues;
+    if (newOptions.promoteBuffers == null && typeof this.s.promoteBuffers === 'boolean')
+      newOptions.promoteBuffers = this.s.promoteBuffers;
+
+    // Sort options
+    if (findCommand.sort) {
+      findCommand.sort = formattedOrderClause(findCommand.sort);
+    }
+
+    // Set the readConcern
+    decorateWithReadConcern(findCommand, this, options);
+
+    // Decorate find command with collation options
+    try {
+      decorateWithCollation(findCommand, this, options);
+    } catch (err) {
+      if (typeof callback === 'function') return callback(err, null);
+      throw err;
+    }
+
+    const cursor = this.s.topology.cursor(
+      new FindOperation(this, this.s.namespace, findCommand, newOptions),
+      newOptions
+    );
+
+    // TODO: remove this when NODE-2074 is resolved
+    if (typeof callback === 'function') {
+      callback(null, cursor);
+      return;
+    }
+
+    return cursor;
+  }
+);
+
+/**
+ * Inserts a single document into MongoDB. If documents passed in do not contain the **_id** field,
+ * one will be added to each of the documents missing it by the driver, mutating the document. This behavior
+ * can be overridden by setting the **forceServerObjectId** flag.
+ *
+ * @method
+ * @param {object} doc Document to insert.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=true] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~insertOneWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.insertOne = function(doc, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  const insertOneOperation = new InsertOneOperation(this, doc, options);
+
+  return executeOperation(this.s.topology, insertOneOperation, callback);
+};
+
+/**
+ * Inserts an array of documents into MongoDB. If documents passed in do not contain the **_id** field,
+ * one will be added to each of the documents missing it by the driver, mutating the document. This behavior
+ * can be overridden by setting the **forceServerObjectId** flag.
+ *
+ * @method
+ * @param {object[]} docs Documents to insert.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {boolean} [options.ordered=true] If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails.
+ * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=true] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~insertWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.insertMany = function(docs, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options ? Object.assign({}, options) : { ordered: true };
+
+  const insertManyOperation = new InsertManyOperation(this, docs, options);
+
+  return executeOperation(this.s.topology, insertManyOperation, callback);
+};
+
+/**
+ * @typedef {Object} Collection~BulkWriteOpResult
+ * @property {number} insertedCount Number of documents inserted.
+ * @property {number} matchedCount Number of documents matched for update.
+ * @property {number} modifiedCount Number of documents modified.
+ * @property {number} deletedCount Number of documents deleted.
+ * @property {number} upsertedCount Number of documents upserted.
+ * @property {object} insertedIds Inserted document generated Id's, hash key is the index of the originating operation
+ * @property {object} upsertedIds Upserted document generated Id's, hash key is the index of the originating operation
+ * @property {object} result The command result object.
+ */
+
+/**
+ * The callback format for inserts
+ * @callback Collection~bulkWriteOpCallback
+ * @param {BulkWriteError} error An error instance representing the error during the execution.
+ * @param {Collection~BulkWriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Perform a bulkWrite operation without a fluent API
+ *
+ * Legal operation types are
+ *
+ *  { insertOne: { document: { a: 1 } } }
+ *
+ *  { updateOne: { filter: {a:2}, update: {$set: {a:2}}, upsert:true } }
+ *
+ *  { updateMany: { filter: {a:2}, update: {$set: {a:2}}, upsert:true } }
+ *
+ *  { updateMany: { filter: {}, update: {$set: {"a.$[i].x": 5}}, arrayFilters: [{ "i.x": 5 }]} }
+ *
+ *  { deleteOne: { filter: {c:1} } }
+ *
+ *  { deleteMany: { filter: {c:1} } }
+ *
+ *  { replaceOne: { filter: {c:3}, replacement: {c:4}, upsert:true}}
+ *
+ * If documents passed in do not contain the **_id** field,
+ * one will be added to each of the documents missing it by the driver, mutating the document. This behavior
+ * can be overridden by setting the **forceServerObjectId** flag.
+ *
+ * @method
+ * @param {object[]} operations Bulk operations to perform.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.ordered=true] Execute write operation in ordered or unordered fashion.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object[]} [options.arrayFilters] Determines which array elements to modify for update operation in MongoDB 3.6 or higher.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~bulkWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.bulkWrite = function(operations, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || { ordered: true };
+
+  if (!Array.isArray(operations)) {
+    throw MongoError.create({ message: 'operations must be an array of documents', driver: true });
+  }
+
+  const bulkWriteOperation = new BulkWriteOperation(this, operations, options);
+
+  return executeOperation(this.s.topology, bulkWriteOperation, callback);
+};
+
+/**
+ * @typedef {Object} Collection~WriteOpResult
+ * @property {object[]} ops All the documents inserted using insertOne/insertMany/replaceOne. Documents contain the _id field if forceServerObjectId == false for insertOne/insertMany
+ * @property {object} connection The connection object used for the operation.
+ * @property {object} result The command result object.
+ */
+
+/**
+ * The callback format for inserts
+ * @callback Collection~writeOpCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection~WriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * @typedef {Object} Collection~insertWriteOpResult
+ * @property {number} insertedCount The total amount of documents inserted.
+ * @property {object[]} ops All the documents inserted using insertOne/insertMany/replaceOne. Documents contain the _id field if forceServerObjectId == false for insertOne/insertMany
+ * @property {Object.<Number, ObjectId>} insertedIds Map of the index of the inserted document to the id of the inserted document.
+ * @property {object} connection The connection object used for the operation.
+ * @property {object} result The raw command result object returned from MongoDB (content might vary by server version).
+ * @property {number} result.ok Is 1 if the command executed correctly.
+ * @property {number} result.n The total count of documents inserted.
+ */
+
+/**
+ * @typedef {Object} Collection~insertOneWriteOpResult
+ * @property {number} insertedCount The total amount of documents inserted.
+ * @property {object[]} ops All the documents inserted using insertOne/insertMany/replaceOne. Documents contain the _id field if forceServerObjectId == false for insertOne/insertMany
+ * @property {ObjectId} insertedId The driver generated ObjectId for the insert operation.
+ * @property {object} connection The connection object used for the operation.
+ * @property {object} result The raw command result object returned from MongoDB (content might vary by server version).
+ * @property {number} result.ok Is 1 if the command executed correctly.
+ * @property {number} result.n The total count of documents inserted.
+ */
+
+/**
+ * The callback format for inserts
+ * @callback Collection~insertWriteOpCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection~insertWriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * The callback format for inserts
+ * @callback Collection~insertOneWriteOpCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection~insertOneWriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Inserts a single document or a an array of documents into MongoDB. If documents passed in do not contain the **_id** field,
+ * one will be added to each of the documents missing it by the driver, mutating the document. This behavior
+ * can be overridden by setting the **forceServerObjectId** flag.
+ *
+ * @method
+ * @param {(object|object[])} docs Documents to insert.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~insertWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use insertOne, insertMany or bulkWrite
+ */
+Collection.prototype.insert = deprecate(function(docs, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || { ordered: false };
+  docs = !Array.isArray(docs) ? [docs] : docs;
+
+  if (options.keepGoing === true) {
+    options.ordered = false;
+  }
+
+  return this.insertMany(docs, options, callback);
+}, 'collection.insert is deprecated. Use insertOne, insertMany or bulkWrite instead.');
+
+/**
+ * @typedef {Object} Collection~updateWriteOpResult
+ * @property {Object} result The raw result returned from MongoDB. Will vary depending on server version.
+ * @property {Number} result.ok Is 1 if the command executed correctly.
+ * @property {Number} result.n The total count of documents scanned.
+ * @property {Number} result.nModified The total count of documents modified.
+ * @property {Object} connection The connection object used for the operation.
+ * @property {Number} matchedCount The number of documents that matched the filter.
+ * @property {Number} modifiedCount The number of documents that were modified.
+ * @property {Number} upsertedCount The number of documents upserted.
+ * @property {Object} upsertedId The upserted id.
+ * @property {ObjectId} upsertedId._id The upserted _id returned from the server.
+ * @property {Object} message The raw msg response wrapped in an internal class
+ * @property {object[]} [ops] In a response to {@link Collection#replaceOne replaceOne}, contains the new value of the document on the server. This is the same document that was originally passed in, and is only here for legacy purposes.
+ */
+
+/**
+ * The callback format for inserts
+ * @callback Collection~updateWriteOpCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection~updateWriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Update a single document in a collection
+ * @method
+ * @param {object} filter The Filter used to select the document to update
+ * @param {object} update The update operations to be applied to the document
+ * @param {object} [options] Optional settings.
+ * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+ * @param {boolean} [options.upsert=false] When true, creates a new document if no document matches the query..
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~updateWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.updateOne = function(filter, update, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options);
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeOperation(
+    this.s.topology,
+    new UpdateOneOperation(this, filter, update, options),
+    callback
+  );
+};
+
+/**
+ * Replace a document in a collection with another document
+ * @method
+ * @param {object} filter The Filter used to select the document to replace
+ * @param {object} doc The Document that replaces the matching document
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+ * @param {boolean} [options.upsert=false] When true, creates a new document if no document matches the query.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~updateWriteOpCallback} [callback] The command result callback
+ * @return {Promise<Collection~updateWriteOpResult>} returns Promise if no callback passed
+ */
+Collection.prototype.replaceOne = function(filter, doc, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options);
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeOperation(
+    this.s.topology,
+    new ReplaceOneOperation(this, filter, doc, options),
+    callback
+  );
+};
+
+/**
+ * Update multiple documents in a collection
+ * @method
+ * @param {object} filter The Filter used to select the documents to update
+ * @param {object} update The update operations to be applied to the documents
+ * @param {object} [options] Optional settings.
+ * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+ * @param {boolean} [options.upsert=false] When true, creates a new document if no document matches the query..
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~updateWriteOpCallback} [callback] The command result callback
+ * @return {Promise<Collection~updateWriteOpResult>} returns Promise if no callback passed
+ */
+Collection.prototype.updateMany = function(filter, update, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options);
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeOperation(
+    this.s.topology,
+    new UpdateManyOperation(this, filter, update, options),
+    callback
+  );
+};
+
+/**
+ * Updates documents.
+ * @method
+ * @param {object} selector The selector for the update operation.
+ * @param {object} update The update operations to be applied to the documents
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.upsert=false] Update operation is an upsert.
+ * @param {boolean} [options.multi=false] Update one/all documents with operation.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {object} [options.hint] An optional hint for query optimization. See the {@link https://docs.mongodb.com/manual/reference/command/update/#update-command-hint|update command} reference for more information.
+ * @param {Collection~writeOpCallback} [callback] The command result callback
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated use updateOne, updateMany or bulkWrite
+ */
+Collection.prototype.update = deprecate(function(selector, update, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeLegacyOperation(this.s.topology, updateDocuments, [
+    this,
+    selector,
+    update,
+    options,
+    callback
+  ]);
+}, 'collection.update is deprecated. Use updateOne, updateMany, or bulkWrite instead.');
+
+/**
+ * @typedef {Object} Collection~deleteWriteOpResult
+ * @property {Object} result The raw result returned from MongoDB. Will vary depending on server version.
+ * @property {Number} result.ok Is 1 if the command executed correctly.
+ * @property {Number} result.n The total count of documents deleted.
+ * @property {Object} connection The connection object used for the operation.
+ * @property {Number} deletedCount The number of documents deleted.
+ */
+
+/**
+ * The callback format for deletes
+ * @callback Collection~deleteWriteOpCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection~deleteWriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Delete a document from a collection
+ * @method
+ * @param {object} filter The Filter used to select the document to remove
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {string|object} [options.hint] optional index hint for optimizing the filter query
+ * @param {Collection~deleteWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.deleteOne = function(filter, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options);
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  const deleteOneOperation = new DeleteOneOperation(this, filter, options);
+
+  return executeOperation(this.s.topology, deleteOneOperation, callback);
+};
+
+Collection.prototype.removeOne = Collection.prototype.deleteOne;
+
+/**
+ * Delete multiple documents from a collection
+ * @method
+ * @param {object} filter The Filter used to select the documents to remove
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {string|object} [options.hint] optional index hint for optimizing the filter query
+ * @param {Collection~deleteWriteOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.deleteMany = function(filter, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options);
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  const deleteManyOperation = new DeleteManyOperation(this, filter, options);
+
+  return executeOperation(this.s.topology, deleteManyOperation, callback);
+};
+
+Collection.prototype.removeMany = Collection.prototype.deleteMany;
+
+/**
+ * Remove documents.
+ * @method
+ * @param {object} selector The selector for the update operation.
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.single=false] Removes the first document found.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~writeOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated use deleteOne, deleteMany or bulkWrite
+ */
+Collection.prototype.remove = deprecate(function(selector, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeLegacyOperation(this.s.topology, removeDocuments, [
+    this,
+    selector,
+    options,
+    callback
+  ]);
+}, 'collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.');
+
+/**
+ * Save a document. Simple full document replacement function. Not recommended for efficiency, use atomic
+ * operators and update instead for more efficient operations.
+ * @method
+ * @param {object} doc Document to save
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~writeOpCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated use insertOne, insertMany, updateOne or updateMany
+ */
+Collection.prototype.save = deprecate(function(doc, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeLegacyOperation(this.s.topology, save, [this, doc, options, callback]);
+}, 'collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.');
+
+/**
+ * The callback format for results
+ * @callback Collection~resultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {object} result The result object if the command was executed successfully.
+ */
+
+/**
+ * The callback format for an aggregation call
+ * @callback Collection~aggregationCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {AggregationCursor} cursor The cursor if the aggregation command was executed successfully.
+ */
+
+/**
+ * Fetches the first document that matches the query
+ * @method
+ * @param {object} query Query for find Operation
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.limit=0] Sets the limit of documents returned in the query.
+ * @param {(array|object)} [options.sort] Set to sort the documents coming back from the query. Array of indexes, [['a', 1]] etc.
+ * @param {object} [options.projection] The fields to return in the query. Object of fields to include or exclude (not both), {'a':1}
+ * @param {object} [options.fields] **Deprecated** Use `options.projection` instead
+ * @param {number} [options.skip=0] Set to skip N documents ahead in your query (useful for pagination).
+ * @param {Object} [options.hint] Tell the query to use specific indexes in the query. Object of indexes to use, {'_id':1}
+ * @param {boolean} [options.snapshot=false] DEPRECATED: Snapshot query.
+ * @param {boolean} [options.timeout=false] Specify if the cursor can timeout.
+ * @param {boolean} [options.tailable=false] Specify if the cursor is tailable.
+ * @param {number} [options.batchSize=1] Set the batchSize for the getMoreCommand when iterating over the query results.
+ * @param {boolean} [options.returnKey=false] Only return the index key.
+ * @param {number} [options.maxScan] DEPRECATED: Limit the number of items to scan.
+ * @param {number} [options.min] Set index bounds.
+ * @param {number} [options.max] Set index bounds.
+ * @param {boolean} [options.showDiskLoc=false] Show disk location of results.
+ * @param {string} [options.comment] You can put a $comment field on a query to make looking in the profiler logs simpler.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {boolean} [options.partial=false] Specify if the cursor should return partial results when querying against a sharded system
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.findOne = deprecateOptions(
+  {
+    name: 'collection.find',
+    deprecatedOptions: DEPRECATED_FIND_OPTIONS,
+    optionsIndex: 1
+  },
+  function(query, options, callback) {
+    if (typeof callback === 'object') {
+      // TODO(MAJOR): throw in the future
+      emitWarningOnce('Third parameter to `findOne()` must be a callback or undefined');
+    }
+
+    if (typeof query === 'function') (callback = query), (query = {}), (options = {});
+    if (typeof options === 'function') (callback = options), (options = {});
+    query = query || {};
+    options = options || {};
+
+    const findOneOperation = new FindOneOperation(this, query, options);
+
+    return executeOperation(this.s.topology, findOneOperation, callback);
+  }
+);
+
+/**
+ * The callback format for the collection method, must be used if strict is specified
+ * @callback Collection~collectionResultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection} collection The collection instance.
+ */
+
+/**
+ * Rename the collection.
+ *
+ * @method
+ * @param {string} newName New name of of the collection.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.dropTarget=false] Drop the target name collection if it previously exists.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~collectionResultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.rename = function(newName, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options, { readPreference: ReadPreference.PRIMARY });
+
+  const renameOperation = new RenameOperation(this, newName, options);
+
+  return executeOperation(this.s.topology, renameOperation, callback);
+};
+
+/**
+ * Drop the collection from the database, removing it permanently. New accesses will create a new collection.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.drop = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const dropCollectionOperation = new DropCollectionOperation(
+    this.s.db,
+    this.collectionName,
+    options
+  );
+
+  return executeOperation(this.s.topology, dropCollectionOperation, callback);
+};
+
+/**
+ * Returns the options of the collection.
+ *
+ * @method
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.options = function(opts, callback) {
+  if (typeof opts === 'function') (callback = opts), (opts = {});
+  opts = opts || {};
+
+  const optionsOperation = new OptionsOperation(this, opts);
+
+  return executeOperation(this.s.topology, optionsOperation, callback);
+};
+
+/**
+ * Returns if the collection is a capped collection
+ *
+ * @method
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.isCapped = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const isCappedOperation = new IsCappedOperation(this, options);
+
+  return executeOperation(this.s.topology, isCappedOperation, callback);
+};
+
+/**
+ * Creates an index on the db and collection collection.
+ * @method
+ * @param {(string|array|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.unique=false] Creates an unique index.
+ * @param {boolean} [options.sparse=false] Creates a sparse index.
+ * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible.
+ * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value
+ * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates.
+ * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates.
+ * @param {number} [options.v] Specify the format version of the indexes.
+ * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher)
+ * @param {string} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes)
+ * @param {object} [options.partialFilterExpression] Creates a partial index based on the given filter object (MongoDB 3.2 or higher)
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {(number|string)} [options.commitQuorum] (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @example
+ * const collection = client.db('foo').collection('bar');
+ *
+ * await collection.createIndex({ a: 1, b: -1 });
+ *
+ * // Alternate syntax for { c: 1, d: -1 } that ensures order of indexes
+ * await collection.createIndex([ [c, 1], [d, -1] ]);
+ *
+ * // Equivalent to { e: 1 }
+ * await collection.createIndex('e');
+ *
+ * // Equivalent to { f: 1, g: 1 }
+ * await collection.createIndex(['f', 'g'])
+ *
+ * // Equivalent to { h: 1, i: -1 }
+ * await collection.createIndex([ { h: 1 }, { i: -1 } ]);
+ *
+ * // Equivalent to { j: 1, k: -1, l: 2d }
+ * await collection.createIndex(['j', ['k', -1], { l: '2d' }])
+ */
+Collection.prototype.createIndex = function(fieldOrSpec, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const createIndexesOperation = new CreateIndexesOperation(
+    this,
+    this.collectionName,
+    fieldOrSpec,
+    options
+  );
+
+  return executeOperation(this.s.topology, createIndexesOperation, callback);
+};
+
+/**
+ * @typedef {object} Collection~IndexDefinition
+ * @description A definition for an index. Used by the createIndex command.
+ * @see https://docs.mongodb.com/manual/reference/command/createIndexes/
+ */
+
+/**
+ * Creates multiple indexes in the collection, this method is only supported for
+ * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported
+ * error.
+ *
+ * **Note**: Unlike {@link Collection#createIndex createIndex}, this function takes in raw index specifications.
+ * Index specifications are defined {@link http://docs.mongodb.org/manual/reference/command/createIndexes/ here}.
+ *
+ * @method
+ * @param {Collection~IndexDefinition[]} indexSpecs An array of index specifications to be created
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {(number|string)} [options.commitQuorum] (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @example
+ * const collection = client.db('foo').collection('bar');
+ * await collection.createIndexes([
+ *   // Simple index on field fizz
+ *   {
+ *     key: { fizz: 1 },
+ *   }
+ *   // wildcard index
+ *   {
+ *     key: { '$**': 1 }
+ *   },
+ *   // named index on darmok and jalad
+ *   {
+ *     key: { darmok: 1, jalad: -1 }
+ *     name: 'tanagra'
+ *   }
+ * ]);
+ */
+Collection.prototype.createIndexes = function(indexSpecs, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+
+  options = options ? Object.assign({}, options) : {};
+
+  if (typeof options.maxTimeMS !== 'number') delete options.maxTimeMS;
+
+  const createIndexesOperation = new CreateIndexesOperation(
+    this,
+    this.collectionName,
+    indexSpecs,
+    options
+  );
+
+  return executeOperation(this.s.topology, createIndexesOperation, callback);
+};
+
+/**
+ * Drops an index from this collection.
+ * @method
+ * @param {string} indexName Name of the index to drop.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.dropIndex = function(indexName, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+
+  options = args.length ? args.shift() || {} : {};
+  // Run only against primary
+  options.readPreference = ReadPreference.PRIMARY;
+
+  const dropIndexOperation = new DropIndexOperation(this, indexName, options);
+
+  return executeOperation(this.s.topology, dropIndexOperation, callback);
+};
+
+/**
+ * Drops all indexes from this collection.
+ * @method
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.dropIndexes = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options ? Object.assign({}, options) : {};
+
+  if (typeof options.maxTimeMS !== 'number') delete options.maxTimeMS;
+
+  const dropIndexesOperation = new DropIndexesOperation(this, options);
+
+  return executeOperation(this.s.topology, dropIndexesOperation, callback);
+};
+
+/**
+ * Drops all indexes from this collection.
+ * @method
+ * @deprecated use dropIndexes
+ * @param {Collection~resultCallback} callback The command result callback
+ * @return {Promise} returns Promise if no [callback] passed
+ */
+Collection.prototype.dropAllIndexes = deprecate(
+  Collection.prototype.dropIndexes,
+  'collection.dropAllIndexes is deprecated. Use dropIndexes instead.'
+);
+
+/**
+ * Reindex all indexes on the collection
+ * Warning: reIndex is a blocking operation (indexes are rebuilt in the foreground) and will be slow for large collections.
+ * @method
+ * @deprecated use db.command instead
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.reIndex = deprecate(function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const reIndexOperation = new ReIndexOperation(this, options);
+
+  return executeOperation(this.s.topology, reIndexOperation, callback);
+}, 'collection.reIndex is deprecated. Use db.command instead.');
+
+/**
+ * Get the list of all indexes information for the collection.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.batchSize=1000] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @return {CommandCursor}
+ */
+Collection.prototype.listIndexes = function(options) {
+  const cursor = new CommandCursor(
+    this.s.topology,
+    new ListIndexesOperation(this, options),
+    options
+  );
+
+  return cursor;
+};
+
+/**
+ * Ensures that an index exists, if it does not it creates it
+ * @method
+ * @deprecated use createIndexes instead
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.unique=false] Creates an unique index.
+ * @param {boolean} [options.sparse=false] Creates a sparse index.
+ * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible.
+ * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value
+ * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates.
+ * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates.
+ * @param {number} [options.v] Specify the format version of the indexes.
+ * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher)
+ * @param {number} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes)
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.ensureIndex = deprecate(function(fieldOrSpec, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.s.topology, ensureIndex, [
+    this,
+    fieldOrSpec,
+    options,
+    callback
+  ]);
+}, 'collection.ensureIndex is deprecated. Use createIndexes instead.');
+
+/**
+ * Checks if one or more indexes exist on the collection, fails on first non-existing index
+ * @method
+ * @param {(string|array)} indexes One or more index names to check.
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.indexExists = function(indexes, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const indexExistsOperation = new IndexExistsOperation(this, indexes, options);
+
+  return executeOperation(this.s.topology, indexExistsOperation, callback);
+};
+
+/**
+ * Retrieves this collections index info.
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.full=false] Returns the full raw index information.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.indexInformation = function(options, callback) {
+  const args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  options = args.length ? args.shift() || {} : {};
+
+  const indexInformationOperation = new IndexInformationOperation(
+    this.s.db,
+    this.collectionName,
+    options
+  );
+
+  return executeOperation(this.s.topology, indexInformationOperation, callback);
+};
+
+/**
+ * The callback format for results
+ * @callback Collection~countCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {number} result The count of documents that matched the query.
+ */
+
+/**
+ * An estimated count of matching documents in the db to a query.
+ *
+ * **NOTE:** This method has been deprecated, since it does not provide an accurate count of the documents
+ * in a collection. To obtain an accurate count of documents in the collection, use {@link Collection#countDocuments countDocuments}.
+ * To obtain an estimated count of all documents in the collection, use {@link Collection#estimatedDocumentCount estimatedDocumentCount}.
+ *
+ * @method
+ * @param {object} [query={}] The query for the count.
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {boolean} [options.limit] The limit of documents to count.
+ * @param {boolean} [options.skip] The number of documents to skip for the count.
+ * @param {string} [options.hint] An index name hint for the query.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~countCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated use {@link Collection#countDocuments countDocuments} or {@link Collection#estimatedDocumentCount estimatedDocumentCount} instead
+ */
+Collection.prototype.count = deprecate(function(query, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  query = args.length ? args.shift() || {} : {};
+  options = args.length ? args.shift() || {} : {};
+
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeOperation(
+    this.s.topology,
+    new EstimatedDocumentCountOperation(this, query, options),
+    callback
+  );
+}, 'collection.count is deprecated, and will be removed in a future version.' +
+  ' Use Collection.countDocuments or Collection.estimatedDocumentCount instead');
+
+/**
+ * Gets an estimate of the count of documents in a collection using collection metadata.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.maxTimeMS] The maximum amount of time to allow the operation to run.
+ * @param {Collection~countCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed.
+ */
+Collection.prototype.estimatedDocumentCount = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const estimatedDocumentCountOperation = new EstimatedDocumentCountOperation(this, options);
+
+  return executeOperation(this.s.topology, estimatedDocumentCountOperation, callback);
+};
+
+/**
+ * Gets the number of documents matching the filter.
+ * For a fast count of the total documents in a collection see {@link Collection#estimatedDocumentCount estimatedDocumentCount}.
+ * **Note**: When migrating from {@link Collection#count count} to {@link Collection#countDocuments countDocuments}
+ * the following query operators must be replaced:
+ *
+ * | Operator | Replacement |
+ * | -------- | ----------- |
+ * | `$where`   | [`$expr`][1] |
+ * | `$near`    | [`$geoWithin`][2] with [`$center`][3] |
+ * | `$nearSphere` | [`$geoWithin`][2] with [`$centerSphere`][4] |
+ *
+ * [1]: https://docs.mongodb.com/manual/reference/operator/query/expr/
+ * [2]: https://docs.mongodb.com/manual/reference/operator/query/geoWithin/
+ * [3]: https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center
+ * [4]: https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere
+ *
+ * @param {object} [query] the query for the count
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.collation] Specifies a collation.
+ * @param {string|object} [options.hint] The index to use.
+ * @param {number} [options.limit] The maximum number of document to count.
+ * @param {number} [options.maxTimeMS] The maximum amount of time to allow the operation to run.
+ * @param {number} [options.skip] The number of documents to skip before counting.
+ * @param {Collection~countCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed.
+ * @see https://docs.mongodb.com/manual/reference/operator/query/expr/
+ * @see https://docs.mongodb.com/manual/reference/operator/query/geoWithin/
+ * @see https://docs.mongodb.com/manual/reference/operator/query/center/#op._S_center
+ * @see https://docs.mongodb.com/manual/reference/operator/query/centerSphere/#op._S_centerSphere
+ */
+
+Collection.prototype.countDocuments = function(query, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  query = args.length ? args.shift() || {} : {};
+  options = args.length ? args.shift() || {} : {};
+
+  const countDocumentsOperation = new CountDocumentsOperation(this, query, options);
+
+  return executeOperation(this.s.topology, countDocumentsOperation, callback);
+};
+
+/**
+ * The distinct command returns a list of distinct values for the given key across a collection.
+ * @method
+ * @param {string} key Field of the document to find distinct values for.
+ * @param {object} [query] The query for filtering the set of documents to which we apply the distinct filter.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+ * @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.distinct = function(key, query, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  const queryOption = args.length ? args.shift() || {} : {};
+  const optionsOption = args.length ? args.shift() || {} : {};
+
+  const distinctOperation = new DistinctOperation(this, key, queryOption, optionsOption);
+
+  return executeOperation(this.s.topology, distinctOperation, callback);
+};
+
+/**
+ * Retrieve all the indexes on the collection.
+ * @method
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.indexes = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const indexesOperation = new IndexesOperation(this, options);
+
+  return executeOperation(this.s.topology, indexesOperation, callback);
+};
+
+/**
+ * Get all the collection statistics.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.scale] Divide the returned sizes by scale value.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The collection result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.stats = function(options, callback) {
+  const args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  options = args.length ? args.shift() || {} : {};
+
+  const statsOperation = new StatsOperation(this, options);
+
+  return executeOperation(this.s.topology, statsOperation, callback);
+};
+
+/**
+ * @typedef {Object} Collection~findAndModifyWriteOpResult
+ * @property {object} value Document returned from the `findAndModify` command. If no documents were found, `value` will be `null` by default even if a document was upserted unless `returnDocument` is specified as `'after'`, in which case the upserted document will be returned.
+ * @property {object} lastErrorObject The raw lastErrorObject returned from the command. See {@link https://docs.mongodb.com/manual/reference/command/findAndModify/index.html#lasterrorobject|findAndModify command documentation}.
+ * @property {Number} ok Is 1 if the command executed correctly.
+ */
+
+/**
+ * The callback format for inserts
+ * @callback Collection~findAndModifyCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection~findAndModifyWriteOpResult} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Find a document and delete it in one atomic operation. Requires a write lock for the duration of the operation.
+ *
+ * @method
+ * @param {object} filter The Filter used to select the document to remove
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {object} [options.projection] Limits the fields to return for all matching documents.
+ * @param {object} [options.sort] Determines which document the operation modifies if the query selects multiple documents.
+ * @param {number} [options.maxTimeMS] The maximum amount of time to allow the query to run.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~findAndModifyCallback} [callback] The collection result callback
+ * @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
+ */
+Collection.prototype.findOneAndDelete = function(filter, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // Add ignoreUndefined
+  if (this.s.options.ignoreUndefined) {
+    options = Object.assign({}, options);
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  return executeOperation(
+    this.s.topology,
+    new FindOneAndDeleteOperation(this, filter, options),
+    callback
+  );
+};
+
+/**
+ * Find a document and replace it in one atomic operation. Requires a write lock for the duration of the operation.
+ *
+ * @method
+ * @param {object} filter The Filter used to select the document to replace
+ * @param {object} replacement The Document that replaces the matching document
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {string|object} [options.hint] An optional index to use for this operation
+ * @param {number} [options.maxTimeMS] The maximum amount of time to allow the query to run.
+ * @param {object} [options.projection] Limits the fields to return for all matching documents.
+ * @param {object} [options.sort] Determines which document the operation modifies if the query selects multiple documents.
+ * @param {boolean} [options.upsert=false] Upsert the document if it does not exist.
+ * @param {'before'|'after'} [options.returnDocument='before'] When set to `'after'`, returns the updated document rather than the original. The default is `'before'`.
+ * @param {boolean} [options.returnOriginal=true] **Deprecated** Use `options.returnDocument` instead.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~findAndModifyCallback} [callback] The collection result callback
+ * @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
+ */
+Collection.prototype.findOneAndReplace = deprecateOptions(
+  {
+    name: 'collection.findOneAndReplace',
+    deprecatedOptions: ['returnOriginal'],
+    optionsIndex: 2
+  },
+  function(filter, replacement, options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = options || {};
+
+    // Add ignoreUndefined
+    if (this.s.options.ignoreUndefined) {
+      options = Object.assign({}, options);
+      options.ignoreUndefined = this.s.options.ignoreUndefined;
+    }
+
+    return executeOperation(
+      this.s.topology,
+      new FindOneAndReplaceOperation(this, filter, replacement, options),
+      callback
+    );
+  }
+);
+
+/**
+ * Find a document and update it in one atomic operation. Requires a write lock for the duration of the operation.
+ *
+ * @method
+ * @param {object} filter The Filter used to select the document to update
+ * @param {object} update Update operations to be performed on the document
+ * @param {object} [options] Optional settings.
+ * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {string|object} [options.hint] An optional index to use for this operation
+ * @param {number} [options.maxTimeMS] The maximum amount of time to allow the query to run.
+ * @param {object} [options.projection] Limits the fields to return for all matching documents.
+ * @param {object} [options.sort] Determines which document the operation modifies if the query selects multiple documents.
+ * @param {boolean} [options.upsert=false] Upsert the document if it does not exist.
+ * @param {'before'|'after'} [options.returnDocument='before'] When set to `'after'`, returns the updated document rather than the original. The default is `'before'`.
+ * @param {boolean} [options.returnOriginal=true] **Deprecated** Use `options.returnDocument` instead.
+ * @param {boolean} [options.checkKeys=false] If true, will throw if bson documents start with `$` or include a `.` in any key value
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] An ptional session to use for this operation
+ * @param {Collection~findAndModifyCallback} [callback] The collection result callback
+ * @return {Promise<Collection~findAndModifyWriteOpResultObject>} returns Promise if no callback passed
+ */
+Collection.prototype.findOneAndUpdate = deprecateOptions(
+  {
+    name: 'collection.findOneAndUpdate',
+    deprecatedOptions: ['returnOriginal'],
+    optionsIndex: 2
+  },
+  function(filter, update, options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = options || {};
+
+    // Add ignoreUndefined
+    if (this.s.options.ignoreUndefined) {
+      options = Object.assign({}, options);
+      options.ignoreUndefined = this.s.options.ignoreUndefined;
+    }
+
+    return executeOperation(
+      this.s.topology,
+      new FindOneAndUpdateOperation(this, filter, update, options),
+      callback
+    );
+  }
+);
+
+/**
+ * Find and update a document.
+ * @method
+ * @param {object} query Query object to locate the object to modify.
+ * @param {array} sort If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
+ * @param {object} doc The fields/vals to be updated.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.remove=false] Set to true to remove the object before returning.
+ * @param {boolean} [options.upsert=false] Perform an upsert operation.
+ * @param {boolean} [options.new=false] Set to true if you want to return the modified object rather than the original. Ignored for remove.
+ * @param {object} [options.projection] Object containing the field projection for the result returned from the operation.
+ * @param {object} [options.fields] **Deprecated** Use `options.projection` instead
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Array} [options.arrayFilters] optional list of array filters referenced in filtered positional operators
+ * @param {Collection~findAndModifyCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead
+ */
+Collection.prototype.findAndModify = deprecate(
+  _findAndModify,
+  'collection.findAndModify is deprecated. Use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead.'
+);
+
+/**
+ * @ignore
+ */
+
+Collection.prototype._findAndModify = _findAndModify;
+
+function _findAndModify(query, sort, doc, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  sort = args.length ? args.shift() || [] : [];
+  doc = args.length ? args.shift() : null;
+  options = args.length ? args.shift() || {} : {};
+
+  // Clone options
+  options = Object.assign({}, options);
+  // Force read preference primary
+  options.readPreference = ReadPreference.PRIMARY;
+
+  return executeOperation(
+    this.s.topology,
+    new FindAndModifyOperation(this, query, sort, doc, options),
+    callback
+  );
+}
+
+/**
+ * Find and remove a document.
+ * @method
+ * @param {object} query Query object to locate the object to modify.
+ * @param {array} sort If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated use findOneAndDelete instead
+ */
+Collection.prototype.findAndRemove = deprecate(function(query, sort, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  sort = args.length ? args.shift() || [] : [];
+  options = args.length ? args.shift() || {} : {};
+
+  // Add the remove option
+  options.remove = true;
+
+  return executeOperation(
+    this.s.topology,
+    new FindAndModifyOperation(this, query, sort, null, options),
+    callback
+  );
+}, 'collection.findAndRemove is deprecated. Use findOneAndDelete instead.');
+
+/**
+ * Execute an aggregation framework pipeline against the collection, needs MongoDB >= 2.2
+ * @method
+ * @param {object} [pipeline=[]] Array containing all the aggregation framework commands for the execution.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {object} [options.cursor] Return the query as cursor, on 2.6 > it returns as a real cursor on pre 2.6 it returns as an emulated cursor.
+ * @param {number} [options.cursor.batchSize=1000] Deprecated. Use `options.batchSize`
+ * @param {boolean} [options.allowDiskUse=false] allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 >).
+ * @param {number} [options.maxTimeMS] maxTimeMS specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.
+ * @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {string} [options.comment] Add a comment to an aggregation command
+ * @param {string|object} [options.hint] Add an index selection hint to an aggregation command
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~aggregationCallback} callback The command result callback
+ * @return {(null|AggregationCursor)}
+ */
+Collection.prototype.aggregate = function(pipeline, options, callback) {
+  if (Array.isArray(pipeline)) {
+    // Set up callback if one is provided
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+
+    // If we have no options or callback we are doing
+    // a cursor based aggregation
+    if (options == null && callback == null) {
+      options = {};
+    }
+  } else {
+    // Aggregation pipeline passed as arguments on the method
+    const args = Array.prototype.slice.call(arguments, 0);
+    // Get the callback
+    callback = args.pop();
+    // Get the possible options object
+    const opts = args[args.length - 1];
+    // If it contains any of the admissible options pop it of the args
+    options =
+      opts &&
+      (opts.readPreference ||
+        opts.explain ||
+        opts.cursor ||
+        opts.out ||
+        opts.maxTimeMS ||
+        opts.hint ||
+        opts.allowDiskUse)
+        ? args.pop()
+        : {};
+    // Left over arguments is the pipeline
+    pipeline = args;
+  }
+
+  const cursor = new AggregationCursor(
+    this.s.topology,
+    new AggregateOperation(this, pipeline, options),
+    options
+  );
+
+  // TODO: remove this when NODE-2074 is resolved
+  if (typeof callback === 'function') {
+    callback(null, cursor);
+    return;
+  }
+
+  return cursor;
+};
+
+/**
+ * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this collection.
+ * @method
+ * @since 3.0.0
+ * @param {Array} [pipeline] An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.
+ * @param {object} [options] Optional settings
+ * @param {string} [options.fullDocument='default'] Allowed values: ‘default’, ‘updateLookup’. When set to ‘updateLookup’, the change stream will include both a delta describing the changes to the document, as well as a copy of the entire document that was changed from some time after the change occurred.
+ * @param {object} [options.resumeAfter] Specifies the logical starting point for the new change stream. This should be the _id field from a previously returned change stream document.
+ * @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a change stream query
+ * @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {ReadPreference} [options.readPreference] The read preference. Defaults to the read preference of the database or collection. See {@link https://docs.mongodb.com/manual/reference/read-preference|read preference documentation}.
+ * @param {Timestamp} [options.startAtOperationTime] receive change events that occur after the specified timestamp
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @return {ChangeStream} a ChangeStream instance.
+ */
+Collection.prototype.watch = function(pipeline, options) {
+  pipeline = pipeline || [];
+  options = options || {};
+
+  // Allow optionally not specifying a pipeline
+  if (!Array.isArray(pipeline)) {
+    options = pipeline;
+    pipeline = [];
+  }
+
+  return new ChangeStream(this, pipeline, options);
+};
+
+/**
+ * The callback format for results
+ * @callback Collection~parallelCollectionScanCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Cursor[]} cursors A list of cursors returned allowing for parallel reading of collection.
+ */
+
+/**
+ * Return N number of parallel cursors for a collection allowing parallel reading of entire collection. There are
+ * no ordering guarantees for returned results.
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.batchSize=1000] Set the batchSize for the getMoreCommand when iterating over the query results.
+ * @param {number} [options.numCursors=1] The maximum number of parallel command cursors to return (the number of returned cursors will be in the range 1:numCursors)
+ * @param {boolean} [options.raw=false] Return all BSON documents as Raw Buffer documents.
+ * @param {Collection~parallelCollectionScanCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.parallelCollectionScan = deprecate(function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = { numCursors: 1 });
+  // Set number of cursors to 1
+  options.numCursors = options.numCursors || 1;
+  options.batchSize = options.batchSize || 1000;
+
+  options = Object.assign({}, options);
+  // Ensure we have the right read preference inheritance
+  options.readPreference = ReadPreference.resolve(this, options);
+
+  // Add a promiseLibrary
+  options.promiseLibrary = this.s.promiseLibrary;
+
+  if (options.session) {
+    options.session = undefined;
+  }
+
+  return executeLegacyOperation(
+    this.s.topology,
+    parallelCollectionScan,
+    [this, options, callback],
+    { skipSessions: true }
+  );
+}, 'parallelCollectionScan is deprecated in MongoDB v4.1');
+
+/**
+ * Execute a geo search using a geo haystack index on a collection.
+ *
+ * @method
+ * @param {number} x Point to search on the x axis, ensure the indexes are ordered in the same order.
+ * @param {number} y Point to search on the y axis, ensure the indexes are ordered in the same order.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.maxDistance] Include results up to maxDistance from the point.
+ * @param {object} [options.search] Filter the results by a query.
+ * @param {number} [options.limit=false] Max number of results to return.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated See {@link https://docs.mongodb.com/manual/geospatial-queries/|geospatial queries docs} for current geospatial support
+ */
+Collection.prototype.geoHaystackSearch = deprecate(function(x, y, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 2);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  options = args.length ? args.shift() || {} : {};
+
+  const geoHaystackSearchOperation = new GeoHaystackSearchOperation(this, x, y, options);
+
+  return executeOperation(this.s.topology, geoHaystackSearchOperation, callback);
+}, 'geoHaystackSearch is deprecated, and will be removed in a future version.');
+
+/**
+ * Run a group command across a collection
+ *
+ * @method
+ * @param {(object|array|function|code)} keys An object, array or function expressing the keys to group by.
+ * @param {object} condition An optional condition that must be true for a row to be considered.
+ * @param {object} initial Initial value of the aggregation counter object.
+ * @param {(function|Code)} reduce The reduce function aggregates (reduces) the objects iterated
+ * @param {(function|Code)} finalize An optional function to be run on each item in the result set just before the item is returned.
+ * @param {boolean} command Specify if you wish to run using the internal group command or using eval, default is true.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated MongoDB 3.6 or higher no longer supports the group command. We recommend rewriting using the aggregation framework.
+ */
+Collection.prototype.group = deprecate(function(
+  keys,
+  condition,
+  initial,
+  reduce,
+  finalize,
+  command,
+  options,
+  callback
+) {
+  const args = Array.prototype.slice.call(arguments, 3);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  reduce = args.length ? args.shift() : null;
+  finalize = args.length ? args.shift() : null;
+  command = args.length ? args.shift() : null;
+  options = args.length ? args.shift() || {} : {};
+
+  // Make sure we are backward compatible
+  if (!(typeof finalize === 'function')) {
+    command = finalize;
+    finalize = null;
+  }
+
+  if (
+    !Array.isArray(keys) &&
+    keys instanceof Object &&
+    typeof keys !== 'function' &&
+    !(keys._bsontype === 'Code')
+  ) {
+    keys = Object.keys(keys);
+  }
+
+  if (typeof reduce === 'function') {
+    reduce = reduce.toString();
+  }
+
+  if (typeof finalize === 'function') {
+    finalize = finalize.toString();
+  }
+
+  // Set up the command as default
+  command = command == null ? true : command;
+
+  return executeLegacyOperation(this.s.topology, group, [
+    this,
+    keys,
+    condition,
+    initial,
+    reduce,
+    finalize,
+    command,
+    options,
+    callback
+  ]);
+},
+'MongoDB 3.6 or higher no longer supports the group command. We recommend rewriting using the aggregation framework.');
+
+/**
+ * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.
+ *
+ * @method
+ * @param {(function|string)} map The mapping function.
+ * @param {(function|string)} reduce The reduce function.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {object} [options.out] Sets the output target for the map reduce job. *{inline:1} | {replace:'collectionName'} | {merge:'collectionName'} | {reduce:'collectionName'}*
+ * @param {object} [options.query] Query filter object.
+ * @param {object} [options.sort] Sorts the input objects using this key. Useful for optimization, like sorting by the emit key for fewer reduces.
+ * @param {number} [options.limit] Number of objects to return from collection.
+ * @param {boolean} [options.keeptemp=false] Keep temporary data.
+ * @param {(function|string)} [options.finalize] Finalize function.
+ * @param {object} [options.scope] Can pass in variables that can be access from map/reduce/finalize.
+ * @param {boolean} [options.jsMode=false] It is possible to make the execution stay in JS. Provided in MongoDB > 2.0.X.
+ * @param {boolean} [options.verbose=false] Provide statistics on job execution time.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+Collection.prototype.mapReduce = function(map, reduce, options, callback) {
+  if ('function' === typeof options) (callback = options), (options = {});
+  // Out must allways be defined (make sure we don't break weirdly on pre 1.8+ servers)
+  if (null == options.out) {
+    throw new Error(
+      'the out option parameter must be defined, see mongodb docs for possible values'
+    );
+  }
+
+  if ('function' === typeof map) {
+    map = map.toString();
+  }
+
+  if ('function' === typeof reduce) {
+    reduce = reduce.toString();
+  }
+
+  if ('function' === typeof options.finalize) {
+    options.finalize = options.finalize.toString();
+  }
+  const mapReduceOperation = new MapReduceOperation(this, map, reduce, options);
+
+  return executeOperation(this.s.topology, mapReduceOperation, callback);
+};
+
+/**
+ * Initiate an Out of order batch write operation. All operations will be buffered into insert/update/remove commands executed out of order.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @return {UnorderedBulkOperation}
+ */
+Collection.prototype.initializeUnorderedBulkOp = function(options) {
+  options = options || {};
+  // Give function's options precedence over session options.
+  if (options.ignoreUndefined == null) {
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  options.promiseLibrary = this.s.promiseLibrary;
+  return unordered(this.s.topology, this, options);
+};
+
+/**
+ * Initiate an In order bulk write operation. Operations will be serially executed in the order they are added, creating a new operation for each switch in types.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @return {null}
+ */
+Collection.prototype.initializeOrderedBulkOp = function(options) {
+  options = options || {};
+  // Give function's options precedence over session's options.
+  if (options.ignoreUndefined == null) {
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+  options.promiseLibrary = this.s.promiseLibrary;
+  return ordered(this.s.topology, this, options);
+};
+
+/**
+ * Return the db logger
+ * @method
+ * @return {Logger} return the db logger
+ * @ignore
+ */
+Collection.prototype.getLogger = function() {
+  return this.s.db.s.logger;
+};
+
+module.exports = Collection;
diff --git a/NodeAPI/node_modules/mongodb/lib/command_cursor.js b/NodeAPI/node_modules/mongodb/lib/command_cursor.js
new file mode 100644
index 0000000000000000000000000000000000000000..cd0f9d7a8526ce13fc6aa74ec686394ec1c77a94
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/command_cursor.js
@@ -0,0 +1,269 @@
+'use strict';
+
+const ReadPreference = require('./core').ReadPreference;
+const MongoError = require('./core').MongoError;
+const Cursor = require('./cursor');
+const CursorState = require('./core/cursor').CursorState;
+
+/**
+ * @fileOverview The **CommandCursor** class is an internal class that embodies a
+ * generalized cursor based on a MongoDB command allowing for iteration over the
+ * results returned. It supports one by one document iteration, conversion to an
+ * array or can be iterated as a Node 0.10.X or higher stream
+ *
+ * **CommandCursor Cannot directly be instantiated**
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   // Create a collection we want to drop later
+ *   const col = client.db(dbName).collection('listCollectionsExample1');
+ *   // Insert a bunch of documents
+ *   col.insert([{a:1, b:1}
+ *     , {a:2, b:2}, {a:3, b:3}
+ *     , {a:4, b:4}], {w:1}, function(err, result) {
+ *     test.equal(null, err);
+ *     // List the database collections available
+ *     db.listCollections().toArray(function(err, items) {
+ *       test.equal(null, err);
+ *       client.close();
+ *     });
+ *   });
+ * });
+ */
+
+/**
+ * Namespace provided by the browser.
+ * @external Readable
+ */
+
+/**
+ * Creates a new Command Cursor instance (INTERNAL TYPE, do not instantiate directly)
+ * @class CommandCursor
+ * @extends external:Readable
+ * @fires CommandCursor#data
+ * @fires CommandCursor#end
+ * @fires CommandCursor#close
+ * @fires CommandCursor#readable
+ * @return {CommandCursor} an CommandCursor instance.
+ */
+class CommandCursor extends Cursor {
+  constructor(topology, ns, cmd, options) {
+    super(topology, ns, cmd, options);
+  }
+
+  /**
+   * Set the ReadPreference for the cursor.
+   * @method
+   * @param {(string|ReadPreference)} readPreference The new read preference for the cursor.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  setReadPreference(readPreference) {
+    if (this.s.state === CursorState.CLOSED || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (this.s.state !== CursorState.INIT) {
+      throw MongoError.create({
+        message: 'cannot change cursor readPreference after cursor has been accessed',
+        driver: true
+      });
+    }
+
+    if (readPreference instanceof ReadPreference) {
+      this.options.readPreference = readPreference;
+    } else if (typeof readPreference === 'string') {
+      this.options.readPreference = new ReadPreference(readPreference);
+    } else {
+      throw new TypeError('Invalid read preference: ' + readPreference);
+    }
+
+    return this;
+  }
+
+  /**
+   * Set the batch size for the cursor.
+   * @method
+   * @param {number} value The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find/|find command documentation}.
+   * @throws {MongoError}
+   * @return {CommandCursor}
+   */
+  batchSize(value) {
+    if (this.s.state === CursorState.CLOSED || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'batchSize requires an integer', driver: true });
+    }
+
+    if (this.cmd.cursor) {
+      this.cmd.cursor.batchSize = value;
+    }
+
+    this.setCursorBatchSize(value);
+    return this;
+  }
+
+  /**
+   * Add a maxTimeMS stage to the aggregation pipeline
+   * @method
+   * @param {number} value The state maxTimeMS value.
+   * @return {CommandCursor}
+   */
+  maxTimeMS(value) {
+    if (this.topology.lastIsMaster().minWireVersion > 2) {
+      this.cmd.maxTimeMS = value;
+    }
+
+    return this;
+  }
+
+  /**
+   * Return the cursor logger
+   * @method
+   * @return {Logger} return the cursor logger
+   * @ignore
+   */
+  getLogger() {
+    return this.logger;
+  }
+}
+
+// aliases
+CommandCursor.prototype.get = CommandCursor.prototype.toArray;
+
+/**
+ * CommandCursor stream data event, fired for each document in the cursor.
+ *
+ * @event CommandCursor#data
+ * @type {object}
+ */
+
+/**
+ * CommandCursor stream end event
+ *
+ * @event CommandCursor#end
+ * @type {null}
+ */
+
+/**
+ * CommandCursor stream close event
+ *
+ * @event CommandCursor#close
+ * @type {null}
+ */
+
+/**
+ * CommandCursor stream readable event
+ *
+ * @event CommandCursor#readable
+ * @type {null}
+ */
+
+/**
+ * Get the next available document from the cursor, returns null if no more documents are available.
+ * @function CommandCursor.prototype.next
+ * @param {CommandCursor~resultCallback} [callback] The result callback.
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * Check if there is any document still available in the cursor
+ * @function CommandCursor.prototype.hasNext
+ * @param {CommandCursor~resultCallback} [callback] The result callback.
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * The callback format for results
+ * @callback CommandCursor~toArrayResultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {object[]} documents All the documents the satisfy the cursor.
+ */
+
+/**
+ * Returns an array of documents. The caller is responsible for making sure that there
+ * is enough memory to store the results. Note that the array only contain partial
+ * results when this cursor had been previously accessed.
+ * @method CommandCursor.prototype.toArray
+ * @param {CommandCursor~toArrayResultCallback} [callback] The result callback.
+ * @throws {MongoError}
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * The callback format for results
+ * @callback CommandCursor~resultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {(object|null)} result The result object if the command was executed successfully.
+ */
+
+/**
+ * Iterates over all the documents for this cursor. As with **{cursor.toArray}**,
+ * not all of the elements will be iterated if this cursor had been previously accessed.
+ * In that case, **{cursor.rewind}** can be used to reset the cursor. However, unlike
+ * **{cursor.toArray}**, the cursor will only hold a maximum of batch size elements
+ * at any given time if batch size is specified. Otherwise, the caller is responsible
+ * for making sure that the entire result can fit the memory.
+ * @method CommandCursor.prototype.each
+ * @param {CommandCursor~resultCallback} callback The result callback.
+ * @throws {MongoError}
+ * @return {null}
+ */
+
+/**
+ * Close the cursor, sending a KillCursor command and emitting close.
+ * @method CommandCursor.prototype.close
+ * @param {CommandCursor~resultCallback} [callback] The result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+
+/**
+ * Is the cursor closed
+ * @method CommandCursor.prototype.isClosed
+ * @return {boolean}
+ */
+
+/**
+ * Clone the cursor
+ * @function CommandCursor.prototype.clone
+ * @return {CommandCursor}
+ */
+
+/**
+ * Resets the cursor
+ * @function CommandCursor.prototype.rewind
+ * @return {CommandCursor}
+ */
+
+/**
+ * The callback format for the forEach iterator method
+ * @callback CommandCursor~iteratorCallback
+ * @param {Object} doc An emitted document for the iterator
+ */
+
+/**
+ * The callback error format for the forEach iterator method
+ * @callback CommandCursor~endCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ */
+
+/*
+ * Iterates over all the documents for this cursor using the iterator, callback pattern.
+ * @method CommandCursor.prototype.forEach
+ * @param {CommandCursor~iteratorCallback} iterator The iteration callback.
+ * @param {CommandCursor~endCallback} callback The end callback.
+ * @throws {MongoError}
+ * @return {null}
+ */
+
+module.exports = CommandCursor;
diff --git a/NodeAPI/node_modules/mongodb/lib/constants.js b/NodeAPI/node_modules/mongodb/lib/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..d6cc68add8e3229f46b35078fe6959f4fcab2333
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/constants.js
@@ -0,0 +1,10 @@
+'use strict';
+
+module.exports = {
+  SYSTEM_NAMESPACE_COLLECTION: 'system.namespaces',
+  SYSTEM_INDEX_COLLECTION: 'system.indexes',
+  SYSTEM_PROFILE_COLLECTION: 'system.profile',
+  SYSTEM_USER_COLLECTION: 'system.users',
+  SYSTEM_COMMAND_COLLECTION: '$cmd',
+  SYSTEM_JS_COLLECTION: 'system.js'
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/auth_provider.js b/NodeAPI/node_modules/mongodb/lib/core/auth/auth_provider.js
new file mode 100644
index 0000000000000000000000000000000000000000..a5f6e995ee8902b21b2ec3edc70a5a774208052c
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/auth_provider.js
@@ -0,0 +1,55 @@
+'use strict';
+
+/**
+ * Context used during authentication
+ *
+ * @property {Connection} connection The connection to authenticate
+ * @property {MongoCredentials} credentials The credentials to use for authentication
+ * @property {object} options The options passed to the `connect` method
+ * @property {object?} response The response of the initial handshake
+ * @property {Buffer?} nonce A random nonce generated for use in an authentication conversation
+ */
+class AuthContext {
+  constructor(connection, credentials, options) {
+    this.connection = connection;
+    this.credentials = credentials;
+    this.options = options;
+  }
+}
+
+class AuthProvider {
+  constructor(bson) {
+    this.bson = bson;
+  }
+
+  /**
+   * Prepare the handshake document before the initial handshake.
+   *
+   * @param {object} handshakeDoc The document used for the initial handshake on a connection
+   * @param {AuthContext} authContext Context for authentication flow
+   * @param {function} callback
+   */
+  prepare(handshakeDoc, context, callback) {
+    callback(undefined, handshakeDoc);
+  }
+
+  /**
+   * Authenticate
+   *
+   * @param {AuthContext} context A shared context for authentication flow
+   * @param {authResultCallback} callback The callback to return the result from the authentication
+   */
+  auth(context, callback) {
+    callback(new TypeError('`auth` method must be overridden by subclass'));
+  }
+}
+
+/**
+ * This is a result from an authentication provider
+ *
+ * @callback authResultCallback
+ * @param {error} error An error object. Set to null if no error present
+ * @param {boolean} result The result of the authentication process
+ */
+
+module.exports = { AuthContext, AuthProvider };
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/defaultAuthProviders.js b/NodeAPI/node_modules/mongodb/lib/core/auth/defaultAuthProviders.js
new file mode 100644
index 0000000000000000000000000000000000000000..92ac6059fb29ba2d8bffc7ed5ec27d5a8d6568b9
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/defaultAuthProviders.js
@@ -0,0 +1,29 @@
+'use strict';
+
+const MongoCR = require('./mongocr');
+const X509 = require('./x509');
+const Plain = require('./plain');
+const GSSAPI = require('./gssapi');
+const ScramSHA1 = require('./scram').ScramSHA1;
+const ScramSHA256 = require('./scram').ScramSHA256;
+const MongoDBAWS = require('./mongodb_aws');
+
+/**
+ * Returns the default authentication providers.
+ *
+ * @param {BSON} bson Bson definition
+ * @returns {Object} a mapping of auth names to auth types
+ */
+function defaultAuthProviders(bson) {
+  return {
+    'mongodb-aws': new MongoDBAWS(bson),
+    mongocr: new MongoCR(bson),
+    x509: new X509(bson),
+    plain: new Plain(bson),
+    gssapi: new GSSAPI(bson),
+    'scram-sha-1': new ScramSHA1(bson),
+    'scram-sha-256': new ScramSHA256(bson)
+  };
+}
+
+module.exports = { defaultAuthProviders };
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/gssapi.js b/NodeAPI/node_modules/mongodb/lib/core/auth/gssapi.js
new file mode 100644
index 0000000000000000000000000000000000000000..9a6c110b0e15d899bb068572c6d8054c33bf91dd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/gssapi.js
@@ -0,0 +1,151 @@
+'use strict';
+const dns = require('dns');
+
+const AuthProvider = require('./auth_provider').AuthProvider;
+const retrieveKerberos = require('../utils').retrieveKerberos;
+const MongoError = require('../error').MongoError;
+
+let kerberos;
+
+class GSSAPI extends AuthProvider {
+  auth(authContext, callback) {
+    const connection = authContext.connection;
+    const credentials = authContext.credentials;
+    if (credentials == null) return callback(new MongoError('credentials required'));
+    const username = credentials.username;
+    function externalCommand(command, cb) {
+      return connection.command('$external.$cmd', command, cb);
+    }
+    makeKerberosClient(authContext, (err, client) => {
+      if (err) return callback(err);
+      if (client == null) return callback(new MongoError('gssapi client missing'));
+      client.step('', (err, payload) => {
+        if (err) return callback(err);
+        externalCommand(saslStart(payload), (err, response) => {
+          if (err) return callback(err);
+          const result = response.result;
+          negotiate(client, 10, result.payload, (err, payload) => {
+            if (err) return callback(err);
+            externalCommand(saslContinue(payload, result.conversationId), (err, response) => {
+              if (err) return callback(err);
+              const result = response.result;
+              finalize(client, username, result.payload, (err, payload) => {
+                if (err) return callback(err);
+                externalCommand(
+                  {
+                    saslContinue: 1,
+                    conversationId: result.conversationId,
+                    payload
+                  },
+                  (err, result) => {
+                    if (err) return callback(err);
+                    callback(undefined, result);
+                  }
+                );
+              });
+            });
+          });
+        });
+      });
+    });
+  }
+}
+module.exports = GSSAPI;
+
+function makeKerberosClient(authContext, callback) {
+  const host = authContext.options.host;
+  const port = authContext.options.port;
+  const credentials = authContext.credentials;
+  if (!host || !port || !credentials) {
+    return callback(
+      new MongoError(
+        `Connection must specify: ${host ? 'host' : ''}, ${port ? 'port' : ''}, ${
+          credentials ? 'host' : 'credentials'
+        }.`
+      )
+    );
+  }
+  if (kerberos == null) {
+    try {
+      kerberos = retrieveKerberos();
+    } catch (e) {
+      return callback(e);
+    }
+  }
+  const username = credentials.username;
+  const password = credentials.password;
+  const mechanismProperties = credentials.mechanismProperties;
+  const serviceName =
+    mechanismProperties['gssapiservicename'] ||
+    mechanismProperties['gssapiServiceName'] ||
+    'mongodb';
+  performGssapiCanonicalizeHostName(host, mechanismProperties, (err, host) => {
+    if (err) return callback(err);
+    const initOptions = {};
+    if (password != null) {
+      Object.assign(initOptions, { user: username, password: password });
+    }
+    kerberos.initializeClient(
+      `${serviceName}${process.platform === 'win32' ? '/' : '@'}${host}`,
+      initOptions,
+      (err, client) => {
+        if (err) return callback(new MongoError(err));
+        callback(null, client);
+      }
+    );
+  });
+}
+
+function saslStart(payload) {
+  return {
+    saslStart: 1,
+    mechanism: 'GSSAPI',
+    payload,
+    autoAuthorize: 1
+  };
+}
+function saslContinue(payload, conversationId) {
+  return {
+    saslContinue: 1,
+    conversationId,
+    payload
+  };
+}
+function negotiate(client, retries, payload, callback) {
+  client.step(payload, (err, response) => {
+    // Retries exhausted, raise error
+    if (err && retries === 0) return callback(err);
+    // Adjust number of retries and call step again
+    if (err) return negotiate(client, retries - 1, payload, callback);
+    // Return the payload
+    callback(undefined, response || '');
+  });
+}
+function finalize(client, user, payload, callback) {
+  // GSS Client Unwrap
+  client.unwrap(payload, (err, response) => {
+    if (err) return callback(err);
+    // Wrap the response
+    client.wrap(response || '', { user }, (err, wrapped) => {
+      if (err) return callback(err);
+      // Return the payload
+      callback(undefined, wrapped);
+    });
+  });
+}
+function performGssapiCanonicalizeHostName(host, mechanismProperties, callback) {
+  const canonicalizeHostName =
+    typeof mechanismProperties.gssapiCanonicalizeHostName === 'boolean'
+      ? mechanismProperties.gssapiCanonicalizeHostName
+      : false;
+  if (!canonicalizeHostName) return callback(undefined, host);
+  // Attempt to resolve the host name
+  dns.resolveCname(host, (err, r) => {
+    if (err) return callback(err);
+    // Get the first resolve host id
+    if (Array.isArray(r) && r.length > 0) {
+      return callback(undefined, r[0]);
+    }
+    callback(undefined, host);
+  });
+}
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/mongo_credentials.js b/NodeAPI/node_modules/mongodb/lib/core/auth/mongo_credentials.js
new file mode 100644
index 0000000000000000000000000000000000000000..090969e540d1bc40752b1e5ff243968bf45de0d1
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/mongo_credentials.js
@@ -0,0 +1,107 @@
+'use strict';
+
+// Resolves the default auth mechanism according to
+// https://github.com/mongodb/specifications/blob/master/source/auth/auth.rst
+function getDefaultAuthMechanism(ismaster) {
+  if (ismaster) {
+    // If ismaster contains saslSupportedMechs, use scram-sha-256
+    // if it is available, else scram-sha-1
+    if (Array.isArray(ismaster.saslSupportedMechs)) {
+      return ismaster.saslSupportedMechs.indexOf('SCRAM-SHA-256') >= 0
+        ? 'scram-sha-256'
+        : 'scram-sha-1';
+    }
+
+    // Fallback to legacy selection method. If wire version >= 3, use scram-sha-1
+    if (ismaster.maxWireVersion >= 3) {
+      return 'scram-sha-1';
+    }
+  }
+
+  // Default for wireprotocol < 3
+  return 'mongocr';
+}
+
+/**
+ * A representation of the credentials used by MongoDB
+ * @class
+ * @property {string} mechanism The method used to authenticate
+ * @property {string} [username] The username used for authentication
+ * @property {string} [password] The password used for authentication
+ * @property {string} [source] The database that the user should authenticate against
+ * @property {object} [mechanismProperties] Special properties used by some types of auth mechanisms
+ */
+class MongoCredentials {
+  /**
+   * Creates a new MongoCredentials object
+   * @param {object} [options]
+   * @param {string} [options.username] The username used for authentication
+   * @param {string} [options.password] The password used for authentication
+   * @param {string} [options.source] The database that the user should authenticate against
+   * @param {string} [options.mechanism] The method used to authenticate
+   * @param {object} [options.mechanismProperties] Special properties used by some types of auth mechanisms
+   */
+  constructor(options) {
+    options = options || {};
+    this.username = options.username;
+    this.password = options.password;
+    this.source = options.source || options.db;
+    this.mechanism = options.mechanism || 'default';
+    this.mechanismProperties = options.mechanismProperties || {};
+
+    if (/MONGODB-AWS/i.test(this.mechanism)) {
+      if (!this.username && process.env.AWS_ACCESS_KEY_ID) {
+        this.username = process.env.AWS_ACCESS_KEY_ID;
+      }
+
+      if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) {
+        this.password = process.env.AWS_SECRET_ACCESS_KEY;
+      }
+
+      if (!this.mechanismProperties.AWS_SESSION_TOKEN && process.env.AWS_SESSION_TOKEN) {
+        this.mechanismProperties.AWS_SESSION_TOKEN = process.env.AWS_SESSION_TOKEN;
+      }
+    }
+
+    Object.freeze(this.mechanismProperties);
+    Object.freeze(this);
+  }
+
+  /**
+   * Determines if two MongoCredentials objects are equivalent
+   * @param {MongoCredentials} other another MongoCredentials object
+   * @returns {boolean} true if the two objects are equal.
+   */
+  equals(other) {
+    return (
+      this.mechanism === other.mechanism &&
+      this.username === other.username &&
+      this.password === other.password &&
+      this.source === other.source
+    );
+  }
+
+  /**
+   * If the authentication mechanism is set to "default", resolves the authMechanism
+   * based on the server version and server supported sasl mechanisms.
+   *
+   * @param {Object} [ismaster] An ismaster response from the server
+   * @returns {MongoCredentials}
+   */
+  resolveAuthMechanism(ismaster) {
+    // If the mechanism is not "default", then it does not need to be resolved
+    if (/DEFAULT/i.test(this.mechanism)) {
+      return new MongoCredentials({
+        username: this.username,
+        password: this.password,
+        source: this.source,
+        mechanism: getDefaultAuthMechanism(ismaster),
+        mechanismProperties: this.mechanismProperties
+      });
+    }
+
+    return this;
+  }
+}
+
+module.exports = { MongoCredentials };
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/mongocr.js b/NodeAPI/node_modules/mongodb/lib/core/auth/mongocr.js
new file mode 100644
index 0000000000000000000000000000000000000000..0b1c341a38396668a73271859b23cdf7c525496e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/mongocr.js
@@ -0,0 +1,45 @@
+'use strict';
+
+const crypto = require('crypto');
+const AuthProvider = require('./auth_provider').AuthProvider;
+
+class MongoCR extends AuthProvider {
+  auth(authContext, callback) {
+    const connection = authContext.connection;
+    const credentials = authContext.credentials;
+    const username = credentials.username;
+    const password = credentials.password;
+    const source = credentials.source;
+
+    connection.command(`${source}.$cmd`, { getnonce: 1 }, (err, result) => {
+      let nonce = null;
+      let key = null;
+
+      // Get nonce
+      if (err == null) {
+        const r = result.result;
+        nonce = r.nonce;
+        // Use node md5 generator
+        let md5 = crypto.createHash('md5');
+        // Generate keys used for authentication
+        md5.update(username + ':mongo:' + password, 'utf8');
+        const hash_password = md5.digest('hex');
+        // Final key
+        md5 = crypto.createHash('md5');
+        md5.update(nonce + username + hash_password, 'utf8');
+        key = md5.digest('hex');
+      }
+
+      const authenticateCommand = {
+        authenticate: 1,
+        user: username,
+        nonce,
+        key
+      };
+
+      connection.command(`${source}.$cmd`, authenticateCommand, callback);
+    });
+  }
+}
+
+module.exports = MongoCR;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/mongodb_aws.js b/NodeAPI/node_modules/mongodb/lib/core/auth/mongodb_aws.js
new file mode 100644
index 0000000000000000000000000000000000000000..af19d6dc0d30ce490cc1c726bf9a1f672790bdac
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/mongodb_aws.js
@@ -0,0 +1,256 @@
+'use strict';
+const AuthProvider = require('./auth_provider').AuthProvider;
+const MongoCredentials = require('./mongo_credentials').MongoCredentials;
+const MongoError = require('../error').MongoError;
+const crypto = require('crypto');
+const http = require('http');
+const maxWireVersion = require('../utils').maxWireVersion;
+const url = require('url');
+
+let aws4;
+try {
+  aws4 = require('aws4');
+} catch (e) {
+  // don't do anything;
+}
+
+const ASCII_N = 110;
+const AWS_RELATIVE_URI = 'http://169.254.170.2';
+const AWS_EC2_URI = 'http://169.254.169.254';
+const AWS_EC2_PATH = '/latest/meta-data/iam/security-credentials';
+
+class MongoDBAWS extends AuthProvider {
+  auth(authContext, callback) {
+    const connection = authContext.connection;
+    const credentials = authContext.credentials;
+
+    if (maxWireVersion(connection) < 9) {
+      callback(new MongoError('MONGODB-AWS authentication requires MongoDB version 4.4 or later'));
+      return;
+    }
+
+    if (aws4 == null) {
+      callback(
+        new MongoError(
+          'MONGODB-AWS authentication requires the `aws4` module, please install it as a dependency of your project'
+        )
+      );
+
+      return;
+    }
+
+    if (credentials.username == null) {
+      makeTempCredentials(credentials, (err, tempCredentials) => {
+        if (err) return callback(err);
+
+        authContext.credentials = tempCredentials;
+        this.auth(authContext, callback);
+      });
+
+      return;
+    }
+
+    const username = credentials.username;
+    const password = credentials.password;
+    const db = credentials.source;
+    const token = credentials.mechanismProperties.AWS_SESSION_TOKEN;
+    const bson = this.bson;
+
+    crypto.randomBytes(32, (err, nonce) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      const saslStart = {
+        saslStart: 1,
+        mechanism: 'MONGODB-AWS',
+        payload: bson.serialize({ r: nonce, p: ASCII_N })
+      };
+
+      connection.command(`${db}.$cmd`, saslStart, (err, result) => {
+        if (err) return callback(err);
+
+        const res = result.result;
+        const serverResponse = bson.deserialize(res.payload.buffer);
+        const host = serverResponse.h;
+        const serverNonce = serverResponse.s.buffer;
+        if (serverNonce.length !== 64) {
+          callback(
+            new MongoError(`Invalid server nonce length ${serverNonce.length}, expected 64`)
+          );
+          return;
+        }
+
+        if (serverNonce.compare(nonce, 0, nonce.length, 0, nonce.length) !== 0) {
+          callback(new MongoError('Server nonce does not begin with client nonce'));
+          return;
+        }
+
+        if (host.length < 1 || host.length > 255 || host.indexOf('..') !== -1) {
+          callback(new MongoError(`Server returned an invalid host: "${host}"`));
+          return;
+        }
+
+        const body = 'Action=GetCallerIdentity&Version=2011-06-15';
+        const options = aws4.sign(
+          {
+            method: 'POST',
+            host,
+            region: deriveRegion(serverResponse.h),
+            service: 'sts',
+            headers: {
+              'Content-Type': 'application/x-www-form-urlencoded',
+              'Content-Length': body.length,
+              'X-MongoDB-Server-Nonce': serverNonce.toString('base64'),
+              'X-MongoDB-GS2-CB-Flag': 'n'
+            },
+            path: '/',
+            body
+          },
+          {
+            accessKeyId: username,
+            secretAccessKey: password,
+            token
+          }
+        );
+
+        const authorization = options.headers.Authorization;
+        const date = options.headers['X-Amz-Date'];
+        const payload = { a: authorization, d: date };
+        if (token) {
+          payload.t = token;
+        }
+
+        const saslContinue = {
+          saslContinue: 1,
+          conversationId: 1,
+          payload: bson.serialize(payload)
+        };
+
+        connection.command(`${db}.$cmd`, saslContinue, err => {
+          if (err) return callback(err);
+          callback();
+        });
+      });
+    });
+  }
+}
+
+function makeTempCredentials(credentials, callback) {
+  function done(creds) {
+    if (creds.AccessKeyId == null || creds.SecretAccessKey == null || creds.Token == null) {
+      callback(new MongoError('Could not obtain temporary MONGODB-AWS credentials'));
+      return;
+    }
+
+    callback(
+      undefined,
+      new MongoCredentials({
+        username: creds.AccessKeyId,
+        password: creds.SecretAccessKey,
+        source: credentials.source,
+        mechanism: 'MONGODB-AWS',
+        mechanismProperties: {
+          AWS_SESSION_TOKEN: creds.Token
+        }
+      })
+    );
+  }
+
+  // If the environment variable AWS_CONTAINER_CREDENTIALS_RELATIVE_URI
+  // is set then drivers MUST assume that it was set by an AWS ECS agent
+  if (process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI) {
+    request(
+      `${AWS_RELATIVE_URI}${process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI}`,
+      (err, res) => {
+        if (err) return callback(err);
+        done(res);
+      }
+    );
+
+    return;
+  }
+
+  // Otherwise assume we are on an EC2 instance
+
+  // get a token
+
+  request(
+    `${AWS_EC2_URI}/latest/api/token`,
+    { method: 'PUT', json: false, headers: { 'X-aws-ec2-metadata-token-ttl-seconds': 30 } },
+    (err, token) => {
+      if (err) return callback(err);
+
+      // get role name
+      request(
+        `${AWS_EC2_URI}/${AWS_EC2_PATH}`,
+        { json: false, headers: { 'X-aws-ec2-metadata-token': token } },
+        (err, roleName) => {
+          if (err) return callback(err);
+
+          // get temp credentials
+          request(
+            `${AWS_EC2_URI}/${AWS_EC2_PATH}/${roleName}`,
+            { headers: { 'X-aws-ec2-metadata-token': token } },
+            (err, creds) => {
+              if (err) return callback(err);
+              done(creds);
+            }
+          );
+        }
+      );
+    }
+  );
+}
+
+function deriveRegion(host) {
+  const parts = host.split('.');
+  if (parts.length === 1 || parts[1] === 'amazonaws') {
+    return 'us-east-1';
+  }
+
+  return parts[1];
+}
+
+function request(uri, options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = Object.assign(
+    {
+      method: 'GET',
+      timeout: 10000,
+      json: true
+    },
+    url.parse(uri),
+    options
+  );
+
+  const req = http.request(options, res => {
+    res.setEncoding('utf8');
+
+    let data = '';
+    res.on('data', d => (data += d));
+    res.on('end', () => {
+      if (options.json === false) {
+        callback(undefined, data);
+        return;
+      }
+
+      try {
+        const parsed = JSON.parse(data);
+        callback(undefined, parsed);
+      } catch (err) {
+        callback(new MongoError(`Invalid JSON response: "${data}"`));
+      }
+    });
+  });
+
+  req.on('error', err => callback(err));
+  req.end();
+}
+
+module.exports = MongoDBAWS;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/plain.js b/NodeAPI/node_modules/mongodb/lib/core/auth/plain.js
new file mode 100644
index 0000000000000000000000000000000000000000..f8de3dd981742515abba7af7f43158befa9b8399
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/plain.js
@@ -0,0 +1,28 @@
+'use strict';
+const retrieveBSON = require('../connection/utils').retrieveBSON;
+const AuthProvider = require('./auth_provider').AuthProvider;
+
+// TODO: can we get the Binary type from this.bson instead?
+const BSON = retrieveBSON();
+const Binary = BSON.Binary;
+
+class Plain extends AuthProvider {
+  auth(authContext, callback) {
+    const connection = authContext.connection;
+    const credentials = authContext.credentials;
+    const username = credentials.username;
+    const password = credentials.password;
+
+    const payload = new Binary(`\x00${username}\x00${password}`);
+    const command = {
+      saslStart: 1,
+      mechanism: 'PLAIN',
+      payload: payload,
+      autoAuthorize: 1
+    };
+
+    connection.command('$external.$cmd', command, callback);
+  }
+}
+
+module.exports = Plain;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/scram.js b/NodeAPI/node_modules/mongodb/lib/core/auth/scram.js
new file mode 100644
index 0000000000000000000000000000000000000000..7eca32dda327195b14b5a47bdf3698377f473938
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/scram.js
@@ -0,0 +1,347 @@
+'use strict';
+const crypto = require('crypto');
+const Buffer = require('safe-buffer').Buffer;
+const retrieveBSON = require('../connection/utils').retrieveBSON;
+const MongoError = require('../error').MongoError;
+const AuthProvider = require('./auth_provider').AuthProvider;
+const emitWarningOnce = require('../../utils').emitWarning;
+
+const BSON = retrieveBSON();
+const Binary = BSON.Binary;
+
+let saslprep;
+try {
+  saslprep = require('saslprep');
+} catch (e) {
+  // don't do anything;
+}
+
+class ScramSHA extends AuthProvider {
+  constructor(bson, cryptoMethod) {
+    super(bson);
+    this.cryptoMethod = cryptoMethod || 'sha1';
+  }
+
+  prepare(handshakeDoc, authContext, callback) {
+    const cryptoMethod = this.cryptoMethod;
+    if (cryptoMethod === 'sha256' && saslprep == null) {
+      emitWarningOnce('Warning: no saslprep library specified. Passwords will not be sanitized');
+    }
+
+    crypto.randomBytes(24, (err, nonce) => {
+      if (err) {
+        return callback(err);
+      }
+
+      // store the nonce for later use
+      Object.assign(authContext, { nonce });
+
+      const credentials = authContext.credentials;
+      const request = Object.assign({}, handshakeDoc, {
+        speculativeAuthenticate: Object.assign(makeFirstMessage(cryptoMethod, credentials, nonce), {
+          db: credentials.source
+        })
+      });
+
+      callback(undefined, request);
+    });
+  }
+
+  auth(authContext, callback) {
+    const response = authContext.response;
+    if (response && response.speculativeAuthenticate) {
+      continueScramConversation(
+        this.cryptoMethod,
+        response.speculativeAuthenticate,
+        authContext,
+        callback
+      );
+
+      return;
+    }
+
+    executeScram(this.cryptoMethod, authContext, callback);
+  }
+}
+
+function cleanUsername(username) {
+  return username.replace('=', '=3D').replace(',', '=2C');
+}
+
+function clientFirstMessageBare(username, nonce) {
+  // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8.
+  // Since the username is not sasl-prep-d, we need to do this here.
+  return Buffer.concat([
+    Buffer.from('n=', 'utf8'),
+    Buffer.from(username, 'utf8'),
+    Buffer.from(',r=', 'utf8'),
+    Buffer.from(nonce.toString('base64'), 'utf8')
+  ]);
+}
+
+function makeFirstMessage(cryptoMethod, credentials, nonce) {
+  const username = cleanUsername(credentials.username);
+  const mechanism = cryptoMethod === 'sha1' ? 'SCRAM-SHA-1' : 'SCRAM-SHA-256';
+
+  // NOTE: This is done b/c Javascript uses UTF-16, but the server is hashing in UTF-8.
+  // Since the username is not sasl-prep-d, we need to do this here.
+  return {
+    saslStart: 1,
+    mechanism,
+    payload: new Binary(
+      Buffer.concat([Buffer.from('n,,', 'utf8'), clientFirstMessageBare(username, nonce)])
+    ),
+    autoAuthorize: 1,
+    options: { skipEmptyExchange: true }
+  };
+}
+
+function executeScram(cryptoMethod, authContext, callback) {
+  const connection = authContext.connection;
+  const credentials = authContext.credentials;
+  const nonce = authContext.nonce;
+  const db = credentials.source;
+
+  const saslStartCmd = makeFirstMessage(cryptoMethod, credentials, nonce);
+  connection.command(`${db}.$cmd`, saslStartCmd, (_err, result) => {
+    const err = resolveError(_err, result);
+    if (err) {
+      return callback(err);
+    }
+
+    continueScramConversation(cryptoMethod, result.result, authContext, callback);
+  });
+}
+
+function continueScramConversation(cryptoMethod, response, authContext, callback) {
+  const connection = authContext.connection;
+  const credentials = authContext.credentials;
+  const nonce = authContext.nonce;
+
+  const db = credentials.source;
+  const username = cleanUsername(credentials.username);
+  const password = credentials.password;
+
+  let processedPassword;
+  if (cryptoMethod === 'sha256') {
+    processedPassword = saslprep ? saslprep(password) : password;
+  } else {
+    try {
+      processedPassword = passwordDigest(username, password);
+    } catch (e) {
+      return callback(e);
+    }
+  }
+
+  const payload = Buffer.isBuffer(response.payload)
+    ? new Binary(response.payload)
+    : response.payload;
+  const dict = parsePayload(payload.value());
+
+  const iterations = parseInt(dict.i, 10);
+  if (iterations && iterations < 4096) {
+    callback(new MongoError(`Server returned an invalid iteration count ${iterations}`), false);
+    return;
+  }
+
+  const salt = dict.s;
+  const rnonce = dict.r;
+  if (rnonce.startsWith('nonce')) {
+    callback(new MongoError(`Server returned an invalid nonce: ${rnonce}`), false);
+    return;
+  }
+
+  // Set up start of proof
+  const withoutProof = `c=biws,r=${rnonce}`;
+  const saltedPassword = HI(
+    processedPassword,
+    Buffer.from(salt, 'base64'),
+    iterations,
+    cryptoMethod
+  );
+
+  const clientKey = HMAC(cryptoMethod, saltedPassword, 'Client Key');
+  const serverKey = HMAC(cryptoMethod, saltedPassword, 'Server Key');
+  const storedKey = H(cryptoMethod, clientKey);
+  const authMessage = [
+    clientFirstMessageBare(username, nonce),
+    payload.value().toString('base64'),
+    withoutProof
+  ].join(',');
+
+  const clientSignature = HMAC(cryptoMethod, storedKey, authMessage);
+  const clientProof = `p=${xor(clientKey, clientSignature)}`;
+  const clientFinal = [withoutProof, clientProof].join(',');
+
+  const serverSignature = HMAC(cryptoMethod, serverKey, authMessage);
+  const saslContinueCmd = {
+    saslContinue: 1,
+    conversationId: response.conversationId,
+    payload: new Binary(Buffer.from(clientFinal))
+  };
+
+  connection.command(`${db}.$cmd`, saslContinueCmd, (_err, result) => {
+    const err = resolveError(_err, result);
+    if (err) {
+      return callback(err);
+    }
+
+    const r = result.result;
+    const parsedResponse = parsePayload(r.payload.value());
+    if (!compareDigest(Buffer.from(parsedResponse.v, 'base64'), serverSignature)) {
+      callback(new MongoError('Server returned an invalid signature'));
+      return;
+    }
+
+    if (!r || r.done !== false) {
+      return callback(err, r);
+    }
+
+    const retrySaslContinueCmd = {
+      saslContinue: 1,
+      conversationId: r.conversationId,
+      payload: Buffer.alloc(0)
+    };
+
+    connection.command(`${db}.$cmd`, retrySaslContinueCmd, callback);
+  });
+}
+
+function parsePayload(payload) {
+  const dict = {};
+  const parts = payload.split(',');
+  for (let i = 0; i < parts.length; i++) {
+    const valueParts = parts[i].split('=');
+    dict[valueParts[0]] = valueParts[1];
+  }
+
+  return dict;
+}
+
+function passwordDigest(username, password) {
+  if (typeof username !== 'string') {
+    throw new MongoError('username must be a string');
+  }
+
+  if (typeof password !== 'string') {
+    throw new MongoError('password must be a string');
+  }
+
+  if (password.length === 0) {
+    throw new MongoError('password cannot be empty');
+  }
+
+  const md5 = crypto.createHash('md5');
+  md5.update(`${username}:mongo:${password}`, 'utf8');
+  return md5.digest('hex');
+}
+
+// XOR two buffers
+function xor(a, b) {
+  if (!Buffer.isBuffer(a)) {
+    a = Buffer.from(a);
+  }
+
+  if (!Buffer.isBuffer(b)) {
+    b = Buffer.from(b);
+  }
+
+  const length = Math.max(a.length, b.length);
+  const res = [];
+
+  for (let i = 0; i < length; i += 1) {
+    res.push(a[i] ^ b[i]);
+  }
+
+  return Buffer.from(res).toString('base64');
+}
+
+function H(method, text) {
+  return crypto
+    .createHash(method)
+    .update(text)
+    .digest();
+}
+
+function HMAC(method, key, text) {
+  return crypto
+    .createHmac(method, key)
+    .update(text)
+    .digest();
+}
+
+let _hiCache = {};
+let _hiCacheCount = 0;
+function _hiCachePurge() {
+  _hiCache = {};
+  _hiCacheCount = 0;
+}
+
+const hiLengthMap = {
+  sha256: 32,
+  sha1: 20
+};
+
+function HI(data, salt, iterations, cryptoMethod) {
+  // omit the work if already generated
+  const key = [data, salt.toString('base64'), iterations].join('_');
+  if (_hiCache[key] !== undefined) {
+    return _hiCache[key];
+  }
+
+  // generate the salt
+  const saltedData = crypto.pbkdf2Sync(
+    data,
+    salt,
+    iterations,
+    hiLengthMap[cryptoMethod],
+    cryptoMethod
+  );
+
+  // cache a copy to speed up the next lookup, but prevent unbounded cache growth
+  if (_hiCacheCount >= 200) {
+    _hiCachePurge();
+  }
+
+  _hiCache[key] = saltedData;
+  _hiCacheCount += 1;
+  return saltedData;
+}
+
+function compareDigest(lhs, rhs) {
+  if (lhs.length !== rhs.length) {
+    return false;
+  }
+
+  if (typeof crypto.timingSafeEqual === 'function') {
+    return crypto.timingSafeEqual(lhs, rhs);
+  }
+
+  let result = 0;
+  for (let i = 0; i < lhs.length; i++) {
+    result |= lhs[i] ^ rhs[i];
+  }
+
+  return result === 0;
+}
+
+function resolveError(err, result) {
+  if (err) return err;
+
+  const r = result.result;
+  if (r.$err || r.errmsg) return new MongoError(r);
+}
+
+class ScramSHA1 extends ScramSHA {
+  constructor(bson) {
+    super(bson, 'sha1');
+  }
+}
+
+class ScramSHA256 extends ScramSHA {
+  constructor(bson) {
+    super(bson, 'sha256');
+  }
+}
+
+module.exports = { ScramSHA1, ScramSHA256 };
diff --git a/NodeAPI/node_modules/mongodb/lib/core/auth/x509.js b/NodeAPI/node_modules/mongodb/lib/core/auth/x509.js
new file mode 100644
index 0000000000000000000000000000000000000000..4dafa3c6ce23df2b8e48a376de1b92c8e7630c8b
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/auth/x509.js
@@ -0,0 +1,35 @@
+'use strict';
+const AuthProvider = require('./auth_provider').AuthProvider;
+
+class X509 extends AuthProvider {
+  prepare(handshakeDoc, authContext, callback) {
+    const credentials = authContext.credentials;
+    Object.assign(handshakeDoc, {
+      speculativeAuthenticate: x509AuthenticateCommand(credentials)
+    });
+
+    callback(undefined, handshakeDoc);
+  }
+
+  auth(authContext, callback) {
+    const connection = authContext.connection;
+    const credentials = authContext.credentials;
+    const response = authContext.response;
+    if (response.speculativeAuthenticate) {
+      return callback();
+    }
+
+    connection.command('$external.$cmd', x509AuthenticateCommand(credentials), callback);
+  }
+}
+
+function x509AuthenticateCommand(credentials) {
+  const command = { authenticate: 1, mechanism: 'MONGODB-X509' };
+  if (credentials.username) {
+    Object.assign(command, { user: credentials.username });
+  }
+
+  return command;
+}
+
+module.exports = X509;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/apm.js b/NodeAPI/node_modules/mongodb/lib/core/connection/apm.js
new file mode 100644
index 0000000000000000000000000000000000000000..1acf22cb7abeca2f1fba321c2707ed13c211cc00
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/apm.js
@@ -0,0 +1,251 @@
+'use strict';
+const Msg = require('../connection/msg').Msg;
+const KillCursor = require('../connection/commands').KillCursor;
+const GetMore = require('../connection/commands').GetMore;
+const calculateDurationInMs = require('../../utils').calculateDurationInMs;
+
+/** Commands that we want to redact because of the sensitive nature of their contents */
+const SENSITIVE_COMMANDS = new Set([
+  'authenticate',
+  'saslStart',
+  'saslContinue',
+  'getnonce',
+  'createUser',
+  'updateUser',
+  'copydbgetnonce',
+  'copydbsaslstart',
+  'copydb'
+]);
+
+// helper methods
+const extractCommandName = commandDoc => Object.keys(commandDoc)[0];
+const namespace = command => command.ns;
+const databaseName = command => command.ns.split('.')[0];
+const collectionName = command => command.ns.split('.')[1];
+const generateConnectionId = pool =>
+  pool.options ? `${pool.options.host}:${pool.options.port}` : pool.address;
+const maybeRedact = (commandName, result) => (SENSITIVE_COMMANDS.has(commandName) ? {} : result);
+const isLegacyPool = pool => pool.s && pool.queue;
+
+const LEGACY_FIND_QUERY_MAP = {
+  $query: 'filter',
+  $orderby: 'sort',
+  $hint: 'hint',
+  $comment: 'comment',
+  $maxScan: 'maxScan',
+  $max: 'max',
+  $min: 'min',
+  $returnKey: 'returnKey',
+  $showDiskLoc: 'showRecordId',
+  $maxTimeMS: 'maxTimeMS',
+  $snapshot: 'snapshot'
+};
+
+const LEGACY_FIND_OPTIONS_MAP = {
+  numberToSkip: 'skip',
+  numberToReturn: 'batchSize',
+  returnFieldsSelector: 'projection'
+};
+
+const OP_QUERY_KEYS = [
+  'tailable',
+  'oplogReplay',
+  'noCursorTimeout',
+  'awaitData',
+  'partial',
+  'exhaust'
+];
+
+/**
+ * Extract the actual command from the query, possibly upconverting if it's a legacy
+ * format
+ *
+ * @param {Object} command the command
+ */
+const extractCommand = command => {
+  if (command instanceof GetMore) {
+    return {
+      getMore: command.cursorId,
+      collection: collectionName(command),
+      batchSize: command.numberToReturn
+    };
+  }
+
+  if (command instanceof KillCursor) {
+    return {
+      killCursors: collectionName(command),
+      cursors: command.cursorIds
+    };
+  }
+
+  if (command instanceof Msg) {
+    return command.command;
+  }
+
+  if (command.query && command.query.$query) {
+    let result;
+    if (command.ns === 'admin.$cmd') {
+      // upconvert legacy command
+      result = Object.assign({}, command.query.$query);
+    } else {
+      // upconvert legacy find command
+      result = { find: collectionName(command) };
+      Object.keys(LEGACY_FIND_QUERY_MAP).forEach(key => {
+        if (typeof command.query[key] !== 'undefined')
+          result[LEGACY_FIND_QUERY_MAP[key]] = command.query[key];
+      });
+    }
+
+    Object.keys(LEGACY_FIND_OPTIONS_MAP).forEach(key => {
+      if (typeof command[key] !== 'undefined') result[LEGACY_FIND_OPTIONS_MAP[key]] = command[key];
+    });
+
+    OP_QUERY_KEYS.forEach(key => {
+      if (command[key]) result[key] = command[key];
+    });
+
+    if (typeof command.pre32Limit !== 'undefined') {
+      result.limit = command.pre32Limit;
+    }
+
+    if (command.query.$explain) {
+      return { explain: result };
+    }
+
+    return result;
+  }
+
+  return command.query ? command.query : command;
+};
+
+const extractReply = (command, reply) => {
+  if (command instanceof GetMore) {
+    return {
+      ok: 1,
+      cursor: {
+        id: reply.message.cursorId,
+        ns: namespace(command),
+        nextBatch: reply.message.documents
+      }
+    };
+  }
+
+  if (command instanceof KillCursor) {
+    return {
+      ok: 1,
+      cursorsUnknown: command.cursorIds
+    };
+  }
+
+  // is this a legacy find command?
+  if (command.query && typeof command.query.$query !== 'undefined') {
+    return {
+      ok: 1,
+      cursor: {
+        id: reply.message.cursorId,
+        ns: namespace(command),
+        firstBatch: reply.message.documents
+      }
+    };
+  }
+
+  return reply && reply.result ? reply.result : reply;
+};
+
+const extractConnectionDetails = pool => {
+  if (isLegacyPool(pool)) {
+    return {
+      connectionId: generateConnectionId(pool)
+    };
+  }
+
+  // APM in the modern pool is done at the `Connection` level, so we rename it here for
+  // readability.
+  const connection = pool;
+  return {
+    address: connection.address,
+    connectionId: connection.id
+  };
+};
+
+/** An event indicating the start of a given command */
+class CommandStartedEvent {
+  /**
+   * Create a started event
+   *
+   * @param {Pool} pool the pool that originated the command
+   * @param {Object} command the command
+   */
+  constructor(pool, command) {
+    const cmd = extractCommand(command);
+    const commandName = extractCommandName(cmd);
+    const connectionDetails = extractConnectionDetails(pool);
+
+    // NOTE: remove in major revision, this is not spec behavior
+    if (SENSITIVE_COMMANDS.has(commandName)) {
+      this.commandObj = {};
+      this.commandObj[commandName] = true;
+    }
+
+    Object.assign(this, connectionDetails, {
+      requestId: command.requestId,
+      databaseName: databaseName(command),
+      commandName,
+      command: cmd
+    });
+  }
+}
+
+/** An event indicating the success of a given command */
+class CommandSucceededEvent {
+  /**
+   * Create a succeeded event
+   *
+   * @param {Pool} pool the pool that originated the command
+   * @param {Object} command the command
+   * @param {Object} reply the reply for this command from the server
+   * @param {Array} started a high resolution tuple timestamp of when the command was first sent, to calculate duration
+   */
+  constructor(pool, command, reply, started) {
+    const cmd = extractCommand(command);
+    const commandName = extractCommandName(cmd);
+    const connectionDetails = extractConnectionDetails(pool);
+
+    Object.assign(this, connectionDetails, {
+      requestId: command.requestId,
+      commandName,
+      duration: calculateDurationInMs(started),
+      reply: maybeRedact(commandName, extractReply(command, reply))
+    });
+  }
+}
+
+/** An event indicating the failure of a given command */
+class CommandFailedEvent {
+  /**
+   * Create a failure event
+   *
+   * @param {Pool} pool the pool that originated the command
+   * @param {Object} command the command
+   * @param {MongoError|Object} error the generated error or a server error response
+   * @param {Array} started a high resolution tuple timestamp of when the command was first sent, to calculate duration
+   */
+  constructor(pool, command, error, started) {
+    const cmd = extractCommand(command);
+    const commandName = extractCommandName(cmd);
+    const connectionDetails = extractConnectionDetails(pool);
+
+    Object.assign(this, connectionDetails, {
+      requestId: command.requestId,
+      commandName,
+      duration: calculateDurationInMs(started),
+      failure: maybeRedact(commandName, error)
+    });
+  }
+}
+
+module.exports = {
+  CommandStartedEvent,
+  CommandSucceededEvent,
+  CommandFailedEvent
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/command_result.js b/NodeAPI/node_modules/mongodb/lib/core/connection/command_result.js
new file mode 100644
index 0000000000000000000000000000000000000000..762aa3f17b42b10e35b260061ee3320a9c6d6a70
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/command_result.js
@@ -0,0 +1,36 @@
+'use strict';
+
+/**
+ * Creates a new CommandResult instance
+ * @class
+ * @param {object} result CommandResult object
+ * @param {Connection} connection A connection instance associated with this result
+ * @return {CommandResult} A cursor instance
+ */
+var CommandResult = function(result, connection, message) {
+  this.result = result;
+  this.connection = connection;
+  this.message = message;
+};
+
+/**
+ * Convert CommandResult to JSON
+ * @method
+ * @return {object}
+ */
+CommandResult.prototype.toJSON = function() {
+  let result = Object.assign({}, this, this.result);
+  delete result.message;
+  return result;
+};
+
+/**
+ * Convert CommandResult to String representation
+ * @method
+ * @return {string}
+ */
+CommandResult.prototype.toString = function() {
+  return JSON.stringify(this.toJSON());
+};
+
+module.exports = CommandResult;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/commands.js b/NodeAPI/node_modules/mongodb/lib/core/connection/commands.js
new file mode 100644
index 0000000000000000000000000000000000000000..b24ff8481c4cfd2bf96e52d41673977a4c5e98d5
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/commands.js
@@ -0,0 +1,507 @@
+'use strict';
+
+var retrieveBSON = require('./utils').retrieveBSON;
+var BSON = retrieveBSON();
+var Long = BSON.Long;
+const Buffer = require('safe-buffer').Buffer;
+
+// Incrementing request id
+var _requestId = 0;
+
+// Wire command operation ids
+var opcodes = require('../wireprotocol/shared').opcodes;
+
+// Query flags
+var OPTS_TAILABLE_CURSOR = 2;
+var OPTS_SLAVE = 4;
+var OPTS_OPLOG_REPLAY = 8;
+var OPTS_NO_CURSOR_TIMEOUT = 16;
+var OPTS_AWAIT_DATA = 32;
+var OPTS_EXHAUST = 64;
+var OPTS_PARTIAL = 128;
+
+// Response flags
+var CURSOR_NOT_FOUND = 1;
+var QUERY_FAILURE = 2;
+var SHARD_CONFIG_STALE = 4;
+var AWAIT_CAPABLE = 8;
+
+/**************************************************************
+ * QUERY
+ **************************************************************/
+var Query = function(bson, ns, query, options) {
+  var self = this;
+  // Basic options needed to be passed in
+  if (ns == null) throw new Error('ns must be specified for query');
+  if (query == null) throw new Error('query must be specified for query');
+
+  // Validate that we are not passing 0x00 in the collection name
+  if (ns.indexOf('\x00') !== -1) {
+    throw new Error('namespace cannot contain a null character');
+  }
+
+  // Basic options
+  this.bson = bson;
+  this.ns = ns;
+  this.query = query;
+
+  // Additional options
+  this.numberToSkip = options.numberToSkip || 0;
+  this.numberToReturn = options.numberToReturn || 0;
+  this.returnFieldSelector = options.returnFieldSelector || null;
+  this.requestId = Query.getRequestId();
+
+  // special case for pre-3.2 find commands, delete ASAP
+  this.pre32Limit = options.pre32Limit;
+
+  // Serialization option
+  this.serializeFunctions =
+    typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+  this.ignoreUndefined =
+    typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false;
+  this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16;
+  this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : true;
+  this.batchSize = self.numberToReturn;
+
+  // Flags
+  this.tailable = false;
+  this.slaveOk = typeof options.slaveOk === 'boolean' ? options.slaveOk : false;
+  this.oplogReplay = false;
+  this.noCursorTimeout = false;
+  this.awaitData = false;
+  this.exhaust = false;
+  this.partial = false;
+};
+
+//
+// Assign a new request Id
+Query.prototype.incRequestId = function() {
+  this.requestId = _requestId++;
+};
+
+//
+// Assign a new request Id
+Query.nextRequestId = function() {
+  return _requestId + 1;
+};
+
+//
+// Uses a single allocated buffer for the process, avoiding multiple memory allocations
+Query.prototype.toBin = function() {
+  var self = this;
+  var buffers = [];
+  var projection = null;
+
+  // Set up the flags
+  var flags = 0;
+  if (this.tailable) {
+    flags |= OPTS_TAILABLE_CURSOR;
+  }
+
+  if (this.slaveOk) {
+    flags |= OPTS_SLAVE;
+  }
+
+  if (this.oplogReplay) {
+    flags |= OPTS_OPLOG_REPLAY;
+  }
+
+  if (this.noCursorTimeout) {
+    flags |= OPTS_NO_CURSOR_TIMEOUT;
+  }
+
+  if (this.awaitData) {
+    flags |= OPTS_AWAIT_DATA;
+  }
+
+  if (this.exhaust) {
+    flags |= OPTS_EXHAUST;
+  }
+
+  if (this.partial) {
+    flags |= OPTS_PARTIAL;
+  }
+
+  // If batchSize is different to self.numberToReturn
+  if (self.batchSize !== self.numberToReturn) self.numberToReturn = self.batchSize;
+
+  // Allocate write protocol header buffer
+  var header = Buffer.alloc(
+    4 * 4 + // Header
+    4 + // Flags
+    Buffer.byteLength(self.ns) +
+    1 + // namespace
+    4 + // numberToSkip
+      4 // numberToReturn
+  );
+
+  // Add header to buffers
+  buffers.push(header);
+
+  // Serialize the query
+  var query = self.bson.serialize(this.query, {
+    checkKeys: this.checkKeys,
+    serializeFunctions: this.serializeFunctions,
+    ignoreUndefined: this.ignoreUndefined
+  });
+
+  // Add query document
+  buffers.push(query);
+
+  if (self.returnFieldSelector && Object.keys(self.returnFieldSelector).length > 0) {
+    // Serialize the projection document
+    projection = self.bson.serialize(this.returnFieldSelector, {
+      checkKeys: this.checkKeys,
+      serializeFunctions: this.serializeFunctions,
+      ignoreUndefined: this.ignoreUndefined
+    });
+    // Add projection document
+    buffers.push(projection);
+  }
+
+  // Total message size
+  var totalLength = header.length + query.length + (projection ? projection.length : 0);
+
+  // Set up the index
+  var index = 4;
+
+  // Write total document length
+  header[3] = (totalLength >> 24) & 0xff;
+  header[2] = (totalLength >> 16) & 0xff;
+  header[1] = (totalLength >> 8) & 0xff;
+  header[0] = totalLength & 0xff;
+
+  // Write header information requestId
+  header[index + 3] = (this.requestId >> 24) & 0xff;
+  header[index + 2] = (this.requestId >> 16) & 0xff;
+  header[index + 1] = (this.requestId >> 8) & 0xff;
+  header[index] = this.requestId & 0xff;
+  index = index + 4;
+
+  // Write header information responseTo
+  header[index + 3] = (0 >> 24) & 0xff;
+  header[index + 2] = (0 >> 16) & 0xff;
+  header[index + 1] = (0 >> 8) & 0xff;
+  header[index] = 0 & 0xff;
+  index = index + 4;
+
+  // Write header information OP_QUERY
+  header[index + 3] = (opcodes.OP_QUERY >> 24) & 0xff;
+  header[index + 2] = (opcodes.OP_QUERY >> 16) & 0xff;
+  header[index + 1] = (opcodes.OP_QUERY >> 8) & 0xff;
+  header[index] = opcodes.OP_QUERY & 0xff;
+  index = index + 4;
+
+  // Write header information flags
+  header[index + 3] = (flags >> 24) & 0xff;
+  header[index + 2] = (flags >> 16) & 0xff;
+  header[index + 1] = (flags >> 8) & 0xff;
+  header[index] = flags & 0xff;
+  index = index + 4;
+
+  // Write collection name
+  index = index + header.write(this.ns, index, 'utf8') + 1;
+  header[index - 1] = 0;
+
+  // Write header information flags numberToSkip
+  header[index + 3] = (this.numberToSkip >> 24) & 0xff;
+  header[index + 2] = (this.numberToSkip >> 16) & 0xff;
+  header[index + 1] = (this.numberToSkip >> 8) & 0xff;
+  header[index] = this.numberToSkip & 0xff;
+  index = index + 4;
+
+  // Write header information flags numberToReturn
+  header[index + 3] = (this.numberToReturn >> 24) & 0xff;
+  header[index + 2] = (this.numberToReturn >> 16) & 0xff;
+  header[index + 1] = (this.numberToReturn >> 8) & 0xff;
+  header[index] = this.numberToReturn & 0xff;
+  index = index + 4;
+
+  // Return the buffers
+  return buffers;
+};
+
+Query.getRequestId = function() {
+  return ++_requestId;
+};
+
+/**************************************************************
+ * GETMORE
+ **************************************************************/
+var GetMore = function(bson, ns, cursorId, opts) {
+  opts = opts || {};
+  this.numberToReturn = opts.numberToReturn || 0;
+  this.requestId = _requestId++;
+  this.bson = bson;
+  this.ns = ns;
+  this.cursorId = cursorId;
+};
+
+//
+// Uses a single allocated buffer for the process, avoiding multiple memory allocations
+GetMore.prototype.toBin = function() {
+  var length = 4 + Buffer.byteLength(this.ns) + 1 + 4 + 8 + 4 * 4;
+  // Create command buffer
+  var index = 0;
+  // Allocate buffer
+  var _buffer = Buffer.alloc(length);
+
+  // Write header information
+  // index = write32bit(index, _buffer, length);
+  _buffer[index + 3] = (length >> 24) & 0xff;
+  _buffer[index + 2] = (length >> 16) & 0xff;
+  _buffer[index + 1] = (length >> 8) & 0xff;
+  _buffer[index] = length & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, requestId);
+  _buffer[index + 3] = (this.requestId >> 24) & 0xff;
+  _buffer[index + 2] = (this.requestId >> 16) & 0xff;
+  _buffer[index + 1] = (this.requestId >> 8) & 0xff;
+  _buffer[index] = this.requestId & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, 0);
+  _buffer[index + 3] = (0 >> 24) & 0xff;
+  _buffer[index + 2] = (0 >> 16) & 0xff;
+  _buffer[index + 1] = (0 >> 8) & 0xff;
+  _buffer[index] = 0 & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, OP_GETMORE);
+  _buffer[index + 3] = (opcodes.OP_GETMORE >> 24) & 0xff;
+  _buffer[index + 2] = (opcodes.OP_GETMORE >> 16) & 0xff;
+  _buffer[index + 1] = (opcodes.OP_GETMORE >> 8) & 0xff;
+  _buffer[index] = opcodes.OP_GETMORE & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, 0);
+  _buffer[index + 3] = (0 >> 24) & 0xff;
+  _buffer[index + 2] = (0 >> 16) & 0xff;
+  _buffer[index + 1] = (0 >> 8) & 0xff;
+  _buffer[index] = 0 & 0xff;
+  index = index + 4;
+
+  // Write collection name
+  index = index + _buffer.write(this.ns, index, 'utf8') + 1;
+  _buffer[index - 1] = 0;
+
+  // Write batch size
+  // index = write32bit(index, _buffer, numberToReturn);
+  _buffer[index + 3] = (this.numberToReturn >> 24) & 0xff;
+  _buffer[index + 2] = (this.numberToReturn >> 16) & 0xff;
+  _buffer[index + 1] = (this.numberToReturn >> 8) & 0xff;
+  _buffer[index] = this.numberToReturn & 0xff;
+  index = index + 4;
+
+  // Write cursor id
+  // index = write32bit(index, _buffer, cursorId.getLowBits());
+  _buffer[index + 3] = (this.cursorId.getLowBits() >> 24) & 0xff;
+  _buffer[index + 2] = (this.cursorId.getLowBits() >> 16) & 0xff;
+  _buffer[index + 1] = (this.cursorId.getLowBits() >> 8) & 0xff;
+  _buffer[index] = this.cursorId.getLowBits() & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, cursorId.getHighBits());
+  _buffer[index + 3] = (this.cursorId.getHighBits() >> 24) & 0xff;
+  _buffer[index + 2] = (this.cursorId.getHighBits() >> 16) & 0xff;
+  _buffer[index + 1] = (this.cursorId.getHighBits() >> 8) & 0xff;
+  _buffer[index] = this.cursorId.getHighBits() & 0xff;
+  index = index + 4;
+
+  // Return buffer
+  return _buffer;
+};
+
+/**************************************************************
+ * KILLCURSOR
+ **************************************************************/
+var KillCursor = function(bson, ns, cursorIds) {
+  this.ns = ns;
+  this.requestId = _requestId++;
+  this.cursorIds = cursorIds;
+};
+
+//
+// Uses a single allocated buffer for the process, avoiding multiple memory allocations
+KillCursor.prototype.toBin = function() {
+  var length = 4 + 4 + 4 * 4 + this.cursorIds.length * 8;
+
+  // Create command buffer
+  var index = 0;
+  var _buffer = Buffer.alloc(length);
+
+  // Write header information
+  // index = write32bit(index, _buffer, length);
+  _buffer[index + 3] = (length >> 24) & 0xff;
+  _buffer[index + 2] = (length >> 16) & 0xff;
+  _buffer[index + 1] = (length >> 8) & 0xff;
+  _buffer[index] = length & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, requestId);
+  _buffer[index + 3] = (this.requestId >> 24) & 0xff;
+  _buffer[index + 2] = (this.requestId >> 16) & 0xff;
+  _buffer[index + 1] = (this.requestId >> 8) & 0xff;
+  _buffer[index] = this.requestId & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, 0);
+  _buffer[index + 3] = (0 >> 24) & 0xff;
+  _buffer[index + 2] = (0 >> 16) & 0xff;
+  _buffer[index + 1] = (0 >> 8) & 0xff;
+  _buffer[index] = 0 & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, OP_KILL_CURSORS);
+  _buffer[index + 3] = (opcodes.OP_KILL_CURSORS >> 24) & 0xff;
+  _buffer[index + 2] = (opcodes.OP_KILL_CURSORS >> 16) & 0xff;
+  _buffer[index + 1] = (opcodes.OP_KILL_CURSORS >> 8) & 0xff;
+  _buffer[index] = opcodes.OP_KILL_CURSORS & 0xff;
+  index = index + 4;
+
+  // index = write32bit(index, _buffer, 0);
+  _buffer[index + 3] = (0 >> 24) & 0xff;
+  _buffer[index + 2] = (0 >> 16) & 0xff;
+  _buffer[index + 1] = (0 >> 8) & 0xff;
+  _buffer[index] = 0 & 0xff;
+  index = index + 4;
+
+  // Write batch size
+  // index = write32bit(index, _buffer, this.cursorIds.length);
+  _buffer[index + 3] = (this.cursorIds.length >> 24) & 0xff;
+  _buffer[index + 2] = (this.cursorIds.length >> 16) & 0xff;
+  _buffer[index + 1] = (this.cursorIds.length >> 8) & 0xff;
+  _buffer[index] = this.cursorIds.length & 0xff;
+  index = index + 4;
+
+  // Write all the cursor ids into the array
+  for (var i = 0; i < this.cursorIds.length; i++) {
+    // Write cursor id
+    // index = write32bit(index, _buffer, cursorIds[i].getLowBits());
+    _buffer[index + 3] = (this.cursorIds[i].getLowBits() >> 24) & 0xff;
+    _buffer[index + 2] = (this.cursorIds[i].getLowBits() >> 16) & 0xff;
+    _buffer[index + 1] = (this.cursorIds[i].getLowBits() >> 8) & 0xff;
+    _buffer[index] = this.cursorIds[i].getLowBits() & 0xff;
+    index = index + 4;
+
+    // index = write32bit(index, _buffer, cursorIds[i].getHighBits());
+    _buffer[index + 3] = (this.cursorIds[i].getHighBits() >> 24) & 0xff;
+    _buffer[index + 2] = (this.cursorIds[i].getHighBits() >> 16) & 0xff;
+    _buffer[index + 1] = (this.cursorIds[i].getHighBits() >> 8) & 0xff;
+    _buffer[index] = this.cursorIds[i].getHighBits() & 0xff;
+    index = index + 4;
+  }
+
+  // Return buffer
+  return _buffer;
+};
+
+var Response = function(bson, message, msgHeader, msgBody, opts) {
+  opts = opts || { promoteLongs: true, promoteValues: true, promoteBuffers: false };
+  this.parsed = false;
+  this.raw = message;
+  this.data = msgBody;
+  this.bson = bson;
+  this.opts = opts;
+
+  // Read the message header
+  this.length = msgHeader.length;
+  this.requestId = msgHeader.requestId;
+  this.responseTo = msgHeader.responseTo;
+  this.opCode = msgHeader.opCode;
+  this.fromCompressed = msgHeader.fromCompressed;
+
+  // Read the message body
+  this.responseFlags = msgBody.readInt32LE(0);
+  this.cursorId = new Long(msgBody.readInt32LE(4), msgBody.readInt32LE(8));
+  this.startingFrom = msgBody.readInt32LE(12);
+  this.numberReturned = msgBody.readInt32LE(16);
+
+  // Preallocate document array
+  this.documents = new Array(this.numberReturned);
+
+  // Flag values
+  this.cursorNotFound = (this.responseFlags & CURSOR_NOT_FOUND) !== 0;
+  this.queryFailure = (this.responseFlags & QUERY_FAILURE) !== 0;
+  this.shardConfigStale = (this.responseFlags & SHARD_CONFIG_STALE) !== 0;
+  this.awaitCapable = (this.responseFlags & AWAIT_CAPABLE) !== 0;
+  this.promoteLongs = typeof opts.promoteLongs === 'boolean' ? opts.promoteLongs : true;
+  this.promoteValues = typeof opts.promoteValues === 'boolean' ? opts.promoteValues : true;
+  this.promoteBuffers = typeof opts.promoteBuffers === 'boolean' ? opts.promoteBuffers : false;
+};
+
+Response.prototype.isParsed = function() {
+  return this.parsed;
+};
+
+Response.prototype.parse = function(options) {
+  // Don't parse again if not needed
+  if (this.parsed) return;
+  options = options || {};
+
+  // Allow the return of raw documents instead of parsing
+  var raw = options.raw || false;
+  var documentsReturnedIn = options.documentsReturnedIn || null;
+  var promoteLongs =
+    typeof options.promoteLongs === 'boolean' ? options.promoteLongs : this.opts.promoteLongs;
+  var promoteValues =
+    typeof options.promoteValues === 'boolean' ? options.promoteValues : this.opts.promoteValues;
+  var promoteBuffers =
+    typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : this.opts.promoteBuffers;
+  var bsonSize, _options;
+
+  // Set up the options
+  _options = {
+    promoteLongs: promoteLongs,
+    promoteValues: promoteValues,
+    promoteBuffers: promoteBuffers
+  };
+
+  // Position within OP_REPLY at which documents start
+  // (See https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#wire-op-reply)
+  this.index = 20;
+
+  //
+  // Parse Body
+  //
+  for (var i = 0; i < this.numberReturned; i++) {
+    bsonSize =
+      this.data[this.index] |
+      (this.data[this.index + 1] << 8) |
+      (this.data[this.index + 2] << 16) |
+      (this.data[this.index + 3] << 24);
+
+    // If we have raw results specified slice the return document
+    if (raw) {
+      this.documents[i] = this.data.slice(this.index, this.index + bsonSize);
+    } else {
+      this.documents[i] = this.bson.deserialize(
+        this.data.slice(this.index, this.index + bsonSize),
+        _options
+      );
+    }
+
+    // Adjust the index
+    this.index = this.index + bsonSize;
+  }
+
+  if (this.documents.length === 1 && documentsReturnedIn != null && raw) {
+    const fieldsAsRaw = {};
+    fieldsAsRaw[documentsReturnedIn] = true;
+    _options.fieldsAsRaw = fieldsAsRaw;
+
+    const doc = this.bson.deserialize(this.documents[0], _options);
+    this.documents = [doc];
+  }
+
+  // Set parsed
+  this.parsed = true;
+};
+
+module.exports = {
+  Query: Query,
+  GetMore: GetMore,
+  Response: Response,
+  KillCursor: KillCursor
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/connect.js b/NodeAPI/node_modules/mongodb/lib/core/connection/connect.js
new file mode 100644
index 0000000000000000000000000000000000000000..bd10535466eb9427c9ad3b4b4fee44819966dcf1
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/connect.js
@@ -0,0 +1,352 @@
+'use strict';
+const net = require('net');
+const tls = require('tls');
+const Connection = require('./connection');
+const MongoError = require('../error').MongoError;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const MongoNetworkTimeoutError = require('../error').MongoNetworkTimeoutError;
+const defaultAuthProviders = require('../auth/defaultAuthProviders').defaultAuthProviders;
+const AuthContext = require('../auth/auth_provider').AuthContext;
+const WIRE_CONSTANTS = require('../wireprotocol/constants');
+const makeClientMetadata = require('../utils').makeClientMetadata;
+const MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION;
+const MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION;
+const MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION;
+const MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION;
+let AUTH_PROVIDERS;
+
+function connect(options, cancellationToken, callback) {
+  if (typeof cancellationToken === 'function') {
+    callback = cancellationToken;
+    cancellationToken = undefined;
+  }
+
+  const ConnectionType = options && options.connectionType ? options.connectionType : Connection;
+  if (AUTH_PROVIDERS == null) {
+    AUTH_PROVIDERS = defaultAuthProviders(options.bson);
+  }
+
+  const family = options.family !== void 0 ? options.family : 0;
+  makeConnection(family, options, cancellationToken, (err, socket) => {
+    if (err) {
+      callback(err, socket); // in the error case, `socket` is the originating error event name
+      return;
+    }
+
+    performInitialHandshake(new ConnectionType(socket, options), options, callback);
+  });
+}
+
+function isModernConnectionType(conn) {
+  return !(conn instanceof Connection);
+}
+
+function checkSupportedServer(ismaster, options) {
+  const serverVersionHighEnough =
+    ismaster &&
+    typeof ismaster.maxWireVersion === 'number' &&
+    ismaster.maxWireVersion >= MIN_SUPPORTED_WIRE_VERSION;
+  const serverVersionLowEnough =
+    ismaster &&
+    typeof ismaster.minWireVersion === 'number' &&
+    ismaster.minWireVersion <= MAX_SUPPORTED_WIRE_VERSION;
+
+  if (serverVersionHighEnough) {
+    if (serverVersionLowEnough) {
+      return null;
+    }
+
+    const message = `Server at ${options.host}:${options.port} reports minimum wire version ${ismaster.minWireVersion}, but this version of the Node.js Driver requires at most ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`;
+    return new MongoError(message);
+  }
+
+  const message = `Server at ${options.host}:${
+    options.port
+  } reports maximum wire version ${ismaster.maxWireVersion ||
+    0}, but this version of the Node.js Driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION})`;
+  return new MongoError(message);
+}
+
+function performInitialHandshake(conn, options, _callback) {
+  const callback = function(err, ret) {
+    if (err && conn) {
+      conn.destroy();
+    }
+    _callback(err, ret);
+  };
+
+  const credentials = options.credentials;
+  if (credentials) {
+    if (!credentials.mechanism.match(/DEFAULT/i) && !AUTH_PROVIDERS[credentials.mechanism]) {
+      callback(new MongoError(`authMechanism '${credentials.mechanism}' not supported`));
+      return;
+    }
+  }
+
+  const authContext = new AuthContext(conn, credentials, options);
+  prepareHandshakeDocument(authContext, (err, handshakeDoc) => {
+    if (err) {
+      return callback(err);
+    }
+
+    const handshakeOptions = Object.assign({}, options);
+    if (options.connectTimeoutMS || options.connectionTimeout) {
+      // The handshake technically is a monitoring check, so its socket timeout should be connectTimeoutMS
+      handshakeOptions.socketTimeout = options.connectTimeoutMS || options.connectionTimeout;
+    }
+
+    const start = new Date().getTime();
+    conn.command('admin.$cmd', handshakeDoc, handshakeOptions, (err, result) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      const response = result.result;
+      if (response.ok === 0) {
+        callback(new MongoError(response));
+        return;
+      }
+
+      const supportedServerErr = checkSupportedServer(response, options);
+      if (supportedServerErr) {
+        callback(supportedServerErr);
+        return;
+      }
+
+      if (!isModernConnectionType(conn)) {
+        // resolve compression
+        if (response.compression) {
+          const agreedCompressors = handshakeDoc.compression.filter(
+            compressor => response.compression.indexOf(compressor) !== -1
+          );
+
+          if (agreedCompressors.length) {
+            conn.agreedCompressor = agreedCompressors[0];
+          }
+
+          if (options.compression && options.compression.zlibCompressionLevel) {
+            conn.zlibCompressionLevel = options.compression.zlibCompressionLevel;
+          }
+        }
+      }
+
+      // NOTE: This is metadata attached to the connection while porting away from
+      //       handshake being done in the `Server` class. Likely, it should be
+      //       relocated, or at very least restructured.
+      conn.ismaster = response;
+      conn.lastIsMasterMS = new Date().getTime() - start;
+
+      if (!response.arbiterOnly && credentials) {
+        // store the response on auth context
+        Object.assign(authContext, { response });
+
+        const resolvedCredentials = credentials.resolveAuthMechanism(response);
+        const authProvider = AUTH_PROVIDERS[resolvedCredentials.mechanism];
+        authProvider.auth(authContext, err => {
+          if (err) return callback(err);
+          callback(undefined, conn);
+        });
+
+        return;
+      }
+
+      callback(undefined, conn);
+    });
+  });
+}
+
+function prepareHandshakeDocument(authContext, callback) {
+  const options = authContext.options;
+  const compressors =
+    options.compression && options.compression.compressors ? options.compression.compressors : [];
+
+  const handshakeDoc = {
+    ismaster: true,
+    client: options.metadata || makeClientMetadata(options),
+    compression: compressors
+  };
+
+  const credentials = authContext.credentials;
+  if (credentials) {
+    if (credentials.mechanism.match(/DEFAULT/i) && credentials.username) {
+      Object.assign(handshakeDoc, {
+        saslSupportedMechs: `${credentials.source}.${credentials.username}`
+      });
+
+      AUTH_PROVIDERS['scram-sha-256'].prepare(handshakeDoc, authContext, callback);
+      return;
+    }
+
+    const authProvider = AUTH_PROVIDERS[credentials.mechanism];
+    authProvider.prepare(handshakeDoc, authContext, callback);
+    return;
+  }
+
+  callback(undefined, handshakeDoc);
+}
+
+const LEGAL_SSL_SOCKET_OPTIONS = [
+  'pfx',
+  'key',
+  'passphrase',
+  'cert',
+  'ca',
+  'ciphers',
+  'NPNProtocols',
+  'ALPNProtocols',
+  'servername',
+  'ecdhCurve',
+  'secureProtocol',
+  'secureContext',
+  'session',
+  'minDHSize',
+  'crl',
+  'rejectUnauthorized'
+];
+
+function parseConnectOptions(family, options) {
+  const host = typeof options.host === 'string' ? options.host : 'localhost';
+  if (host.indexOf('/') !== -1) {
+    return { path: host };
+  }
+
+  const result = {
+    family,
+    host,
+    port: typeof options.port === 'number' ? options.port : 27017,
+    rejectUnauthorized: false
+  };
+
+  return result;
+}
+
+function parseSslOptions(family, options) {
+  const result = parseConnectOptions(family, options);
+
+  // Merge in valid SSL options
+  for (const name in options) {
+    if (options[name] != null && LEGAL_SSL_SOCKET_OPTIONS.indexOf(name) !== -1) {
+      result[name] = options[name];
+    }
+  }
+
+  // Override checkServerIdentity behavior
+  if (options.checkServerIdentity === false) {
+    // Skip the identiy check by retuning undefined as per node documents
+    // https://nodejs.org/api/tls.html#tls_tls_connect_options_callback
+    result.checkServerIdentity = function() {
+      return undefined;
+    };
+  } else if (typeof options.checkServerIdentity === 'function') {
+    result.checkServerIdentity = options.checkServerIdentity;
+  }
+
+  // Set default sni servername to be the same as host
+  if (result.servername == null && !net.isIP(result.host)) {
+    result.servername = result.host;
+  }
+
+  return result;
+}
+
+const SOCKET_ERROR_EVENTS = new Set(['error', 'close', 'timeout', 'parseError']);
+function makeConnection(family, options, cancellationToken, _callback) {
+  const useSsl = typeof options.ssl === 'boolean' ? options.ssl : false;
+  const keepAlive = typeof options.keepAlive === 'boolean' ? options.keepAlive : true;
+  let keepAliveInitialDelay =
+    typeof options.keepAliveInitialDelay === 'number' ? options.keepAliveInitialDelay : 120000;
+  const noDelay = typeof options.noDelay === 'boolean' ? options.noDelay : true;
+  const connectionTimeout =
+    typeof options.connectionTimeout === 'number'
+      ? options.connectionTimeout
+      : typeof options.connectTimeoutMS === 'number'
+      ? options.connectTimeoutMS
+      : 30000;
+  const socketTimeout = typeof options.socketTimeout === 'number' ? options.socketTimeout : 0;
+  const rejectUnauthorized =
+    typeof options.rejectUnauthorized === 'boolean' ? options.rejectUnauthorized : true;
+
+  if (keepAliveInitialDelay > socketTimeout) {
+    keepAliveInitialDelay = Math.round(socketTimeout / 2);
+  }
+
+  let socket;
+  const callback = function(err, ret) {
+    if (err && socket) {
+      socket.destroy();
+    }
+
+    _callback(err, ret);
+  };
+
+  try {
+    if (useSsl) {
+      socket = tls.connect(parseSslOptions(family, options));
+      if (typeof socket.disableRenegotiation === 'function') {
+        socket.disableRenegotiation();
+      }
+    } else {
+      socket = net.createConnection(parseConnectOptions(family, options));
+    }
+  } catch (err) {
+    return callback(err);
+  }
+
+  socket.setKeepAlive(keepAlive, keepAliveInitialDelay);
+  socket.setTimeout(connectionTimeout);
+  socket.setNoDelay(noDelay);
+
+  const connectEvent = useSsl ? 'secureConnect' : 'connect';
+  let cancellationHandler;
+  function errorHandler(eventName) {
+    return err => {
+      SOCKET_ERROR_EVENTS.forEach(event => socket.removeAllListeners(event));
+      if (cancellationHandler) {
+        cancellationToken.removeListener('cancel', cancellationHandler);
+      }
+
+      socket.removeListener(connectEvent, connectHandler);
+      callback(connectionFailureError(eventName, err));
+    };
+  }
+
+  function connectHandler() {
+    SOCKET_ERROR_EVENTS.forEach(event => socket.removeAllListeners(event));
+    if (cancellationHandler) {
+      cancellationToken.removeListener('cancel', cancellationHandler);
+    }
+
+    if (socket.authorizationError && rejectUnauthorized) {
+      return callback(socket.authorizationError);
+    }
+
+    socket.setTimeout(socketTimeout);
+    callback(null, socket);
+  }
+
+  SOCKET_ERROR_EVENTS.forEach(event => socket.once(event, errorHandler(event)));
+  if (cancellationToken) {
+    cancellationHandler = errorHandler('cancel');
+    cancellationToken.once('cancel', cancellationHandler);
+  }
+
+  socket.once(connectEvent, connectHandler);
+}
+
+function connectionFailureError(type, err) {
+  switch (type) {
+    case 'error':
+      return new MongoNetworkError(err);
+    case 'timeout':
+      return new MongoNetworkTimeoutError(`connection timed out`);
+    case 'close':
+      return new MongoNetworkError(`connection closed`);
+    case 'cancel':
+      return new MongoNetworkError(`connection establishment was cancelled`);
+    default:
+      return new MongoNetworkError(`unknown network error`);
+  }
+}
+
+module.exports = connect;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/connection.js b/NodeAPI/node_modules/mongodb/lib/core/connection/connection.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b22513b2a6af2fb92fd3c56ec374333a62b0bcf
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/connection.js
@@ -0,0 +1,711 @@
+'use strict';
+
+const EventEmitter = require('events').EventEmitter;
+const crypto = require('crypto');
+const debugOptions = require('./utils').debugOptions;
+const parseHeader = require('../wireprotocol/shared').parseHeader;
+const decompress = require('../wireprotocol/compression').decompress;
+const Response = require('./commands').Response;
+const BinMsg = require('./msg').BinMsg;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const MongoNetworkTimeoutError = require('../error').MongoNetworkTimeoutError;
+const MongoError = require('../error').MongoError;
+const Logger = require('./logger');
+const OP_COMPRESSED = require('../wireprotocol/shared').opcodes.OP_COMPRESSED;
+const OP_MSG = require('../wireprotocol/shared').opcodes.OP_MSG;
+const MESSAGE_HEADER_SIZE = require('../wireprotocol/shared').MESSAGE_HEADER_SIZE;
+const Buffer = require('safe-buffer').Buffer;
+const Query = require('./commands').Query;
+const CommandResult = require('./command_result');
+
+let _id = 0;
+
+const DEFAULT_MAX_BSON_MESSAGE_SIZE = 1024 * 1024 * 16 * 4;
+const DEBUG_FIELDS = [
+  'host',
+  'port',
+  'size',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'noDelay',
+  'connectionTimeout',
+  'socketTimeout',
+  'ssl',
+  'ca',
+  'crl',
+  'cert',
+  'rejectUnauthorized',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'checkServerIdentity'
+];
+
+let connectionAccountingSpy = undefined;
+let connectionAccounting = false;
+let connections = {};
+
+/**
+ * A class representing a single connection to a MongoDB server
+ *
+ * @fires Connection#connect
+ * @fires Connection#close
+ * @fires Connection#error
+ * @fires Connection#timeout
+ * @fires Connection#parseError
+ * @fires Connection#message
+ */
+class Connection extends EventEmitter {
+  /**
+   * Creates a new Connection instance
+   *
+   * **NOTE**: Internal class, do not instantiate directly
+   *
+   * @param {Socket} socket The socket this connection wraps
+   * @param {Object} options Various settings
+   * @param {object} options.bson An implementation of bson serialize and deserialize
+   * @param {string} [options.host='localhost'] The host the socket is connected to
+   * @param {number} [options.port=27017] The port used for the socket connection
+   * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
+   * @param {number} [options.keepAliveInitialDelay=120000] Initial delay before TCP keep alive enabled
+   * @param {number} [options.connectionTimeout=30000] TCP Connection timeout setting
+   * @param {number} [options.socketTimeout=0] TCP Socket timeout setting
+   * @param {boolean} [options.promoteLongs] Convert Long values from the db into Numbers if they fit into 53 bits
+   * @param {boolean} [options.promoteValues] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+   * @param {boolean} [options.promoteBuffers] Promotes Binary BSON values to native Node Buffers.
+   * @param {number} [options.maxBsonMessageSize=0x4000000] Largest possible size of a BSON message (for legacy purposes)
+   */
+  constructor(socket, options) {
+    super();
+
+    options = options || {};
+    if (!options.bson) {
+      throw new TypeError('must pass in valid bson parser');
+    }
+
+    this.id = _id++;
+    this.options = options;
+    this.logger = Logger('Connection', options);
+    this.bson = options.bson;
+    this.tag = options.tag;
+    this.maxBsonMessageSize = options.maxBsonMessageSize || DEFAULT_MAX_BSON_MESSAGE_SIZE;
+
+    this.port = options.port || 27017;
+    this.host = options.host || 'localhost';
+    this.socketTimeout = typeof options.socketTimeout === 'number' ? options.socketTimeout : 0;
+
+    // These values are inspected directly in tests, but maybe not necessary to keep around
+    this.keepAlive = typeof options.keepAlive === 'boolean' ? options.keepAlive : true;
+    this.keepAliveInitialDelay =
+      typeof options.keepAliveInitialDelay === 'number' ? options.keepAliveInitialDelay : 120000;
+    this.connectionTimeout =
+      typeof options.connectionTimeout === 'number' ? options.connectionTimeout : 30000;
+    if (this.keepAliveInitialDelay > this.socketTimeout) {
+      this.keepAliveInitialDelay = Math.round(this.socketTimeout / 2);
+    }
+
+    // Debug information
+    if (this.logger.isDebug()) {
+      this.logger.debug(
+        `creating connection ${this.id} with options [${JSON.stringify(
+          debugOptions(DEBUG_FIELDS, options)
+        )}]`
+      );
+    }
+
+    // Response options
+    this.responseOptions = {
+      promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true,
+      promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true,
+      promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false
+    };
+
+    // Flushing
+    this.flushing = false;
+    this.queue = [];
+
+    // Internal state
+    this.writeStream = null;
+    this.destroyed = false;
+    this.timedOut = false;
+
+    // Create hash method
+    const hash = crypto.createHash('sha1');
+    hash.update(this.address);
+    this.hashedName = hash.digest('hex');
+
+    // All operations in flight on the connection
+    this.workItems = [];
+
+    // setup socket
+    this.socket = socket;
+    this.socket.once('error', errorHandler(this));
+    this.socket.once('timeout', timeoutHandler(this));
+    this.socket.once('close', closeHandler(this));
+    this.socket.on('data', dataHandler(this));
+
+    if (connectionAccounting) {
+      addConnection(this.id, this);
+    }
+  }
+
+  setSocketTimeout(value) {
+    if (this.socket) {
+      this.socket.setTimeout(value);
+    }
+  }
+
+  resetSocketTimeout() {
+    if (this.socket) {
+      this.socket.setTimeout(this.socketTimeout);
+    }
+  }
+
+  static enableConnectionAccounting(spy) {
+    if (spy) {
+      connectionAccountingSpy = spy;
+    }
+
+    connectionAccounting = true;
+    connections = {};
+  }
+
+  static disableConnectionAccounting() {
+    connectionAccounting = false;
+    connectionAccountingSpy = undefined;
+  }
+
+  static connections() {
+    return connections;
+  }
+
+  get address() {
+    return `${this.host}:${this.port}`;
+  }
+
+  /**
+   * Unref this connection
+   * @method
+   * @return {boolean}
+   */
+  unref() {
+    if (this.socket == null) {
+      this.once('connect', () => this.socket.unref());
+      return;
+    }
+
+    this.socket.unref();
+  }
+
+  /**
+   * Flush all work Items on this connection
+   *
+   * @param {*} err The error to propagate to the flushed work items
+   */
+  flush(err) {
+    while (this.workItems.length > 0) {
+      const workItem = this.workItems.shift();
+      if (workItem.cb) {
+        workItem.cb(err);
+      }
+    }
+  }
+
+  /**
+   * Destroy connection
+   * @method
+   */
+  destroy(options, callback) {
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+
+    options = Object.assign({ force: false }, options);
+
+    if (connectionAccounting) {
+      deleteConnection(this.id);
+    }
+
+    if (this.socket == null) {
+      this.destroyed = true;
+      return;
+    }
+
+    if (options.force || this.timedOut) {
+      this.socket.destroy();
+      this.destroyed = true;
+      if (typeof callback === 'function') callback(null, null);
+      return;
+    }
+
+    this.socket.end(err => {
+      this.destroyed = true;
+      if (typeof callback === 'function') callback(err, null);
+    });
+  }
+
+  /**
+   * Write to connection
+   * @method
+   * @param {Command} command Command to write out need to implement toBin and toBinUnified
+   */
+  write(buffer) {
+    // Debug Log
+    if (this.logger.isDebug()) {
+      if (!Array.isArray(buffer)) {
+        this.logger.debug(`writing buffer [${buffer.toString('hex')}] to ${this.address}`);
+      } else {
+        for (let i = 0; i < buffer.length; i++)
+          this.logger.debug(`writing buffer [${buffer[i].toString('hex')}] to ${this.address}`);
+      }
+    }
+
+    // Double check that the connection is not destroyed
+    if (this.socket.destroyed === false) {
+      // Write out the command
+      if (!Array.isArray(buffer)) {
+        this.socket.write(buffer, 'binary');
+        return true;
+      }
+
+      // Iterate over all buffers and write them in order to the socket
+      for (let i = 0; i < buffer.length; i++) {
+        this.socket.write(buffer[i], 'binary');
+      }
+
+      return true;
+    }
+
+    // Connection is destroyed return write failed
+    return false;
+  }
+
+  /**
+   * Return id of connection as a string
+   * @method
+   * @return {string}
+   */
+  toString() {
+    return '' + this.id;
+  }
+
+  /**
+   * Return json object of connection
+   * @method
+   * @return {object}
+   */
+  toJSON() {
+    return { id: this.id, host: this.host, port: this.port };
+  }
+
+  /**
+   * Is the connection connected
+   * @method
+   * @return {boolean}
+   */
+  isConnected() {
+    if (this.destroyed) return false;
+    return !this.socket.destroyed && this.socket.writable;
+  }
+
+  /**
+   * @ignore
+   */
+  command(ns, command, options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+
+    const conn = this;
+    const socketTimeout = typeof options.socketTimeout === 'number' ? options.socketTimeout : 0;
+    const bson = conn.options.bson;
+    const query = new Query(bson, ns, command, {
+      numberToSkip: 0,
+      numberToReturn: 1
+    });
+
+    const noop = () => {};
+    function _callback(err, result) {
+      callback(err, result);
+      callback = noop;
+    }
+
+    function errorHandler(err) {
+      conn.resetSocketTimeout();
+      CONNECTION_ERROR_EVENTS.forEach(eventName => conn.removeListener(eventName, errorHandler));
+      conn.removeListener('message', messageHandler);
+
+      if (err == null) {
+        err = new MongoError(`runCommand failed for connection to '${conn.address}'`);
+      }
+
+      // ignore all future errors
+      conn.on('error', noop);
+      _callback(err);
+    }
+
+    function messageHandler(msg) {
+      if (msg.responseTo !== query.requestId) {
+        return;
+      }
+
+      conn.resetSocketTimeout();
+      CONNECTION_ERROR_EVENTS.forEach(eventName => conn.removeListener(eventName, errorHandler));
+      conn.removeListener('message', messageHandler);
+
+      msg.parse({ promoteValues: true });
+
+      const response = msg.documents[0];
+      if (response.ok === 0 || response.$err || response.errmsg || response.code) {
+        _callback(new MongoError(response));
+        return;
+      }
+
+      _callback(undefined, new CommandResult(response, this, msg));
+    }
+
+    conn.setSocketTimeout(socketTimeout);
+    CONNECTION_ERROR_EVENTS.forEach(eventName => conn.once(eventName, errorHandler));
+    conn.on('message', messageHandler);
+    conn.write(query.toBin());
+  }
+}
+
+const CONNECTION_ERROR_EVENTS = ['error', 'close', 'timeout', 'parseError'];
+
+function deleteConnection(id) {
+  // console.log("=== deleted connection " + id + " :: " + (connections[id] ? connections[id].port : ''))
+  delete connections[id];
+
+  if (connectionAccountingSpy) {
+    connectionAccountingSpy.deleteConnection(id);
+  }
+}
+
+function addConnection(id, connection) {
+  // console.log("=== added connection " + id + " :: " + connection.port)
+  connections[id] = connection;
+
+  if (connectionAccountingSpy) {
+    connectionAccountingSpy.addConnection(id, connection);
+  }
+}
+
+//
+// Connection handlers
+function errorHandler(conn) {
+  return function(err) {
+    if (connectionAccounting) deleteConnection(conn.id);
+    // Debug information
+    if (conn.logger.isDebug()) {
+      conn.logger.debug(
+        `connection ${conn.id} for [${conn.address}] errored out with [${JSON.stringify(err)}]`
+      );
+    }
+
+    conn.emit('error', new MongoNetworkError(err), conn);
+  };
+}
+
+function timeoutHandler(conn) {
+  return function() {
+    if (connectionAccounting) deleteConnection(conn.id);
+
+    if (conn.logger.isDebug()) {
+      conn.logger.debug(`connection ${conn.id} for [${conn.address}] timed out`);
+    }
+
+    conn.timedOut = true;
+    conn.emit(
+      'timeout',
+      new MongoNetworkTimeoutError(`connection ${conn.id} to ${conn.address} timed out`, {
+        beforeHandshake: conn.ismaster == null
+      }),
+      conn
+    );
+  };
+}
+
+function closeHandler(conn) {
+  return function(hadError) {
+    if (connectionAccounting) deleteConnection(conn.id);
+
+    if (conn.logger.isDebug()) {
+      conn.logger.debug(`connection ${conn.id} with for [${conn.address}] closed`);
+    }
+
+    if (!hadError) {
+      conn.emit(
+        'close',
+        new MongoNetworkError(`connection ${conn.id} to ${conn.address} closed`),
+        conn
+      );
+    }
+  };
+}
+
+// Handle a message once it is received
+function processMessage(conn, message) {
+  const msgHeader = parseHeader(message);
+  if (msgHeader.opCode !== OP_COMPRESSED) {
+    const ResponseConstructor = msgHeader.opCode === OP_MSG ? BinMsg : Response;
+    conn.emit(
+      'message',
+      new ResponseConstructor(
+        conn.bson,
+        message,
+        msgHeader,
+        message.slice(MESSAGE_HEADER_SIZE),
+        conn.responseOptions
+      ),
+      conn
+    );
+
+    return;
+  }
+
+  msgHeader.fromCompressed = true;
+  let index = MESSAGE_HEADER_SIZE;
+  msgHeader.opCode = message.readInt32LE(index);
+  index += 4;
+  msgHeader.length = message.readInt32LE(index);
+  index += 4;
+  const compressorID = message[index];
+  index++;
+
+  decompress(compressorID, message.slice(index), (err, decompressedMsgBody) => {
+    if (err) {
+      conn.emit('error', err);
+      return;
+    }
+
+    if (decompressedMsgBody.length !== msgHeader.length) {
+      conn.emit(
+        'error',
+        new MongoError(
+          'Decompressing a compressed message from the server failed. The message is corrupt.'
+        )
+      );
+
+      return;
+    }
+
+    const ResponseConstructor = msgHeader.opCode === OP_MSG ? BinMsg : Response;
+    conn.emit(
+      'message',
+      new ResponseConstructor(
+        conn.bson,
+        message,
+        msgHeader,
+        decompressedMsgBody,
+        conn.responseOptions
+      ),
+      conn
+    );
+  });
+}
+
+function dataHandler(conn) {
+  return function(data) {
+    // Parse until we are done with the data
+    while (data.length > 0) {
+      // If we still have bytes to read on the current message
+      if (conn.bytesRead > 0 && conn.sizeOfMessage > 0) {
+        // Calculate the amount of remaining bytes
+        const remainingBytesToRead = conn.sizeOfMessage - conn.bytesRead;
+        // Check if the current chunk contains the rest of the message
+        if (remainingBytesToRead > data.length) {
+          // Copy the new data into the exiting buffer (should have been allocated when we know the message size)
+          data.copy(conn.buffer, conn.bytesRead);
+          // Adjust the number of bytes read so it point to the correct index in the buffer
+          conn.bytesRead = conn.bytesRead + data.length;
+
+          // Reset state of buffer
+          data = Buffer.alloc(0);
+        } else {
+          // Copy the missing part of the data into our current buffer
+          data.copy(conn.buffer, conn.bytesRead, 0, remainingBytesToRead);
+          // Slice the overflow into a new buffer that we will then re-parse
+          data = data.slice(remainingBytesToRead);
+
+          // Emit current complete message
+          const emitBuffer = conn.buffer;
+          // Reset state of buffer
+          conn.buffer = null;
+          conn.sizeOfMessage = 0;
+          conn.bytesRead = 0;
+          conn.stubBuffer = null;
+
+          processMessage(conn, emitBuffer);
+        }
+      } else {
+        // Stub buffer is kept in case we don't get enough bytes to determine the
+        // size of the message (< 4 bytes)
+        if (conn.stubBuffer != null && conn.stubBuffer.length > 0) {
+          // If we have enough bytes to determine the message size let's do it
+          if (conn.stubBuffer.length + data.length > 4) {
+            // Prepad the data
+            const newData = Buffer.alloc(conn.stubBuffer.length + data.length);
+            conn.stubBuffer.copy(newData, 0);
+            data.copy(newData, conn.stubBuffer.length);
+            // Reassign for parsing
+            data = newData;
+
+            // Reset state of buffer
+            conn.buffer = null;
+            conn.sizeOfMessage = 0;
+            conn.bytesRead = 0;
+            conn.stubBuffer = null;
+          } else {
+            // Add the the bytes to the stub buffer
+            const newStubBuffer = Buffer.alloc(conn.stubBuffer.length + data.length);
+            // Copy existing stub buffer
+            conn.stubBuffer.copy(newStubBuffer, 0);
+            // Copy missing part of the data
+            data.copy(newStubBuffer, conn.stubBuffer.length);
+            // Exit parsing loop
+            data = Buffer.alloc(0);
+          }
+        } else {
+          if (data.length > 4) {
+            // Retrieve the message size
+            const sizeOfMessage = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
+            // If we have a negative sizeOfMessage emit error and return
+            if (sizeOfMessage < 0 || sizeOfMessage > conn.maxBsonMessageSize) {
+              const errorObject = {
+                err: 'socketHandler',
+                trace: '',
+                bin: conn.buffer,
+                parseState: {
+                  sizeOfMessage: sizeOfMessage,
+                  bytesRead: conn.bytesRead,
+                  stubBuffer: conn.stubBuffer
+                }
+              };
+              // We got a parse Error fire it off then keep going
+              conn.emit('parseError', errorObject, conn);
+              return;
+            }
+
+            // Ensure that the size of message is larger than 0 and less than the max allowed
+            if (
+              sizeOfMessage > 4 &&
+              sizeOfMessage < conn.maxBsonMessageSize &&
+              sizeOfMessage > data.length
+            ) {
+              conn.buffer = Buffer.alloc(sizeOfMessage);
+              // Copy all the data into the buffer
+              data.copy(conn.buffer, 0);
+              // Update bytes read
+              conn.bytesRead = data.length;
+              // Update sizeOfMessage
+              conn.sizeOfMessage = sizeOfMessage;
+              // Ensure stub buffer is null
+              conn.stubBuffer = null;
+              // Exit parsing loop
+              data = Buffer.alloc(0);
+            } else if (
+              sizeOfMessage > 4 &&
+              sizeOfMessage < conn.maxBsonMessageSize &&
+              sizeOfMessage === data.length
+            ) {
+              const emitBuffer = data;
+              // Reset state of buffer
+              conn.buffer = null;
+              conn.sizeOfMessage = 0;
+              conn.bytesRead = 0;
+              conn.stubBuffer = null;
+              // Exit parsing loop
+              data = Buffer.alloc(0);
+              // Emit the message
+              processMessage(conn, emitBuffer);
+            } else if (sizeOfMessage <= 4 || sizeOfMessage > conn.maxBsonMessageSize) {
+              const errorObject = {
+                err: 'socketHandler',
+                trace: null,
+                bin: data,
+                parseState: {
+                  sizeOfMessage: sizeOfMessage,
+                  bytesRead: 0,
+                  buffer: null,
+                  stubBuffer: null
+                }
+              };
+              // We got a parse Error fire it off then keep going
+              conn.emit('parseError', errorObject, conn);
+
+              // Clear out the state of the parser
+              conn.buffer = null;
+              conn.sizeOfMessage = 0;
+              conn.bytesRead = 0;
+              conn.stubBuffer = null;
+              // Exit parsing loop
+              data = Buffer.alloc(0);
+            } else {
+              const emitBuffer = data.slice(0, sizeOfMessage);
+              // Reset state of buffer
+              conn.buffer = null;
+              conn.sizeOfMessage = 0;
+              conn.bytesRead = 0;
+              conn.stubBuffer = null;
+              // Copy rest of message
+              data = data.slice(sizeOfMessage);
+              // Emit the message
+              processMessage(conn, emitBuffer);
+            }
+          } else {
+            // Create a buffer that contains the space for the non-complete message
+            conn.stubBuffer = Buffer.alloc(data.length);
+            // Copy the data to the stub buffer
+            data.copy(conn.stubBuffer, 0);
+            // Exit parsing loop
+            data = Buffer.alloc(0);
+          }
+        }
+      }
+    }
+  };
+}
+
+/**
+ * A server connect event, used to verify that the connection is up and running
+ *
+ * @event Connection#connect
+ * @type {Connection}
+ */
+
+/**
+ * The server connection closed, all pool connections closed
+ *
+ * @event Connection#close
+ * @type {Connection}
+ */
+
+/**
+ * The server connection caused an error, all pool connections closed
+ *
+ * @event Connection#error
+ * @type {Connection}
+ */
+
+/**
+ * The server connection timed out, all pool connections closed
+ *
+ * @event Connection#timeout
+ * @type {Connection}
+ */
+
+/**
+ * The driver experienced an invalid message, all pool connections closed
+ *
+ * @event Connection#parseError
+ * @type {Connection}
+ */
+
+/**
+ * An event emitted each time the connection receives a parsed message from the wire
+ *
+ * @event Connection#message
+ * @type {Connection}
+ */
+
+module.exports = Connection;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/logger.js b/NodeAPI/node_modules/mongodb/lib/core/connection/logger.js
new file mode 100644
index 0000000000000000000000000000000000000000..b2957a5556b5e22c1f5f3231451374da05c50607
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/logger.js
@@ -0,0 +1,252 @@
+'use strict';
+
+var f = require('util').format,
+  MongoError = require('../error').MongoError;
+
+// Filters for classes
+var classFilters = {};
+var filteredClasses = {};
+var level = null;
+// Save the process id
+var pid = process.pid;
+// current logger
+var currentLogger = null;
+
+/**
+ * @callback Logger~loggerCallback
+ * @param {string} msg message being logged
+ * @param {object} state an object containing more metadata about the logging message
+ */
+
+/**
+ * Creates a new Logger instance
+ * @class
+ * @param {string} className The Class name associated with the logging instance
+ * @param {object} [options=null] Optional settings.
+ * @param {Logger~loggerCallback} [options.logger=null] Custom logger function;
+ * @param {string} [options.loggerLevel=error] Override default global log level.
+ */
+var Logger = function(className, options) {
+  if (!(this instanceof Logger)) return new Logger(className, options);
+  options = options || {};
+
+  // Current reference
+  this.className = className;
+
+  // Current logger
+  if (options.logger) {
+    currentLogger = options.logger;
+  } else if (currentLogger == null) {
+    // eslint-disable-next-line no-console
+    currentLogger = console.log;
+  }
+
+  // Set level of logging, default is error
+  if (options.loggerLevel) {
+    level = options.loggerLevel || 'error';
+  }
+
+  // Add all class names
+  if (filteredClasses[this.className] == null) classFilters[this.className] = true;
+};
+
+/**
+ * Log a message at the debug level
+ * @method
+ * @param {string} message The message to log
+ * @param {object} object additional meta data to log
+ * @return {null}
+ */
+Logger.prototype.debug = function(message, object) {
+  if (
+    this.isDebug() &&
+    ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) ||
+      (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))
+  ) {
+    var dateTime = new Date().getTime();
+    var msg = f('[%s-%s:%s] %s %s', 'DEBUG', this.className, pid, dateTime, message);
+    var state = {
+      type: 'debug',
+      message: message,
+      className: this.className,
+      pid: pid,
+      date: dateTime
+    };
+    if (object) state.meta = object;
+    currentLogger(msg, state);
+  }
+};
+
+/**
+ * Log a message at the warn level
+ * @method
+ * @param {string} message The message to log
+ * @param {object} object additional meta data to log
+ * @return {null}
+ */
+(Logger.prototype.warn = function(message, object) {
+  if (
+    this.isWarn() &&
+    ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) ||
+      (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))
+  ) {
+    var dateTime = new Date().getTime();
+    var msg = f('[%s-%s:%s] %s %s', 'WARN', this.className, pid, dateTime, message);
+    var state = {
+      type: 'warn',
+      message: message,
+      className: this.className,
+      pid: pid,
+      date: dateTime
+    };
+    if (object) state.meta = object;
+    currentLogger(msg, state);
+  }
+}),
+  /**
+   * Log a message at the info level
+   * @method
+   * @param {string} message The message to log
+   * @param {object} object additional meta data to log
+   * @return {null}
+   */
+  (Logger.prototype.info = function(message, object) {
+    if (
+      this.isInfo() &&
+      ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) ||
+        (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))
+    ) {
+      var dateTime = new Date().getTime();
+      var msg = f('[%s-%s:%s] %s %s', 'INFO', this.className, pid, dateTime, message);
+      var state = {
+        type: 'info',
+        message: message,
+        className: this.className,
+        pid: pid,
+        date: dateTime
+      };
+      if (object) state.meta = object;
+      currentLogger(msg, state);
+    }
+  }),
+  /**
+   * Log a message at the error level
+   * @method
+   * @param {string} message The message to log
+   * @param {object} object additional meta data to log
+   * @return {null}
+   */
+  (Logger.prototype.error = function(message, object) {
+    if (
+      this.isError() &&
+      ((Object.keys(filteredClasses).length > 0 && filteredClasses[this.className]) ||
+        (Object.keys(filteredClasses).length === 0 && classFilters[this.className]))
+    ) {
+      var dateTime = new Date().getTime();
+      var msg = f('[%s-%s:%s] %s %s', 'ERROR', this.className, pid, dateTime, message);
+      var state = {
+        type: 'error',
+        message: message,
+        className: this.className,
+        pid: pid,
+        date: dateTime
+      };
+      if (object) state.meta = object;
+      currentLogger(msg, state);
+    }
+  }),
+  /**
+   * Is the logger set at info level
+   * @method
+   * @return {boolean}
+   */
+  (Logger.prototype.isInfo = function() {
+    return level === 'info' || level === 'debug';
+  }),
+  /**
+   * Is the logger set at error level
+   * @method
+   * @return {boolean}
+   */
+  (Logger.prototype.isError = function() {
+    return level === 'error' || level === 'info' || level === 'debug';
+  }),
+  /**
+   * Is the logger set at error level
+   * @method
+   * @return {boolean}
+   */
+  (Logger.prototype.isWarn = function() {
+    return level === 'error' || level === 'warn' || level === 'info' || level === 'debug';
+  }),
+  /**
+   * Is the logger set at debug level
+   * @method
+   * @return {boolean}
+   */
+  (Logger.prototype.isDebug = function() {
+    return level === 'debug';
+  });
+
+/**
+ * Resets the logger to default settings, error and no filtered classes
+ * @method
+ * @return {null}
+ */
+Logger.reset = function() {
+  level = 'error';
+  filteredClasses = {};
+};
+
+/**
+ * Get the current logger function
+ * @method
+ * @return {Logger~loggerCallback}
+ */
+Logger.currentLogger = function() {
+  return currentLogger;
+};
+
+/**
+ * Set the current logger function
+ * @method
+ * @param {Logger~loggerCallback} logger Logger function.
+ * @return {null}
+ */
+Logger.setCurrentLogger = function(logger) {
+  if (typeof logger !== 'function') throw new MongoError('current logger must be a function');
+  currentLogger = logger;
+};
+
+/**
+ * Set what classes to log.
+ * @method
+ * @param {string} type The type of filter (currently only class)
+ * @param {string[]} values The filters to apply
+ * @return {null}
+ */
+Logger.filter = function(type, values) {
+  if (type === 'class' && Array.isArray(values)) {
+    filteredClasses = {};
+
+    values.forEach(function(x) {
+      filteredClasses[x] = true;
+    });
+  }
+};
+
+/**
+ * Set the current log level
+ * @method
+ * @param {string} level Set current log level (debug, info, error)
+ * @return {null}
+ */
+Logger.setLevel = function(_level) {
+  if (_level !== 'info' && _level !== 'error' && _level !== 'debug' && _level !== 'warn') {
+    throw new Error(f('%s is an illegal logging level', _level));
+  }
+
+  level = _level;
+};
+
+module.exports = Logger;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/msg.js b/NodeAPI/node_modules/mongodb/lib/core/connection/msg.js
new file mode 100644
index 0000000000000000000000000000000000000000..e241c096af9f359ab655cd0a0f5f7d763ff14c81
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/msg.js
@@ -0,0 +1,224 @@
+'use strict';
+
+// Implementation of OP_MSG spec:
+// https://github.com/mongodb/specifications/blob/master/source/message/OP_MSG.rst
+//
+// struct Section {
+//   uint8 payloadType;
+//   union payload {
+//       document  document; // payloadType == 0
+//       struct sequence { // payloadType == 1
+//           int32      size;
+//           cstring    identifier;
+//           document*  documents;
+//       };
+//   };
+// };
+
+// struct OP_MSG {
+//   struct MsgHeader {
+//       int32  messageLength;
+//       int32  requestID;
+//       int32  responseTo;
+//       int32  opCode = 2013;
+//   };
+//   uint32      flagBits;
+//   Section+    sections;
+//   [uint32     checksum;]
+// };
+
+const Buffer = require('safe-buffer').Buffer;
+const opcodes = require('../wireprotocol/shared').opcodes;
+const databaseNamespace = require('../wireprotocol/shared').databaseNamespace;
+const ReadPreference = require('../topologies/read_preference');
+const MongoError = require('../../core/error').MongoError;
+
+// Incrementing request id
+let _requestId = 0;
+
+// Msg Flags
+const OPTS_CHECKSUM_PRESENT = 1;
+const OPTS_MORE_TO_COME = 2;
+const OPTS_EXHAUST_ALLOWED = 1 << 16;
+
+class Msg {
+  constructor(bson, ns, command, options) {
+    // Basic options needed to be passed in
+    if (command == null) throw new Error('query must be specified for query');
+
+    // Basic options
+    this.bson = bson;
+    this.ns = ns;
+    this.command = command;
+    this.command.$db = databaseNamespace(ns);
+
+    if (options.readPreference && options.readPreference.mode !== ReadPreference.PRIMARY) {
+      this.command.$readPreference = options.readPreference.toJSON();
+    }
+
+    // Ensure empty options
+    this.options = options || {};
+
+    // Additional options
+    this.requestId = options.requestId ? options.requestId : Msg.getRequestId();
+
+    // Serialization option
+    this.serializeFunctions =
+      typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+    this.ignoreUndefined =
+      typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false;
+    this.checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false;
+    this.maxBsonSize = options.maxBsonSize || 1024 * 1024 * 16;
+
+    // flags
+    this.checksumPresent = false;
+    this.moreToCome = options.moreToCome || false;
+    this.exhaustAllowed =
+      typeof options.exhaustAllowed === 'boolean' ? options.exhaustAllowed : false;
+  }
+
+  toBin() {
+    const buffers = [];
+    let flags = 0;
+
+    if (this.checksumPresent) {
+      flags |= OPTS_CHECKSUM_PRESENT;
+    }
+
+    if (this.moreToCome) {
+      flags |= OPTS_MORE_TO_COME;
+    }
+
+    if (this.exhaustAllowed) {
+      flags |= OPTS_EXHAUST_ALLOWED;
+    }
+
+    const header = Buffer.alloc(
+      4 * 4 + // Header
+        4 // Flags
+    );
+
+    buffers.push(header);
+
+    let totalLength = header.length;
+    const command = this.command;
+    totalLength += this.makeDocumentSegment(buffers, command);
+
+    header.writeInt32LE(totalLength, 0); // messageLength
+    header.writeInt32LE(this.requestId, 4); // requestID
+    header.writeInt32LE(0, 8); // responseTo
+    header.writeInt32LE(opcodes.OP_MSG, 12); // opCode
+    header.writeUInt32LE(flags, 16); // flags
+    return buffers;
+  }
+
+  makeDocumentSegment(buffers, document) {
+    const payloadTypeBuffer = Buffer.alloc(1);
+    payloadTypeBuffer[0] = 0;
+
+    const documentBuffer = this.serializeBson(document);
+    buffers.push(payloadTypeBuffer);
+    buffers.push(documentBuffer);
+
+    return payloadTypeBuffer.length + documentBuffer.length;
+  }
+
+  serializeBson(document) {
+    return this.bson.serialize(document, {
+      checkKeys: this.checkKeys,
+      serializeFunctions: this.serializeFunctions,
+      ignoreUndefined: this.ignoreUndefined
+    });
+  }
+}
+
+Msg.getRequestId = function() {
+  _requestId = (_requestId + 1) & 0x7fffffff;
+  return _requestId;
+};
+
+class BinMsg {
+  constructor(bson, message, msgHeader, msgBody, opts) {
+    opts = opts || { promoteLongs: true, promoteValues: true, promoteBuffers: false };
+    this.parsed = false;
+    this.raw = message;
+    this.data = msgBody;
+    this.bson = bson;
+    this.opts = opts;
+
+    // Read the message header
+    this.length = msgHeader.length;
+    this.requestId = msgHeader.requestId;
+    this.responseTo = msgHeader.responseTo;
+    this.opCode = msgHeader.opCode;
+    this.fromCompressed = msgHeader.fromCompressed;
+
+    // Read response flags
+    this.responseFlags = msgBody.readInt32LE(0);
+    this.checksumPresent = (this.responseFlags & OPTS_CHECKSUM_PRESENT) !== 0;
+    this.moreToCome = (this.responseFlags & OPTS_MORE_TO_COME) !== 0;
+    this.exhaustAllowed = (this.responseFlags & OPTS_EXHAUST_ALLOWED) !== 0;
+    this.promoteLongs = typeof opts.promoteLongs === 'boolean' ? opts.promoteLongs : true;
+    this.promoteValues = typeof opts.promoteValues === 'boolean' ? opts.promoteValues : true;
+    this.promoteBuffers = typeof opts.promoteBuffers === 'boolean' ? opts.promoteBuffers : false;
+
+    this.documents = [];
+  }
+
+  isParsed() {
+    return this.parsed;
+  }
+
+  parse(options) {
+    // Don't parse again if not needed
+    if (this.parsed) return;
+    options = options || {};
+
+    this.index = 4;
+    // Allow the return of raw documents instead of parsing
+    const raw = options.raw || false;
+    const documentsReturnedIn = options.documentsReturnedIn || null;
+    const promoteLongs =
+      typeof options.promoteLongs === 'boolean' ? options.promoteLongs : this.opts.promoteLongs;
+    const promoteValues =
+      typeof options.promoteValues === 'boolean' ? options.promoteValues : this.opts.promoteValues;
+    const promoteBuffers =
+      typeof options.promoteBuffers === 'boolean'
+        ? options.promoteBuffers
+        : this.opts.promoteBuffers;
+
+    // Set up the options
+    const _options = {
+      promoteLongs: promoteLongs,
+      promoteValues: promoteValues,
+      promoteBuffers: promoteBuffers
+    };
+
+    while (this.index < this.data.length) {
+      const payloadType = this.data.readUInt8(this.index++);
+      if (payloadType === 1) {
+        // It was decided that no driver makes use of payload type 1
+        throw new MongoError('OP_MSG Payload Type 1 detected unsupported protocol');
+      } else if (payloadType === 0) {
+        const bsonSize = this.data.readUInt32LE(this.index);
+        const bin = this.data.slice(this.index, this.index + bsonSize);
+        this.documents.push(raw ? bin : this.bson.deserialize(bin, _options));
+
+        this.index += bsonSize;
+      }
+    }
+
+    if (this.documents.length === 1 && documentsReturnedIn != null && raw) {
+      const fieldsAsRaw = {};
+      fieldsAsRaw[documentsReturnedIn] = true;
+      _options.fieldsAsRaw = fieldsAsRaw;
+
+      const doc = this.bson.deserialize(this.documents[0], _options);
+      this.documents = [doc];
+    }
+
+    this.parsed = true;
+  }
+}
+
+module.exports = { Msg, BinMsg };
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/pool.js b/NodeAPI/node_modules/mongodb/lib/core/connection/pool.js
new file mode 100644
index 0000000000000000000000000000000000000000..f0061ee914ec736b6808c45af79d1df5d4078543
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/pool.js
@@ -0,0 +1,1281 @@
+'use strict';
+
+const inherits = require('util').inherits;
+const EventEmitter = require('events').EventEmitter;
+const MongoError = require('../error').MongoError;
+const MongoTimeoutError = require('../error').MongoTimeoutError;
+const MongoWriteConcernError = require('../error').MongoWriteConcernError;
+const Logger = require('./logger');
+const f = require('util').format;
+const Msg = require('./msg').Msg;
+const CommandResult = require('./command_result');
+const MESSAGE_HEADER_SIZE = require('../wireprotocol/shared').MESSAGE_HEADER_SIZE;
+const COMPRESSION_DETAILS_SIZE = require('../wireprotocol/shared').COMPRESSION_DETAILS_SIZE;
+const opcodes = require('../wireprotocol/shared').opcodes;
+const compress = require('../wireprotocol/compression').compress;
+const compressorIDs = require('../wireprotocol/compression').compressorIDs;
+const uncompressibleCommands = require('../wireprotocol/compression').uncompressibleCommands;
+const apm = require('./apm');
+const Buffer = require('safe-buffer').Buffer;
+const connect = require('./connect');
+const updateSessionFromResponse = require('../sessions').updateSessionFromResponse;
+const eachAsync = require('../utils').eachAsync;
+const makeStateMachine = require('../utils').makeStateMachine;
+const now = require('../../utils').now;
+
+const DISCONNECTED = 'disconnected';
+const CONNECTING = 'connecting';
+const CONNECTED = 'connected';
+const DRAINING = 'draining';
+const DESTROYING = 'destroying';
+const DESTROYED = 'destroyed';
+const stateTransition = makeStateMachine({
+  [DISCONNECTED]: [CONNECTING, DRAINING, DISCONNECTED],
+  [CONNECTING]: [CONNECTING, CONNECTED, DRAINING, DISCONNECTED],
+  [CONNECTED]: [CONNECTED, DISCONNECTED, DRAINING],
+  [DRAINING]: [DRAINING, DESTROYING, DESTROYED],
+  [DESTROYING]: [DESTROYING, DESTROYED],
+  [DESTROYED]: [DESTROYED]
+});
+
+const CONNECTION_EVENTS = new Set([
+  'error',
+  'close',
+  'timeout',
+  'parseError',
+  'connect',
+  'message'
+]);
+
+var _id = 0;
+
+/**
+ * Creates a new Pool instance
+ * @class
+ * @param {string} options.host The server host
+ * @param {number} options.port The server port
+ * @param {number} [options.size=5] Max server connection pool size
+ * @param {number} [options.minSize=0] Minimum server connection pool size
+ * @param {boolean} [options.reconnect=true] Server will attempt to reconnect on loss of connection
+ * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times
+ * @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
+ * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.keepAliveInitialDelay=120000] Initial delay before TCP keep alive enabled
+ * @param {boolean} [options.noDelay=true] TCP Connection no delay
+ * @param {number} [options.connectionTimeout=30000] TCP Connection timeout setting
+ * @param {number} [options.socketTimeout=0] TCP Socket timeout setting
+ * @param {number} [options.monitoringSocketTimeout=0] TCP Socket timeout setting for replicaset monitoring socket
+ * @param {boolean} [options.ssl=false] Use SSL for connection
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {Buffer} [options.ca] SSL Certificate store binary buffer
+ * @param {Buffer} [options.crl] SSL Certificate revocation store binary buffer
+ * @param {Buffer} [options.cert] SSL Certificate binary buffer
+ * @param {Buffer} [options.key] SSL Key file binary buffer
+ * @param {string} [options.passphrase] SSL Certificate pass phrase
+ * @param {boolean} [options.rejectUnauthorized=false] Reject unauthorized server certificates
+ * @param {boolean} [options.promoteLongs=true] Convert Long values from the db into Numbers if they fit into 53 bits
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @fires Pool#connect
+ * @fires Pool#close
+ * @fires Pool#error
+ * @fires Pool#timeout
+ * @fires Pool#parseError
+ * @return {Pool} A cursor instance
+ */
+var Pool = function(topology, options) {
+  // Add event listener
+  EventEmitter.call(this);
+
+  // Store topology for later use
+  this.topology = topology;
+
+  this.s = {
+    state: DISCONNECTED,
+    cancellationToken: new EventEmitter()
+  };
+
+  // we don't care how many connections are listening for cancellation
+  this.s.cancellationToken.setMaxListeners(Infinity);
+
+  // Add the options
+  this.options = Object.assign(
+    {
+      // Host and port settings
+      host: 'localhost',
+      port: 27017,
+      // Pool default max size
+      size: 5,
+      // Pool default min size
+      minSize: 0,
+      // socket settings
+      connectionTimeout: 30000,
+      socketTimeout: 0,
+      keepAlive: true,
+      keepAliveInitialDelay: 120000,
+      noDelay: true,
+      // SSL Settings
+      ssl: false,
+      checkServerIdentity: true,
+      ca: null,
+      crl: null,
+      cert: null,
+      key: null,
+      passphrase: null,
+      rejectUnauthorized: false,
+      promoteLongs: true,
+      promoteValues: true,
+      promoteBuffers: false,
+      // Reconnection options
+      reconnect: true,
+      reconnectInterval: 1000,
+      reconnectTries: 30,
+      // Enable domains
+      domainsEnabled: false,
+      // feature flag for determining if we are running with the unified topology or not
+      legacyCompatMode: true
+    },
+    options
+  );
+
+  // Identification information
+  this.id = _id++;
+  // Current reconnect retries
+  this.retriesLeft = this.options.reconnectTries;
+  this.reconnectId = null;
+  this.reconnectError = null;
+  // No bson parser passed in
+  if (
+    !options.bson ||
+    (options.bson &&
+      (typeof options.bson.serialize !== 'function' ||
+        typeof options.bson.deserialize !== 'function'))
+  ) {
+    throw new Error('must pass in valid bson parser');
+  }
+
+  // Logger instance
+  this.logger = Logger('Pool', options);
+  // Connections
+  this.availableConnections = [];
+  this.inUseConnections = [];
+  this.connectingConnections = 0;
+  // Currently executing
+  this.executing = false;
+  // Operation work queue
+  this.queue = [];
+
+  // Number of consecutive timeouts caught
+  this.numberOfConsecutiveTimeouts = 0;
+  // Current pool Index
+  this.connectionIndex = 0;
+
+  // event handlers
+  const pool = this;
+  this._messageHandler = messageHandler(this);
+  this._connectionCloseHandler = function(err) {
+    const connection = this;
+    connectionFailureHandler(pool, 'close', err, connection);
+  };
+
+  this._connectionErrorHandler = function(err) {
+    const connection = this;
+    connectionFailureHandler(pool, 'error', err, connection);
+  };
+
+  this._connectionTimeoutHandler = function(err) {
+    const connection = this;
+    connectionFailureHandler(pool, 'timeout', err, connection);
+  };
+
+  this._connectionParseErrorHandler = function(err) {
+    const connection = this;
+    connectionFailureHandler(pool, 'parseError', err, connection);
+  };
+};
+
+inherits(Pool, EventEmitter);
+
+Object.defineProperty(Pool.prototype, 'size', {
+  enumerable: true,
+  get: function() {
+    return this.options.size;
+  }
+});
+
+Object.defineProperty(Pool.prototype, 'minSize', {
+  enumerable: true,
+  get: function() {
+    return this.options.minSize;
+  }
+});
+
+Object.defineProperty(Pool.prototype, 'connectionTimeout', {
+  enumerable: true,
+  get: function() {
+    return this.options.connectionTimeout;
+  }
+});
+
+Object.defineProperty(Pool.prototype, 'socketTimeout', {
+  enumerable: true,
+  get: function() {
+    return this.options.socketTimeout;
+  }
+});
+
+Object.defineProperty(Pool.prototype, 'state', {
+  enumerable: true,
+  get: function() {
+    return this.s.state;
+  }
+});
+
+// clears all pool state
+function resetPoolState(pool) {
+  pool.inUseConnections = [];
+  pool.availableConnections = [];
+  pool.connectingConnections = 0;
+  pool.executing = false;
+  pool.numberOfConsecutiveTimeouts = 0;
+  pool.connectionIndex = 0;
+  pool.retriesLeft = pool.options.reconnectTries;
+  pool.reconnectId = null;
+}
+
+function connectionFailureHandler(pool, event, err, conn) {
+  if (conn) {
+    if (conn._connectionFailHandled) {
+      return;
+    }
+
+    conn._connectionFailHandled = true;
+    conn.destroy();
+
+    // Remove the connection
+    removeConnection(pool, conn);
+
+    // flush remaining work items
+    conn.flush(err);
+  }
+
+  // Did we catch a timeout, increment the numberOfConsecutiveTimeouts
+  if (event === 'timeout') {
+    pool.numberOfConsecutiveTimeouts = pool.numberOfConsecutiveTimeouts + 1;
+
+    // Have we timed out more than reconnectTries in a row ?
+    // Force close the pool as we are trying to connect to tcp sink hole
+    if (pool.numberOfConsecutiveTimeouts > pool.options.reconnectTries) {
+      pool.numberOfConsecutiveTimeouts = 0;
+      // Destroy all connections and pool
+      pool.destroy(true);
+      // Emit close event
+      return pool.emit('close', pool);
+    }
+  }
+
+  // No more socket available propegate the event
+  if (pool.socketCount() === 0) {
+    if (pool.state !== DESTROYED && pool.state !== DESTROYING && pool.state !== DRAINING) {
+      if (pool.options.reconnect) {
+        stateTransition(pool, DISCONNECTED);
+      }
+    }
+
+    // Do not emit error events, they are always close events
+    // do not trigger the low level error handler in node
+    event = event === 'error' ? 'close' : event;
+    pool.emit(event, err);
+  }
+
+  // Start reconnection attempts
+  if (!pool.reconnectId && pool.options.reconnect) {
+    pool.reconnectError = err;
+    pool.reconnectId = setTimeout(attemptReconnect(pool), pool.options.reconnectInterval);
+  }
+
+  // Do we need to do anything to maintain the minimum pool size
+  const totalConnections = totalConnectionCount(pool);
+  if (totalConnections < pool.minSize) {
+    createConnection(pool);
+  }
+}
+
+function attemptReconnect(pool, callback) {
+  return function() {
+    pool.emit('attemptReconnect', pool);
+
+    if (pool.state === DESTROYED || pool.state === DESTROYING) {
+      if (typeof callback === 'function') {
+        callback(new MongoError('Cannot create connection when pool is destroyed'));
+      }
+
+      return;
+    }
+
+    pool.retriesLeft = pool.retriesLeft - 1;
+    if (pool.retriesLeft <= 0) {
+      pool.destroy();
+
+      const error = new MongoTimeoutError(
+        `failed to reconnect after ${pool.options.reconnectTries} attempts with interval ${pool.options.reconnectInterval} ms`,
+        pool.reconnectError
+      );
+
+      pool.emit('reconnectFailed', error);
+      if (typeof callback === 'function') {
+        callback(error);
+      }
+
+      return;
+    }
+
+    // clear the reconnect id on retry
+    pool.reconnectId = null;
+
+    // now retry creating a connection
+    createConnection(pool, (err, conn) => {
+      if (err == null) {
+        pool.reconnectId = null;
+        pool.retriesLeft = pool.options.reconnectTries;
+        pool.emit('reconnect', pool);
+      }
+
+      if (typeof callback === 'function') {
+        callback(err, conn);
+      }
+    });
+  };
+}
+
+function moveConnectionBetween(connection, from, to) {
+  var index = from.indexOf(connection);
+  // Move the connection from connecting to available
+  if (index !== -1) {
+    from.splice(index, 1);
+    to.push(connection);
+  }
+}
+
+function messageHandler(self) {
+  return function(message, connection) {
+    // workItem to execute
+    var workItem = null;
+
+    // Locate the workItem
+    for (var i = 0; i < connection.workItems.length; i++) {
+      if (connection.workItems[i].requestId === message.responseTo) {
+        // Get the callback
+        workItem = connection.workItems[i];
+        // Remove from list of workItems
+        connection.workItems.splice(i, 1);
+      }
+    }
+
+    if (workItem && workItem.monitoring) {
+      moveConnectionBetween(connection, self.inUseConnections, self.availableConnections);
+    }
+
+    // Reset timeout counter
+    self.numberOfConsecutiveTimeouts = 0;
+
+    // Reset the connection timeout if we modified it for
+    // this operation
+    if (workItem && workItem.socketTimeout) {
+      connection.resetSocketTimeout();
+    }
+
+    // Log if debug enabled
+    if (self.logger.isDebug()) {
+      self.logger.debug(
+        f(
+          'message [%s] received from %s:%s',
+          message.raw.toString('hex'),
+          self.options.host,
+          self.options.port
+        )
+      );
+    }
+
+    function handleOperationCallback(self, cb, err, result) {
+      // No domain enabled
+      if (!self.options.domainsEnabled) {
+        return process.nextTick(function() {
+          return cb(err, result);
+        });
+      }
+
+      // Domain enabled just call the callback
+      cb(err, result);
+    }
+
+    // Keep executing, ensure current message handler does not stop execution
+    if (!self.executing) {
+      process.nextTick(function() {
+        _execute(self)();
+      });
+    }
+
+    // Time to dispatch the message if we have a callback
+    if (workItem && !workItem.immediateRelease) {
+      try {
+        // Parse the message according to the provided options
+        message.parse(workItem);
+      } catch (err) {
+        return handleOperationCallback(self, workItem.cb, new MongoError(err));
+      }
+
+      if (message.documents[0]) {
+        const document = message.documents[0];
+        const session = workItem.session;
+        if (session) {
+          updateSessionFromResponse(session, document);
+        }
+
+        if (self.topology && document.$clusterTime) {
+          self.topology.clusterTime = document.$clusterTime;
+        }
+      }
+
+      // Establish if we have an error
+      if (workItem.command && message.documents[0]) {
+        const responseDoc = message.documents[0];
+
+        if (responseDoc.writeConcernError) {
+          const err = new MongoWriteConcernError(responseDoc.writeConcernError, responseDoc);
+          return handleOperationCallback(self, workItem.cb, err);
+        }
+
+        if (responseDoc.ok === 0 || responseDoc.$err || responseDoc.errmsg || responseDoc.code) {
+          return handleOperationCallback(self, workItem.cb, new MongoError(responseDoc));
+        }
+      }
+
+      // Add the connection details
+      message.hashedName = connection.hashedName;
+
+      // Return the documents
+      handleOperationCallback(
+        self,
+        workItem.cb,
+        null,
+        new CommandResult(workItem.fullResult ? message : message.documents[0], connection, message)
+      );
+    }
+  };
+}
+
+/**
+ * Return the total socket count in the pool.
+ * @method
+ * @return {Number} The number of socket available.
+ */
+Pool.prototype.socketCount = function() {
+  return this.availableConnections.length + this.inUseConnections.length;
+  // + this.connectingConnections.length;
+};
+
+function totalConnectionCount(pool) {
+  return (
+    pool.availableConnections.length + pool.inUseConnections.length + pool.connectingConnections
+  );
+}
+
+/**
+ * Return all pool connections
+ * @method
+ * @return {Connection[]} The pool connections
+ */
+Pool.prototype.allConnections = function() {
+  return this.availableConnections.concat(this.inUseConnections);
+};
+
+/**
+ * Get a pool connection (round-robin)
+ * @method
+ * @return {Connection}
+ */
+Pool.prototype.get = function() {
+  return this.allConnections()[0];
+};
+
+/**
+ * Is the pool connected
+ * @method
+ * @return {boolean}
+ */
+Pool.prototype.isConnected = function() {
+  // We are in a destroyed state
+  if (this.state === DESTROYED || this.state === DESTROYING) {
+    return false;
+  }
+
+  // Get connections
+  var connections = this.availableConnections.concat(this.inUseConnections);
+
+  // Check if we have any connected connections
+  for (var i = 0; i < connections.length; i++) {
+    if (connections[i].isConnected()) return true;
+  }
+
+  // Not connected
+  return false;
+};
+
+/**
+ * Was the pool destroyed
+ * @method
+ * @return {boolean}
+ */
+Pool.prototype.isDestroyed = function() {
+  return this.state === DESTROYED || this.state === DESTROYING;
+};
+
+/**
+ * Is the pool in a disconnected state
+ * @method
+ * @return {boolean}
+ */
+Pool.prototype.isDisconnected = function() {
+  return this.state === DISCONNECTED;
+};
+
+/**
+ * Connect pool
+ */
+Pool.prototype.connect = function(callback) {
+  if (this.state !== DISCONNECTED) {
+    throw new MongoError('connection in unlawful state ' + this.state);
+  }
+
+  stateTransition(this, CONNECTING);
+  createConnection(this, (err, conn) => {
+    if (err) {
+      if (typeof callback === 'function') {
+        this.destroy();
+        callback(err);
+        return;
+      }
+
+      if (this.state === CONNECTING) {
+        this.emit('error', err);
+      }
+
+      this.destroy();
+      return;
+    }
+
+    stateTransition(this, CONNECTED);
+
+    // create min connections
+    if (this.minSize) {
+      for (let i = 0; i < this.minSize; i++) {
+        createConnection(this);
+      }
+    }
+
+    if (typeof callback === 'function') {
+      callback(null, conn);
+    } else {
+      this.emit('connect', this, conn);
+    }
+  });
+};
+
+/**
+ * Authenticate using a specified mechanism
+ * @param {authResultCallback} callback A callback function
+ */
+Pool.prototype.auth = function(credentials, callback) {
+  if (typeof callback === 'function') callback(null, null);
+};
+
+/**
+ * Logout all users against a database
+ * @param {authResultCallback} callback A callback function
+ */
+Pool.prototype.logout = function(dbName, callback) {
+  if (typeof callback === 'function') callback(null, null);
+};
+
+/**
+ * Unref the pool
+ * @method
+ */
+Pool.prototype.unref = function() {
+  // Get all the known connections
+  var connections = this.availableConnections.concat(this.inUseConnections);
+
+  connections.forEach(function(c) {
+    c.unref();
+  });
+};
+
+// Destroy the connections
+function destroy(self, connections, options, callback) {
+  stateTransition(self, DESTROYING);
+
+  // indicate that in-flight connections should cancel
+  self.s.cancellationToken.emit('cancel');
+
+  eachAsync(
+    connections,
+    (conn, cb) => {
+      for (const eventName of CONNECTION_EVENTS) {
+        conn.removeAllListeners(eventName);
+      }
+
+      // ignore any errors during destruction
+      conn.on('error', () => {});
+
+      conn.destroy(options, cb);
+    },
+    err => {
+      if (err) {
+        if (typeof callback === 'function') callback(err, null);
+        return;
+      }
+
+      resetPoolState(self);
+      self.queue = [];
+
+      stateTransition(self, DESTROYED);
+      if (typeof callback === 'function') callback(null, null);
+    }
+  );
+}
+
+/**
+ * Destroy pool
+ * @method
+ */
+Pool.prototype.destroy = function(force, callback) {
+  var self = this;
+  if (typeof force === 'function') {
+    callback = force;
+    force = false;
+  }
+
+  // Do not try again if the pool is already dead
+  if (this.state === DESTROYED || self.state === DESTROYING) {
+    if (typeof callback === 'function') callback(null, null);
+    return;
+  }
+
+  // Set state to draining
+  stateTransition(this, DRAINING);
+
+  // Are we force closing
+  if (force) {
+    // Get all the known connections
+    var connections = self.availableConnections.concat(self.inUseConnections);
+
+    // Flush any remaining work items with
+    // an error
+    while (self.queue.length > 0) {
+      var workItem = self.queue.shift();
+      if (typeof workItem.cb === 'function') {
+        workItem.cb(new MongoError('Pool was force destroyed'));
+      }
+    }
+
+    // Destroy the topology
+    return destroy(self, connections, { force: true }, callback);
+  }
+
+  // Clear out the reconnect if set
+  if (this.reconnectId) {
+    clearTimeout(this.reconnectId);
+  }
+
+  // Wait for the operations to drain before we close the pool
+  function checkStatus() {
+    if (self.state === DESTROYED || self.state === DESTROYING) {
+      if (typeof callback === 'function') {
+        callback();
+      }
+
+      return;
+    }
+
+    flushMonitoringOperations(self.queue);
+
+    if (self.queue.length === 0) {
+      // Get all the known connections
+      var connections = self.availableConnections.concat(self.inUseConnections);
+
+      // Check if we have any in flight operations
+      for (var i = 0; i < connections.length; i++) {
+        // There is an operation still in flight, reschedule a
+        // check waiting for it to drain
+        if (connections[i].workItems.length > 0) {
+          return setTimeout(checkStatus, 1);
+        }
+      }
+
+      destroy(self, connections, { force: false }, callback);
+    } else {
+      // Ensure we empty the queue
+      _execute(self)();
+      // Set timeout
+      setTimeout(checkStatus, 1);
+    }
+  }
+
+  // Initiate drain of operations
+  checkStatus();
+};
+
+/**
+ * Reset all connections of this pool
+ *
+ * @param {function} [callback]
+ */
+Pool.prototype.reset = function(callback) {
+  if (this.s.state !== CONNECTED) {
+    if (typeof callback === 'function') {
+      callback(new MongoError('pool is not connected, reset aborted'));
+    }
+
+    return;
+  }
+
+  // signal in-flight connections should be cancelled
+  this.s.cancellationToken.emit('cancel');
+
+  // destroy existing connections
+  const connections = this.availableConnections.concat(this.inUseConnections);
+  eachAsync(
+    connections,
+    (conn, cb) => {
+      for (const eventName of CONNECTION_EVENTS) {
+        conn.removeAllListeners(eventName);
+      }
+
+      conn.destroy({ force: true }, cb);
+    },
+    err => {
+      if (err) {
+        if (typeof callback === 'function') {
+          callback(err, null);
+          return;
+        }
+      }
+
+      resetPoolState(this);
+
+      // create a new connection, this will ultimately trigger execution
+      createConnection(this, () => {
+        if (typeof callback === 'function') {
+          callback(null, null);
+        }
+      });
+    }
+  );
+};
+
+// Prepare the buffer that Pool.prototype.write() uses to send to the server
+function serializeCommand(self, command, callback) {
+  const originalCommandBuffer = command.toBin();
+
+  // Check whether we and the server have agreed to use a compressor
+  const shouldCompress = !!self.options.agreedCompressor;
+  if (!shouldCompress || !canCompress(command)) {
+    return callback(null, originalCommandBuffer);
+  }
+
+  // Transform originalCommandBuffer into OP_COMPRESSED
+  const concatenatedOriginalCommandBuffer = Buffer.concat(originalCommandBuffer);
+  const messageToBeCompressed = concatenatedOriginalCommandBuffer.slice(MESSAGE_HEADER_SIZE);
+
+  // Extract information needed for OP_COMPRESSED from the uncompressed message
+  const originalCommandOpCode = concatenatedOriginalCommandBuffer.readInt32LE(12);
+
+  // Compress the message body
+  compress(self, messageToBeCompressed, function(err, compressedMessage) {
+    if (err) return callback(err, null);
+
+    // Create the msgHeader of OP_COMPRESSED
+    const msgHeader = Buffer.alloc(MESSAGE_HEADER_SIZE);
+    msgHeader.writeInt32LE(
+      MESSAGE_HEADER_SIZE + COMPRESSION_DETAILS_SIZE + compressedMessage.length,
+      0
+    ); // messageLength
+    msgHeader.writeInt32LE(command.requestId, 4); // requestID
+    msgHeader.writeInt32LE(0, 8); // responseTo (zero)
+    msgHeader.writeInt32LE(opcodes.OP_COMPRESSED, 12); // opCode
+
+    // Create the compression details of OP_COMPRESSED
+    const compressionDetails = Buffer.alloc(COMPRESSION_DETAILS_SIZE);
+    compressionDetails.writeInt32LE(originalCommandOpCode, 0); // originalOpcode
+    compressionDetails.writeInt32LE(messageToBeCompressed.length, 4); // Size of the uncompressed compressedMessage, excluding the MsgHeader
+    compressionDetails.writeUInt8(compressorIDs[self.options.agreedCompressor], 8); // compressorID
+
+    return callback(null, [msgHeader, compressionDetails, compressedMessage]);
+  });
+}
+
+/**
+ * Write a message to MongoDB
+ * @method
+ * @return {Connection}
+ */
+Pool.prototype.write = function(command, options, cb) {
+  var self = this;
+  // Ensure we have a callback
+  if (typeof options === 'function') {
+    cb = options;
+  }
+
+  // Always have options
+  options = options || {};
+
+  // We need to have a callback function unless the message returns no response
+  if (!(typeof cb === 'function') && !options.noResponse) {
+    throw new MongoError('write method must provide a callback');
+  }
+
+  // Pool was destroyed error out
+  if (this.state === DESTROYED || this.state === DESTROYING) {
+    cb(new MongoError('pool destroyed'));
+    return;
+  }
+
+  if (this.state === DRAINING) {
+    cb(new MongoError('pool is draining, new operations prohibited'));
+    return;
+  }
+
+  if (this.options.domainsEnabled && process.domain && typeof cb === 'function') {
+    // if we have a domain bind to it
+    var oldCb = cb;
+    cb = process.domain.bind(function() {
+      // v8 - argumentsToArray one-liner
+      var args = new Array(arguments.length);
+      for (var i = 0; i < arguments.length; i++) {
+        args[i] = arguments[i];
+      }
+      // bounce off event loop so domain switch takes place
+      process.nextTick(function() {
+        oldCb.apply(null, args);
+      });
+    });
+  }
+
+  // Do we have an operation
+  var operation = {
+    cb: cb,
+    raw: false,
+    promoteLongs: true,
+    promoteValues: true,
+    promoteBuffers: false,
+    fullResult: false
+  };
+
+  // Set the options for the parsing
+  operation.promoteLongs = typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true;
+  operation.promoteValues =
+    typeof options.promoteValues === 'boolean' ? options.promoteValues : true;
+  operation.promoteBuffers =
+    typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false;
+  operation.raw = typeof options.raw === 'boolean' ? options.raw : false;
+  operation.immediateRelease =
+    typeof options.immediateRelease === 'boolean' ? options.immediateRelease : false;
+  operation.documentsReturnedIn = options.documentsReturnedIn;
+  operation.command = typeof options.command === 'boolean' ? options.command : false;
+  operation.fullResult = typeof options.fullResult === 'boolean' ? options.fullResult : false;
+  operation.noResponse = typeof options.noResponse === 'boolean' ? options.noResponse : false;
+  operation.session = options.session || null;
+
+  // Optional per operation socketTimeout
+  operation.socketTimeout = options.socketTimeout;
+  operation.monitoring = options.monitoring;
+
+  // Get the requestId
+  operation.requestId = command.requestId;
+
+  // If command monitoring is enabled we need to modify the callback here
+  if (self.options.monitorCommands) {
+    this.emit('commandStarted', new apm.CommandStartedEvent(this, command));
+
+    operation.started = now();
+    operation.cb = (err, reply) => {
+      if (err) {
+        self.emit(
+          'commandFailed',
+          new apm.CommandFailedEvent(this, command, err, operation.started)
+        );
+      } else {
+        if (reply && reply.result && (reply.result.ok === 0 || reply.result.$err)) {
+          self.emit(
+            'commandFailed',
+            new apm.CommandFailedEvent(this, command, reply.result, operation.started)
+          );
+        } else {
+          self.emit(
+            'commandSucceeded',
+            new apm.CommandSucceededEvent(this, command, reply, operation.started)
+          );
+        }
+      }
+
+      if (typeof cb === 'function') cb(err, reply);
+    };
+  }
+
+  // Prepare the operation buffer
+  serializeCommand(self, command, (err, serializedBuffers) => {
+    if (err) throw err;
+
+    // Set the operation's buffer to the serialization of the commands
+    operation.buffer = serializedBuffers;
+
+    // If we have a monitoring operation schedule as the very first operation
+    // Otherwise add to back of queue
+    if (options.monitoring) {
+      self.queue.unshift(operation);
+    } else {
+      self.queue.push(operation);
+    }
+
+    // Attempt to execute the operation
+    if (!self.executing) {
+      process.nextTick(function() {
+        _execute(self)();
+      });
+    }
+  });
+};
+
+// Return whether a command contains an uncompressible command term
+// Will return true if command contains no uncompressible command terms
+function canCompress(command) {
+  const commandDoc = command instanceof Msg ? command.command : command.query;
+  const commandName = Object.keys(commandDoc)[0];
+  return !uncompressibleCommands.has(commandName);
+}
+
+// Remove connection method
+function remove(connection, connections) {
+  for (var i = 0; i < connections.length; i++) {
+    if (connections[i] === connection) {
+      connections.splice(i, 1);
+      return true;
+    }
+  }
+}
+
+function removeConnection(self, connection) {
+  if (remove(connection, self.availableConnections)) return;
+  if (remove(connection, self.inUseConnections)) return;
+}
+
+function createConnection(pool, callback) {
+  if (pool.state === DESTROYED || pool.state === DESTROYING) {
+    if (typeof callback === 'function') {
+      callback(new MongoError('Cannot create connection when pool is destroyed'));
+    }
+
+    return;
+  }
+
+  pool.connectingConnections++;
+  connect(pool.options, pool.s.cancellationToken, (err, connection) => {
+    pool.connectingConnections--;
+
+    if (err) {
+      if (pool.logger.isDebug()) {
+        pool.logger.debug(`connection attempt failed with error [${JSON.stringify(err)}]`);
+      }
+
+      // check if reconnect is enabled, and attempt retry if so
+      if (!pool.reconnectId && pool.options.reconnect) {
+        if (pool.state === CONNECTING && pool.options.legacyCompatMode) {
+          callback(err);
+          return;
+        }
+
+        pool.reconnectError = err;
+        pool.reconnectId = setTimeout(
+          attemptReconnect(pool, callback),
+          pool.options.reconnectInterval
+        );
+
+        return;
+      }
+
+      if (typeof callback === 'function') {
+        callback(err);
+      }
+
+      return;
+    }
+
+    // the pool might have been closed since we started creating the connection
+    if (pool.state === DESTROYED || pool.state === DESTROYING) {
+      if (typeof callback === 'function') {
+        callback(new MongoError('Pool was destroyed after connection creation'));
+      }
+
+      connection.destroy();
+      return;
+    }
+
+    // otherwise, connect relevant event handlers and add it to our available connections
+    connection.on('error', pool._connectionErrorHandler);
+    connection.on('close', pool._connectionCloseHandler);
+    connection.on('timeout', pool._connectionTimeoutHandler);
+    connection.on('parseError', pool._connectionParseErrorHandler);
+    connection.on('message', pool._messageHandler);
+
+    pool.availableConnections.push(connection);
+
+    // if a callback was provided, return the connection
+    if (typeof callback === 'function') {
+      callback(null, connection);
+    }
+
+    // immediately execute any waiting work
+    _execute(pool)();
+  });
+}
+
+function flushMonitoringOperations(queue) {
+  for (var i = 0; i < queue.length; i++) {
+    if (queue[i].monitoring) {
+      var workItem = queue[i];
+      queue.splice(i, 1);
+      workItem.cb(
+        new MongoError({ message: 'no connection available for monitoring', driver: true })
+      );
+    }
+  }
+}
+
+function _execute(self) {
+  return function() {
+    if (self.state === DESTROYED) return;
+    // Already executing, skip
+    if (self.executing) return;
+    // Set pool as executing
+    self.executing = true;
+
+    // New pool connections are in progress, wait them to finish
+    // before executing any more operation to ensure distribution of
+    // operations
+    if (self.connectingConnections > 0) {
+      self.executing = false;
+      return;
+    }
+
+    // As long as we have available connections
+    // eslint-disable-next-line
+    while (true) {
+      // Total availble connections
+      const totalConnections = totalConnectionCount(self);
+
+      // No available connections available, flush any monitoring ops
+      if (self.availableConnections.length === 0) {
+        // Flush any monitoring operations
+        flushMonitoringOperations(self.queue);
+
+        // Try to create a new connection to execute stuck operation
+        if (totalConnections < self.options.size && self.queue.length > 0) {
+          createConnection(self);
+        }
+
+        break;
+      }
+
+      // No queue break
+      if (self.queue.length === 0) {
+        break;
+      }
+
+      var connection = null;
+      const connections = self.availableConnections.filter(conn => conn.workItems.length === 0);
+
+      // No connection found that has no work on it, just pick one for pipelining
+      if (connections.length === 0) {
+        connection =
+          self.availableConnections[self.connectionIndex++ % self.availableConnections.length];
+      } else {
+        connection = connections[self.connectionIndex++ % connections.length];
+      }
+
+      // Is the connection connected
+      if (!connection.isConnected()) {
+        // Remove the disconnected connection
+        removeConnection(self, connection);
+        // Flush any monitoring operations in the queue, failing fast
+        flushMonitoringOperations(self.queue);
+        break;
+      }
+
+      // Get the next work item
+      var workItem = self.queue.shift();
+
+      // If we are monitoring we need to use a connection that is not
+      // running another operation to avoid socket timeout changes
+      // affecting an existing operation
+      if (workItem.monitoring) {
+        var foundValidConnection = false;
+
+        for (let i = 0; i < self.availableConnections.length; i++) {
+          // If the connection is connected
+          // And there are no pending workItems on it
+          // Then we can safely use it for monitoring.
+          if (
+            self.availableConnections[i].isConnected() &&
+            self.availableConnections[i].workItems.length === 0
+          ) {
+            foundValidConnection = true;
+            connection = self.availableConnections[i];
+            break;
+          }
+        }
+
+        // No safe connection found, attempt to grow the connections
+        // if possible and break from the loop
+        if (!foundValidConnection) {
+          // Put workItem back on the queue
+          self.queue.unshift(workItem);
+
+          // Attempt to grow the pool if it's not yet maxsize
+          if (totalConnections < self.options.size && self.queue.length > 0) {
+            // Create a new connection
+            createConnection(self);
+          }
+
+          // Re-execute the operation
+          setTimeout(() => _execute(self)(), 10);
+          break;
+        }
+      }
+
+      // Don't execute operation until we have a full pool
+      if (totalConnections < self.options.size) {
+        // Connection has work items, then put it back on the queue
+        // and create a new connection
+        if (connection.workItems.length > 0) {
+          // Lets put the workItem back on the list
+          self.queue.unshift(workItem);
+          // Create a new connection
+          createConnection(self);
+          // Break from the loop
+          break;
+        }
+      }
+
+      // Get actual binary commands
+      var buffer = workItem.buffer;
+
+      // If we are monitoring take the connection of the availableConnections
+      if (workItem.monitoring) {
+        moveConnectionBetween(connection, self.availableConnections, self.inUseConnections);
+      }
+
+      // Track the executing commands on the mongo server
+      // as long as there is an expected response
+      if (!workItem.noResponse) {
+        connection.workItems.push(workItem);
+      }
+
+      // We have a custom socketTimeout
+      if (!workItem.immediateRelease && typeof workItem.socketTimeout === 'number') {
+        connection.setSocketTimeout(workItem.socketTimeout);
+      }
+
+      // Capture if write was successful
+      var writeSuccessful = true;
+
+      // Put operation on the wire
+      if (Array.isArray(buffer)) {
+        for (let i = 0; i < buffer.length; i++) {
+          writeSuccessful = connection.write(buffer[i]);
+        }
+      } else {
+        writeSuccessful = connection.write(buffer);
+      }
+
+      // if the command is designated noResponse, call the callback immeditely
+      if (workItem.noResponse && typeof workItem.cb === 'function') {
+        workItem.cb(null, null);
+      }
+
+      if (writeSuccessful === false) {
+        // If write not successful put back on queue
+        self.queue.unshift(workItem);
+        // Remove the disconnected connection
+        removeConnection(self, connection);
+        // Flush any monitoring operations in the queue, failing fast
+        flushMonitoringOperations(self.queue);
+        break;
+      }
+    }
+
+    self.executing = false;
+  };
+}
+
+// Make execution loop available for testing
+Pool._execute = _execute;
+
+/**
+ * A server connect event, used to verify that the connection is up and running
+ *
+ * @event Pool#connect
+ * @type {Pool}
+ */
+
+/**
+ * A server reconnect event, used to verify that pool reconnected.
+ *
+ * @event Pool#reconnect
+ * @type {Pool}
+ */
+
+/**
+ * The server connection closed, all pool connections closed
+ *
+ * @event Pool#close
+ * @type {Pool}
+ */
+
+/**
+ * The server connection caused an error, all pool connections closed
+ *
+ * @event Pool#error
+ * @type {Pool}
+ */
+
+/**
+ * The server connection timed out, all pool connections closed
+ *
+ * @event Pool#timeout
+ * @type {Pool}
+ */
+
+/**
+ * The driver experienced an invalid message, all pool connections closed
+ *
+ * @event Pool#parseError
+ * @type {Pool}
+ */
+
+/**
+ * The driver attempted to reconnect
+ *
+ * @event Pool#attemptReconnect
+ * @type {Pool}
+ */
+
+/**
+ * The driver exhausted all reconnect attempts
+ *
+ * @event Pool#reconnectFailed
+ * @type {Pool}
+ */
+
+module.exports = Pool;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/connection/utils.js b/NodeAPI/node_modules/mongodb/lib/core/connection/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..3362b6984d5e97608b67ebb4c4bc2ba3c4aeabed
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/connection/utils.js
@@ -0,0 +1,52 @@
+'use strict';
+
+const require_optional = require('optional-require')(require);
+
+function debugOptions(debugFields, options) {
+  const finaloptions = {};
+  debugFields.forEach(function(n) {
+    finaloptions[n] = options[n];
+  });
+
+  return finaloptions;
+}
+
+function retrieveBSON() {
+  const BSON = require('bson');
+  BSON.native = false;
+
+  const optionalBSON = require_optional('bson-ext');
+  if (optionalBSON) {
+    optionalBSON.native = true;
+    return optionalBSON;
+  }
+
+  return BSON;
+}
+
+// Throw an error if an attempt to use Snappy is made when Snappy is not installed
+function noSnappyWarning() {
+  throw new Error(
+    'Attempted to use Snappy compression, but Snappy is not installed. Install or disable Snappy compression and try again.'
+  );
+}
+
+// Facilitate loading Snappy optionally
+function retrieveSnappy() {
+  let snappy = require_optional('snappy');
+  if (!snappy) {
+    snappy = {
+      compress: noSnappyWarning,
+      uncompress: noSnappyWarning,
+      compressSync: noSnappyWarning,
+      uncompressSync: noSnappyWarning
+    };
+  }
+  return snappy;
+}
+
+module.exports = {
+  debugOptions,
+  retrieveBSON,
+  retrieveSnappy
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/cursor.js b/NodeAPI/node_modules/mongodb/lib/core/cursor.js
new file mode 100644
index 0000000000000000000000000000000000000000..48b60d1a95b0676621eef84c07b6f3779844260b
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/cursor.js
@@ -0,0 +1,874 @@
+'use strict';
+
+const Logger = require('./connection/logger');
+const retrieveBSON = require('./connection/utils').retrieveBSON;
+const MongoError = require('./error').MongoError;
+const MongoNetworkError = require('./error').MongoNetworkError;
+const collationNotSupported = require('./utils').collationNotSupported;
+const ReadPreference = require('./topologies/read_preference');
+const isUnifiedTopology = require('./utils').isUnifiedTopology;
+const executeOperation = require('../operations/execute_operation');
+const Readable = require('stream').Readable;
+const SUPPORTS = require('../utils').SUPPORTS;
+const MongoDBNamespace = require('../utils').MongoDBNamespace;
+const mergeOptions = require('../utils').mergeOptions;
+const OperationBase = require('../operations/operation').OperationBase;
+
+const BSON = retrieveBSON();
+const Long = BSON.Long;
+
+// Possible states for a cursor
+const CursorState = {
+  INIT: 0,
+  OPEN: 1,
+  CLOSED: 2,
+  GET_MORE: 3
+};
+
+//
+// Handle callback (including any exceptions thrown)
+function handleCallback(callback, err, result) {
+  try {
+    callback(err, result);
+  } catch (err) {
+    process.nextTick(function() {
+      throw err;
+    });
+  }
+}
+
+/**
+ * This is a cursor results callback
+ *
+ * @callback resultCallback
+ * @param {error} error An error object. Set to null if no error present
+ * @param {object} document
+ */
+
+/**
+ * @fileOverview The **Cursor** class is an internal class that embodies a cursor on MongoDB
+ * allowing for iteration over the results returned from the underlying query.
+ *
+ * **CURSORS Cannot directly be instantiated**
+ */
+
+/**
+ * The core cursor class. All cursors in the driver build off of this one.
+ *
+ * @property {number} cursorBatchSize The current cursorBatchSize for the cursor
+ * @property {number} cursorLimit The current cursorLimit for the cursor
+ * @property {number} cursorSkip The current cursorSkip for the cursor
+ */
+class CoreCursor extends Readable {
+  /**
+   * Create a new core `Cursor` instance.
+   * **NOTE** Not to be instantiated directly
+   *
+   * @param {object} topology The server topology instance.
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {{object}|Long} cmd The selector (can be a command or a cursorId)
+   * @param {object} [options=null] Optional settings.
+   * @param {object} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find/| find command documentation} and {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+   * @param {array} [options.documents=[]] Initial documents list for cursor
+   * @param {object} [options.transforms=null] Transform methods for the cursor results
+   * @param {function} [options.transforms.query] Transform the value returned from the initial query
+   * @param {function} [options.transforms.doc] Transform each document returned from Cursor.prototype._next
+   */
+  constructor(topology, ns, cmd, options) {
+    super({ objectMode: true });
+    options = options || {};
+
+    if (ns instanceof OperationBase) {
+      this.operation = ns;
+      ns = this.operation.ns.toString();
+      options = this.operation.options;
+      cmd = this.operation.cmd ? this.operation.cmd : {};
+    }
+
+    // Cursor pool
+    this.pool = null;
+    // Cursor server
+    this.server = null;
+
+    // Do we have a not connected handler
+    this.disconnectHandler = options.disconnectHandler;
+
+    // Set local values
+    this.bson = topology.s.bson;
+    this.ns = ns;
+    this.namespace = MongoDBNamespace.fromString(ns);
+    this.cmd = cmd;
+    this.options = options;
+    this.topology = topology;
+
+    // All internal state
+    this.cursorState = {
+      cursorId: null,
+      cmd,
+      documents: options.documents || [],
+      cursorIndex: 0,
+      dead: false,
+      killed: false,
+      init: false,
+      notified: false,
+      limit: options.limit || cmd.limit || 0,
+      skip: options.skip || cmd.skip || 0,
+      batchSize: options.batchSize || cmd.batchSize || 1000,
+      currentLimit: 0,
+      // Result field name if not a cursor (contains the array of results)
+      transforms: options.transforms,
+      raw: options.raw || (cmd && cmd.raw)
+    };
+
+    if (typeof options.session === 'object') {
+      this.cursorState.session = options.session;
+    }
+
+    // Add promoteLong to cursor state
+    const topologyOptions = topology.s.options;
+    if (typeof topologyOptions.promoteLongs === 'boolean') {
+      this.cursorState.promoteLongs = topologyOptions.promoteLongs;
+    } else if (typeof options.promoteLongs === 'boolean') {
+      this.cursorState.promoteLongs = options.promoteLongs;
+    }
+
+    // Add promoteValues to cursor state
+    if (typeof topologyOptions.promoteValues === 'boolean') {
+      this.cursorState.promoteValues = topologyOptions.promoteValues;
+    } else if (typeof options.promoteValues === 'boolean') {
+      this.cursorState.promoteValues = options.promoteValues;
+    }
+
+    // Add promoteBuffers to cursor state
+    if (typeof topologyOptions.promoteBuffers === 'boolean') {
+      this.cursorState.promoteBuffers = topologyOptions.promoteBuffers;
+    } else if (typeof options.promoteBuffers === 'boolean') {
+      this.cursorState.promoteBuffers = options.promoteBuffers;
+    }
+
+    if (topologyOptions.reconnect) {
+      this.cursorState.reconnect = topologyOptions.reconnect;
+    }
+
+    // Logger
+    this.logger = Logger('Cursor', topologyOptions);
+
+    //
+    // Did we pass in a cursor id
+    if (typeof cmd === 'number') {
+      this.cursorState.cursorId = Long.fromNumber(cmd);
+      this.cursorState.lastCursorId = this.cursorState.cursorId;
+    } else if (cmd instanceof Long) {
+      this.cursorState.cursorId = cmd;
+      this.cursorState.lastCursorId = cmd;
+    }
+
+    // TODO: remove as part of NODE-2104
+    if (this.operation) {
+      this.operation.cursorState = this.cursorState;
+    }
+  }
+
+  setCursorBatchSize(value) {
+    this.cursorState.batchSize = value;
+  }
+
+  cursorBatchSize() {
+    return this.cursorState.batchSize;
+  }
+
+  setCursorLimit(value) {
+    this.cursorState.limit = value;
+  }
+
+  cursorLimit() {
+    return this.cursorState.limit;
+  }
+
+  setCursorSkip(value) {
+    this.cursorState.skip = value;
+  }
+
+  cursorSkip() {
+    return this.cursorState.skip;
+  }
+
+  /**
+   * Retrieve the next document from the cursor
+   * @method
+   * @param {resultCallback} callback A callback function
+   */
+  _next(callback) {
+    nextFunction(this, callback);
+  }
+
+  /**
+   * Clone the cursor
+   * @method
+   * @return {Cursor}
+   */
+  clone() {
+    const clonedOptions = mergeOptions({}, this.options);
+    delete clonedOptions.session;
+    return this.topology.cursor(this.ns, this.cmd, clonedOptions);
+  }
+
+  /**
+   * Checks if the cursor is dead
+   * @method
+   * @return {boolean} A boolean signifying if the cursor is dead or not
+   */
+  isDead() {
+    return this.cursorState.dead === true;
+  }
+
+  /**
+   * Checks if the cursor was killed by the application
+   * @method
+   * @return {boolean} A boolean signifying if the cursor was killed by the application
+   */
+  isKilled() {
+    return this.cursorState.killed === true;
+  }
+
+  /**
+   * Checks if the cursor notified it's caller about it's death
+   * @method
+   * @return {boolean} A boolean signifying if the cursor notified the callback
+   */
+  isNotified() {
+    return this.cursorState.notified === true;
+  }
+
+  /**
+   * Returns current buffered documents length
+   * @method
+   * @return {number} The number of items in the buffered documents
+   */
+  bufferedCount() {
+    return this.cursorState.documents.length - this.cursorState.cursorIndex;
+  }
+
+  /**
+   * Returns current buffered documents
+   * @method
+   * @return {Array} An array of buffered documents
+   */
+  readBufferedDocuments(number) {
+    const unreadDocumentsLength = this.cursorState.documents.length - this.cursorState.cursorIndex;
+    const length = number < unreadDocumentsLength ? number : unreadDocumentsLength;
+    let elements = this.cursorState.documents.slice(
+      this.cursorState.cursorIndex,
+      this.cursorState.cursorIndex + length
+    );
+
+    // Transform the doc with passed in transformation method if provided
+    if (this.cursorState.transforms && typeof this.cursorState.transforms.doc === 'function') {
+      // Transform all the elements
+      for (let i = 0; i < elements.length; i++) {
+        elements[i] = this.cursorState.transforms.doc(elements[i]);
+      }
+    }
+
+    // Ensure we do not return any more documents than the limit imposed
+    // Just return the number of elements up to the limit
+    if (
+      this.cursorState.limit > 0 &&
+      this.cursorState.currentLimit + elements.length > this.cursorState.limit
+    ) {
+      elements = elements.slice(0, this.cursorState.limit - this.cursorState.currentLimit);
+      this.kill();
+    }
+
+    // Adjust current limit
+    this.cursorState.currentLimit = this.cursorState.currentLimit + elements.length;
+    this.cursorState.cursorIndex = this.cursorState.cursorIndex + elements.length;
+
+    // Return elements
+    return elements;
+  }
+
+  /**
+   * Resets local state for this cursor instance, and issues a `killCursors` command to the server
+   *
+   * @param {resultCallback} callback A callback function
+   */
+  kill(callback) {
+    // Set cursor to dead
+    this.cursorState.dead = true;
+    this.cursorState.killed = true;
+    // Remove documents
+    this.cursorState.documents = [];
+
+    // If no cursor id just return
+    if (
+      this.cursorState.cursorId == null ||
+      this.cursorState.cursorId.isZero() ||
+      this.cursorState.init === false
+    ) {
+      if (callback) callback(null, null);
+      return;
+    }
+
+    this.server.killCursors(this.ns, this.cursorState, callback);
+  }
+
+  /**
+   * Resets the cursor
+   */
+  rewind() {
+    if (this.cursorState.init) {
+      if (!this.cursorState.dead) {
+        this.kill();
+      }
+
+      this.cursorState.currentLimit = 0;
+      this.cursorState.init = false;
+      this.cursorState.dead = false;
+      this.cursorState.killed = false;
+      this.cursorState.notified = false;
+      this.cursorState.documents = [];
+      this.cursorState.cursorId = null;
+      this.cursorState.cursorIndex = 0;
+    }
+  }
+
+  // Internal methods
+  _read() {
+    if ((this.s && this.s.state === CursorState.CLOSED) || this.isDead()) {
+      return this.push(null);
+    }
+
+    // Get the next item
+    this._next((err, result) => {
+      if (err) {
+        if (this.listeners('error') && this.listeners('error').length > 0) {
+          this.emit('error', err);
+        }
+        if (!this.isDead()) this.close();
+
+        // Emit end event
+        this.emit('end');
+        return this.emit('finish');
+      }
+
+      // If we provided a transformation method
+      if (
+        this.cursorState.streamOptions &&
+        typeof this.cursorState.streamOptions.transform === 'function' &&
+        result != null
+      ) {
+        return this.push(this.cursorState.streamOptions.transform(result));
+      }
+
+      // Return the result
+      this.push(result);
+
+      if (result === null && this.isDead()) {
+        this.once('end', () => {
+          this.close();
+          this.emit('finish');
+        });
+      }
+    });
+  }
+
+  _endSession(options, callback) {
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+    options = options || {};
+
+    const session = this.cursorState.session;
+
+    if (session && (options.force || session.owner === this)) {
+      this.cursorState.session = undefined;
+
+      if (this.operation) {
+        this.operation.clearSession();
+      }
+
+      session.endSession(callback);
+      return true;
+    }
+
+    if (callback) {
+      callback();
+    }
+
+    return false;
+  }
+
+  _getMore(callback) {
+    if (this.logger.isDebug()) {
+      this.logger.debug(`schedule getMore call for query [${JSON.stringify(this.query)}]`);
+    }
+
+    // Set the current batchSize
+    let batchSize = this.cursorState.batchSize;
+    if (
+      this.cursorState.limit > 0 &&
+      this.cursorState.currentLimit + batchSize > this.cursorState.limit
+    ) {
+      batchSize = this.cursorState.limit - this.cursorState.currentLimit;
+    }
+
+    const cursorState = this.cursorState;
+    this.server.getMore(this.ns, cursorState, batchSize, this.options, (err, result, conn) => {
+      // NOTE: `getMore` modifies `cursorState`, would be very ideal not to do so in the future
+      if (err || (cursorState.cursorId && cursorState.cursorId.isZero())) {
+        this._endSession();
+      }
+
+      callback(err, result, conn);
+    });
+  }
+
+  _initializeCursor(callback) {
+    const cursor = this;
+
+    // NOTE: this goes away once cursors use `executeOperation`
+    if (isUnifiedTopology(cursor.topology) && cursor.topology.shouldCheckForSessionSupport()) {
+      cursor.topology.selectServer(ReadPreference.primaryPreferred, err => {
+        if (err) {
+          callback(err);
+          return;
+        }
+
+        this._initializeCursor(callback);
+      });
+
+      return;
+    }
+
+    function done(err, result) {
+      const cursorState = cursor.cursorState;
+      if (err || (cursorState.cursorId && cursorState.cursorId.isZero())) {
+        cursor._endSession();
+      }
+
+      if (
+        cursorState.documents.length === 0 &&
+        cursorState.cursorId &&
+        cursorState.cursorId.isZero() &&
+        !cursor.cmd.tailable &&
+        !cursor.cmd.awaitData
+      ) {
+        return setCursorNotified(cursor, callback);
+      }
+
+      callback(err, result);
+    }
+
+    const queryCallback = (err, r) => {
+      if (err) {
+        return done(err);
+      }
+
+      const result = r.message;
+
+      if (Array.isArray(result.documents) && result.documents.length === 1) {
+        const document = result.documents[0];
+
+        if (result.queryFailure) {
+          return done(new MongoError(document), null);
+        }
+
+        // Check if we have a command cursor
+        if (!cursor.cmd.find || (cursor.cmd.find && cursor.cmd.virtual === false)) {
+          // We have an error document, return the error
+          if (document.$err || document.errmsg) {
+            return done(new MongoError(document), null);
+          }
+
+          // We have a cursor document
+          if (document.cursor != null && typeof document.cursor !== 'string') {
+            const id = document.cursor.id;
+            // If we have a namespace change set the new namespace for getmores
+            if (document.cursor.ns) {
+              cursor.ns = document.cursor.ns;
+            }
+            // Promote id to long if needed
+            cursor.cursorState.cursorId = typeof id === 'number' ? Long.fromNumber(id) : id;
+            cursor.cursorState.lastCursorId = cursor.cursorState.cursorId;
+            cursor.cursorState.operationTime = document.operationTime;
+
+            // If we have a firstBatch set it
+            if (Array.isArray(document.cursor.firstBatch)) {
+              cursor.cursorState.documents = document.cursor.firstBatch; //.reverse();
+            }
+
+            // Return after processing command cursor
+            return done(null, result);
+          }
+        }
+      }
+
+      // Otherwise fall back to regular find path
+      const cursorId = result.cursorId || 0;
+      cursor.cursorState.cursorId = cursorId instanceof Long ? cursorId : Long.fromNumber(cursorId);
+      cursor.cursorState.documents = result.documents;
+      cursor.cursorState.lastCursorId = result.cursorId;
+
+      // Transform the results with passed in transformation method if provided
+      if (
+        cursor.cursorState.transforms &&
+        typeof cursor.cursorState.transforms.query === 'function'
+      ) {
+        cursor.cursorState.documents = cursor.cursorState.transforms.query(result);
+      }
+
+      done(null, result);
+    };
+
+    if (cursor.operation) {
+      if (cursor.logger.isDebug()) {
+        cursor.logger.debug(
+          `issue initial query [${JSON.stringify(cursor.cmd)}] with flags [${JSON.stringify(
+            cursor.query
+          )}]`
+        );
+      }
+
+      executeOperation(cursor.topology, cursor.operation, (err, result) => {
+        if (err) {
+          done(err);
+          return;
+        }
+
+        cursor.server = cursor.operation.server;
+        cursor.cursorState.init = true;
+
+        // NOTE: this is a special internal method for cloning a cursor, consider removing
+        if (cursor.cursorState.cursorId != null) {
+          return done();
+        }
+
+        queryCallback(err, result);
+      });
+
+      return;
+    }
+
+    // Very explicitly choose what is passed to selectServer
+    const serverSelectOptions = {};
+    if (cursor.cursorState.session) {
+      serverSelectOptions.session = cursor.cursorState.session;
+    }
+
+    if (cursor.operation) {
+      serverSelectOptions.readPreference = cursor.operation.readPreference;
+    } else if (cursor.options.readPreference) {
+      serverSelectOptions.readPreference = cursor.options.readPreference;
+    }
+
+    return cursor.topology.selectServer(serverSelectOptions, (err, server) => {
+      if (err) {
+        const disconnectHandler = cursor.disconnectHandler;
+        if (disconnectHandler != null) {
+          return disconnectHandler.addObjectAndMethod(
+            'cursor',
+            cursor,
+            'next',
+            [callback],
+            callback
+          );
+        }
+
+        return callback(err);
+      }
+
+      cursor.server = server;
+      cursor.cursorState.init = true;
+      if (collationNotSupported(cursor.server, cursor.cmd)) {
+        return callback(new MongoError(`server ${cursor.server.name} does not support collation`));
+      }
+
+      // NOTE: this is a special internal method for cloning a cursor, consider removing
+      if (cursor.cursorState.cursorId != null) {
+        return done();
+      }
+
+      if (cursor.logger.isDebug()) {
+        cursor.logger.debug(
+          `issue initial query [${JSON.stringify(cursor.cmd)}] with flags [${JSON.stringify(
+            cursor.query
+          )}]`
+        );
+      }
+
+      if (cursor.cmd.find != null) {
+        server.query(cursor.ns, cursor.cmd, cursor.cursorState, cursor.options, queryCallback);
+        return;
+      }
+
+      const commandOptions = Object.assign({ session: cursor.cursorState.session }, cursor.options);
+      server.command(cursor.ns, cursor.cmd, commandOptions, queryCallback);
+    });
+  }
+}
+
+if (SUPPORTS.ASYNC_ITERATOR) {
+  CoreCursor.prototype[Symbol.asyncIterator] = require('../async/async_iterator').asyncIterator;
+}
+
+/**
+ * Validate if the pool is dead and return error
+ */
+function isConnectionDead(self, callback) {
+  if (self.pool && self.pool.isDestroyed()) {
+    self.cursorState.killed = true;
+    const err = new MongoNetworkError(
+      `connection to host ${self.pool.host}:${self.pool.port} was destroyed`
+    );
+
+    _setCursorNotifiedImpl(self, () => callback(err));
+    return true;
+  }
+
+  return false;
+}
+
+/**
+ * Validate if the cursor is dead but was not explicitly killed by user
+ */
+function isCursorDeadButNotkilled(self, callback) {
+  // Cursor is dead but not marked killed, return null
+  if (self.cursorState.dead && !self.cursorState.killed) {
+    self.cursorState.killed = true;
+    setCursorNotified(self, callback);
+    return true;
+  }
+
+  return false;
+}
+
+/**
+ * Validate if the cursor is dead and was killed by user
+ */
+function isCursorDeadAndKilled(self, callback) {
+  if (self.cursorState.dead && self.cursorState.killed) {
+    handleCallback(callback, new MongoError('cursor is dead'));
+    return true;
+  }
+
+  return false;
+}
+
+/**
+ * Validate if the cursor was killed by the user
+ */
+function isCursorKilled(self, callback) {
+  if (self.cursorState.killed) {
+    setCursorNotified(self, callback);
+    return true;
+  }
+
+  return false;
+}
+
+/**
+ * Mark cursor as being dead and notified
+ */
+function setCursorDeadAndNotified(self, callback) {
+  self.cursorState.dead = true;
+  setCursorNotified(self, callback);
+}
+
+/**
+ * Mark cursor as being notified
+ */
+function setCursorNotified(self, callback) {
+  _setCursorNotifiedImpl(self, () => handleCallback(callback, null, null));
+}
+
+function _setCursorNotifiedImpl(self, callback) {
+  self.cursorState.notified = true;
+  self.cursorState.documents = [];
+  self.cursorState.cursorIndex = 0;
+
+  if (self.cursorState.session) {
+    self._endSession(callback);
+    return;
+  }
+
+  return callback();
+}
+
+function nextFunction(self, callback) {
+  // We have notified about it
+  if (self.cursorState.notified) {
+    return callback(new Error('cursor is exhausted'));
+  }
+
+  // Cursor is killed return null
+  if (isCursorKilled(self, callback)) return;
+
+  // Cursor is dead but not marked killed, return null
+  if (isCursorDeadButNotkilled(self, callback)) return;
+
+  // We have a dead and killed cursor, attempting to call next should error
+  if (isCursorDeadAndKilled(self, callback)) return;
+
+  // We have just started the cursor
+  if (!self.cursorState.init) {
+    // Topology is not connected, save the call in the provided store to be
+    // Executed at some point when the handler deems it's reconnected
+    if (!self.topology.isConnected(self.options)) {
+      // Only need this for single server, because repl sets and mongos
+      // will always continue trying to reconnect
+      if (self.topology._type === 'server' && !self.topology.s.options.reconnect) {
+        // Reconnect is disabled, so we'll never reconnect
+        return callback(new MongoError('no connection available'));
+      }
+
+      if (self.disconnectHandler != null) {
+        if (self.topology.isDestroyed()) {
+          // Topology was destroyed, so don't try to wait for it to reconnect
+          return callback(new MongoError('Topology was destroyed'));
+        }
+
+        self.disconnectHandler.addObjectAndMethod('cursor', self, 'next', [callback], callback);
+        return;
+      }
+    }
+
+    self._initializeCursor((err, result) => {
+      if (err || result === null) {
+        callback(err, result);
+        return;
+      }
+
+      nextFunction(self, callback);
+    });
+
+    return;
+  }
+
+  if (self.cursorState.limit > 0 && self.cursorState.currentLimit >= self.cursorState.limit) {
+    // Ensure we kill the cursor on the server
+    self.kill(() =>
+      // Set cursor in dead and notified state
+      setCursorDeadAndNotified(self, callback)
+    );
+  } else if (
+    self.cursorState.cursorIndex === self.cursorState.documents.length &&
+    !Long.ZERO.equals(self.cursorState.cursorId)
+  ) {
+    // Ensure an empty cursor state
+    self.cursorState.documents = [];
+    self.cursorState.cursorIndex = 0;
+
+    // Check if topology is destroyed
+    if (self.topology.isDestroyed())
+      return callback(
+        new MongoNetworkError('connection destroyed, not possible to instantiate cursor')
+      );
+
+    // Check if connection is dead and return if not possible to
+    // execute a getMore on this connection
+    if (isConnectionDead(self, callback)) return;
+
+    // Execute the next get more
+    self._getMore(function(err, doc, connection) {
+      if (err) {
+        return handleCallback(callback, err);
+      }
+
+      // Save the returned connection to ensure all getMore's fire over the same connection
+      self.connection = connection;
+
+      // Tailable cursor getMore result, notify owner about it
+      // No attempt is made here to retry, this is left to the user of the
+      // core module to handle to keep core simple
+      if (
+        self.cursorState.documents.length === 0 &&
+        self.cmd.tailable &&
+        Long.ZERO.equals(self.cursorState.cursorId)
+      ) {
+        // No more documents in the tailed cursor
+        return handleCallback(
+          callback,
+          new MongoError({
+            message: 'No more documents in tailed cursor',
+            tailable: self.cmd.tailable,
+            awaitData: self.cmd.awaitData
+          })
+        );
+      } else if (
+        self.cursorState.documents.length === 0 &&
+        self.cmd.tailable &&
+        !Long.ZERO.equals(self.cursorState.cursorId)
+      ) {
+        return nextFunction(self, callback);
+      }
+
+      if (self.cursorState.limit > 0 && self.cursorState.currentLimit >= self.cursorState.limit) {
+        return setCursorDeadAndNotified(self, callback);
+      }
+
+      nextFunction(self, callback);
+    });
+  } else if (
+    self.cursorState.documents.length === self.cursorState.cursorIndex &&
+    self.cmd.tailable &&
+    Long.ZERO.equals(self.cursorState.cursorId)
+  ) {
+    return handleCallback(
+      callback,
+      new MongoError({
+        message: 'No more documents in tailed cursor',
+        tailable: self.cmd.tailable,
+        awaitData: self.cmd.awaitData
+      })
+    );
+  } else if (
+    self.cursorState.documents.length === self.cursorState.cursorIndex &&
+    Long.ZERO.equals(self.cursorState.cursorId)
+  ) {
+    setCursorDeadAndNotified(self, callback);
+  } else {
+    if (self.cursorState.limit > 0 && self.cursorState.currentLimit >= self.cursorState.limit) {
+      // Ensure we kill the cursor on the server
+      self.kill(() =>
+        // Set cursor in dead and notified state
+        setCursorDeadAndNotified(self, callback)
+      );
+
+      return;
+    }
+
+    // Increment the current cursor limit
+    self.cursorState.currentLimit += 1;
+
+    // Get the document
+    let doc = self.cursorState.documents[self.cursorState.cursorIndex++];
+
+    // Doc overflow
+    if (!doc || doc.$err) {
+      // Ensure we kill the cursor on the server
+      self.kill(() =>
+        // Set cursor in dead and notified state
+        setCursorDeadAndNotified(self, function() {
+          handleCallback(callback, new MongoError(doc ? doc.$err : undefined));
+        })
+      );
+
+      return;
+    }
+
+    // Transform the doc with passed in transformation method if provided
+    if (self.cursorState.transforms && typeof self.cursorState.transforms.doc === 'function') {
+      doc = self.cursorState.transforms.doc(doc);
+    }
+
+    // Return the document
+    handleCallback(callback, null, doc);
+  }
+}
+
+module.exports = {
+  CursorState,
+  CoreCursor
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/error.js b/NodeAPI/node_modules/mongodb/lib/core/error.js
new file mode 100644
index 0000000000000000000000000000000000000000..702e3cecded6f5555c7bbc19ad7a4e3b0c0722aa
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/error.js
@@ -0,0 +1,351 @@
+'use strict';
+
+const kErrorLabels = Symbol('errorLabels');
+
+/**
+ * Creates a new MongoError
+ *
+ * @augments Error
+ * @param {Error|string|object} message The error message
+ * @property {string} message The error message
+ * @property {string} stack The error call stack
+ */
+class MongoError extends Error {
+  constructor(message) {
+    if (message instanceof Error) {
+      super(message.message);
+      this.stack = message.stack;
+    } else {
+      if (typeof message === 'string') {
+        super(message);
+      } else {
+        super(message.message || message.errmsg || message.$err || 'n/a');
+        if (message.errorLabels) {
+          this[kErrorLabels] = new Set(message.errorLabels);
+        }
+
+        for (var name in message) {
+          if (name === 'errorLabels' || name === 'errmsg') {
+            continue;
+          }
+
+          this[name] = message[name];
+        }
+      }
+
+      Error.captureStackTrace(this, this.constructor);
+    }
+
+    this.name = 'MongoError';
+  }
+
+  /**
+   * Legacy name for server error responses
+   */
+  get errmsg() {
+    return this.message;
+  }
+
+  /**
+   * Creates a new MongoError object
+   *
+   * @param {Error|string|object} options The options used to create the error.
+   * @return {MongoError} A MongoError instance
+   * @deprecated Use `new MongoError()` instead.
+   */
+  static create(options) {
+    return new MongoError(options);
+  }
+
+  /**
+   * Checks the error to see if it has an error label
+   * @param {string} label The error label to check for
+   * @returns {boolean} returns true if the error has the provided error label
+   */
+  hasErrorLabel(label) {
+    if (this[kErrorLabels] == null) {
+      return false;
+    }
+
+    return this[kErrorLabels].has(label);
+  }
+
+  addErrorLabel(label) {
+    if (this[kErrorLabels] == null) {
+      this[kErrorLabels] = new Set();
+    }
+
+    this[kErrorLabels].add(label);
+  }
+
+  get errorLabels() {
+    return this[kErrorLabels] ? Array.from(this[kErrorLabels]) : [];
+  }
+}
+
+const kBeforeHandshake = Symbol('beforeHandshake');
+function isNetworkErrorBeforeHandshake(err) {
+  return err[kBeforeHandshake] === true;
+}
+
+/**
+ * An error indicating an issue with the network, including TCP
+ * errors and timeouts.
+ *
+ * @param {Error|string|object} message The error message
+ * @property {string} message The error message
+ * @property {string} stack The error call stack
+ * @extends MongoError
+ */
+class MongoNetworkError extends MongoError {
+  constructor(message, options) {
+    super(message);
+    this.name = 'MongoNetworkError';
+
+    if (options && typeof options.beforeHandshake === 'boolean') {
+      this[kBeforeHandshake] = options.beforeHandshake;
+    }
+  }
+}
+
+/**
+ * An error indicating a network timeout occurred
+ *
+ * @param {Error|string|object} message The error message
+ * @property {string} message The error message
+ * @property {object} [options.beforeHandshake] Indicates the timeout happened before a connection handshake completed
+ * @extends MongoError
+ */
+class MongoNetworkTimeoutError extends MongoNetworkError {
+  constructor(message, options) {
+    super(message, options);
+    this.name = 'MongoNetworkTimeoutError';
+  }
+}
+
+/**
+ * An error used when attempting to parse a value (like a connection string)
+ *
+ * @param {Error|string|object} message The error message
+ * @property {string} message The error message
+ * @extends MongoError
+ */
+class MongoParseError extends MongoError {
+  constructor(message) {
+    super(message);
+    this.name = 'MongoParseError';
+  }
+}
+
+/**
+ * An error signifying a client-side timeout event
+ *
+ * @param {Error|string|object} message The error message
+ * @param {string|object} [reason] The reason the timeout occured
+ * @property {string} message The error message
+ * @property {string} [reason] An optional reason context for the timeout, generally an error saved during flow of monitoring and selecting servers
+ * @extends MongoError
+ */
+class MongoTimeoutError extends MongoError {
+  constructor(message, reason) {
+    if (reason && reason.error) {
+      super(reason.error.message || reason.error);
+    } else {
+      super(message);
+    }
+
+    this.name = 'MongoTimeoutError';
+    if (reason) {
+      this.reason = reason;
+    }
+  }
+}
+
+/**
+ * An error signifying a client-side server selection error
+ *
+ * @param {Error|string|object} message The error message
+ * @param {string|object} [reason] The reason the timeout occured
+ * @property {string} message The error message
+ * @property {string} [reason] An optional reason context for the timeout, generally an error saved during flow of monitoring and selecting servers
+ * @extends MongoError
+ */
+class MongoServerSelectionError extends MongoTimeoutError {
+  constructor(message, reason) {
+    super(message, reason);
+    this.name = 'MongoServerSelectionError';
+  }
+}
+
+function makeWriteConcernResultObject(input) {
+  const output = Object.assign({}, input);
+
+  if (output.ok === 0) {
+    output.ok = 1;
+    delete output.errmsg;
+    delete output.code;
+    delete output.codeName;
+  }
+
+  return output;
+}
+
+/**
+ * An error thrown when the server reports a writeConcernError
+ *
+ * @param {Error|string|object} message The error message
+ * @param {object} result The result document (provided if ok: 1)
+ * @property {string} message The error message
+ * @property {object} [result] The result document (provided if ok: 1)
+ * @extends MongoError
+ */
+class MongoWriteConcernError extends MongoError {
+  constructor(message, result) {
+    super(message);
+    this.name = 'MongoWriteConcernError';
+
+    if (result && Array.isArray(result.errorLabels)) {
+      this[kErrorLabels] = new Set(result.errorLabels);
+    }
+
+    if (result != null) {
+      this.result = makeWriteConcernResultObject(result);
+    }
+  }
+}
+
+// see: https://github.com/mongodb/specifications/blob/master/source/retryable-writes/retryable-writes.rst#terms
+const RETRYABLE_ERROR_CODES = new Set([
+  6, // HostUnreachable
+  7, // HostNotFound
+  89, // NetworkTimeout
+  91, // ShutdownInProgress
+  189, // PrimarySteppedDown
+  9001, // SocketException
+  10107, // NotMaster
+  11600, // InterruptedAtShutdown
+  11602, // InterruptedDueToReplStateChange
+  13435, // NotMasterNoSlaveOk
+  13436 // NotMasterOrSecondary
+]);
+
+const RETRYABLE_WRITE_ERROR_CODES = new Set([
+  11600, // InterruptedAtShutdown
+  11602, // InterruptedDueToReplStateChange
+  10107, // NotMaster
+  13435, // NotMasterNoSlaveOk
+  13436, // NotMasterOrSecondary
+  189, // PrimarySteppedDown
+  91, // ShutdownInProgress
+  7, // HostNotFound
+  6, // HostUnreachable
+  89, // NetworkTimeout
+  9001, // SocketException
+  262 // ExceededTimeLimit
+]);
+
+function isRetryableWriteError(error) {
+  if (error instanceof MongoWriteConcernError) {
+    return (
+      RETRYABLE_WRITE_ERROR_CODES.has(error.code) ||
+      RETRYABLE_WRITE_ERROR_CODES.has(error.result.code)
+    );
+  }
+
+  return RETRYABLE_WRITE_ERROR_CODES.has(error.code);
+}
+
+/**
+ * Determines whether an error is something the driver should attempt to retry
+ *
+ * @ignore
+ * @param {MongoError|Error} error
+ */
+function isRetryableError(error) {
+  return (
+    RETRYABLE_ERROR_CODES.has(error.code) ||
+    error instanceof MongoNetworkError ||
+    error.message.match(/not master/) ||
+    error.message.match(/node is recovering/)
+  );
+}
+
+const SDAM_RECOVERING_CODES = new Set([
+  91, // ShutdownInProgress
+  189, // PrimarySteppedDown
+  11600, // InterruptedAtShutdown
+  11602, // InterruptedDueToReplStateChange
+  13436 // NotMasterOrSecondary
+]);
+
+const SDAM_NOTMASTER_CODES = new Set([
+  10107, // NotMaster
+  13435 // NotMasterNoSlaveOk
+]);
+
+const SDAM_NODE_SHUTTING_DOWN_ERROR_CODES = new Set([
+  11600, // InterruptedAtShutdown
+  91 // ShutdownInProgress
+]);
+
+function isRecoveringError(err) {
+  if (err.code && SDAM_RECOVERING_CODES.has(err.code)) {
+    return true;
+  }
+
+  return err.message.match(/not master or secondary/) || err.message.match(/node is recovering/);
+}
+
+function isNotMasterError(err) {
+  if (err.code && SDAM_NOTMASTER_CODES.has(err.code)) {
+    return true;
+  }
+
+  if (isRecoveringError(err)) {
+    return false;
+  }
+
+  return err.message.match(/not master/);
+}
+
+function isNodeShuttingDownError(err) {
+  return err.code && SDAM_NODE_SHUTTING_DOWN_ERROR_CODES.has(err.code);
+}
+
+/**
+ * Determines whether SDAM can recover from a given error. If it cannot
+ * then the pool will be cleared, and server state will completely reset
+ * locally.
+ *
+ * @ignore
+ * @see https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#not-master-and-node-is-recovering
+ * @param {MongoError|Error} error
+ */
+function isSDAMUnrecoverableError(error) {
+  // NOTE: null check is here for a strictly pre-CMAP world, a timeout or
+  //       close event are considered unrecoverable
+  if (error instanceof MongoParseError || error == null) {
+    return true;
+  }
+
+  if (isRecoveringError(error) || isNotMasterError(error)) {
+    return true;
+  }
+
+  return false;
+}
+
+module.exports = {
+  MongoError,
+  MongoNetworkError,
+  MongoNetworkTimeoutError,
+  MongoParseError,
+  MongoTimeoutError,
+  MongoServerSelectionError,
+  MongoWriteConcernError,
+  isRetryableError,
+  isSDAMUnrecoverableError,
+  isNodeShuttingDownError,
+  isRetryableWriteError,
+  isNetworkErrorBeforeHandshake
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/index.js b/NodeAPI/node_modules/mongodb/lib/core/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..cf3bbfed7b25e7e492f54ab41fc6ae5b083de99b
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/index.js
@@ -0,0 +1,50 @@
+'use strict';
+
+let BSON = require('bson');
+const require_optional = require('optional-require')(require);
+const EJSON = require('./utils').retrieveEJSON();
+
+try {
+  // Attempt to grab the native BSON parser
+  const BSONNative = require_optional('bson-ext');
+  // If we got the native parser, use it instead of the
+  // Javascript one
+  if (BSONNative) {
+    BSON = BSONNative;
+  }
+} catch (err) {} // eslint-disable-line
+
+module.exports = {
+  // Errors
+  MongoError: require('./error').MongoError,
+  MongoNetworkError: require('./error').MongoNetworkError,
+  MongoParseError: require('./error').MongoParseError,
+  MongoTimeoutError: require('./error').MongoTimeoutError,
+  MongoServerSelectionError: require('./error').MongoServerSelectionError,
+  MongoWriteConcernError: require('./error').MongoWriteConcernError,
+  // Core
+  Connection: require('./connection/connection'),
+  Server: require('./topologies/server'),
+  ReplSet: require('./topologies/replset'),
+  Mongos: require('./topologies/mongos'),
+  Logger: require('./connection/logger'),
+  Cursor: require('./cursor').CoreCursor,
+  ReadPreference: require('./topologies/read_preference'),
+  Sessions: require('./sessions'),
+  BSON: BSON,
+  EJSON: EJSON,
+  Topology: require('./sdam/topology').Topology,
+  // Raw operations
+  Query: require('./connection/commands').Query,
+  // Auth mechanisms
+  MongoCredentials: require('./auth/mongo_credentials').MongoCredentials,
+  defaultAuthProviders: require('./auth/defaultAuthProviders').defaultAuthProviders,
+  MongoCR: require('./auth/mongocr'),
+  X509: require('./auth/x509'),
+  Plain: require('./auth/plain'),
+  GSSAPI: require('./auth/gssapi'),
+  ScramSHA1: require('./auth/scram').ScramSHA1,
+  ScramSHA256: require('./auth/scram').ScramSHA256,
+  // Utilities
+  parseConnectionString: require('./uri_parser')
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/common.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/common.js
new file mode 100644
index 0000000000000000000000000000000000000000..3cfff4270629d0caabc91160cf26741f313c80e3
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/common.js
@@ -0,0 +1,67 @@
+'use strict';
+
+// shared state names
+const STATE_CLOSING = 'closing';
+const STATE_CLOSED = 'closed';
+const STATE_CONNECTING = 'connecting';
+const STATE_CONNECTED = 'connected';
+
+// An enumeration of topology types we know about
+const TopologyType = {
+  Single: 'Single',
+  ReplicaSetNoPrimary: 'ReplicaSetNoPrimary',
+  ReplicaSetWithPrimary: 'ReplicaSetWithPrimary',
+  Sharded: 'Sharded',
+  Unknown: 'Unknown'
+};
+
+// An enumeration of server types we know about
+const ServerType = {
+  Standalone: 'Standalone',
+  Mongos: 'Mongos',
+  PossiblePrimary: 'PossiblePrimary',
+  RSPrimary: 'RSPrimary',
+  RSSecondary: 'RSSecondary',
+  RSArbiter: 'RSArbiter',
+  RSOther: 'RSOther',
+  RSGhost: 'RSGhost',
+  Unknown: 'Unknown'
+};
+
+// helper to get a server's type that works for both legacy and unified topologies
+function serverType(server) {
+  let description = server.s.description || server.s.serverDescription;
+  if (description.topologyType === TopologyType.Single) return description.servers[0].type;
+  return description.type;
+}
+
+const TOPOLOGY_DEFAULTS = {
+  useUnifiedTopology: true,
+  localThresholdMS: 15,
+  serverSelectionTimeoutMS: 30000,
+  heartbeatFrequencyMS: 10000,
+  minHeartbeatFrequencyMS: 500
+};
+
+function drainTimerQueue(queue) {
+  queue.forEach(clearTimeout);
+  queue.clear();
+}
+
+function clearAndRemoveTimerFrom(timer, timers) {
+  clearTimeout(timer);
+  return timers.delete(timer);
+}
+
+module.exports = {
+  STATE_CLOSING,
+  STATE_CLOSED,
+  STATE_CONNECTING,
+  STATE_CONNECTED,
+  TOPOLOGY_DEFAULTS,
+  TopologyType,
+  ServerType,
+  serverType,
+  drainTimerQueue,
+  clearAndRemoveTimerFrom
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/events.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/events.js
new file mode 100644
index 0000000000000000000000000000000000000000..08a14adca5490b227fd916064aa04efcc6e42aac
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/events.js
@@ -0,0 +1,124 @@
+'use strict';
+
+/**
+ * Published when server description changes, but does NOT include changes to the RTT.
+ *
+ * @property {Object} topologyId A unique identifier for the topology
+ * @property {ServerAddress} address The address (host/port pair) of the server
+ * @property {ServerDescription} previousDescription The previous server description
+ * @property {ServerDescription} newDescription The new server description
+ */
+class ServerDescriptionChangedEvent {
+  constructor(topologyId, address, previousDescription, newDescription) {
+    Object.assign(this, { topologyId, address, previousDescription, newDescription });
+  }
+}
+
+/**
+ * Published when server is initialized.
+ *
+ * @property {Object} topologyId A unique identifier for the topology
+ * @property {ServerAddress} address The address (host/port pair) of the server
+ */
+class ServerOpeningEvent {
+  constructor(topologyId, address) {
+    Object.assign(this, { topologyId, address });
+  }
+}
+
+/**
+ * Published when server is closed.
+ *
+ * @property {ServerAddress} address The address (host/port pair) of the server
+ * @property {Object} topologyId A unique identifier for the topology
+ */
+class ServerClosedEvent {
+  constructor(topologyId, address) {
+    Object.assign(this, { topologyId, address });
+  }
+}
+
+/**
+ * Published when topology description changes.
+ *
+ * @property {Object} topologyId
+ * @property {TopologyDescription} previousDescription The old topology description
+ * @property {TopologyDescription} newDescription The new topology description
+ */
+class TopologyDescriptionChangedEvent {
+  constructor(topologyId, previousDescription, newDescription) {
+    Object.assign(this, { topologyId, previousDescription, newDescription });
+  }
+}
+
+/**
+ * Published when topology is initialized.
+ *
+ * @param {Object} topologyId A unique identifier for the topology
+ */
+class TopologyOpeningEvent {
+  constructor(topologyId) {
+    Object.assign(this, { topologyId });
+  }
+}
+
+/**
+ * Published when topology is closed.
+ *
+ * @param {Object} topologyId A unique identifier for the topology
+ */
+class TopologyClosedEvent {
+  constructor(topologyId) {
+    Object.assign(this, { topologyId });
+  }
+}
+
+/**
+ * Fired when the server monitor’s ismaster command is started - immediately before
+ * the ismaster command is serialized into raw BSON and written to the socket.
+ *
+ * @property {Object} connectionId The connection id for the command
+ */
+class ServerHeartbeatStartedEvent {
+  constructor(connectionId) {
+    Object.assign(this, { connectionId });
+  }
+}
+
+/**
+ * Fired when the server monitor’s ismaster succeeds.
+ *
+ * @param {Number} duration The execution time of the event in ms
+ * @param {Object} reply The command reply
+ * @param {Object} connectionId The connection id for the command
+ */
+class ServerHeartbeatSucceededEvent {
+  constructor(duration, reply, connectionId) {
+    Object.assign(this, { connectionId, duration, reply });
+  }
+}
+
+/**
+ * Fired when the server monitor’s ismaster fails, either with an “ok: 0” or a socket exception.
+ *
+ * @param {Number} duration The execution time of the event in ms
+ * @param {MongoError|Object} failure The command failure
+ * @param {Object} connectionId The connection id for the command
+ */
+class ServerHeartbeatFailedEvent {
+  constructor(duration, failure, connectionId) {
+    Object.assign(this, { connectionId, duration, failure });
+  }
+}
+
+module.exports = {
+  ServerDescriptionChangedEvent,
+  ServerOpeningEvent,
+  ServerClosedEvent,
+  TopologyDescriptionChangedEvent,
+  TopologyOpeningEvent,
+  TopologyClosedEvent,
+  ServerHeartbeatStartedEvent,
+  ServerHeartbeatSucceededEvent,
+  ServerHeartbeatFailedEvent
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/monitor.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/monitor.js
new file mode 100644
index 0000000000000000000000000000000000000000..701fb59b28af9d1daaa4efaf27481f9434df7d86
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/monitor.js
@@ -0,0 +1,413 @@
+'use strict';
+
+const ServerType = require('./common').ServerType;
+const EventEmitter = require('events');
+const connect = require('../connection/connect');
+const Connection = require('../../cmap/connection').Connection;
+const common = require('./common');
+const makeStateMachine = require('../utils').makeStateMachine;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const BSON = require('../connection/utils').retrieveBSON();
+const makeInterruptableAsyncInterval = require('../../utils').makeInterruptableAsyncInterval;
+const calculateDurationInMs = require('../../utils').calculateDurationInMs;
+const now = require('../../utils').now;
+
+const sdamEvents = require('./events');
+const ServerHeartbeatStartedEvent = sdamEvents.ServerHeartbeatStartedEvent;
+const ServerHeartbeatSucceededEvent = sdamEvents.ServerHeartbeatSucceededEvent;
+const ServerHeartbeatFailedEvent = sdamEvents.ServerHeartbeatFailedEvent;
+
+const kServer = Symbol('server');
+const kMonitorId = Symbol('monitorId');
+const kConnection = Symbol('connection');
+const kCancellationToken = Symbol('cancellationToken');
+const kRTTPinger = Symbol('rttPinger');
+const kRoundTripTime = Symbol('roundTripTime');
+
+const STATE_CLOSED = common.STATE_CLOSED;
+const STATE_CLOSING = common.STATE_CLOSING;
+const STATE_IDLE = 'idle';
+const STATE_MONITORING = 'monitoring';
+const stateTransition = makeStateMachine({
+  [STATE_CLOSING]: [STATE_CLOSING, STATE_IDLE, STATE_CLOSED],
+  [STATE_CLOSED]: [STATE_CLOSED, STATE_MONITORING],
+  [STATE_IDLE]: [STATE_IDLE, STATE_MONITORING, STATE_CLOSING],
+  [STATE_MONITORING]: [STATE_MONITORING, STATE_IDLE, STATE_CLOSING]
+});
+
+const INVALID_REQUEST_CHECK_STATES = new Set([STATE_CLOSING, STATE_CLOSED, STATE_MONITORING]);
+
+function isInCloseState(monitor) {
+  return monitor.s.state === STATE_CLOSED || monitor.s.state === STATE_CLOSING;
+}
+
+class Monitor extends EventEmitter {
+  constructor(server, options) {
+    super(options);
+
+    this[kServer] = server;
+    this[kConnection] = undefined;
+    this[kCancellationToken] = new EventEmitter();
+    this[kCancellationToken].setMaxListeners(Infinity);
+    this[kMonitorId] = null;
+    this.s = {
+      state: STATE_CLOSED
+    };
+
+    this.address = server.description.address;
+    this.options = Object.freeze({
+      connectTimeoutMS:
+        typeof options.connectionTimeout === 'number'
+          ? options.connectionTimeout
+          : typeof options.connectTimeoutMS === 'number'
+          ? options.connectTimeoutMS
+          : 10000,
+      heartbeatFrequencyMS:
+        typeof options.heartbeatFrequencyMS === 'number' ? options.heartbeatFrequencyMS : 10000,
+      minHeartbeatFrequencyMS:
+        typeof options.minHeartbeatFrequencyMS === 'number' ? options.minHeartbeatFrequencyMS : 500
+    });
+
+    // TODO: refactor this to pull it directly from the pool, requires new ConnectionPool integration
+    const connectOptions = Object.assign(
+      {
+        id: '<monitor>',
+        host: server.description.host,
+        port: server.description.port,
+        bson: server.s.bson,
+        connectionType: Connection
+      },
+      server.s.options,
+      this.options,
+
+      // force BSON serialization options
+      {
+        raw: false,
+        promoteLongs: true,
+        promoteValues: true,
+        promoteBuffers: true
+      }
+    );
+
+    // ensure no authentication is used for monitoring
+    delete connectOptions.credentials;
+
+    // ensure encryption is not requested for monitoring
+    delete connectOptions.autoEncrypter;
+
+    this.connectOptions = Object.freeze(connectOptions);
+  }
+
+  connect() {
+    if (this.s.state !== STATE_CLOSED) {
+      return;
+    }
+
+    // start
+    const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS;
+    const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS;
+    this[kMonitorId] = makeInterruptableAsyncInterval(monitorServer(this), {
+      interval: heartbeatFrequencyMS,
+      minInterval: minHeartbeatFrequencyMS,
+      immediate: true
+    });
+  }
+
+  requestCheck() {
+    if (INVALID_REQUEST_CHECK_STATES.has(this.s.state)) {
+      return;
+    }
+
+    this[kMonitorId].wake();
+  }
+
+  reset() {
+    const topologyVersion = this[kServer].description.topologyVersion;
+    if (isInCloseState(this) || topologyVersion == null) {
+      return;
+    }
+
+    stateTransition(this, STATE_CLOSING);
+    resetMonitorState(this);
+
+    // restart monitor
+    stateTransition(this, STATE_IDLE);
+
+    // restart monitoring
+    const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS;
+    const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS;
+    this[kMonitorId] = makeInterruptableAsyncInterval(monitorServer(this), {
+      interval: heartbeatFrequencyMS,
+      minInterval: minHeartbeatFrequencyMS
+    });
+  }
+
+  close() {
+    if (isInCloseState(this)) {
+      return;
+    }
+
+    stateTransition(this, STATE_CLOSING);
+    resetMonitorState(this);
+
+    // close monitor
+    this.emit('close');
+    stateTransition(this, STATE_CLOSED);
+  }
+}
+
+function resetMonitorState(monitor) {
+  if (monitor[kMonitorId]) {
+    monitor[kMonitorId].stop();
+    monitor[kMonitorId] = null;
+  }
+
+  if (monitor[kRTTPinger]) {
+    monitor[kRTTPinger].close();
+    monitor[kRTTPinger] = undefined;
+  }
+
+  monitor[kCancellationToken].emit('cancel');
+  if (monitor[kMonitorId]) {
+    clearTimeout(monitor[kMonitorId]);
+    monitor[kMonitorId] = undefined;
+  }
+
+  if (monitor[kConnection]) {
+    monitor[kConnection].destroy({ force: true });
+  }
+}
+
+function checkServer(monitor, callback) {
+  let start = now();
+  monitor.emit('serverHeartbeatStarted', new ServerHeartbeatStartedEvent(monitor.address));
+
+  function failureHandler(err) {
+    if (monitor[kConnection]) {
+      monitor[kConnection].destroy({ force: true });
+      monitor[kConnection] = undefined;
+    }
+
+    monitor.emit(
+      'serverHeartbeatFailed',
+      new ServerHeartbeatFailedEvent(calculateDurationInMs(start), err, monitor.address)
+    );
+
+    monitor.emit('resetServer', err);
+    monitor.emit('resetConnectionPool');
+    callback(err);
+  }
+
+  if (monitor[kConnection] != null && !monitor[kConnection].closed) {
+    const connectTimeoutMS = monitor.options.connectTimeoutMS;
+    const maxAwaitTimeMS = monitor.options.heartbeatFrequencyMS;
+    const topologyVersion = monitor[kServer].description.topologyVersion;
+    const isAwaitable = topologyVersion != null;
+
+    const cmd = { ismaster: true };
+    const options = { socketTimeout: connectTimeoutMS };
+
+    if (isAwaitable) {
+      cmd.maxAwaitTimeMS = maxAwaitTimeMS;
+      cmd.topologyVersion = makeTopologyVersion(topologyVersion);
+      if (connectTimeoutMS) {
+        options.socketTimeout = connectTimeoutMS + maxAwaitTimeMS;
+      }
+      options.exhaustAllowed = true;
+      if (monitor[kRTTPinger] == null) {
+        monitor[kRTTPinger] = new RTTPinger(monitor[kCancellationToken], monitor.connectOptions);
+      }
+    }
+
+    monitor[kConnection].command('admin.$cmd', cmd, options, (err, result) => {
+      if (err) {
+        failureHandler(err);
+        return;
+      }
+
+      const isMaster = result.result;
+      const rttPinger = monitor[kRTTPinger];
+
+      const duration =
+        isAwaitable && rttPinger ? rttPinger.roundTripTime : calculateDurationInMs(start);
+
+      monitor.emit(
+        'serverHeartbeatSucceeded',
+        new ServerHeartbeatSucceededEvent(duration, isMaster, monitor.address)
+      );
+
+      // if we are using the streaming protocol then we immediately issue another `started`
+      // event, otherwise the "check" is complete and return to the main monitor loop
+      if (isAwaitable && isMaster.topologyVersion) {
+        monitor.emit('serverHeartbeatStarted', new ServerHeartbeatStartedEvent(monitor.address));
+        start = now();
+      } else {
+        if (monitor[kRTTPinger]) {
+          monitor[kRTTPinger].close();
+          monitor[kRTTPinger] = undefined;
+        }
+
+        callback(undefined, isMaster);
+      }
+    });
+
+    return;
+  }
+
+  // connecting does an implicit `ismaster`
+  connect(monitor.connectOptions, monitor[kCancellationToken], (err, conn) => {
+    if (conn && isInCloseState(monitor)) {
+      conn.destroy({ force: true });
+      return;
+    }
+
+    if (err) {
+      monitor[kConnection] = undefined;
+
+      // we already reset the connection pool on network errors in all cases
+      if (!(err instanceof MongoNetworkError)) {
+        monitor.emit('resetConnectionPool');
+      }
+
+      failureHandler(err);
+      return;
+    }
+
+    monitor[kConnection] = conn;
+    monitor.emit(
+      'serverHeartbeatSucceeded',
+      new ServerHeartbeatSucceededEvent(
+        calculateDurationInMs(start),
+        conn.ismaster,
+        monitor.address
+      )
+    );
+
+    callback(undefined, conn.ismaster);
+  });
+}
+
+function monitorServer(monitor) {
+  return callback => {
+    stateTransition(monitor, STATE_MONITORING);
+    function done() {
+      if (!isInCloseState(monitor)) {
+        stateTransition(monitor, STATE_IDLE);
+      }
+
+      callback();
+    }
+
+    // TODO: the next line is a legacy event, remove in v4
+    process.nextTick(() => monitor.emit('monitoring', monitor[kServer]));
+
+    checkServer(monitor, (err, isMaster) => {
+      if (err) {
+        // otherwise an error occured on initial discovery, also bail
+        if (monitor[kServer].description.type === ServerType.Unknown) {
+          monitor.emit('resetServer', err);
+          return done();
+        }
+      }
+
+      // if the check indicates streaming is supported, immediately reschedule monitoring
+      if (isMaster && isMaster.topologyVersion) {
+        setTimeout(() => {
+          if (!isInCloseState(monitor)) {
+            monitor[kMonitorId].wake();
+          }
+        });
+      }
+
+      done();
+    });
+  };
+}
+
+function makeTopologyVersion(tv) {
+  return {
+    processId: tv.processId,
+    counter: BSON.Long.fromNumber(tv.counter)
+  };
+}
+
+class RTTPinger {
+  constructor(cancellationToken, options) {
+    this[kConnection] = null;
+    this[kCancellationToken] = cancellationToken;
+    this[kRoundTripTime] = 0;
+    this.closed = false;
+
+    const heartbeatFrequencyMS = options.heartbeatFrequencyMS;
+    this[kMonitorId] = setTimeout(() => measureRoundTripTime(this, options), heartbeatFrequencyMS);
+  }
+
+  get roundTripTime() {
+    return this[kRoundTripTime];
+  }
+
+  close() {
+    this.closed = true;
+
+    clearTimeout(this[kMonitorId]);
+    this[kMonitorId] = undefined;
+
+    if (this[kConnection]) {
+      this[kConnection].destroy({ force: true });
+    }
+  }
+}
+
+function measureRoundTripTime(rttPinger, options) {
+  const start = now();
+  const cancellationToken = rttPinger[kCancellationToken];
+  const heartbeatFrequencyMS = options.heartbeatFrequencyMS;
+  if (rttPinger.closed) {
+    return;
+  }
+
+  function measureAndReschedule(conn) {
+    if (rttPinger.closed) {
+      conn.destroy({ force: true });
+      return;
+    }
+
+    if (rttPinger[kConnection] == null) {
+      rttPinger[kConnection] = conn;
+    }
+
+    rttPinger[kRoundTripTime] = calculateDurationInMs(start);
+    rttPinger[kMonitorId] = setTimeout(
+      () => measureRoundTripTime(rttPinger, options),
+      heartbeatFrequencyMS
+    );
+  }
+
+  if (rttPinger[kConnection] == null) {
+    connect(options, cancellationToken, (err, conn) => {
+      if (err) {
+        rttPinger[kConnection] = undefined;
+        rttPinger[kRoundTripTime] = 0;
+        return;
+      }
+
+      measureAndReschedule(conn);
+    });
+
+    return;
+  }
+
+  rttPinger[kConnection].command('admin.$cmd', { ismaster: 1 }, err => {
+    if (err) {
+      rttPinger[kConnection] = undefined;
+      rttPinger[kRoundTripTime] = 0;
+      return;
+    }
+
+    measureAndReschedule();
+  });
+}
+
+module.exports = {
+  Monitor
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/server.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/server.js
new file mode 100644
index 0000000000000000000000000000000000000000..26aeb5ed23433123cc6a55cf32af4a88bbb53ad8
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/server.js
@@ -0,0 +1,564 @@
+'use strict';
+const EventEmitter = require('events');
+const ConnectionPool = require('../../cmap/connection_pool').ConnectionPool;
+const CMAP_EVENT_NAMES = require('../../cmap/events').CMAP_EVENT_NAMES;
+const MongoError = require('../error').MongoError;
+const relayEvents = require('../utils').relayEvents;
+const BSON = require('../connection/utils').retrieveBSON();
+const Logger = require('../connection/logger');
+const ServerDescription = require('./server_description').ServerDescription;
+const compareTopologyVersion = require('./server_description').compareTopologyVersion;
+const ReadPreference = require('../topologies/read_preference');
+const Monitor = require('./monitor').Monitor;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const MongoNetworkTimeoutError = require('../error').MongoNetworkTimeoutError;
+const collationNotSupported = require('../utils').collationNotSupported;
+const debugOptions = require('../connection/utils').debugOptions;
+const isSDAMUnrecoverableError = require('../error').isSDAMUnrecoverableError;
+const isRetryableWriteError = require('../error').isRetryableWriteError;
+const isNodeShuttingDownError = require('../error').isNodeShuttingDownError;
+const isNetworkErrorBeforeHandshake = require('../error').isNetworkErrorBeforeHandshake;
+const maxWireVersion = require('../utils').maxWireVersion;
+const makeStateMachine = require('../utils').makeStateMachine;
+const common = require('./common');
+const ServerType = common.ServerType;
+const isTransactionCommand = require('../transactions').isTransactionCommand;
+
+// Used for filtering out fields for logging
+const DEBUG_FIELDS = [
+  'reconnect',
+  'reconnectTries',
+  'reconnectInterval',
+  'emitError',
+  'cursorFactory',
+  'host',
+  'port',
+  'size',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'noDelay',
+  'connectionTimeout',
+  'checkServerIdentity',
+  'socketTimeout',
+  'ssl',
+  'ca',
+  'crl',
+  'cert',
+  'key',
+  'rejectUnauthorized',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'servername'
+];
+
+const STATE_CLOSING = common.STATE_CLOSING;
+const STATE_CLOSED = common.STATE_CLOSED;
+const STATE_CONNECTING = common.STATE_CONNECTING;
+const STATE_CONNECTED = common.STATE_CONNECTED;
+const stateTransition = makeStateMachine({
+  [STATE_CLOSED]: [STATE_CLOSED, STATE_CONNECTING],
+  [STATE_CONNECTING]: [STATE_CONNECTING, STATE_CLOSING, STATE_CONNECTED, STATE_CLOSED],
+  [STATE_CONNECTED]: [STATE_CONNECTED, STATE_CLOSING, STATE_CLOSED],
+  [STATE_CLOSING]: [STATE_CLOSING, STATE_CLOSED]
+});
+
+const kMonitor = Symbol('monitor');
+
+/**
+ *
+ * @fires Server#serverHeartbeatStarted
+ * @fires Server#serverHeartbeatSucceeded
+ * @fires Server#serverHeartbeatFailed
+ */
+class Server extends EventEmitter {
+  /**
+   * Create a server
+   *
+   * @param {ServerDescription} description
+   * @param {Object} options
+   */
+  constructor(description, options, topology) {
+    super();
+
+    this.s = {
+      // the server description
+      description,
+      // a saved copy of the incoming options
+      options,
+      // the server logger
+      logger: Logger('Server', options),
+      // the bson parser
+      bson:
+        options.bson ||
+        new BSON([
+          BSON.Binary,
+          BSON.Code,
+          BSON.DBRef,
+          BSON.Decimal128,
+          BSON.Double,
+          BSON.Int32,
+          BSON.Long,
+          BSON.Map,
+          BSON.MaxKey,
+          BSON.MinKey,
+          BSON.ObjectId,
+          BSON.BSONRegExp,
+          BSON.Symbol,
+          BSON.Timestamp
+        ]),
+      // the server state
+      state: STATE_CLOSED,
+      credentials: options.credentials,
+      topology
+    };
+
+    // create the connection pool
+    // NOTE: this used to happen in `connect`, we supported overriding pool options there
+    const poolOptions = Object.assign(
+      { host: this.description.host, port: this.description.port, bson: this.s.bson },
+      options
+    );
+
+    this.s.pool = new ConnectionPool(poolOptions);
+    relayEvents(
+      this.s.pool,
+      this,
+      ['commandStarted', 'commandSucceeded', 'commandFailed'].concat(CMAP_EVENT_NAMES)
+    );
+
+    this.s.pool.on('clusterTimeReceived', clusterTime => {
+      this.clusterTime = clusterTime;
+    });
+
+    // create the monitor
+    this[kMonitor] = new Monitor(this, this.s.options);
+    relayEvents(this[kMonitor], this, [
+      'serverHeartbeatStarted',
+      'serverHeartbeatSucceeded',
+      'serverHeartbeatFailed',
+
+      // legacy events
+      'monitoring'
+    ]);
+
+    this[kMonitor].on('resetConnectionPool', () => {
+      this.s.pool.clear();
+    });
+
+    this[kMonitor].on('resetServer', error => markServerUnknown(this, error));
+    this[kMonitor].on('serverHeartbeatSucceeded', event => {
+      this.emit(
+        'descriptionReceived',
+        new ServerDescription(this.description.address, event.reply, {
+          roundTripTime: calculateRoundTripTime(this.description.roundTripTime, event.duration)
+        })
+      );
+
+      if (this.s.state === STATE_CONNECTING) {
+        stateTransition(this, STATE_CONNECTED);
+        this.emit('connect', this);
+      }
+    });
+  }
+
+  get description() {
+    return this.s.description;
+  }
+
+  get name() {
+    return this.s.description.address;
+  }
+
+  get autoEncrypter() {
+    if (this.s.options && this.s.options.autoEncrypter) {
+      return this.s.options.autoEncrypter;
+    }
+    return null;
+  }
+
+  /**
+   * Initiate server connect
+   */
+  connect() {
+    if (this.s.state !== STATE_CLOSED) {
+      return;
+    }
+
+    stateTransition(this, STATE_CONNECTING);
+    this[kMonitor].connect();
+  }
+
+  /**
+   * Destroy the server connection
+   *
+   * @param {object} [options] Optional settings
+   * @param {Boolean} [options.force=false] Force destroy the pool
+   */
+  destroy(options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = Object.assign({}, { force: false }, options);
+
+    if (this.s.state === STATE_CLOSED) {
+      if (typeof callback === 'function') {
+        callback();
+      }
+
+      return;
+    }
+
+    stateTransition(this, STATE_CLOSING);
+
+    this[kMonitor].close();
+    this.s.pool.close(options, err => {
+      stateTransition(this, STATE_CLOSED);
+      this.emit('closed');
+      if (typeof callback === 'function') {
+        callback(err);
+      }
+    });
+  }
+
+  /**
+   * Immediately schedule monitoring of this server. If there already an attempt being made
+   * this will be a no-op.
+   */
+  requestCheck() {
+    this[kMonitor].requestCheck();
+  }
+
+  /**
+   * Execute a command
+   *
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {object} cmd The command hash
+   * @param {object} [options] Optional settings
+   * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.checkKeys=false] Specify if the bson parser should validate keys.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {Boolean} [options.fullResult=false] Return the full envelope instead of just the result document.
+   * @param {ClientSession} [options.session] Session to use for the operation
+   * @param {opResultCallback} callback A callback function
+   */
+  command(ns, cmd, options, callback) {
+    if (typeof options === 'function') {
+      (callback = options), (options = {}), (options = options || {});
+    }
+
+    if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) {
+      callback(new MongoError('server is closed'));
+      return;
+    }
+
+    const error = basicReadValidations(this, options);
+    if (error) {
+      return callback(error);
+    }
+
+    // Clone the options
+    options = Object.assign({}, options, { wireProtocolCommand: false });
+
+    // Debug log
+    if (this.s.logger.isDebug()) {
+      this.s.logger.debug(
+        `executing command [${JSON.stringify({
+          ns,
+          cmd,
+          options: debugOptions(DEBUG_FIELDS, options)
+        })}] against ${this.name}`
+      );
+    }
+
+    // error if collation not supported
+    if (collationNotSupported(this, cmd)) {
+      callback(new MongoError(`server ${this.name} does not support collation`));
+      return;
+    }
+
+    this.s.pool.withConnection((err, conn, cb) => {
+      if (err) {
+        markServerUnknown(this, err);
+        return cb(err);
+      }
+
+      conn.command(ns, cmd, options, makeOperationHandler(this, conn, cmd, options, cb));
+    }, callback);
+  }
+
+  /**
+   * Execute a query against the server
+   *
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {object} cmd The command document for the query
+   * @param {object} options Optional settings
+   * @param {function} callback
+   */
+  query(ns, cmd, cursorState, options, callback) {
+    if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) {
+      callback(new MongoError('server is closed'));
+      return;
+    }
+
+    this.s.pool.withConnection((err, conn, cb) => {
+      if (err) {
+        markServerUnknown(this, err);
+        return cb(err);
+      }
+
+      conn.query(ns, cmd, cursorState, options, makeOperationHandler(this, conn, cmd, options, cb));
+    }, callback);
+  }
+
+  /**
+   * Execute a `getMore` against the server
+   *
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {object} cursorState State data associated with the cursor calling this method
+   * @param {object} options Optional settings
+   * @param {function} callback
+   */
+  getMore(ns, cursorState, batchSize, options, callback) {
+    if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) {
+      callback(new MongoError('server is closed'));
+      return;
+    }
+
+    this.s.pool.withConnection((err, conn, cb) => {
+      if (err) {
+        markServerUnknown(this, err);
+        return cb(err);
+      }
+
+      conn.getMore(
+        ns,
+        cursorState,
+        batchSize,
+        options,
+        makeOperationHandler(this, conn, null, options, cb)
+      );
+    }, callback);
+  }
+
+  /**
+   * Execute a `killCursors` command against the server
+   *
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {object} cursorState State data associated with the cursor calling this method
+   * @param {function} callback
+   */
+  killCursors(ns, cursorState, callback) {
+    if (this.s.state === STATE_CLOSING || this.s.state === STATE_CLOSED) {
+      if (typeof callback === 'function') {
+        callback(new MongoError('server is closed'));
+      }
+
+      return;
+    }
+
+    this.s.pool.withConnection((err, conn, cb) => {
+      if (err) {
+        markServerUnknown(this, err);
+        return cb(err);
+      }
+
+      conn.killCursors(ns, cursorState, makeOperationHandler(this, conn, null, undefined, cb));
+    }, callback);
+  }
+
+  /**
+   * Insert one or more documents
+   * @method
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {array} ops An array of documents to insert
+   * @param {boolean} [options.ordered=true] Execute in order or out of order
+   * @param {object} [options.writeConcern={}] Write concern for the operation
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {ClientSession} [options.session] Session to use for the operation
+   * @param {opResultCallback} callback A callback function
+   */
+  insert(ns, ops, options, callback) {
+    executeWriteOperation({ server: this, op: 'insert', ns, ops }, options, callback);
+  }
+
+  /**
+   * Perform one or more update operations
+   * @method
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {array} ops An array of updates
+   * @param {boolean} [options.ordered=true] Execute in order or out of order
+   * @param {object} [options.writeConcern={}] Write concern for the operation
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {ClientSession} [options.session] Session to use for the operation
+   * @param {opResultCallback} callback A callback function
+   */
+  update(ns, ops, options, callback) {
+    executeWriteOperation({ server: this, op: 'update', ns, ops }, options, callback);
+  }
+
+  /**
+   * Perform one or more remove operations
+   * @method
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {array} ops An array of removes
+   * @param {boolean} [options.ordered=true] Execute in order or out of order
+   * @param {object} [options.writeConcern={}] Write concern for the operation
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {ClientSession} [options.session] Session to use for the operation
+   * @param {opResultCallback} callback A callback function
+   */
+  remove(ns, ops, options, callback) {
+    executeWriteOperation({ server: this, op: 'remove', ns, ops }, options, callback);
+  }
+}
+
+Object.defineProperty(Server.prototype, 'clusterTime', {
+  get: function() {
+    return this.s.topology.clusterTime;
+  },
+  set: function(clusterTime) {
+    this.s.topology.clusterTime = clusterTime;
+  }
+});
+
+function supportsRetryableWrites(server) {
+  return (
+    server.description.maxWireVersion >= 6 &&
+    server.description.logicalSessionTimeoutMinutes &&
+    server.description.type !== ServerType.Standalone
+  );
+}
+
+function calculateRoundTripTime(oldRtt, duration) {
+  if (oldRtt === -1) {
+    return duration;
+  }
+
+  const alpha = 0.2;
+  return alpha * duration + (1 - alpha) * oldRtt;
+}
+
+function basicReadValidations(server, options) {
+  if (options.readPreference && !(options.readPreference instanceof ReadPreference)) {
+    return new MongoError('readPreference must be an instance of ReadPreference');
+  }
+}
+
+function executeWriteOperation(args, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // TODO: once we drop Node 4, use destructuring either here or in arguments.
+  const server = args.server;
+  const op = args.op;
+  const ns = args.ns;
+  const ops = Array.isArray(args.ops) ? args.ops : [args.ops];
+
+  if (server.s.state === STATE_CLOSING || server.s.state === STATE_CLOSED) {
+    callback(new MongoError('server is closed'));
+    return;
+  }
+
+  if (collationNotSupported(server, options)) {
+    callback(new MongoError(`server ${server.name} does not support collation`));
+    return;
+  }
+  const unacknowledgedWrite = options.writeConcern && options.writeConcern.w === 0;
+  if (unacknowledgedWrite || maxWireVersion(server) < 5) {
+    if ((op === 'update' || op === 'remove') && ops.find(o => o.hint)) {
+      callback(new MongoError(`servers < 3.4 do not support hint on ${op}`));
+      return;
+    }
+  }
+
+  server.s.pool.withConnection((err, conn, cb) => {
+    if (err) {
+      markServerUnknown(server, err);
+      return cb(err);
+    }
+
+    conn[op](ns, ops, options, makeOperationHandler(server, conn, ops, options, cb));
+  }, callback);
+}
+
+function markServerUnknown(server, error) {
+  if (error instanceof MongoNetworkError && !(error instanceof MongoNetworkTimeoutError)) {
+    server[kMonitor].reset();
+  }
+
+  server.emit(
+    'descriptionReceived',
+    new ServerDescription(server.description.address, null, {
+      error,
+      topologyVersion:
+        error && error.topologyVersion ? error.topologyVersion : server.description.topologyVersion
+    })
+  );
+}
+
+function connectionIsStale(pool, connection) {
+  return connection.generation !== pool.generation;
+}
+
+function shouldHandleStateChangeError(server, err) {
+  const etv = err.topologyVersion;
+  const stv = server.description.topologyVersion;
+
+  return compareTopologyVersion(stv, etv) < 0;
+}
+
+function inActiveTransaction(session, cmd) {
+  return session && session.inTransaction() && !isTransactionCommand(cmd);
+}
+
+function makeOperationHandler(server, connection, cmd, options, callback) {
+  const session = options && options.session;
+
+  return function handleOperationResult(err, result) {
+    if (err && !connectionIsStale(server.s.pool, connection)) {
+      if (err instanceof MongoNetworkError) {
+        if (session && !session.hasEnded) {
+          session.serverSession.isDirty = true;
+        }
+
+        if (supportsRetryableWrites(server) && !inActiveTransaction(session, cmd)) {
+          err.addErrorLabel('RetryableWriteError');
+        }
+
+        if (!(err instanceof MongoNetworkTimeoutError) || isNetworkErrorBeforeHandshake(err)) {
+          markServerUnknown(server, err);
+          server.s.pool.clear();
+        }
+      } else {
+        // if pre-4.4 server, then add error label if its a retryable write error
+        if (
+          maxWireVersion(server) < 9 &&
+          isRetryableWriteError(err) &&
+          !inActiveTransaction(session, cmd)
+        ) {
+          err.addErrorLabel('RetryableWriteError');
+        }
+
+        if (isSDAMUnrecoverableError(err)) {
+          if (shouldHandleStateChangeError(server, err)) {
+            if (maxWireVersion(server) <= 7 || isNodeShuttingDownError(err)) {
+              server.s.pool.clear();
+            }
+
+            markServerUnknown(server, err);
+            process.nextTick(() => server.requestCheck());
+          }
+        }
+      }
+    }
+
+    callback(err, result);
+  };
+}
+
+module.exports = {
+  Server
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/server_description.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/server_description.js
new file mode 100644
index 0000000000000000000000000000000000000000..3bb7d2691712d4bc042e0d8422b03536c7bdfad2
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/server_description.js
@@ -0,0 +1,227 @@
+'use strict';
+
+const arrayStrictEqual = require('../utils').arrayStrictEqual;
+const tagsStrictEqual = require('../utils').tagsStrictEqual;
+const errorStrictEqual = require('../utils').errorStrictEqual;
+const ServerType = require('./common').ServerType;
+const now = require('../../utils').now;
+
+const WRITABLE_SERVER_TYPES = new Set([
+  ServerType.RSPrimary,
+  ServerType.Standalone,
+  ServerType.Mongos
+]);
+
+const DATA_BEARING_SERVER_TYPES = new Set([
+  ServerType.RSPrimary,
+  ServerType.RSSecondary,
+  ServerType.Mongos,
+  ServerType.Standalone
+]);
+
+const ISMASTER_FIELDS = [
+  'minWireVersion',
+  'maxWireVersion',
+  'maxBsonObjectSize',
+  'maxMessageSizeBytes',
+  'maxWriteBatchSize',
+  'compression',
+  'me',
+  'hosts',
+  'passives',
+  'arbiters',
+  'tags',
+  'setName',
+  'setVersion',
+  'electionId',
+  'primary',
+  'logicalSessionTimeoutMinutes',
+  'saslSupportedMechs',
+  '__nodejs_mock_server__',
+  '$clusterTime'
+];
+
+/**
+ * The client's view of a single server, based on the most recent ismaster outcome.
+ *
+ * Internal type, not meant to be directly instantiated
+ */
+class ServerDescription {
+  /**
+   * Create a ServerDescription
+   * @param {String} address The address of the server
+   * @param {Object} [ismaster] An optional ismaster response for this server
+   * @param {Object} [options] Optional settings
+   * @param {Number} [options.roundTripTime] The round trip time to ping this server (in ms)
+   * @param {Error} [options.error] An Error used for better reporting debugging
+   * @param {any} [options.topologyVersion] The topologyVersion
+   */
+  constructor(address, ismaster, options) {
+    options = options || {};
+    ismaster = Object.assign(
+      {
+        minWireVersion: 0,
+        maxWireVersion: 0,
+        hosts: [],
+        passives: [],
+        arbiters: [],
+        tags: []
+      },
+      ismaster
+    );
+
+    this.address = address;
+    this.error = options.error;
+    this.roundTripTime = options.roundTripTime || -1;
+    this.lastUpdateTime = now();
+    this.lastWriteDate = ismaster.lastWrite ? ismaster.lastWrite.lastWriteDate : null;
+    this.opTime = ismaster.lastWrite ? ismaster.lastWrite.opTime : null;
+    this.type = parseServerType(ismaster);
+    this.topologyVersion = options.topologyVersion || ismaster.topologyVersion;
+
+    // direct mappings
+    ISMASTER_FIELDS.forEach(field => {
+      if (typeof ismaster[field] !== 'undefined') this[field] = ismaster[field];
+    });
+
+    // normalize case for hosts
+    if (this.me) this.me = this.me.toLowerCase();
+    this.hosts = this.hosts.map(host => host.toLowerCase());
+    this.passives = this.passives.map(host => host.toLowerCase());
+    this.arbiters = this.arbiters.map(host => host.toLowerCase());
+  }
+
+  get allHosts() {
+    return this.hosts.concat(this.arbiters).concat(this.passives);
+  }
+
+  /**
+   * @return {Boolean} Is this server available for reads
+   */
+  get isReadable() {
+    return this.type === ServerType.RSSecondary || this.isWritable;
+  }
+
+  /**
+   * @return {Boolean} Is this server data bearing
+   */
+  get isDataBearing() {
+    return DATA_BEARING_SERVER_TYPES.has(this.type);
+  }
+
+  /**
+   * @return {Boolean} Is this server available for writes
+   */
+  get isWritable() {
+    return WRITABLE_SERVER_TYPES.has(this.type);
+  }
+
+  get host() {
+    const chopLength = `:${this.port}`.length;
+    return this.address.slice(0, -chopLength);
+  }
+
+  get port() {
+    const port = this.address.split(':').pop();
+    return port ? Number.parseInt(port, 10) : port;
+  }
+
+  /**
+   * Determines if another `ServerDescription` is equal to this one per the rules defined
+   * in the {@link https://github.com/mongodb/specifications/blob/master/source/server-discovery-and-monitoring/server-discovery-and-monitoring.rst#serverdescription|SDAM spec}
+   *
+   * @param {ServerDescription} other
+   * @return {Boolean}
+   */
+  equals(other) {
+    const topologyVersionsEqual =
+      this.topologyVersion === other.topologyVersion ||
+      compareTopologyVersion(this.topologyVersion, other.topologyVersion) === 0;
+
+    return (
+      other != null &&
+      errorStrictEqual(this.error, other.error) &&
+      this.type === other.type &&
+      this.minWireVersion === other.minWireVersion &&
+      this.me === other.me &&
+      arrayStrictEqual(this.hosts, other.hosts) &&
+      tagsStrictEqual(this.tags, other.tags) &&
+      this.setName === other.setName &&
+      this.setVersion === other.setVersion &&
+      (this.electionId
+        ? other.electionId && this.electionId.equals(other.electionId)
+        : this.electionId === other.electionId) &&
+      this.primary === other.primary &&
+      this.logicalSessionTimeoutMinutes === other.logicalSessionTimeoutMinutes &&
+      topologyVersionsEqual
+    );
+  }
+}
+
+/**
+ * Parses an `ismaster` message and determines the server type
+ *
+ * @param {Object} ismaster The `ismaster` message to parse
+ * @return {ServerType}
+ */
+function parseServerType(ismaster) {
+  if (!ismaster || !ismaster.ok) {
+    return ServerType.Unknown;
+  }
+
+  if (ismaster.isreplicaset) {
+    return ServerType.RSGhost;
+  }
+
+  if (ismaster.msg && ismaster.msg === 'isdbgrid') {
+    return ServerType.Mongos;
+  }
+
+  if (ismaster.setName) {
+    if (ismaster.hidden) {
+      return ServerType.RSOther;
+    } else if (ismaster.ismaster) {
+      return ServerType.RSPrimary;
+    } else if (ismaster.secondary) {
+      return ServerType.RSSecondary;
+    } else if (ismaster.arbiterOnly) {
+      return ServerType.RSArbiter;
+    } else {
+      return ServerType.RSOther;
+    }
+  }
+
+  return ServerType.Standalone;
+}
+
+/**
+ * Compares two topology versions.
+ *
+ * @param {object} lhs
+ * @param {object} rhs
+ * @returns A negative number if `lhs` is older than `rhs`; positive if `lhs` is newer than `rhs`; 0 if they are equivalent.
+ */
+function compareTopologyVersion(lhs, rhs) {
+  if (lhs == null || rhs == null) {
+    return -1;
+  }
+
+  if (lhs.processId.equals(rhs.processId)) {
+    // TODO: handle counters as Longs
+    if (lhs.counter === rhs.counter) {
+      return 0;
+    } else if (lhs.counter < rhs.counter) {
+      return -1;
+    }
+
+    return 1;
+  }
+
+  return -1;
+}
+
+module.exports = {
+  ServerDescription,
+  parseServerType,
+  compareTopologyVersion
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/server_selection.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/server_selection.js
new file mode 100644
index 0000000000000000000000000000000000000000..80d86ec80eefcbf02f88640aeb92c103f1d83488
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/server_selection.js
@@ -0,0 +1,238 @@
+'use strict';
+const ServerType = require('./common').ServerType;
+const TopologyType = require('./common').TopologyType;
+const ReadPreference = require('../topologies/read_preference');
+const MongoError = require('../error').MongoError;
+
+// max staleness constants
+const IDLE_WRITE_PERIOD = 10000;
+const SMALLEST_MAX_STALENESS_SECONDS = 90;
+
+/**
+ * Returns a server selector that selects for writable servers
+ */
+function writableServerSelector() {
+  return function(topologyDescription, servers) {
+    return latencyWindowReducer(
+      topologyDescription,
+      servers.filter(s => s.isWritable)
+    );
+  };
+}
+
+/**
+ * Reduces the passed in array of servers by the rules of the "Max Staleness" specification
+ * found here: https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness.rst
+ *
+ * @param {ReadPreference} readPreference The read preference providing max staleness guidance
+ * @param {topologyDescription} topologyDescription The topology description
+ * @param {ServerDescription[]} servers The list of server descriptions to be reduced
+ * @return {ServerDescription[]} The list of servers that satisfy the requirements of max staleness
+ */
+function maxStalenessReducer(readPreference, topologyDescription, servers) {
+  if (readPreference.maxStalenessSeconds == null || readPreference.maxStalenessSeconds < 0) {
+    return servers;
+  }
+
+  const maxStaleness = readPreference.maxStalenessSeconds;
+  const maxStalenessVariance =
+    (topologyDescription.heartbeatFrequencyMS + IDLE_WRITE_PERIOD) / 1000;
+  if (maxStaleness < maxStalenessVariance) {
+    throw new MongoError(`maxStalenessSeconds must be at least ${maxStalenessVariance} seconds`);
+  }
+
+  if (maxStaleness < SMALLEST_MAX_STALENESS_SECONDS) {
+    throw new MongoError(
+      `maxStalenessSeconds must be at least ${SMALLEST_MAX_STALENESS_SECONDS} seconds`
+    );
+  }
+
+  if (topologyDescription.type === TopologyType.ReplicaSetWithPrimary) {
+    const primary = Array.from(topologyDescription.servers.values()).filter(primaryFilter)[0];
+    return servers.reduce((result, server) => {
+      const stalenessMS =
+        server.lastUpdateTime -
+        server.lastWriteDate -
+        (primary.lastUpdateTime - primary.lastWriteDate) +
+        topologyDescription.heartbeatFrequencyMS;
+
+      const staleness = stalenessMS / 1000;
+      if (staleness <= readPreference.maxStalenessSeconds) result.push(server);
+      return result;
+    }, []);
+  }
+
+  if (topologyDescription.type === TopologyType.ReplicaSetNoPrimary) {
+    if (servers.length === 0) {
+      return servers;
+    }
+
+    const sMax = servers.reduce((max, s) => (s.lastWriteDate > max.lastWriteDate ? s : max));
+    return servers.reduce((result, server) => {
+      const stalenessMS =
+        sMax.lastWriteDate - server.lastWriteDate + topologyDescription.heartbeatFrequencyMS;
+
+      const staleness = stalenessMS / 1000;
+      if (staleness <= readPreference.maxStalenessSeconds) result.push(server);
+      return result;
+    }, []);
+  }
+
+  return servers;
+}
+
+/**
+ * Determines whether a server's tags match a given set of tags
+ *
+ * @param {String[]} tagSet The requested tag set to match
+ * @param {String[]} serverTags The server's tags
+ */
+function tagSetMatch(tagSet, serverTags) {
+  const keys = Object.keys(tagSet);
+  const serverTagKeys = Object.keys(serverTags);
+  for (let i = 0; i < keys.length; ++i) {
+    const key = keys[i];
+    if (serverTagKeys.indexOf(key) === -1 || serverTags[key] !== tagSet[key]) {
+      return false;
+    }
+  }
+
+  return true;
+}
+
+/**
+ * Reduces a set of server descriptions based on tags requested by the read preference
+ *
+ * @param {ReadPreference} readPreference The read preference providing the requested tags
+ * @param {ServerDescription[]} servers The list of server descriptions to reduce
+ * @return {ServerDescription[]} The list of servers matching the requested tags
+ */
+function tagSetReducer(readPreference, servers) {
+  if (
+    readPreference.tags == null ||
+    (Array.isArray(readPreference.tags) && readPreference.tags.length === 0)
+  ) {
+    return servers;
+  }
+
+  for (let i = 0; i < readPreference.tags.length; ++i) {
+    const tagSet = readPreference.tags[i];
+    const serversMatchingTagset = servers.reduce((matched, server) => {
+      if (tagSetMatch(tagSet, server.tags)) matched.push(server);
+      return matched;
+    }, []);
+
+    if (serversMatchingTagset.length) {
+      return serversMatchingTagset;
+    }
+  }
+
+  return [];
+}
+
+/**
+ * Reduces a list of servers to ensure they fall within an acceptable latency window. This is
+ * further specified in the "Server Selection" specification, found here:
+ * https://github.com/mongodb/specifications/blob/master/source/server-selection/server-selection.rst
+ *
+ * @param {topologyDescription} topologyDescription The topology description
+ * @param {ServerDescription[]} servers The list of servers to reduce
+ * @returns {ServerDescription[]} The servers which fall within an acceptable latency window
+ */
+function latencyWindowReducer(topologyDescription, servers) {
+  const low = servers.reduce(
+    (min, server) => (min === -1 ? server.roundTripTime : Math.min(server.roundTripTime, min)),
+    -1
+  );
+
+  const high = low + topologyDescription.localThresholdMS;
+
+  return servers.reduce((result, server) => {
+    if (server.roundTripTime <= high && server.roundTripTime >= low) result.push(server);
+    return result;
+  }, []);
+}
+
+// filters
+function primaryFilter(server) {
+  return server.type === ServerType.RSPrimary;
+}
+
+function secondaryFilter(server) {
+  return server.type === ServerType.RSSecondary;
+}
+
+function nearestFilter(server) {
+  return server.type === ServerType.RSSecondary || server.type === ServerType.RSPrimary;
+}
+
+function knownFilter(server) {
+  return server.type !== ServerType.Unknown;
+}
+
+/**
+ * Returns a function which selects servers based on a provided read preference
+ *
+ * @param {ReadPreference} readPreference The read preference to select with
+ */
+function readPreferenceServerSelector(readPreference) {
+  if (!readPreference.isValid()) {
+    throw new TypeError('Invalid read preference specified');
+  }
+
+  return function(topologyDescription, servers) {
+    const commonWireVersion = topologyDescription.commonWireVersion;
+    if (
+      commonWireVersion &&
+      readPreference.minWireVersion &&
+      readPreference.minWireVersion > commonWireVersion
+    ) {
+      throw new MongoError(
+        `Minimum wire version '${readPreference.minWireVersion}' required, but found '${commonWireVersion}'`
+      );
+    }
+
+    if (topologyDescription.type === TopologyType.Unknown) {
+      return [];
+    }
+
+    if (
+      topologyDescription.type === TopologyType.Single ||
+      topologyDescription.type === TopologyType.Sharded
+    ) {
+      return latencyWindowReducer(topologyDescription, servers.filter(knownFilter));
+    }
+
+    const mode = readPreference.mode;
+    if (mode === ReadPreference.PRIMARY) {
+      return servers.filter(primaryFilter);
+    }
+
+    if (mode === ReadPreference.PRIMARY_PREFERRED) {
+      const result = servers.filter(primaryFilter);
+      if (result.length) {
+        return result;
+      }
+    }
+
+    const filter = mode === ReadPreference.NEAREST ? nearestFilter : secondaryFilter;
+    const selectedServers = latencyWindowReducer(
+      topologyDescription,
+      tagSetReducer(
+        readPreference,
+        maxStalenessReducer(readPreference, topologyDescription, servers.filter(filter))
+      )
+    );
+
+    if (mode === ReadPreference.SECONDARY_PREFERRED && selectedServers.length === 0) {
+      return servers.filter(primaryFilter);
+    }
+
+    return selectedServers;
+  };
+}
+
+module.exports = {
+  writableServerSelector,
+  readPreferenceServerSelector
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/srv_polling.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/srv_polling.js
new file mode 100644
index 0000000000000000000000000000000000000000..2c0b6ee2ef31f024bfc2995b396f7276796ac0bd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/srv_polling.js
@@ -0,0 +1,135 @@
+'use strict';
+
+const Logger = require('../connection/logger');
+const EventEmitter = require('events').EventEmitter;
+const dns = require('dns');
+/**
+ * Determines whether a provided address matches the provided parent domain in order
+ * to avoid certain attack vectors.
+ *
+ * @param {String} srvAddress The address to check against a domain
+ * @param {String} parentDomain The domain to check the provided address against
+ * @return {Boolean} Whether the provided address matches the parent domain
+ */
+function matchesParentDomain(srvAddress, parentDomain) {
+  const regex = /^.*?\./;
+  const srv = `.${srvAddress.replace(regex, '')}`;
+  const parent = `.${parentDomain.replace(regex, '')}`;
+  return srv.endsWith(parent);
+}
+
+class SrvPollingEvent {
+  constructor(srvRecords) {
+    this.srvRecords = srvRecords;
+  }
+
+  addresses() {
+    return new Set(this.srvRecords.map(record => `${record.name}:${record.port}`));
+  }
+}
+
+class SrvPoller extends EventEmitter {
+  /**
+   * @param {object} options
+   * @param {string} options.srvHost
+   * @param {number} [options.heartbeatFrequencyMS]
+   * @param {function} [options.logger]
+   * @param {string} [options.loggerLevel]
+   */
+  constructor(options) {
+    super();
+
+    if (!options || !options.srvHost) {
+      throw new TypeError('options for SrvPoller must exist and include srvHost');
+    }
+
+    this.srvHost = options.srvHost;
+    this.rescanSrvIntervalMS = 60000;
+    this.heartbeatFrequencyMS = options.heartbeatFrequencyMS || 10000;
+    this.logger = Logger('srvPoller', options);
+
+    this.haMode = false;
+    this.generation = 0;
+
+    this._timeout = null;
+  }
+
+  get srvAddress() {
+    return `_mongodb._tcp.${this.srvHost}`;
+  }
+
+  get intervalMS() {
+    return this.haMode ? this.heartbeatFrequencyMS : this.rescanSrvIntervalMS;
+  }
+
+  start() {
+    if (!this._timeout) {
+      this.schedule();
+    }
+  }
+
+  stop() {
+    if (this._timeout) {
+      clearTimeout(this._timeout);
+      this.generation += 1;
+      this._timeout = null;
+    }
+  }
+
+  schedule() {
+    clearTimeout(this._timeout);
+    this._timeout = setTimeout(() => this._poll(), this.intervalMS);
+  }
+
+  success(srvRecords) {
+    this.haMode = false;
+    this.schedule();
+    this.emit('srvRecordDiscovery', new SrvPollingEvent(srvRecords));
+  }
+
+  failure(message, obj) {
+    this.logger.warn(message, obj);
+    this.haMode = true;
+    this.schedule();
+  }
+
+  parentDomainMismatch(srvRecord) {
+    this.logger.warn(
+      `parent domain mismatch on SRV record (${srvRecord.name}:${srvRecord.port})`,
+      srvRecord
+    );
+  }
+
+  _poll() {
+    const generation = this.generation;
+    dns.resolveSrv(this.srvAddress, (err, srvRecords) => {
+      if (generation !== this.generation) {
+        return;
+      }
+
+      if (err) {
+        this.failure('DNS error', err);
+        return;
+      }
+
+      const finalAddresses = [];
+      srvRecords.forEach(record => {
+        if (matchesParentDomain(record.name, this.srvHost)) {
+          finalAddresses.push(record);
+        } else {
+          this.parentDomainMismatch(record);
+        }
+      });
+
+      if (!finalAddresses.length) {
+        this.failure('No valid addresses found at host');
+        return;
+      }
+
+      this.success(finalAddresses);
+    });
+  }
+}
+
+module.exports.SrvPollingEvent = SrvPollingEvent;
+module.exports.SrvPoller = SrvPoller;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/topology.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/topology.js
new file mode 100644
index 0000000000000000000000000000000000000000..1ca73ee48abc2c9180a7c04a716f538a411d90fb
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/topology.js
@@ -0,0 +1,1143 @@
+'use strict';
+const Denque = require('denque');
+const EventEmitter = require('events');
+const ServerDescription = require('./server_description').ServerDescription;
+const ServerType = require('./common').ServerType;
+const TopologyDescription = require('./topology_description').TopologyDescription;
+const TopologyType = require('./common').TopologyType;
+const events = require('./events');
+const Server = require('./server').Server;
+const relayEvents = require('../utils').relayEvents;
+const ReadPreference = require('../topologies/read_preference');
+const isRetryableWritesSupported = require('../topologies/shared').isRetryableWritesSupported;
+const CoreCursor = require('../cursor').CoreCursor;
+const deprecate = require('util').deprecate;
+const BSON = require('../connection/utils').retrieveBSON();
+const createCompressionInfo = require('../topologies/shared').createCompressionInfo;
+const ClientSession = require('../sessions').ClientSession;
+const MongoError = require('../error').MongoError;
+const MongoServerSelectionError = require('../error').MongoServerSelectionError;
+const resolveClusterTime = require('../topologies/shared').resolveClusterTime;
+const SrvPoller = require('./srv_polling').SrvPoller;
+const getMMAPError = require('../topologies/shared').getMMAPError;
+const makeStateMachine = require('../utils').makeStateMachine;
+const eachAsync = require('../utils').eachAsync;
+const emitDeprecationWarning = require('../../utils').emitDeprecationWarning;
+const ServerSessionPool = require('../sessions').ServerSessionPool;
+const makeClientMetadata = require('../utils').makeClientMetadata;
+const CMAP_EVENT_NAMES = require('../../cmap/events').CMAP_EVENT_NAMES;
+const compareTopologyVersion = require('./server_description').compareTopologyVersion;
+const emitWarning = require('../../utils').emitWarning;
+
+const common = require('./common');
+const drainTimerQueue = common.drainTimerQueue;
+const clearAndRemoveTimerFrom = common.clearAndRemoveTimerFrom;
+
+const serverSelection = require('./server_selection');
+const readPreferenceServerSelector = serverSelection.readPreferenceServerSelector;
+const writableServerSelector = serverSelection.writableServerSelector;
+
+// Global state
+let globalTopologyCounter = 0;
+
+// events that we relay to the `Topology`
+const SERVER_RELAY_EVENTS = [
+  'serverHeartbeatStarted',
+  'serverHeartbeatSucceeded',
+  'serverHeartbeatFailed',
+  'commandStarted',
+  'commandSucceeded',
+  'commandFailed',
+
+  // NOTE: Legacy events
+  'monitoring'
+].concat(CMAP_EVENT_NAMES);
+
+// all events we listen to from `Server` instances
+const LOCAL_SERVER_EVENTS = ['connect', 'descriptionReceived', 'close', 'ended'];
+
+const STATE_CLOSING = common.STATE_CLOSING;
+const STATE_CLOSED = common.STATE_CLOSED;
+const STATE_CONNECTING = common.STATE_CONNECTING;
+const STATE_CONNECTED = common.STATE_CONNECTED;
+const stateTransition = makeStateMachine({
+  [STATE_CLOSED]: [STATE_CLOSED, STATE_CONNECTING],
+  [STATE_CONNECTING]: [STATE_CONNECTING, STATE_CLOSING, STATE_CONNECTED, STATE_CLOSED],
+  [STATE_CONNECTED]: [STATE_CONNECTED, STATE_CLOSING, STATE_CLOSED],
+  [STATE_CLOSING]: [STATE_CLOSING, STATE_CLOSED]
+});
+
+const DEPRECATED_OPTIONS = new Set([
+  'autoReconnect',
+  'reconnectTries',
+  'reconnectInterval',
+  'bufferMaxEntries'
+]);
+
+const kCancelled = Symbol('cancelled');
+const kWaitQueue = Symbol('waitQueue');
+
+/**
+ * A container of server instances representing a connection to a MongoDB topology.
+ *
+ * @fires Topology#serverOpening
+ * @fires Topology#serverClosed
+ * @fires Topology#serverDescriptionChanged
+ * @fires Topology#topologyOpening
+ * @fires Topology#topologyClosed
+ * @fires Topology#topologyDescriptionChanged
+ * @fires Topology#serverHeartbeatStarted
+ * @fires Topology#serverHeartbeatSucceeded
+ * @fires Topology#serverHeartbeatFailed
+ */
+class Topology extends EventEmitter {
+  /**
+   * Create a topology
+   *
+   * @param {Array|String} [seedlist] a string list, or array of Server instances to connect to
+   * @param {Object} [options] Optional settings
+   * @param {Number} [options.localThresholdMS=15] The size of the latency window for selecting among multiple suitable servers
+   * @param {Number} [options.serverSelectionTimeoutMS=30000] How long to block for server selection before throwing an error
+   * @param {Number} [options.heartbeatFrequencyMS=10000] The frequency with which topology updates are scheduled
+   */
+  constructor(seedlist, options) {
+    super();
+    if (typeof options === 'undefined' && typeof seedlist !== 'string') {
+      options = seedlist;
+      seedlist = [];
+
+      // this is for legacy single server constructor support
+      if (options.host) {
+        seedlist.push({ host: options.host, port: options.port });
+      }
+    }
+
+    seedlist = seedlist || [];
+    if (typeof seedlist === 'string') {
+      seedlist = parseStringSeedlist(seedlist);
+    }
+
+    options = Object.assign({}, common.TOPOLOGY_DEFAULTS, options);
+    options = Object.freeze(
+      Object.assign(options, {
+        metadata: makeClientMetadata(options),
+        compression: { compressors: createCompressionInfo(options) }
+      })
+    );
+
+    DEPRECATED_OPTIONS.forEach(optionName => {
+      if (options[optionName]) {
+        emitDeprecationWarning(
+          `The option \`${optionName}\` is incompatible with the unified topology, please read more by visiting http://bit.ly/2D8WfT6`,
+          'DeprecationWarning'
+        );
+      }
+    });
+
+    const topologyType = topologyTypeFromSeedlist(seedlist, options);
+    const topologyId = globalTopologyCounter++;
+    const serverDescriptions = seedlist.reduce((result, seed) => {
+      if (seed.domain_socket) seed.host = seed.domain_socket;
+      const address = seed.port ? `${seed.host}:${seed.port}` : `${seed.host}:27017`;
+      result.set(address, new ServerDescription(address));
+      return result;
+    }, new Map());
+
+    this[kWaitQueue] = new Denque();
+    this.s = {
+      // the id of this topology
+      id: topologyId,
+      // passed in options
+      options,
+      // initial seedlist of servers to connect to
+      seedlist: seedlist,
+      // initial state
+      state: STATE_CLOSED,
+      // the topology description
+      description: new TopologyDescription(
+        topologyType,
+        serverDescriptions,
+        options.replicaSet,
+        null,
+        null,
+        null,
+        options
+      ),
+      serverSelectionTimeoutMS: options.serverSelectionTimeoutMS,
+      heartbeatFrequencyMS: options.heartbeatFrequencyMS,
+      minHeartbeatFrequencyMS: options.minHeartbeatFrequencyMS,
+      // allow users to override the cursor factory
+      Cursor: options.cursorFactory || CoreCursor,
+      // the bson parser
+      bson:
+        options.bson ||
+        new BSON([
+          BSON.Binary,
+          BSON.Code,
+          BSON.DBRef,
+          BSON.Decimal128,
+          BSON.Double,
+          BSON.Int32,
+          BSON.Long,
+          BSON.Map,
+          BSON.MaxKey,
+          BSON.MinKey,
+          BSON.ObjectId,
+          BSON.BSONRegExp,
+          BSON.Symbol,
+          BSON.Timestamp
+        ]),
+      // a map of server instances to normalized addresses
+      servers: new Map(),
+      // Server Session Pool
+      sessionPool: new ServerSessionPool(this),
+      // Active client sessions
+      sessions: new Set(),
+      // Promise library
+      promiseLibrary: options.promiseLibrary || Promise,
+      credentials: options.credentials,
+      clusterTime: null,
+
+      // timer management
+      connectionTimers: new Set()
+    };
+
+    if (options.srvHost) {
+      this.s.srvPoller =
+        options.srvPoller ||
+        new SrvPoller({
+          heartbeatFrequencyMS: this.s.heartbeatFrequencyMS,
+          srvHost: options.srvHost, // TODO: GET THIS
+          logger: options.logger,
+          loggerLevel: options.loggerLevel
+        });
+      this.s.detectTopologyDescriptionChange = ev => {
+        const previousType = ev.previousDescription.type;
+        const newType = ev.newDescription.type;
+
+        if (previousType !== TopologyType.Sharded && newType === TopologyType.Sharded) {
+          this.s.handleSrvPolling = srvPollingHandler(this);
+          this.s.srvPoller.on('srvRecordDiscovery', this.s.handleSrvPolling);
+          this.s.srvPoller.start();
+        }
+      };
+
+      this.on('topologyDescriptionChanged', this.s.detectTopologyDescriptionChange);
+    }
+
+    // NOTE: remove this when NODE-1709 is resolved
+    this.setMaxListeners(Infinity);
+  }
+
+  /**
+   * @return A `TopologyDescription` for this topology
+   */
+  get description() {
+    return this.s.description;
+  }
+
+  get parserType() {
+    return BSON.native ? 'c++' : 'js';
+  }
+
+  /**
+   * Initiate server connect
+   *
+   * @param {Object} [options] Optional settings
+   * @param {Array} [options.auth=null] Array of auth options to apply on connect
+   * @param {function} [callback] An optional callback called once on the first connected server
+   */
+  connect(options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = options || {};
+    if (this.s.state === STATE_CONNECTED) {
+      if (typeof callback === 'function') {
+        callback();
+      }
+
+      return;
+    }
+
+    stateTransition(this, STATE_CONNECTING);
+
+    // emit SDAM monitoring events
+    this.emit('topologyOpening', new events.TopologyOpeningEvent(this.s.id));
+
+    // emit an event for the topology change
+    this.emit(
+      'topologyDescriptionChanged',
+      new events.TopologyDescriptionChangedEvent(
+        this.s.id,
+        new TopologyDescription(TopologyType.Unknown), // initial is always Unknown
+        this.s.description
+      )
+    );
+
+    // connect all known servers, then attempt server selection to connect
+    connectServers(this, Array.from(this.s.description.servers.values()));
+
+    ReadPreference.translate(options);
+    const readPreference = options.readPreference || ReadPreference.primary;
+    const connectHandler = err => {
+      if (err) {
+        this.close();
+
+        if (typeof callback === 'function') {
+          callback(err);
+        } else {
+          this.emit('error', err);
+        }
+
+        return;
+      }
+
+      stateTransition(this, STATE_CONNECTED);
+      this.emit('open', err, this);
+      this.emit('connect', this);
+
+      if (typeof callback === 'function') callback(err, this);
+    };
+
+    // TODO: NODE-2471
+    if (this.s.credentials) {
+      this.command('admin.$cmd', { ping: 1 }, { readPreference }, connectHandler);
+      return;
+    }
+
+    this.selectServer(readPreferenceServerSelector(readPreference), options, connectHandler);
+  }
+
+  /**
+   * Close this topology
+   */
+  close(options, callback) {
+    if (typeof options === 'function') {
+      callback = options;
+      options = {};
+    }
+
+    if (typeof options === 'boolean') {
+      options = { force: options };
+    }
+
+    options = options || {};
+    if (this.s.state === STATE_CLOSED || this.s.state === STATE_CLOSING) {
+      if (typeof callback === 'function') {
+        callback();
+      }
+
+      return;
+    }
+
+    stateTransition(this, STATE_CLOSING);
+
+    drainWaitQueue(this[kWaitQueue], new MongoError('Topology closed'));
+    drainTimerQueue(this.s.connectionTimers);
+
+    if (this.s.srvPoller) {
+      this.s.srvPoller.stop();
+      if (this.s.handleSrvPolling) {
+        this.s.srvPoller.removeListener('srvRecordDiscovery', this.s.handleSrvPolling);
+        delete this.s.handleSrvPolling;
+      }
+    }
+
+    if (this.s.detectTopologyDescriptionChange) {
+      this.removeListener('topologyDescriptionChanged', this.s.detectTopologyDescriptionChange);
+      delete this.s.detectTopologyDescriptionChange;
+    }
+
+    this.s.sessions.forEach(session => session.endSession());
+    this.s.sessionPool.endAllPooledSessions(() => {
+      eachAsync(
+        Array.from(this.s.servers.values()),
+        (server, cb) => destroyServer(server, this, options, cb),
+        err => {
+          this.s.servers.clear();
+
+          // emit an event for close
+          this.emit('topologyClosed', new events.TopologyClosedEvent(this.s.id));
+
+          stateTransition(this, STATE_CLOSED);
+
+          if (typeof callback === 'function') {
+            callback(err);
+          }
+        }
+      );
+    });
+  }
+
+  /**
+   * Selects a server according to the selection predicate provided
+   *
+   * @param {function} [selector] An optional selector to select servers by, defaults to a random selection within a latency window
+   * @param {object} [options] Optional settings related to server selection
+   * @param {number} [options.serverSelectionTimeoutMS] How long to block for server selection before throwing an error
+   * @param {function} callback The callback used to indicate success or failure
+   * @return {Server} An instance of a `Server` meeting the criteria of the predicate provided
+   */
+  selectServer(selector, options, callback) {
+    if (typeof options === 'function') {
+      callback = options;
+      if (typeof selector !== 'function') {
+        options = selector;
+
+        let readPreference;
+        if (selector instanceof ReadPreference) {
+          readPreference = selector;
+        } else if (typeof selector === 'string') {
+          readPreference = new ReadPreference(selector);
+        } else {
+          ReadPreference.translate(options);
+          readPreference = options.readPreference || ReadPreference.primary;
+        }
+
+        selector = readPreferenceServerSelector(readPreference);
+      } else {
+        options = {};
+      }
+    }
+
+    options = Object.assign(
+      {},
+      { serverSelectionTimeoutMS: this.s.serverSelectionTimeoutMS },
+      options
+    );
+
+    const isSharded = this.description.type === TopologyType.Sharded;
+    const session = options.session;
+    const transaction = session && session.transaction;
+
+    if (isSharded && transaction && transaction.server) {
+      callback(undefined, transaction.server);
+      return;
+    }
+
+    // support server selection by options with readPreference
+    let serverSelector = selector;
+    if (typeof selector === 'object') {
+      const readPreference = selector.readPreference
+        ? selector.readPreference
+        : ReadPreference.primary;
+
+      serverSelector = readPreferenceServerSelector(readPreference);
+    }
+
+    const waitQueueMember = {
+      serverSelector,
+      transaction,
+      callback
+    };
+
+    const serverSelectionTimeoutMS = options.serverSelectionTimeoutMS;
+    if (serverSelectionTimeoutMS) {
+      waitQueueMember.timer = setTimeout(() => {
+        waitQueueMember[kCancelled] = true;
+        waitQueueMember.timer = undefined;
+        const timeoutError = new MongoServerSelectionError(
+          `Server selection timed out after ${serverSelectionTimeoutMS} ms`,
+          this.description
+        );
+
+        waitQueueMember.callback(timeoutError);
+      }, serverSelectionTimeoutMS);
+    }
+
+    this[kWaitQueue].push(waitQueueMember);
+    processWaitQueue(this);
+  }
+
+  // Sessions related methods
+
+  /**
+   * @return Whether the topology should initiate selection to determine session support
+   */
+  shouldCheckForSessionSupport() {
+    if (this.description.type === TopologyType.Single) {
+      return !this.description.hasKnownServers;
+    }
+
+    return !this.description.hasDataBearingServers;
+  }
+
+  /**
+   * @return Whether sessions are supported on the current topology
+   */
+  hasSessionSupport() {
+    return this.description.logicalSessionTimeoutMinutes != null;
+  }
+
+  /**
+   * Start a logical session
+   */
+  startSession(options, clientOptions) {
+    const session = new ClientSession(this, this.s.sessionPool, options, clientOptions);
+    session.once('ended', () => {
+      this.s.sessions.delete(session);
+    });
+
+    this.s.sessions.add(session);
+    return session;
+  }
+
+  /**
+   * Send endSessions command(s) with the given session ids
+   *
+   * @param {Array} sessions The sessions to end
+   * @param {function} [callback]
+   */
+  endSessions(sessions, callback) {
+    if (!Array.isArray(sessions)) {
+      sessions = [sessions];
+    }
+
+    this.command(
+      'admin.$cmd',
+      { endSessions: sessions },
+      { readPreference: ReadPreference.primaryPreferred, noResponse: true },
+      () => {
+        // intentionally ignored, per spec
+        if (typeof callback === 'function') callback();
+      }
+    );
+  }
+
+  /**
+   * Update the internal TopologyDescription with a ServerDescription
+   *
+   * @param {object} serverDescription The server to update in the internal list of server descriptions
+   */
+  serverUpdateHandler(serverDescription) {
+    if (!this.s.description.hasServer(serverDescription.address)) {
+      return;
+    }
+
+    // ignore this server update if its from an outdated topologyVersion
+    if (isStaleServerDescription(this.s.description, serverDescription)) {
+      return;
+    }
+
+    // these will be used for monitoring events later
+    const previousTopologyDescription = this.s.description;
+    const previousServerDescription = this.s.description.servers.get(serverDescription.address);
+
+    // Driver Sessions Spec: "Whenever a driver receives a cluster time from
+    // a server it MUST compare it to the current highest seen cluster time
+    // for the deployment. If the new cluster time is higher than the
+    // highest seen cluster time it MUST become the new highest seen cluster
+    // time. Two cluster times are compared using only the BsonTimestamp
+    // value of the clusterTime embedded field."
+    const clusterTime = serverDescription.$clusterTime;
+    if (clusterTime) {
+      resolveClusterTime(this, clusterTime);
+    }
+
+    // If we already know all the information contained in this updated description, then
+    // we don't need to emit SDAM events, but still need to update the description, in order
+    // to keep client-tracked attributes like last update time and round trip time up to date
+    const equalDescriptions =
+      previousServerDescription && previousServerDescription.equals(serverDescription);
+
+    // first update the TopologyDescription
+    this.s.description = this.s.description.update(serverDescription);
+    if (this.s.description.compatibilityError) {
+      this.emit('error', new MongoError(this.s.description.compatibilityError));
+      return;
+    }
+
+    // emit monitoring events for this change
+    if (!equalDescriptions) {
+      this.emit(
+        'serverDescriptionChanged',
+        new events.ServerDescriptionChangedEvent(
+          this.s.id,
+          serverDescription.address,
+          previousServerDescription,
+          this.s.description.servers.get(serverDescription.address)
+        )
+      );
+    }
+
+    // update server list from updated descriptions
+    updateServers(this, serverDescription);
+
+    // attempt to resolve any outstanding server selection attempts
+    if (this[kWaitQueue].length > 0) {
+      processWaitQueue(this);
+    }
+
+    if (!equalDescriptions) {
+      this.emit(
+        'topologyDescriptionChanged',
+        new events.TopologyDescriptionChangedEvent(
+          this.s.id,
+          previousTopologyDescription,
+          this.s.description
+        )
+      );
+    }
+  }
+
+  auth(credentials, callback) {
+    if (typeof credentials === 'function') (callback = credentials), (credentials = null);
+    if (typeof callback === 'function') callback(null, true);
+  }
+
+  logout(callback) {
+    if (typeof callback === 'function') callback(null, true);
+  }
+
+  // Basic operation support. Eventually this should be moved into command construction
+  // during the command refactor.
+
+  /**
+   * Insert one or more documents
+   *
+   * @param {String} ns The full qualified namespace for this operation
+   * @param {Array} ops An array of documents to insert
+   * @param {Boolean} [options.ordered=true] Execute in order or out of order
+   * @param {Object} [options.writeConcern] Write concern for the operation
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields
+   * @param {ClientSession} [options.session] Session to use for the operation
+   * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+   * @param {opResultCallback} callback A callback function
+   */
+  insert(ns, ops, options, callback) {
+    executeWriteOperation({ topology: this, op: 'insert', ns, ops }, options, callback);
+  }
+
+  /**
+   * Perform one or more update operations
+   *
+   * @param {string} ns The fully qualified namespace for this operation
+   * @param {array} ops An array of updates
+   * @param {boolean} [options.ordered=true] Execute in order or out of order
+   * @param {object} [options.writeConcern] Write concern for the operation
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields
+   * @param {ClientSession} [options.session] Session to use for the operation
+   * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+   * @param {opResultCallback} callback A callback function
+   */
+  update(ns, ops, options, callback) {
+    executeWriteOperation({ topology: this, op: 'update', ns, ops }, options, callback);
+  }
+
+  /**
+   * Perform one or more remove operations
+   *
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {array} ops An array of removes
+   * @param {boolean} [options.ordered=true] Execute in order or out of order
+   * @param {object} [options.writeConcern={}] Write concern for the operation
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {ClientSession} [options.session=null] Session to use for the operation
+   * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+   * @param {opResultCallback} callback A callback function
+   */
+  remove(ns, ops, options, callback) {
+    executeWriteOperation({ topology: this, op: 'remove', ns, ops }, options, callback);
+  }
+
+  /**
+   * Execute a command
+   *
+   * @method
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {object} cmd The command hash
+   * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+   * @param {Connection} [options.connection] Specify connection object to execute command against
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {ClientSession} [options.session=null] Session to use for the operation
+   * @param {opResultCallback} callback A callback function
+   */
+  command(ns, cmd, options, callback) {
+    if (typeof options === 'function') {
+      (callback = options), (options = {}), (options = options || {});
+    }
+
+    ReadPreference.translate(options);
+    const readPreference = options.readPreference || ReadPreference.primary;
+
+    this.selectServer(readPreferenceServerSelector(readPreference), options, (err, server) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      const willRetryWrite =
+        !options.retrying &&
+        !!options.retryWrites &&
+        options.session &&
+        isRetryableWritesSupported(this) &&
+        !options.session.inTransaction() &&
+        isWriteCommand(cmd);
+
+      const cb = (err, result) => {
+        if (!err) return callback(null, result);
+        if (!shouldRetryOperation(err)) {
+          return callback(err);
+        }
+
+        if (willRetryWrite) {
+          const newOptions = Object.assign({}, options, { retrying: true });
+          return this.command(ns, cmd, newOptions, callback);
+        }
+
+        return callback(err);
+      };
+
+      // increment and assign txnNumber
+      if (willRetryWrite) {
+        options.session.incrementTransactionNumber();
+        options.willRetryWrite = willRetryWrite;
+      }
+
+      server.command(ns, cmd, options, cb);
+    });
+  }
+
+  /**
+   * Create a new cursor
+   *
+   * @method
+   * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+   * @param {object|Long} cmd Can be either a command returning a cursor or a cursorId
+   * @param {object} [options] Options for the cursor
+   * @param {object} [options.batchSize=0] Batchsize for the operation
+   * @param {array} [options.documents=[]] Initial documents list for cursor
+   * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+   * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+   * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+   * @param {ClientSession} [options.session=null] Session to use for the operation
+   * @param {object} [options.topology] The internal topology of the created cursor
+   * @returns {Cursor}
+   */
+  cursor(ns, cmd, options) {
+    options = options || {};
+    const topology = options.topology || this;
+    const CursorClass = options.cursorFactory || this.s.Cursor;
+    ReadPreference.translate(options);
+
+    return new CursorClass(topology, ns, cmd, options);
+  }
+
+  get clientMetadata() {
+    return this.s.options.metadata;
+  }
+
+  isConnected() {
+    return this.s.state === STATE_CONNECTED;
+  }
+
+  isDestroyed() {
+    return this.s.state === STATE_CLOSED;
+  }
+
+  unref() {
+    emitWarning('not implemented: `unref`');
+  }
+
+  // NOTE: There are many places in code where we explicitly check the last isMaster
+  //       to do feature support detection. This should be done any other way, but for
+  //       now we will just return the first isMaster seen, which should suffice.
+  lastIsMaster() {
+    const serverDescriptions = Array.from(this.description.servers.values());
+    if (serverDescriptions.length === 0) return {};
+
+    const sd = serverDescriptions.filter(sd => sd.type !== ServerType.Unknown)[0];
+    const result = sd || { maxWireVersion: this.description.commonWireVersion };
+    return result;
+  }
+
+  get logicalSessionTimeoutMinutes() {
+    return this.description.logicalSessionTimeoutMinutes;
+  }
+
+  get bson() {
+    return this.s.bson;
+  }
+}
+
+Object.defineProperty(Topology.prototype, 'clusterTime', {
+  enumerable: true,
+  get: function() {
+    return this.s.clusterTime;
+  },
+  set: function(clusterTime) {
+    this.s.clusterTime = clusterTime;
+  }
+});
+
+// legacy aliases
+Topology.prototype.destroy = deprecate(
+  Topology.prototype.close,
+  'destroy() is deprecated, please use close() instead'
+);
+
+const RETRYABLE_WRITE_OPERATIONS = ['findAndModify', 'insert', 'update', 'delete'];
+function isWriteCommand(command) {
+  return RETRYABLE_WRITE_OPERATIONS.some(op => command[op]);
+}
+
+function isStaleServerDescription(topologyDescription, incomingServerDescription) {
+  const currentServerDescription = topologyDescription.servers.get(
+    incomingServerDescription.address
+  );
+  const currentTopologyVersion = currentServerDescription.topologyVersion;
+  return (
+    compareTopologyVersion(currentTopologyVersion, incomingServerDescription.topologyVersion) > 0
+  );
+}
+
+/**
+ * Destroys a server, and removes all event listeners from the instance
+ *
+ * @param {Server} server
+ */
+function destroyServer(server, topology, options, callback) {
+  options = options || {};
+  LOCAL_SERVER_EVENTS.forEach(event => server.removeAllListeners(event));
+
+  server.destroy(options, () => {
+    topology.emit(
+      'serverClosed',
+      new events.ServerClosedEvent(topology.s.id, server.description.address)
+    );
+
+    SERVER_RELAY_EVENTS.forEach(event => server.removeAllListeners(event));
+    if (typeof callback === 'function') {
+      callback();
+    }
+  });
+}
+
+/**
+ * Parses a basic seedlist in string form
+ *
+ * @param {string} seedlist The seedlist to parse
+ */
+function parseStringSeedlist(seedlist) {
+  return seedlist.split(',').map(seed => ({
+    host: seed.split(':')[0],
+    port: seed.split(':')[1] || 27017
+  }));
+}
+
+function topologyTypeFromSeedlist(seedlist, options) {
+  if (options.directConnection) {
+    return TopologyType.Single;
+  }
+
+  const replicaSet = options.replicaSet || options.setName || options.rs_name;
+  if (replicaSet == null) {
+    return TopologyType.Unknown;
+  }
+
+  return TopologyType.ReplicaSetNoPrimary;
+}
+
+function randomSelection(array) {
+  return array[Math.floor(Math.random() * array.length)];
+}
+
+function createAndConnectServer(topology, serverDescription, connectDelay) {
+  topology.emit(
+    'serverOpening',
+    new events.ServerOpeningEvent(topology.s.id, serverDescription.address)
+  );
+
+  const server = new Server(serverDescription, topology.s.options, topology);
+  relayEvents(server, topology, SERVER_RELAY_EVENTS);
+
+  server.on('descriptionReceived', topology.serverUpdateHandler.bind(topology));
+
+  if (connectDelay) {
+    const connectTimer = setTimeout(() => {
+      clearAndRemoveTimerFrom(connectTimer, topology.s.connectionTimers);
+      server.connect();
+    }, connectDelay);
+
+    topology.s.connectionTimers.add(connectTimer);
+    return server;
+  }
+
+  server.connect();
+  return server;
+}
+
+/**
+ * Create `Server` instances for all initially known servers, connect them, and assign
+ * them to the passed in `Topology`.
+ *
+ * @param {Topology} topology The topology responsible for the servers
+ * @param {ServerDescription[]} serverDescriptions A list of server descriptions to connect
+ */
+function connectServers(topology, serverDescriptions) {
+  topology.s.servers = serverDescriptions.reduce((servers, serverDescription) => {
+    const server = createAndConnectServer(topology, serverDescription);
+    servers.set(serverDescription.address, server);
+    return servers;
+  }, new Map());
+}
+
+function updateServers(topology, incomingServerDescription) {
+  // update the internal server's description
+  if (incomingServerDescription && topology.s.servers.has(incomingServerDescription.address)) {
+    const server = topology.s.servers.get(incomingServerDescription.address);
+    server.s.description = incomingServerDescription;
+  }
+
+  // add new servers for all descriptions we currently don't know about locally
+  for (const serverDescription of topology.description.servers.values()) {
+    if (!topology.s.servers.has(serverDescription.address)) {
+      const server = createAndConnectServer(topology, serverDescription);
+      topology.s.servers.set(serverDescription.address, server);
+    }
+  }
+
+  // for all servers no longer known, remove their descriptions and destroy their instances
+  for (const entry of topology.s.servers) {
+    const serverAddress = entry[0];
+    if (topology.description.hasServer(serverAddress)) {
+      continue;
+    }
+
+    const server = topology.s.servers.get(serverAddress);
+    topology.s.servers.delete(serverAddress);
+
+    // prepare server for garbage collection
+    destroyServer(server, topology);
+  }
+}
+
+function executeWriteOperation(args, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // TODO: once we drop Node 4, use destructuring either here or in arguments.
+  const topology = args.topology;
+  const op = args.op;
+  const ns = args.ns;
+  const ops = args.ops;
+
+  const willRetryWrite =
+    !args.retrying &&
+    !!options.retryWrites &&
+    options.session &&
+    isRetryableWritesSupported(topology) &&
+    !options.session.inTransaction() &&
+    options.explain === undefined;
+
+  topology.selectServer(writableServerSelector(), options, (err, server) => {
+    if (err) {
+      callback(err, null);
+      return;
+    }
+
+    const handler = (err, result) => {
+      if (!err) return callback(null, result);
+      if (!shouldRetryOperation(err)) {
+        err = getMMAPError(err);
+        return callback(err);
+      }
+
+      if (willRetryWrite) {
+        const newArgs = Object.assign({}, args, { retrying: true });
+        return executeWriteOperation(newArgs, options, callback);
+      }
+
+      return callback(err);
+    };
+
+    if (callback.operationId) {
+      handler.operationId = callback.operationId;
+    }
+
+    // increment and assign txnNumber
+    if (willRetryWrite) {
+      options.session.incrementTransactionNumber();
+      options.willRetryWrite = willRetryWrite;
+    }
+
+    // execute the write operation
+    server[op](ns, ops, options, handler);
+  });
+}
+
+function shouldRetryOperation(err) {
+  return err instanceof MongoError && err.hasErrorLabel('RetryableWriteError');
+}
+
+function srvPollingHandler(topology) {
+  return function handleSrvPolling(ev) {
+    const previousTopologyDescription = topology.s.description;
+    topology.s.description = topology.s.description.updateFromSrvPollingEvent(ev);
+    if (topology.s.description === previousTopologyDescription) {
+      // Nothing changed, so return
+      return;
+    }
+
+    updateServers(topology);
+
+    topology.emit(
+      'topologyDescriptionChanged',
+      new events.TopologyDescriptionChangedEvent(
+        topology.s.id,
+        previousTopologyDescription,
+        topology.s.description
+      )
+    );
+  };
+}
+
+function drainWaitQueue(queue, err) {
+  while (queue.length) {
+    const waitQueueMember = queue.shift();
+    clearTimeout(waitQueueMember.timer);
+    if (!waitQueueMember[kCancelled]) {
+      waitQueueMember.callback(err);
+    }
+  }
+}
+
+function processWaitQueue(topology) {
+  if (topology.s.state === STATE_CLOSED) {
+    drainWaitQueue(topology[kWaitQueue], new MongoError('Topology is closed, please connect'));
+    return;
+  }
+
+  const serverDescriptions = Array.from(topology.description.servers.values());
+  const membersToProcess = topology[kWaitQueue].length;
+  for (let i = 0; i < membersToProcess && topology[kWaitQueue].length; ++i) {
+    const waitQueueMember = topology[kWaitQueue].shift();
+    if (waitQueueMember[kCancelled]) {
+      continue;
+    }
+
+    let selectedDescriptions;
+    try {
+      const serverSelector = waitQueueMember.serverSelector;
+      selectedDescriptions = serverSelector
+        ? serverSelector(topology.description, serverDescriptions)
+        : serverDescriptions;
+    } catch (e) {
+      clearTimeout(waitQueueMember.timer);
+      waitQueueMember.callback(e);
+      continue;
+    }
+
+    if (selectedDescriptions.length === 0) {
+      topology[kWaitQueue].push(waitQueueMember);
+      continue;
+    }
+
+    const selectedServerDescription = randomSelection(selectedDescriptions);
+    const selectedServer = topology.s.servers.get(selectedServerDescription.address);
+    const transaction = waitQueueMember.transaction;
+    const isSharded = topology.description.type === TopologyType.Sharded;
+    if (isSharded && transaction && transaction.isActive) {
+      transaction.pinServer(selectedServer);
+    }
+
+    clearTimeout(waitQueueMember.timer);
+    waitQueueMember.callback(undefined, selectedServer);
+  }
+
+  if (topology[kWaitQueue].length > 0) {
+    // ensure all server monitors attempt monitoring soon
+    topology.s.servers.forEach(server => process.nextTick(() => server.requestCheck()));
+  }
+}
+
+/**
+ * A server opening SDAM monitoring event
+ *
+ * @event Topology#serverOpening
+ * @type {ServerOpeningEvent}
+ */
+
+/**
+ * A server closed SDAM monitoring event
+ *
+ * @event Topology#serverClosed
+ * @type {ServerClosedEvent}
+ */
+
+/**
+ * A server description SDAM change monitoring event
+ *
+ * @event Topology#serverDescriptionChanged
+ * @type {ServerDescriptionChangedEvent}
+ */
+
+/**
+ * A topology open SDAM event
+ *
+ * @event Topology#topologyOpening
+ * @type {TopologyOpeningEvent}
+ */
+
+/**
+ * A topology closed SDAM event
+ *
+ * @event Topology#topologyClosed
+ * @type {TopologyClosedEvent}
+ */
+
+/**
+ * A topology structure SDAM change event
+ *
+ * @event Topology#topologyDescriptionChanged
+ * @type {TopologyDescriptionChangedEvent}
+ */
+
+/**
+ * A topology serverHeartbeatStarted SDAM event
+ *
+ * @event Topology#serverHeartbeatStarted
+ * @type {ServerHeartbeatStartedEvent}
+ */
+
+/**
+ * A topology serverHeartbeatFailed SDAM event
+ *
+ * @event Topology#serverHeartbeatFailed
+ * @type {ServerHearbeatFailedEvent}
+ */
+
+/**
+ * A topology serverHeartbeatSucceeded SDAM change event
+ *
+ * @event Topology#serverHeartbeatSucceeded
+ * @type {ServerHeartbeatSucceededEvent}
+ */
+
+/**
+ * An event emitted indicating a command was started, if command monitoring is enabled
+ *
+ * @event Topology#commandStarted
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command succeeded, if command monitoring is enabled
+ *
+ * @event Topology#commandSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command failed, if command monitoring is enabled
+ *
+ * @event Topology#commandFailed
+ * @type {object}
+ */
+
+module.exports = {
+  Topology
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sdam/topology_description.js b/NodeAPI/node_modules/mongodb/lib/core/sdam/topology_description.js
new file mode 100644
index 0000000000000000000000000000000000000000..6e01d65bf0364b35c1e872e3070b1424ffdb0fdb
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sdam/topology_description.js
@@ -0,0 +1,460 @@
+'use strict';
+const ServerType = require('./common').ServerType;
+const ServerDescription = require('./server_description').ServerDescription;
+const WIRE_CONSTANTS = require('../wireprotocol/constants');
+const TopologyType = require('./common').TopologyType;
+
+// contstants related to compatability checks
+const MIN_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_SERVER_VERSION;
+const MAX_SUPPORTED_SERVER_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_SERVER_VERSION;
+const MIN_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MIN_SUPPORTED_WIRE_VERSION;
+const MAX_SUPPORTED_WIRE_VERSION = WIRE_CONSTANTS.MAX_SUPPORTED_WIRE_VERSION;
+
+// Representation of a deployment of servers
+class TopologyDescription {
+  /**
+   * Create a TopologyDescription
+   *
+   * @param {string} topologyType
+   * @param {Map<string, ServerDescription>} serverDescriptions the a map of address to ServerDescription
+   * @param {string} setName
+   * @param {number} maxSetVersion
+   * @param {ObjectId} maxElectionId
+   */
+  constructor(
+    topologyType,
+    serverDescriptions,
+    setName,
+    maxSetVersion,
+    maxElectionId,
+    commonWireVersion,
+    options
+  ) {
+    options = options || {};
+
+    // TODO: consider assigning all these values to a temporary value `s` which
+    //       we use `Object.freeze` on, ensuring the internal state of this type
+    //       is immutable.
+    this.type = topologyType || TopologyType.Unknown;
+    this.setName = setName || null;
+    this.maxSetVersion = maxSetVersion || null;
+    this.maxElectionId = maxElectionId || null;
+    this.servers = serverDescriptions || new Map();
+    this.stale = false;
+    this.compatible = true;
+    this.compatibilityError = null;
+    this.logicalSessionTimeoutMinutes = null;
+    this.heartbeatFrequencyMS = options.heartbeatFrequencyMS || 0;
+    this.localThresholdMS = options.localThresholdMS || 0;
+    this.commonWireVersion = commonWireVersion || null;
+
+    // save this locally, but don't display when printing the instance out
+    Object.defineProperty(this, 'options', { value: options, enumberable: false });
+
+    // determine server compatibility
+    for (const serverDescription of this.servers.values()) {
+      if (serverDescription.type === ServerType.Unknown) continue;
+
+      if (serverDescription.minWireVersion > MAX_SUPPORTED_WIRE_VERSION) {
+        this.compatible = false;
+        this.compatibilityError = `Server at ${serverDescription.address} requires wire version ${serverDescription.minWireVersion}, but this version of the driver only supports up to ${MAX_SUPPORTED_WIRE_VERSION} (MongoDB ${MAX_SUPPORTED_SERVER_VERSION})`;
+      }
+
+      if (serverDescription.maxWireVersion < MIN_SUPPORTED_WIRE_VERSION) {
+        this.compatible = false;
+        this.compatibilityError = `Server at ${serverDescription.address} reports wire version ${serverDescription.maxWireVersion}, but this version of the driver requires at least ${MIN_SUPPORTED_WIRE_VERSION} (MongoDB ${MIN_SUPPORTED_SERVER_VERSION}).`;
+        break;
+      }
+    }
+
+    // Whenever a client updates the TopologyDescription from an ismaster response, it MUST set
+    // TopologyDescription.logicalSessionTimeoutMinutes to the smallest logicalSessionTimeoutMinutes
+    // value among ServerDescriptions of all data-bearing server types. If any have a null
+    // logicalSessionTimeoutMinutes, then TopologyDescription.logicalSessionTimeoutMinutes MUST be
+    // set to null.
+    this.logicalSessionTimeoutMinutes = null;
+    for (const addressServerTuple of this.servers) {
+      const server = addressServerTuple[1];
+      if (server.isReadable) {
+        if (server.logicalSessionTimeoutMinutes == null) {
+          // If any of the servers have a null logicalSessionsTimeout, then the whole topology does
+          this.logicalSessionTimeoutMinutes = null;
+          break;
+        }
+
+        if (this.logicalSessionTimeoutMinutes == null) {
+          // First server with a non null logicalSessionsTimeout
+          this.logicalSessionTimeoutMinutes = server.logicalSessionTimeoutMinutes;
+          continue;
+        }
+
+        // Always select the smaller of the:
+        // current server logicalSessionsTimeout and the topologies logicalSessionsTimeout
+        this.logicalSessionTimeoutMinutes = Math.min(
+          this.logicalSessionTimeoutMinutes,
+          server.logicalSessionTimeoutMinutes
+        );
+      }
+    }
+  }
+
+  /**
+   * Returns a new TopologyDescription based on the SrvPollingEvent
+   * @param {SrvPollingEvent} ev The event
+   */
+  updateFromSrvPollingEvent(ev) {
+    const newAddresses = ev.addresses();
+    const serverDescriptions = new Map(this.servers);
+    for (const server of this.servers) {
+      if (newAddresses.has(server[0])) {
+        newAddresses.delete(server[0]);
+      } else {
+        serverDescriptions.delete(server[0]);
+      }
+    }
+
+    if (serverDescriptions.size === this.servers.size && newAddresses.size === 0) {
+      return this;
+    }
+
+    for (const address of newAddresses) {
+      serverDescriptions.set(address, new ServerDescription(address));
+    }
+
+    return new TopologyDescription(
+      this.type,
+      serverDescriptions,
+      this.setName,
+      this.maxSetVersion,
+      this.maxElectionId,
+      this.commonWireVersion,
+      this.options,
+      null
+    );
+  }
+
+  /**
+   * Returns a copy of this description updated with a given ServerDescription
+   *
+   * @param {ServerDescription} serverDescription
+   */
+  update(serverDescription) {
+    const address = serverDescription.address;
+    // NOTE: there are a number of prime targets for refactoring here
+    //       once we support destructuring assignments
+
+    // potentially mutated values
+    let topologyType = this.type;
+    let setName = this.setName;
+    let maxSetVersion = this.maxSetVersion;
+    let maxElectionId = this.maxElectionId;
+    let commonWireVersion = this.commonWireVersion;
+
+    if (serverDescription.setName && setName && serverDescription.setName !== setName) {
+      serverDescription = new ServerDescription(address, null);
+    }
+
+    const serverType = serverDescription.type;
+    let serverDescriptions = new Map(this.servers);
+
+    // update common wire version
+    if (serverDescription.maxWireVersion !== 0) {
+      if (commonWireVersion == null) {
+        commonWireVersion = serverDescription.maxWireVersion;
+      } else {
+        commonWireVersion = Math.min(commonWireVersion, serverDescription.maxWireVersion);
+      }
+    }
+
+    // update the actual server description
+    serverDescriptions.set(address, serverDescription);
+
+    if (topologyType === TopologyType.Single) {
+      // once we are defined as single, that never changes
+      return new TopologyDescription(
+        TopologyType.Single,
+        serverDescriptions,
+        setName,
+        maxSetVersion,
+        maxElectionId,
+        commonWireVersion,
+        this.options
+      );
+    }
+
+    if (topologyType === TopologyType.Unknown) {
+      if (serverType === ServerType.Standalone && this.servers.size !== 1) {
+        serverDescriptions.delete(address);
+      } else {
+        topologyType = topologyTypeForServerType(serverType);
+      }
+    }
+
+    if (topologyType === TopologyType.Sharded) {
+      if ([ServerType.Mongos, ServerType.Unknown].indexOf(serverType) === -1) {
+        serverDescriptions.delete(address);
+      }
+    }
+
+    if (topologyType === TopologyType.ReplicaSetNoPrimary) {
+      if ([ServerType.Standalone, ServerType.Mongos].indexOf(serverType) >= 0) {
+        serverDescriptions.delete(address);
+      }
+
+      if (serverType === ServerType.RSPrimary) {
+        const result = updateRsFromPrimary(
+          serverDescriptions,
+          setName,
+          serverDescription,
+          maxSetVersion,
+          maxElectionId
+        );
+
+        (topologyType = result[0]),
+          (setName = result[1]),
+          (maxSetVersion = result[2]),
+          (maxElectionId = result[3]);
+      } else if (
+        [ServerType.RSSecondary, ServerType.RSArbiter, ServerType.RSOther].indexOf(serverType) >= 0
+      ) {
+        const result = updateRsNoPrimaryFromMember(serverDescriptions, setName, serverDescription);
+        (topologyType = result[0]), (setName = result[1]);
+      }
+    }
+
+    if (topologyType === TopologyType.ReplicaSetWithPrimary) {
+      if ([ServerType.Standalone, ServerType.Mongos].indexOf(serverType) >= 0) {
+        serverDescriptions.delete(address);
+        topologyType = checkHasPrimary(serverDescriptions);
+      } else if (serverType === ServerType.RSPrimary) {
+        const result = updateRsFromPrimary(
+          serverDescriptions,
+          setName,
+          serverDescription,
+          maxSetVersion,
+          maxElectionId
+        );
+
+        (topologyType = result[0]),
+          (setName = result[1]),
+          (maxSetVersion = result[2]),
+          (maxElectionId = result[3]);
+      } else if (
+        [ServerType.RSSecondary, ServerType.RSArbiter, ServerType.RSOther].indexOf(serverType) >= 0
+      ) {
+        topologyType = updateRsWithPrimaryFromMember(
+          serverDescriptions,
+          setName,
+          serverDescription
+        );
+      } else {
+        topologyType = checkHasPrimary(serverDescriptions);
+      }
+    }
+
+    return new TopologyDescription(
+      topologyType,
+      serverDescriptions,
+      setName,
+      maxSetVersion,
+      maxElectionId,
+      commonWireVersion,
+      this.options
+    );
+  }
+
+  get error() {
+    const descriptionsWithError = Array.from(this.servers.values()).filter(sd => sd.error);
+    if (descriptionsWithError.length > 0) {
+      return descriptionsWithError[0].error;
+    }
+    return undefined;
+  }
+
+  /**
+   * Determines if the topology description has any known servers
+   */
+  get hasKnownServers() {
+    return Array.from(this.servers.values()).some(sd => sd.type !== ServerType.Unknown);
+  }
+
+  /**
+   * Determines if this topology description has a data-bearing server available.
+   */
+  get hasDataBearingServers() {
+    return Array.from(this.servers.values()).some(sd => sd.isDataBearing);
+  }
+
+  /**
+   * Determines if the topology has a definition for the provided address
+   *
+   * @param {String} address
+   * @return {Boolean} Whether the topology knows about this server
+   */
+  hasServer(address) {
+    return this.servers.has(address);
+  }
+}
+
+function topologyTypeForServerType(serverType) {
+  if (serverType === ServerType.Standalone) {
+    return TopologyType.Single;
+  }
+
+  if (serverType === ServerType.Mongos) {
+    return TopologyType.Sharded;
+  }
+
+  if (serverType === ServerType.RSPrimary) {
+    return TopologyType.ReplicaSetWithPrimary;
+  }
+
+  if (serverType === ServerType.RSGhost || serverType === ServerType.Unknown) {
+    return TopologyType.Unknown;
+  }
+
+  return TopologyType.ReplicaSetNoPrimary;
+}
+
+function compareObjectId(oid1, oid2) {
+  if (oid1 == null) {
+    return -1;
+  }
+
+  if (oid2 == null) {
+    return 1;
+  }
+
+  if (oid1.id instanceof Buffer && oid2.id instanceof Buffer) {
+    const oid1Buffer = oid1.id;
+    const oid2Buffer = oid2.id;
+    return oid1Buffer.compare(oid2Buffer);
+  }
+
+  const oid1String = oid1.toString();
+  const oid2String = oid2.toString();
+  return oid1String.localeCompare(oid2String);
+}
+
+function updateRsFromPrimary(
+  serverDescriptions,
+  setName,
+  serverDescription,
+  maxSetVersion,
+  maxElectionId
+) {
+  setName = setName || serverDescription.setName;
+  if (setName !== serverDescription.setName) {
+    serverDescriptions.delete(serverDescription.address);
+    return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId];
+  }
+
+  const electionId = serverDescription.electionId ? serverDescription.electionId : null;
+  if (serverDescription.setVersion && electionId) {
+    if (maxSetVersion && maxElectionId) {
+      if (
+        maxSetVersion > serverDescription.setVersion ||
+        compareObjectId(maxElectionId, electionId) > 0
+      ) {
+        // this primary is stale, we must remove it
+        serverDescriptions.set(
+          serverDescription.address,
+          new ServerDescription(serverDescription.address)
+        );
+
+        return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId];
+      }
+    }
+
+    maxElectionId = serverDescription.electionId;
+  }
+
+  if (
+    serverDescription.setVersion != null &&
+    (maxSetVersion == null || serverDescription.setVersion > maxSetVersion)
+  ) {
+    maxSetVersion = serverDescription.setVersion;
+  }
+
+  // We've heard from the primary. Is it the same primary as before?
+  for (const address of serverDescriptions.keys()) {
+    const server = serverDescriptions.get(address);
+
+    if (server.type === ServerType.RSPrimary && server.address !== serverDescription.address) {
+      // Reset old primary's type to Unknown.
+      serverDescriptions.set(address, new ServerDescription(server.address));
+
+      // There can only be one primary
+      break;
+    }
+  }
+
+  // Discover new hosts from this primary's response.
+  serverDescription.allHosts.forEach(address => {
+    if (!serverDescriptions.has(address)) {
+      serverDescriptions.set(address, new ServerDescription(address));
+    }
+  });
+
+  // Remove hosts not in the response.
+  const currentAddresses = Array.from(serverDescriptions.keys());
+  const responseAddresses = serverDescription.allHosts;
+  currentAddresses
+    .filter(addr => responseAddresses.indexOf(addr) === -1)
+    .forEach(address => {
+      serverDescriptions.delete(address);
+    });
+
+  return [checkHasPrimary(serverDescriptions), setName, maxSetVersion, maxElectionId];
+}
+
+function updateRsWithPrimaryFromMember(serverDescriptions, setName, serverDescription) {
+  if (setName == null) {
+    throw new TypeError('setName is required');
+  }
+
+  if (
+    setName !== serverDescription.setName ||
+    (serverDescription.me && serverDescription.address !== serverDescription.me)
+  ) {
+    serverDescriptions.delete(serverDescription.address);
+  }
+
+  return checkHasPrimary(serverDescriptions);
+}
+
+function updateRsNoPrimaryFromMember(serverDescriptions, setName, serverDescription) {
+  let topologyType = TopologyType.ReplicaSetNoPrimary;
+
+  setName = setName || serverDescription.setName;
+  if (setName !== serverDescription.setName) {
+    serverDescriptions.delete(serverDescription.address);
+    return [topologyType, setName];
+  }
+
+  serverDescription.allHosts.forEach(address => {
+    if (!serverDescriptions.has(address)) {
+      serverDescriptions.set(address, new ServerDescription(address));
+    }
+  });
+
+  if (serverDescription.me && serverDescription.address !== serverDescription.me) {
+    serverDescriptions.delete(serverDescription.address);
+  }
+
+  return [topologyType, setName];
+}
+
+function checkHasPrimary(serverDescriptions) {
+  for (const addr of serverDescriptions.keys()) {
+    if (serverDescriptions.get(addr).type === ServerType.RSPrimary) {
+      return TopologyType.ReplicaSetWithPrimary;
+    }
+  }
+
+  return TopologyType.ReplicaSetNoPrimary;
+}
+
+module.exports = {
+  TopologyDescription
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/sessions.js b/NodeAPI/node_modules/mongodb/lib/core/sessions.js
new file mode 100644
index 0000000000000000000000000000000000000000..abc8d94518882cb68ccb1e1bc3d002a501b582c8
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/sessions.js
@@ -0,0 +1,780 @@
+'use strict';
+
+const retrieveBSON = require('./connection/utils').retrieveBSON;
+const EventEmitter = require('events');
+const BSON = retrieveBSON();
+const Binary = BSON.Binary;
+const uuidV4 = require('./utils').uuidV4;
+const MongoError = require('./error').MongoError;
+const isRetryableError = require('././error').isRetryableError;
+const MongoNetworkError = require('./error').MongoNetworkError;
+const MongoWriteConcernError = require('./error').MongoWriteConcernError;
+const Transaction = require('./transactions').Transaction;
+const TxnState = require('./transactions').TxnState;
+const isPromiseLike = require('./utils').isPromiseLike;
+const ReadPreference = require('./topologies/read_preference');
+const maybePromise = require('../utils').maybePromise;
+const isTransactionCommand = require('./transactions').isTransactionCommand;
+const resolveClusterTime = require('./topologies/shared').resolveClusterTime;
+const isSharded = require('./wireprotocol/shared').isSharded;
+const maxWireVersion = require('./utils').maxWireVersion;
+const now = require('./../utils').now;
+const calculateDurationInMs = require('./../utils').calculateDurationInMs;
+const minWireVersionForShardedTransactions = 8;
+
+function assertAlive(session, callback) {
+  if (session.serverSession == null) {
+    const error = new MongoError('Cannot use a session that has ended');
+    if (typeof callback === 'function') {
+      callback(error, null);
+      return false;
+    }
+
+    throw error;
+  }
+
+  return true;
+}
+
+/**
+ * Options to pass when creating a Client Session
+ * @typedef {Object} SessionOptions
+ * @property {boolean} [causalConsistency=true] Whether causal consistency should be enabled on this session
+ * @property {TransactionOptions} [defaultTransactionOptions] The default TransactionOptions to use for transactions started on this session.
+ */
+
+/**
+ * A BSON document reflecting the lsid of a {@link ClientSession}
+ * @typedef {Object} SessionId
+ */
+
+const kServerSession = Symbol('serverSession');
+
+/**
+ * A class representing a client session on the server
+ * WARNING: not meant to be instantiated directly.
+ * @class
+ * @hideconstructor
+ */
+class ClientSession extends EventEmitter {
+  /**
+   * Create a client session.
+   * WARNING: not meant to be instantiated directly
+   *
+   * @param {Topology} topology The current client's topology (Internal Class)
+   * @param {ServerSessionPool} sessionPool The server session pool (Internal Class)
+   * @param {SessionOptions} [options] Optional settings
+   * @param {Object} [clientOptions] Optional settings provided when creating a client in the porcelain driver
+   */
+  constructor(topology, sessionPool, options, clientOptions) {
+    super();
+
+    if (topology == null) {
+      throw new Error('ClientSession requires a topology');
+    }
+
+    if (sessionPool == null || !(sessionPool instanceof ServerSessionPool)) {
+      throw new Error('ClientSession requires a ServerSessionPool');
+    }
+
+    options = options || {};
+    clientOptions = clientOptions || {};
+
+    this.topology = topology;
+    this.sessionPool = sessionPool;
+    this.hasEnded = false;
+    this.clientOptions = clientOptions;
+    this[kServerSession] = undefined;
+
+    this.supports = {
+      causalConsistency:
+        typeof options.causalConsistency !== 'undefined' ? options.causalConsistency : true
+    };
+
+    this.clusterTime = options.initialClusterTime;
+
+    this.operationTime = null;
+    this.explicit = !!options.explicit;
+    this.owner = options.owner;
+    this.defaultTransactionOptions = Object.assign({}, options.defaultTransactionOptions);
+    this.transaction = new Transaction();
+  }
+
+  /**
+   * The server id associated with this session
+   * @type {SessionId}
+   */
+  get id() {
+    return this.serverSession.id;
+  }
+
+  get serverSession() {
+    if (this[kServerSession] == null) {
+      this[kServerSession] = this.sessionPool.acquire();
+    }
+
+    return this[kServerSession];
+  }
+
+  /**
+   * Ends this session on the server
+   *
+   * @param {Object} [options] Optional settings. Currently reserved for future use
+   * @param {Function} [callback] Optional callback for completion of this operation
+   */
+  endSession(options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = options || {};
+
+    const session = this;
+    return maybePromise(this, callback, done => {
+      if (session.hasEnded) {
+        return done();
+      }
+
+      function completeEndSession() {
+        // release the server session back to the pool
+        session.sessionPool.release(session.serverSession);
+        session[kServerSession] = undefined;
+
+        // mark the session as ended, and emit a signal
+        session.hasEnded = true;
+        session.emit('ended', session);
+
+        // spec indicates that we should ignore all errors for `endSessions`
+        done();
+      }
+
+      if (session.serverSession && session.inTransaction()) {
+        session.abortTransaction(err => {
+          if (err) return done(err);
+          completeEndSession();
+        });
+
+        return;
+      }
+
+      completeEndSession();
+    });
+  }
+
+  /**
+   * Advances the operationTime for a ClientSession.
+   *
+   * @param {Timestamp} operationTime the `BSON.Timestamp` of the operation type it is desired to advance to
+   */
+  advanceOperationTime(operationTime) {
+    if (this.operationTime == null) {
+      this.operationTime = operationTime;
+      return;
+    }
+
+    if (operationTime.greaterThan(this.operationTime)) {
+      this.operationTime = operationTime;
+    }
+  }
+
+  /**
+   * Used to determine if this session equals another
+   * @param {ClientSession} session
+   * @return {boolean} true if the sessions are equal
+   */
+  equals(session) {
+    if (!(session instanceof ClientSession)) {
+      return false;
+    }
+
+    return this.id.id.buffer.equals(session.id.id.buffer);
+  }
+
+  /**
+   * Increment the transaction number on the internal ServerSession
+   */
+  incrementTransactionNumber() {
+    this.serverSession.txnNumber++;
+  }
+
+  /**
+   * @returns {boolean} whether this session is currently in a transaction or not
+   */
+  inTransaction() {
+    return this.transaction.isActive;
+  }
+
+  /**
+   * Starts a new transaction with the given options.
+   *
+   * @param {TransactionOptions} options Options for the transaction
+   */
+  startTransaction(options) {
+    assertAlive(this);
+    if (this.inTransaction()) {
+      throw new MongoError('Transaction already in progress');
+    }
+
+    const topologyMaxWireVersion = maxWireVersion(this.topology);
+    if (
+      isSharded(this.topology) &&
+      topologyMaxWireVersion != null &&
+      topologyMaxWireVersion < minWireVersionForShardedTransactions
+    ) {
+      throw new MongoError('Transactions are not supported on sharded clusters in MongoDB < 4.2.');
+    }
+
+    // increment txnNumber
+    this.incrementTransactionNumber();
+
+    // create transaction state
+    this.transaction = new Transaction(
+      Object.assign({}, this.clientOptions, options || this.defaultTransactionOptions)
+    );
+
+    this.transaction.transition(TxnState.STARTING_TRANSACTION);
+  }
+
+  /**
+   * Commits the currently active transaction in this session.
+   *
+   * @param {Function} [callback] optional callback for completion of this operation
+   * @return {Promise} A promise is returned if no callback is provided
+   */
+  commitTransaction(callback) {
+    return maybePromise(this, callback, done => endTransaction(this, 'commitTransaction', done));
+  }
+
+  /**
+   * Aborts the currently active transaction in this session.
+   *
+   * @param {Function} [callback] optional callback for completion of this operation
+   * @return {Promise} A promise is returned if no callback is provided
+   */
+  abortTransaction(callback) {
+    return maybePromise(this, callback, done => endTransaction(this, 'abortTransaction', done));
+  }
+
+  /**
+   * This is here to ensure that ClientSession is never serialized to BSON.
+   * @ignore
+   */
+  toBSON() {
+    throw new Error('ClientSession cannot be serialized to BSON.');
+  }
+
+  /**
+   * A user provided function to be run within a transaction
+   *
+   * @callback WithTransactionCallback
+   * @param {ClientSession} session The parent session of the transaction running the operation. This should be passed into each operation within the lambda.
+   * @returns {Promise} The resulting Promise of operations run within this transaction
+   */
+
+  /**
+   * Runs a provided lambda within a transaction, retrying either the commit operation
+   * or entire transaction as needed (and when the error permits) to better ensure that
+   * the transaction can complete successfully.
+   *
+   * IMPORTANT: This method requires the user to return a Promise, all lambdas that do not
+   * return a Promise will result in undefined behavior.
+   *
+   * @param {WithTransactionCallback} fn
+   * @param {TransactionOptions} [options] Optional settings for the transaction
+   */
+  withTransaction(fn, options) {
+    const startTime = now();
+    return attemptTransaction(this, startTime, fn, options);
+  }
+}
+
+const MAX_WITH_TRANSACTION_TIMEOUT = 120000;
+const UNSATISFIABLE_WRITE_CONCERN_CODE = 100;
+const UNKNOWN_REPL_WRITE_CONCERN_CODE = 79;
+const MAX_TIME_MS_EXPIRED_CODE = 50;
+const NON_DETERMINISTIC_WRITE_CONCERN_ERRORS = new Set([
+  'CannotSatisfyWriteConcern',
+  'UnknownReplWriteConcern',
+  'UnsatisfiableWriteConcern'
+]);
+
+function hasNotTimedOut(startTime, max) {
+  return calculateDurationInMs(startTime) < max;
+}
+
+function isUnknownTransactionCommitResult(err) {
+  return (
+    isMaxTimeMSExpiredError(err) ||
+    (!NON_DETERMINISTIC_WRITE_CONCERN_ERRORS.has(err.codeName) &&
+      err.code !== UNSATISFIABLE_WRITE_CONCERN_CODE &&
+      err.code !== UNKNOWN_REPL_WRITE_CONCERN_CODE)
+  );
+}
+
+function isMaxTimeMSExpiredError(err) {
+  if (err == null) return false;
+  return (
+    err.code === MAX_TIME_MS_EXPIRED_CODE ||
+    (err.writeConcernError && err.writeConcernError.code === MAX_TIME_MS_EXPIRED_CODE)
+  );
+}
+
+function attemptTransactionCommit(session, startTime, fn, options) {
+  return session.commitTransaction().catch(err => {
+    if (
+      err instanceof MongoError &&
+      hasNotTimedOut(startTime, MAX_WITH_TRANSACTION_TIMEOUT) &&
+      !isMaxTimeMSExpiredError(err)
+    ) {
+      if (err.hasErrorLabel('UnknownTransactionCommitResult')) {
+        return attemptTransactionCommit(session, startTime, fn, options);
+      }
+
+      if (err.hasErrorLabel('TransientTransactionError')) {
+        return attemptTransaction(session, startTime, fn, options);
+      }
+    }
+
+    throw err;
+  });
+}
+
+const USER_EXPLICIT_TXN_END_STATES = new Set([
+  TxnState.NO_TRANSACTION,
+  TxnState.TRANSACTION_COMMITTED,
+  TxnState.TRANSACTION_ABORTED
+]);
+
+function userExplicitlyEndedTransaction(session) {
+  return USER_EXPLICIT_TXN_END_STATES.has(session.transaction.state);
+}
+
+function attemptTransaction(session, startTime, fn, options) {
+  session.startTransaction(options);
+
+  let promise;
+  try {
+    promise = fn(session);
+  } catch (err) {
+    promise = Promise.reject(err);
+  }
+
+  if (!isPromiseLike(promise)) {
+    session.abortTransaction();
+    throw new TypeError('Function provided to `withTransaction` must return a Promise');
+  }
+
+  return promise
+    .then(() => {
+      if (userExplicitlyEndedTransaction(session)) {
+        return;
+      }
+
+      return attemptTransactionCommit(session, startTime, fn, options);
+    })
+    .catch(err => {
+      function maybeRetryOrThrow(err) {
+        if (
+          err instanceof MongoError &&
+          err.hasErrorLabel('TransientTransactionError') &&
+          hasNotTimedOut(startTime, MAX_WITH_TRANSACTION_TIMEOUT)
+        ) {
+          return attemptTransaction(session, startTime, fn, options);
+        }
+
+        if (isMaxTimeMSExpiredError(err)) {
+          err.addErrorLabel('UnknownTransactionCommitResult');
+        }
+
+        throw err;
+      }
+
+      if (session.transaction.isActive) {
+        return session.abortTransaction().then(() => maybeRetryOrThrow(err));
+      }
+
+      return maybeRetryOrThrow(err);
+    });
+}
+
+function endTransaction(session, commandName, callback) {
+  if (!assertAlive(session, callback)) {
+    // checking result in case callback was called
+    return;
+  }
+
+  // handle any initial problematic cases
+  let txnState = session.transaction.state;
+
+  if (txnState === TxnState.NO_TRANSACTION) {
+    callback(new MongoError('No transaction started'));
+    return;
+  }
+
+  if (commandName === 'commitTransaction') {
+    if (
+      txnState === TxnState.STARTING_TRANSACTION ||
+      txnState === TxnState.TRANSACTION_COMMITTED_EMPTY
+    ) {
+      // the transaction was never started, we can safely exit here
+      session.transaction.transition(TxnState.TRANSACTION_COMMITTED_EMPTY);
+      callback(null, null);
+      return;
+    }
+
+    if (txnState === TxnState.TRANSACTION_ABORTED) {
+      callback(new MongoError('Cannot call commitTransaction after calling abortTransaction'));
+      return;
+    }
+  } else {
+    if (txnState === TxnState.STARTING_TRANSACTION) {
+      // the transaction was never started, we can safely exit here
+      session.transaction.transition(TxnState.TRANSACTION_ABORTED);
+      callback(null, null);
+      return;
+    }
+
+    if (txnState === TxnState.TRANSACTION_ABORTED) {
+      callback(new MongoError('Cannot call abortTransaction twice'));
+      return;
+    }
+
+    if (
+      txnState === TxnState.TRANSACTION_COMMITTED ||
+      txnState === TxnState.TRANSACTION_COMMITTED_EMPTY
+    ) {
+      callback(new MongoError('Cannot call abortTransaction after calling commitTransaction'));
+      return;
+    }
+  }
+
+  // construct and send the command
+  const command = { [commandName]: 1 };
+
+  // apply a writeConcern if specified
+  let writeConcern;
+  if (session.transaction.options.writeConcern) {
+    writeConcern = Object.assign({}, session.transaction.options.writeConcern);
+  } else if (session.clientOptions && session.clientOptions.w) {
+    writeConcern = { w: session.clientOptions.w };
+  }
+
+  if (txnState === TxnState.TRANSACTION_COMMITTED) {
+    writeConcern = Object.assign({ wtimeout: 10000 }, writeConcern, { w: 'majority' });
+  }
+
+  if (writeConcern) {
+    Object.assign(command, { writeConcern });
+  }
+
+  if (commandName === 'commitTransaction' && session.transaction.options.maxTimeMS) {
+    Object.assign(command, { maxTimeMS: session.transaction.options.maxTimeMS });
+  }
+
+  function commandHandler(e, r) {
+    if (commandName === 'commitTransaction') {
+      session.transaction.transition(TxnState.TRANSACTION_COMMITTED);
+
+      if (
+        e &&
+        (e instanceof MongoNetworkError ||
+          e instanceof MongoWriteConcernError ||
+          isRetryableError(e) ||
+          isMaxTimeMSExpiredError(e))
+      ) {
+        if (isUnknownTransactionCommitResult(e)) {
+          e.addErrorLabel('UnknownTransactionCommitResult');
+
+          // per txns spec, must unpin session in this case
+          session.transaction.unpinServer();
+        }
+      }
+    } else {
+      session.transaction.transition(TxnState.TRANSACTION_ABORTED);
+    }
+
+    callback(e, r);
+  }
+
+  // The spec indicates that we should ignore all errors on `abortTransaction`
+  function transactionError(err) {
+    return commandName === 'commitTransaction' ? err : null;
+  }
+
+  if (
+    // Assumption here that commandName is "commitTransaction" or "abortTransaction"
+    session.transaction.recoveryToken &&
+    supportsRecoveryToken(session)
+  ) {
+    command.recoveryToken = session.transaction.recoveryToken;
+  }
+
+  // send the command
+  session.topology.command('admin.$cmd', command, { session }, (err, reply) => {
+    if (err && isRetryableError(err)) {
+      // SPEC-1185: apply majority write concern when retrying commitTransaction
+      if (command.commitTransaction) {
+        // per txns spec, must unpin session in this case
+        session.transaction.unpinServer();
+
+        command.writeConcern = Object.assign({ wtimeout: 10000 }, command.writeConcern, {
+          w: 'majority'
+        });
+      }
+
+      return session.topology.command('admin.$cmd', command, { session }, (_err, _reply) =>
+        commandHandler(transactionError(_err), _reply)
+      );
+    }
+
+    commandHandler(transactionError(err), reply);
+  });
+}
+
+function supportsRecoveryToken(session) {
+  const topology = session.topology;
+  return !!topology.s.options.useRecoveryToken;
+}
+
+/**
+ * Reflects the existence of a session on the server. Can be reused by the session pool.
+ * WARNING: not meant to be instantiated directly. For internal use only.
+ * @ignore
+ */
+class ServerSession {
+  constructor() {
+    this.id = { id: new Binary(uuidV4(), Binary.SUBTYPE_UUID) };
+    this.lastUse = now();
+    this.txnNumber = 0;
+    this.isDirty = false;
+  }
+
+  /**
+   * Determines if the server session has timed out.
+   * @ignore
+   * @param {Date} sessionTimeoutMinutes The server's "logicalSessionTimeoutMinutes"
+   * @return {boolean} true if the session has timed out.
+   */
+  hasTimedOut(sessionTimeoutMinutes) {
+    // Take the difference of the lastUse timestamp and now, which will result in a value in
+    // milliseconds, and then convert milliseconds to minutes to compare to `sessionTimeoutMinutes`
+    const idleTimeMinutes = Math.round(
+      ((calculateDurationInMs(this.lastUse) % 86400000) % 3600000) / 60000
+    );
+
+    return idleTimeMinutes > sessionTimeoutMinutes - 1;
+  }
+}
+
+/**
+ * Maintains a pool of Server Sessions.
+ * For internal use only
+ * @ignore
+ */
+class ServerSessionPool {
+  constructor(topology) {
+    if (topology == null) {
+      throw new Error('ServerSessionPool requires a topology');
+    }
+
+    this.topology = topology;
+    this.sessions = [];
+  }
+
+  /**
+   * Ends all sessions in the session pool.
+   * @ignore
+   */
+  endAllPooledSessions(callback) {
+    if (this.sessions.length) {
+      this.topology.endSessions(
+        this.sessions.map(session => session.id),
+        () => {
+          this.sessions = [];
+          if (typeof callback === 'function') {
+            callback();
+          }
+        }
+      );
+
+      return;
+    }
+
+    if (typeof callback === 'function') {
+      callback();
+    }
+  }
+
+  /**
+   * Acquire a Server Session from the pool.
+   * Iterates through each session in the pool, removing any stale sessions
+   * along the way. The first non-stale session found is removed from the
+   * pool and returned. If no non-stale session is found, a new ServerSession
+   * is created.
+   * @ignore
+   * @returns {ServerSession}
+   */
+  acquire() {
+    const sessionTimeoutMinutes = this.topology.logicalSessionTimeoutMinutes;
+    while (this.sessions.length) {
+      const session = this.sessions.shift();
+      if (!session.hasTimedOut(sessionTimeoutMinutes)) {
+        return session;
+      }
+    }
+
+    return new ServerSession();
+  }
+
+  /**
+   * Release a session to the session pool
+   * Adds the session back to the session pool if the session has not timed out yet.
+   * This method also removes any stale sessions from the pool.
+   * @ignore
+   * @param {ServerSession} session The session to release to the pool
+   */
+  release(session) {
+    const sessionTimeoutMinutes = this.topology.logicalSessionTimeoutMinutes;
+    while (this.sessions.length) {
+      const pooledSession = this.sessions[this.sessions.length - 1];
+      if (pooledSession.hasTimedOut(sessionTimeoutMinutes)) {
+        this.sessions.pop();
+      } else {
+        break;
+      }
+    }
+
+    if (!session.hasTimedOut(sessionTimeoutMinutes)) {
+      if (session.isDirty) {
+        return;
+      }
+
+      // otherwise, readd this session to the session pool
+      this.sessions.unshift(session);
+    }
+  }
+}
+
+// TODO: this should be codified in command construction
+// @see https://github.com/mongodb/specifications/blob/master/source/read-write-concern/read-write-concern.rst#read-concern
+function commandSupportsReadConcern(command, options) {
+  if (
+    command.aggregate ||
+    command.count ||
+    command.distinct ||
+    command.find ||
+    command.parallelCollectionScan ||
+    command.geoNear ||
+    command.geoSearch
+  ) {
+    return true;
+  }
+
+  if (
+    command.mapReduce &&
+    options &&
+    options.out &&
+    (options.out.inline === 1 || options.out === 'inline')
+  ) {
+    return true;
+  }
+
+  return false;
+}
+
+/**
+ * Optionally decorate a command with sessions specific keys
+ *
+ * @ignore
+ * @param {ClientSession} session the session tracking transaction state
+ * @param {Object} command the command to decorate
+ * @param {Object} topology the topology for tracking the cluster time
+ * @param {Object} [options] Optional settings passed to calling operation
+ * @return {MongoError|null} An error, if some error condition was met
+ */
+function applySession(session, command, options) {
+  if (session.hasEnded) {
+    // TODO: merge this with `assertAlive`, did not want to throw a try/catch here
+    return new MongoError('Cannot use a session that has ended');
+  }
+
+  // SPEC-1019: silently ignore explicit session with unacknowledged write for backwards compatibility
+  if (options && options.writeConcern && options.writeConcern.w === 0) {
+    return;
+  }
+
+  const serverSession = session.serverSession;
+  serverSession.lastUse = now();
+  command.lsid = serverSession.id;
+
+  // first apply non-transaction-specific sessions data
+  const inTransaction = session.inTransaction() || isTransactionCommand(command);
+  const isRetryableWrite = options.willRetryWrite;
+  const shouldApplyReadConcern = commandSupportsReadConcern(command, options);
+
+  if (serverSession.txnNumber && (isRetryableWrite || inTransaction)) {
+    command.txnNumber = BSON.Long.fromNumber(serverSession.txnNumber);
+  }
+
+  // now attempt to apply transaction-specific sessions data
+  if (!inTransaction) {
+    if (session.transaction.state !== TxnState.NO_TRANSACTION) {
+      session.transaction.transition(TxnState.NO_TRANSACTION);
+    }
+
+    // TODO: the following should only be applied to read operation per spec.
+    // for causal consistency
+    if (session.supports.causalConsistency && session.operationTime && shouldApplyReadConcern) {
+      command.readConcern = command.readConcern || {};
+      Object.assign(command.readConcern, { afterClusterTime: session.operationTime });
+    }
+
+    return;
+  }
+
+  if (options.readPreference && !options.readPreference.equals(ReadPreference.primary)) {
+    return new MongoError(
+      `Read preference in a transaction must be primary, not: ${options.readPreference.mode}`
+    );
+  }
+
+  // `autocommit` must always be false to differentiate from retryable writes
+  command.autocommit = false;
+
+  if (session.transaction.state === TxnState.STARTING_TRANSACTION) {
+    session.transaction.transition(TxnState.TRANSACTION_IN_PROGRESS);
+    command.startTransaction = true;
+
+    const readConcern =
+      session.transaction.options.readConcern || session.clientOptions.readConcern;
+    if (readConcern) {
+      command.readConcern = readConcern;
+    }
+
+    if (session.supports.causalConsistency && session.operationTime) {
+      command.readConcern = command.readConcern || {};
+      Object.assign(command.readConcern, { afterClusterTime: session.operationTime });
+    }
+  }
+}
+
+function updateSessionFromResponse(session, document) {
+  if (document.$clusterTime) {
+    resolveClusterTime(session, document.$clusterTime);
+  }
+
+  if (document.operationTime && session && session.supports.causalConsistency) {
+    session.advanceOperationTime(document.operationTime);
+  }
+
+  if (document.recoveryToken && session && session.inTransaction()) {
+    session.transaction._recoveryToken = document.recoveryToken;
+  }
+}
+
+module.exports = {
+  ClientSession,
+  ServerSession,
+  ServerSessionPool,
+  TxnState,
+  applySession,
+  updateSessionFromResponse,
+  commandSupportsReadConcern
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/tools/smoke_plugin.js b/NodeAPI/node_modules/mongodb/lib/core/tools/smoke_plugin.js
new file mode 100644
index 0000000000000000000000000000000000000000..7488f0f1dc2ce5cbc9fc2fef9c9af50d2aa5d610
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/tools/smoke_plugin.js
@@ -0,0 +1,62 @@
+'use strict';
+
+var fs = require('fs');
+
+/* Note: because this plugin uses process.on('uncaughtException'), only one
+ * of these can exist at any given time. This plugin and anything else that
+ * uses process.on('uncaughtException') will conflict. */
+exports.attachToRunner = function(runner, outputFile) {
+  var smokeOutput = { results: [] };
+  var runningTests = {};
+
+  var integraPlugin = {
+    beforeTest: function(test, callback) {
+      test.startTime = Date.now();
+      runningTests[test.name] = test;
+      callback();
+    },
+    afterTest: function(test, callback) {
+      smokeOutput.results.push({
+        status: test.status,
+        start: test.startTime,
+        end: Date.now(),
+        test_file: test.name,
+        exit_code: 0,
+        url: ''
+      });
+      delete runningTests[test.name];
+      callback();
+    },
+    beforeExit: function(obj, callback) {
+      fs.writeFile(outputFile, JSON.stringify(smokeOutput), function() {
+        callback();
+      });
+    }
+  };
+
+  // In case of exception, make sure we write file
+  process.on('uncaughtException', function(err) {
+    // Mark all currently running tests as failed
+    for (var testName in runningTests) {
+      smokeOutput.results.push({
+        status: 'fail',
+        start: runningTests[testName].startTime,
+        end: Date.now(),
+        test_file: testName,
+        exit_code: 0,
+        url: ''
+      });
+    }
+
+    // write file
+    fs.writeFileSync(outputFile, JSON.stringify(smokeOutput));
+
+    // Standard NodeJS uncaught exception handler
+    // eslint-disable-next-line no-console
+    console.error(err.stack);
+    process.exit(1);
+  });
+
+  runner.plugin(integraPlugin);
+  return integraPlugin;
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/topologies/mongos.js b/NodeAPI/node_modules/mongodb/lib/core/topologies/mongos.js
new file mode 100644
index 0000000000000000000000000000000000000000..b07d14ec69100e45a12a814f939211d405823356
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/topologies/mongos.js
@@ -0,0 +1,1397 @@
+'use strict';
+
+const inherits = require('util').inherits;
+const f = require('util').format;
+const EventEmitter = require('events').EventEmitter;
+const CoreCursor = require('../cursor').CoreCursor;
+const Logger = require('../connection/logger');
+const retrieveBSON = require('../connection/utils').retrieveBSON;
+const MongoError = require('../error').MongoError;
+const Server = require('./server');
+const diff = require('./shared').diff;
+const cloneOptions = require('./shared').cloneOptions;
+const SessionMixins = require('./shared').SessionMixins;
+const isRetryableWritesSupported = require('./shared').isRetryableWritesSupported;
+const relayEvents = require('../utils').relayEvents;
+const BSON = retrieveBSON();
+const getMMAPError = require('./shared').getMMAPError;
+const makeClientMetadata = require('../utils').makeClientMetadata;
+const legacyIsRetryableWriteError = require('./shared').legacyIsRetryableWriteError;
+
+/**
+ * @fileOverview The **Mongos** class is a class that represents a Mongos Proxy topology and is
+ * used to construct connections.
+ */
+
+//
+// States
+var DISCONNECTED = 'disconnected';
+var CONNECTING = 'connecting';
+var CONNECTED = 'connected';
+var UNREFERENCED = 'unreferenced';
+var DESTROYING = 'destroying';
+var DESTROYED = 'destroyed';
+
+function stateTransition(self, newState) {
+  var legalTransitions = {
+    disconnected: [CONNECTING, DESTROYING, DESTROYED, DISCONNECTED],
+    connecting: [CONNECTING, DESTROYING, DESTROYED, CONNECTED, DISCONNECTED],
+    connected: [CONNECTED, DISCONNECTED, DESTROYING, DESTROYED, UNREFERENCED],
+    unreferenced: [UNREFERENCED, DESTROYING, DESTROYED],
+    destroyed: [DESTROYED]
+  };
+
+  // Get current state
+  var legalStates = legalTransitions[self.state];
+  if (legalStates && legalStates.indexOf(newState) !== -1) {
+    self.state = newState;
+  } else {
+    self.s.logger.error(
+      f(
+        'Mongos with id [%s] failed attempted illegal state transition from [%s] to [%s] only following state allowed [%s]',
+        self.id,
+        self.state,
+        newState,
+        legalStates
+      )
+    );
+  }
+}
+
+//
+// ReplSet instance id
+var id = 1;
+var handlers = ['connect', 'close', 'error', 'timeout', 'parseError'];
+
+/**
+ * Creates a new Mongos instance
+ * @class
+ * @param {array} seedlist A list of seeds for the replicaset
+ * @param {number} [options.haInterval=5000] The High availability period for replicaset inquiry
+ * @param {Cursor} [options.cursorFactory=Cursor] The cursor factory class used for all query cursors
+ * @param {number} [options.size=5] Server connection pool size
+ * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.keepAliveInitialDelay=120000] Initial delay before TCP keep alive enabled
+ * @param {number} [options.localThresholdMS=15] Cutoff latency point in MS for MongoS proxy selection
+ * @param {boolean} [options.noDelay=true] TCP Connection no delay
+ * @param {number} [options.connectionTimeout=1000] TCP Connection timeout setting
+ * @param {number} [options.socketTimeout=0] TCP Socket timeout setting
+ * @param {boolean} [options.ssl=false] Use SSL for connection
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {Buffer} [options.ca] SSL Certificate store binary buffer
+ * @param {Buffer} [options.crl] SSL Certificate revocation store binary buffer
+ * @param {Buffer} [options.cert] SSL Certificate binary buffer
+ * @param {Buffer} [options.key] SSL Key file binary buffer
+ * @param {string} [options.passphrase] SSL Certificate pass phrase
+ * @param {string} [options.servername=null] String containing the server name requested via TLS SNI.
+ * @param {boolean} [options.rejectUnauthorized=true] Reject unauthorized server certificates
+ * @param {boolean} [options.promoteLongs=true] Convert Long values from the db into Numbers if they fit into 53 bits
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
+ * @return {Mongos} A cursor instance
+ * @fires Mongos#connect
+ * @fires Mongos#reconnect
+ * @fires Mongos#joined
+ * @fires Mongos#left
+ * @fires Mongos#failed
+ * @fires Mongos#fullsetup
+ * @fires Mongos#all
+ * @fires Mongos#serverHeartbeatStarted
+ * @fires Mongos#serverHeartbeatSucceeded
+ * @fires Mongos#serverHeartbeatFailed
+ * @fires Mongos#topologyOpening
+ * @fires Mongos#topologyClosed
+ * @fires Mongos#topologyDescriptionChanged
+ * @property {string} type the topology type.
+ * @property {string} parserType the parser type used (c++ or js).
+ */
+var Mongos = function(seedlist, options) {
+  options = options || {};
+
+  // Get replSet Id
+  this.id = id++;
+
+  // deduplicate seedlist
+  if (Array.isArray(seedlist)) {
+    seedlist = seedlist.reduce((seeds, seed) => {
+      if (seeds.find(s => s.host === seed.host && s.port === seed.port)) {
+        return seeds;
+      }
+
+      seeds.push(seed);
+      return seeds;
+    }, []);
+  }
+
+  // Internal state
+  this.s = {
+    options: Object.assign({ metadata: makeClientMetadata(options) }, options),
+    // BSON instance
+    bson:
+      options.bson ||
+      new BSON([
+        BSON.Binary,
+        BSON.Code,
+        BSON.DBRef,
+        BSON.Decimal128,
+        BSON.Double,
+        BSON.Int32,
+        BSON.Long,
+        BSON.Map,
+        BSON.MaxKey,
+        BSON.MinKey,
+        BSON.ObjectId,
+        BSON.BSONRegExp,
+        BSON.Symbol,
+        BSON.Timestamp
+      ]),
+    // Factory overrides
+    Cursor: options.cursorFactory || CoreCursor,
+    // Logger instance
+    logger: Logger('Mongos', options),
+    // Seedlist
+    seedlist: seedlist,
+    // Ha interval
+    haInterval: options.haInterval ? options.haInterval : 10000,
+    // Disconnect handler
+    disconnectHandler: options.disconnectHandler,
+    // Server selection index
+    index: 0,
+    // Connect function options passed in
+    connectOptions: {},
+    // Are we running in debug mode
+    debug: typeof options.debug === 'boolean' ? options.debug : false,
+    // localThresholdMS
+    localThresholdMS: options.localThresholdMS || 15
+  };
+
+  // Log info warning if the socketTimeout < haInterval as it will cause
+  // a lot of recycled connections to happen.
+  if (
+    this.s.logger.isWarn() &&
+    this.s.options.socketTimeout !== 0 &&
+    this.s.options.socketTimeout < this.s.haInterval
+  ) {
+    this.s.logger.warn(
+      f(
+        'warning socketTimeout %s is less than haInterval %s. This might cause unnecessary server reconnections due to socket timeouts',
+        this.s.options.socketTimeout,
+        this.s.haInterval
+      )
+    );
+  }
+
+  // Disconnected state
+  this.state = DISCONNECTED;
+
+  // Current proxies we are connecting to
+  this.connectingProxies = [];
+  // Currently connected proxies
+  this.connectedProxies = [];
+  // Disconnected proxies
+  this.disconnectedProxies = [];
+  // Index of proxy to run operations against
+  this.index = 0;
+  // High availability timeout id
+  this.haTimeoutId = null;
+  // Last ismaster
+  this.ismaster = null;
+
+  // Description of the Replicaset
+  this.topologyDescription = {
+    topologyType: 'Unknown',
+    servers: []
+  };
+
+  // Highest clusterTime seen in responses from the current deployment
+  this.clusterTime = null;
+
+  // Add event listener
+  EventEmitter.call(this);
+};
+
+inherits(Mongos, EventEmitter);
+Object.assign(Mongos.prototype, SessionMixins);
+
+Object.defineProperty(Mongos.prototype, 'type', {
+  enumerable: true,
+  get: function() {
+    return 'mongos';
+  }
+});
+
+Object.defineProperty(Mongos.prototype, 'parserType', {
+  enumerable: true,
+  get: function() {
+    return BSON.native ? 'c++' : 'js';
+  }
+});
+
+Object.defineProperty(Mongos.prototype, 'logicalSessionTimeoutMinutes', {
+  enumerable: true,
+  get: function() {
+    if (!this.ismaster) return null;
+    return this.ismaster.logicalSessionTimeoutMinutes || null;
+  }
+});
+
+/**
+ * Emit event if it exists
+ * @method
+ */
+function emitSDAMEvent(self, event, description) {
+  if (self.listeners(event).length > 0) {
+    self.emit(event, description);
+  }
+}
+
+const SERVER_EVENTS = ['serverDescriptionChanged', 'error', 'close', 'timeout', 'parseError'];
+function destroyServer(server, options, callback) {
+  options = options || {};
+  SERVER_EVENTS.forEach(event => server.removeAllListeners(event));
+  server.destroy(options, callback);
+}
+
+/**
+ * Initiate server connect
+ */
+Mongos.prototype.connect = function(options) {
+  var self = this;
+  // Add any connect level options to the internal state
+  this.s.connectOptions = options || {};
+
+  // Set connecting state
+  stateTransition(this, CONNECTING);
+
+  // Create server instances
+  var servers = this.s.seedlist.map(function(x) {
+    const server = new Server(
+      Object.assign({}, self.s.options, x, options, {
+        reconnect: false,
+        monitoring: false,
+        parent: self
+      })
+    );
+
+    relayEvents(server, self, ['serverDescriptionChanged']);
+    return server;
+  });
+
+  // Emit the topology opening event
+  emitSDAMEvent(this, 'topologyOpening', { topologyId: this.id });
+
+  // Start all server connections
+  connectProxies(self, servers);
+};
+
+/**
+ * Authenticate the topology.
+ * @method
+ * @param {MongoCredentials} credentials The credentials for authentication we are using
+ * @param {authResultCallback} callback A callback function
+ */
+Mongos.prototype.auth = function(credentials, callback) {
+  if (typeof callback === 'function') callback(null, null);
+};
+
+function handleEvent(self) {
+  return function() {
+    if (self.state === DESTROYED || self.state === DESTROYING) {
+      return;
+    }
+
+    // Move to list of disconnectedProxies
+    moveServerFrom(self.connectedProxies, self.disconnectedProxies, this);
+    // Emit the initial topology
+    emitTopologyDescriptionChanged(self);
+    // Emit the left signal
+    self.emit('left', 'mongos', this);
+    // Emit the sdam event
+    self.emit('serverClosed', {
+      topologyId: self.id,
+      address: this.name
+    });
+  };
+}
+
+function handleInitialConnectEvent(self, event) {
+  return function() {
+    var _this = this;
+
+    // Destroy the instance
+    if (self.state === DESTROYED) {
+      // Emit the initial topology
+      emitTopologyDescriptionChanged(self);
+      // Move from connectingProxies
+      moveServerFrom(self.connectingProxies, self.disconnectedProxies, this);
+      return this.destroy();
+    }
+
+    // Check the type of server
+    if (event === 'connect') {
+      // Get last known ismaster
+      self.ismaster = _this.lastIsMaster();
+
+      // Is this not a proxy, remove t
+      if (self.ismaster.msg === 'isdbgrid') {
+        // Add to the connectd list
+        for (let i = 0; i < self.connectedProxies.length; i++) {
+          if (self.connectedProxies[i].name === _this.name) {
+            // Move from connectingProxies
+            moveServerFrom(self.connectingProxies, self.disconnectedProxies, _this);
+            // Emit the initial topology
+            emitTopologyDescriptionChanged(self);
+            _this.destroy();
+            return self.emit('failed', _this);
+          }
+        }
+
+        // Remove the handlers
+        for (let i = 0; i < handlers.length; i++) {
+          _this.removeAllListeners(handlers[i]);
+        }
+
+        // Add stable state handlers
+        _this.on('error', handleEvent(self, 'error'));
+        _this.on('close', handleEvent(self, 'close'));
+        _this.on('timeout', handleEvent(self, 'timeout'));
+        _this.on('parseError', handleEvent(self, 'parseError'));
+
+        // Move from connecting proxies connected
+        moveServerFrom(self.connectingProxies, self.connectedProxies, _this);
+        // Emit the joined event
+        self.emit('joined', 'mongos', _this);
+      } else {
+        // Print warning if we did not find a mongos proxy
+        if (self.s.logger.isWarn()) {
+          var message = 'expected mongos proxy, but found replicaset member mongod for server %s';
+          // We have a standalone server
+          if (!self.ismaster.hosts) {
+            message = 'expected mongos proxy, but found standalone mongod for server %s';
+          }
+
+          self.s.logger.warn(f(message, _this.name));
+        }
+
+        // This is not a mongos proxy, destroy and remove it completely
+        _this.destroy(true);
+        removeProxyFrom(self.connectingProxies, _this);
+        // Emit the left event
+        self.emit('left', 'server', _this);
+        // Emit failed event
+        self.emit('failed', _this);
+      }
+    } else {
+      moveServerFrom(self.connectingProxies, self.disconnectedProxies, this);
+      // Emit the left event
+      self.emit('left', 'mongos', this);
+      // Emit failed event
+      self.emit('failed', this);
+    }
+
+    // Emit the initial topology
+    emitTopologyDescriptionChanged(self);
+
+    // Trigger topologyMonitor
+    if (self.connectingProxies.length === 0) {
+      // Emit connected if we are connected
+      if (self.connectedProxies.length > 0 && self.state === CONNECTING) {
+        // Set the state to connected
+        stateTransition(self, CONNECTED);
+        // Emit the connect event
+        self.emit('connect', self);
+        self.emit('fullsetup', self);
+        self.emit('all', self);
+      } else if (self.disconnectedProxies.length === 0) {
+        // Print warning if we did not find a mongos proxy
+        if (self.s.logger.isWarn()) {
+          self.s.logger.warn(
+            f('no mongos proxies found in seed list, did you mean to connect to a replicaset')
+          );
+        }
+
+        // Emit the error that no proxies were found
+        return self.emit('error', new MongoError('no mongos proxies found in seed list'));
+      }
+
+      // Topology monitor
+      topologyMonitor(self, { firstConnect: true });
+    }
+  };
+}
+
+function connectProxies(self, servers) {
+  // Update connectingProxies
+  self.connectingProxies = self.connectingProxies.concat(servers);
+
+  // Index used to interleaf the server connects, avoiding
+  // runtime issues on io constrained vm's
+  var timeoutInterval = 0;
+
+  function connect(server, timeoutInterval) {
+    setTimeout(function() {
+      // Emit opening server event
+      self.emit('serverOpening', {
+        topologyId: self.id,
+        address: server.name
+      });
+
+      // Emit the initial topology
+      emitTopologyDescriptionChanged(self);
+
+      // Add event handlers
+      server.once('close', handleInitialConnectEvent(self, 'close'));
+      server.once('timeout', handleInitialConnectEvent(self, 'timeout'));
+      server.once('parseError', handleInitialConnectEvent(self, 'parseError'));
+      server.once('error', handleInitialConnectEvent(self, 'error'));
+      server.once('connect', handleInitialConnectEvent(self, 'connect'));
+
+      // Command Monitoring events
+      relayEvents(server, self, ['commandStarted', 'commandSucceeded', 'commandFailed']);
+
+      // Start connection
+      server.connect(self.s.connectOptions);
+    }, timeoutInterval);
+  }
+
+  // Start all the servers
+  servers.forEach(server => connect(server, timeoutInterval++));
+}
+
+function pickProxy(self, session) {
+  // TODO: Destructure :)
+  const transaction = session && session.transaction;
+
+  if (transaction && transaction.server) {
+    if (transaction.server.isConnected()) {
+      return transaction.server;
+    } else {
+      transaction.unpinServer();
+    }
+  }
+
+  // Get the currently connected Proxies
+  var connectedProxies = self.connectedProxies.slice(0);
+
+  // Set lower bound
+  var lowerBoundLatency = Number.MAX_VALUE;
+
+  // Determine the lower bound for the Proxies
+  for (var i = 0; i < connectedProxies.length; i++) {
+    if (connectedProxies[i].lastIsMasterMS < lowerBoundLatency) {
+      lowerBoundLatency = connectedProxies[i].lastIsMasterMS;
+    }
+  }
+
+  // Filter out the possible servers
+  connectedProxies = connectedProxies.filter(function(server) {
+    if (
+      server.lastIsMasterMS <= lowerBoundLatency + self.s.localThresholdMS &&
+      server.isConnected()
+    ) {
+      return true;
+    }
+  });
+
+  let proxy;
+
+  // We have no connectedProxies pick first of the connected ones
+  if (connectedProxies.length === 0) {
+    proxy = self.connectedProxies[0];
+  } else {
+    // Get proxy
+    proxy = connectedProxies[self.index % connectedProxies.length];
+    // Update the index
+    self.index = (self.index + 1) % connectedProxies.length;
+  }
+
+  if (transaction && transaction.isActive && proxy && proxy.isConnected()) {
+    transaction.pinServer(proxy);
+  }
+
+  // Return the proxy
+  return proxy;
+}
+
+function moveServerFrom(from, to, proxy) {
+  for (var i = 0; i < from.length; i++) {
+    if (from[i].name === proxy.name) {
+      from.splice(i, 1);
+    }
+  }
+
+  for (i = 0; i < to.length; i++) {
+    if (to[i].name === proxy.name) {
+      to.splice(i, 1);
+    }
+  }
+
+  to.push(proxy);
+}
+
+function removeProxyFrom(from, proxy) {
+  for (var i = 0; i < from.length; i++) {
+    if (from[i].name === proxy.name) {
+      from.splice(i, 1);
+    }
+  }
+}
+
+function reconnectProxies(self, proxies, callback) {
+  // Count lefts
+  var count = proxies.length;
+
+  // Handle events
+  var _handleEvent = function(self, event) {
+    return function() {
+      var _self = this;
+      count = count - 1;
+
+      // Destroyed
+      if (self.state === DESTROYED || self.state === DESTROYING || self.state === UNREFERENCED) {
+        moveServerFrom(self.connectingProxies, self.disconnectedProxies, _self);
+        return this.destroy();
+      }
+
+      if (event === 'connect') {
+        // Destroyed
+        if (self.state === DESTROYED || self.state === DESTROYING || self.state === UNREFERENCED) {
+          moveServerFrom(self.connectingProxies, self.disconnectedProxies, _self);
+          return _self.destroy();
+        }
+
+        // Remove the handlers
+        for (var i = 0; i < handlers.length; i++) {
+          _self.removeAllListeners(handlers[i]);
+        }
+
+        // Add stable state handlers
+        _self.on('error', handleEvent(self, 'error'));
+        _self.on('close', handleEvent(self, 'close'));
+        _self.on('timeout', handleEvent(self, 'timeout'));
+        _self.on('parseError', handleEvent(self, 'parseError'));
+
+        // Move to the connected servers
+        moveServerFrom(self.connectingProxies, self.connectedProxies, _self);
+        // Emit topology Change
+        emitTopologyDescriptionChanged(self);
+        // Emit joined event
+        self.emit('joined', 'mongos', _self);
+      } else {
+        // Move from connectingProxies
+        moveServerFrom(self.connectingProxies, self.disconnectedProxies, _self);
+        this.destroy();
+      }
+
+      // Are we done finish up callback
+      if (count === 0) {
+        callback();
+      }
+    };
+  };
+
+  // No new servers
+  if (count === 0) {
+    return callback();
+  }
+
+  // Execute method
+  function execute(_server, i) {
+    setTimeout(function() {
+      // Destroyed
+      if (self.state === DESTROYED || self.state === DESTROYING || self.state === UNREFERENCED) {
+        return;
+      }
+
+      // Create a new server instance
+      var server = new Server(
+        Object.assign({}, self.s.options, {
+          host: _server.name.split(':')[0],
+          port: parseInt(_server.name.split(':')[1], 10),
+          reconnect: false,
+          monitoring: false,
+          parent: self
+        })
+      );
+
+      destroyServer(_server, { force: true });
+      removeProxyFrom(self.disconnectedProxies, _server);
+
+      // Relay the server description change
+      relayEvents(server, self, ['serverDescriptionChanged']);
+
+      // Emit opening server event
+      self.emit('serverOpening', {
+        topologyId: server.s.topologyId !== -1 ? server.s.topologyId : self.id,
+        address: server.name
+      });
+
+      // Add temp handlers
+      server.once('connect', _handleEvent(self, 'connect'));
+      server.once('close', _handleEvent(self, 'close'));
+      server.once('timeout', _handleEvent(self, 'timeout'));
+      server.once('error', _handleEvent(self, 'error'));
+      server.once('parseError', _handleEvent(self, 'parseError'));
+
+      // Command Monitoring events
+      relayEvents(server, self, ['commandStarted', 'commandSucceeded', 'commandFailed']);
+
+      // Connect to proxy
+      self.connectingProxies.push(server);
+      server.connect(self.s.connectOptions);
+    }, i);
+  }
+
+  // Create new instances
+  for (var i = 0; i < proxies.length; i++) {
+    execute(proxies[i], i);
+  }
+}
+
+function topologyMonitor(self, options) {
+  options = options || {};
+
+  // no need to set up the monitor if we're already closed
+  if (self.state === DESTROYED || self.state === DESTROYING || self.state === UNREFERENCED) {
+    return;
+  }
+
+  // Set momitoring timeout
+  self.haTimeoutId = setTimeout(function() {
+    if (self.state === DESTROYED || self.state === DESTROYING || self.state === UNREFERENCED) {
+      return;
+    }
+
+    // If we have a primary and a disconnect handler, execute
+    // buffered operations
+    if (self.isConnected() && self.s.disconnectHandler) {
+      self.s.disconnectHandler.execute();
+    }
+
+    // Get the connectingServers
+    var proxies = self.connectedProxies.slice(0);
+    // Get the count
+    var count = proxies.length;
+
+    // If the count is zero schedule a new fast
+    function pingServer(_self, _server, cb) {
+      // Measure running time
+      var start = new Date().getTime();
+
+      // Emit the server heartbeat start
+      emitSDAMEvent(self, 'serverHeartbeatStarted', { connectionId: _server.name });
+
+      // Execute ismaster
+      _server.command(
+        'admin.$cmd',
+        {
+          ismaster: true
+        },
+        {
+          monitoring: true,
+          socketTimeout: self.s.options.connectionTimeout || 2000
+        },
+        function(err, r) {
+          if (
+            self.state === DESTROYED ||
+            self.state === DESTROYING ||
+            self.state === UNREFERENCED
+          ) {
+            // Move from connectingProxies
+            moveServerFrom(self.connectedProxies, self.disconnectedProxies, _server);
+            _server.destroy();
+            return cb(err, r);
+          }
+
+          // Calculate latency
+          var latencyMS = new Date().getTime() - start;
+
+          // We had an error, remove it from the state
+          if (err) {
+            // Emit the server heartbeat failure
+            emitSDAMEvent(self, 'serverHeartbeatFailed', {
+              durationMS: latencyMS,
+              failure: err,
+              connectionId: _server.name
+            });
+            // Move from connected proxies to disconnected proxies
+            moveServerFrom(self.connectedProxies, self.disconnectedProxies, _server);
+          } else {
+            // Update the server ismaster
+            _server.ismaster = r.result;
+            _server.lastIsMasterMS = latencyMS;
+
+            // Server heart beat event
+            emitSDAMEvent(self, 'serverHeartbeatSucceeded', {
+              durationMS: latencyMS,
+              reply: r.result,
+              connectionId: _server.name
+            });
+          }
+
+          cb(err, r);
+        }
+      );
+    }
+
+    // No proxies initiate monitor again
+    if (proxies.length === 0) {
+      // Emit close event if any listeners registered
+      if (self.listeners('close').length > 0 && self.state === CONNECTING) {
+        self.emit('error', new MongoError('no mongos proxy available'));
+      } else {
+        self.emit('close', self);
+      }
+
+      // Attempt to connect to any unknown servers
+      return reconnectProxies(self, self.disconnectedProxies, function() {
+        if (self.state === DESTROYED || self.state === DESTROYING || self.state === UNREFERENCED) {
+          return;
+        }
+
+        // Are we connected ? emit connect event
+        if (self.state === CONNECTING && options.firstConnect) {
+          self.emit('connect', self);
+          self.emit('fullsetup', self);
+          self.emit('all', self);
+        } else if (self.isConnected()) {
+          self.emit('reconnect', self);
+        } else if (!self.isConnected() && self.listeners('close').length > 0) {
+          self.emit('close', self);
+        }
+
+        // Perform topology monitor
+        topologyMonitor(self);
+      });
+    }
+
+    // Ping all servers
+    for (var i = 0; i < proxies.length; i++) {
+      pingServer(self, proxies[i], function() {
+        count = count - 1;
+
+        if (count === 0) {
+          if (
+            self.state === DESTROYED ||
+            self.state === DESTROYING ||
+            self.state === UNREFERENCED
+          ) {
+            return;
+          }
+
+          // Attempt to connect to any unknown servers
+          reconnectProxies(self, self.disconnectedProxies, function() {
+            if (
+              self.state === DESTROYED ||
+              self.state === DESTROYING ||
+              self.state === UNREFERENCED
+            ) {
+              return;
+            }
+
+            // Perform topology monitor
+            topologyMonitor(self);
+          });
+        }
+      });
+    }
+  }, self.s.haInterval);
+}
+
+/**
+ * Returns the last known ismaster document for this server
+ * @method
+ * @return {object}
+ */
+Mongos.prototype.lastIsMaster = function() {
+  return this.ismaster;
+};
+
+/**
+ * Unref all connections belong to this server
+ * @method
+ */
+Mongos.prototype.unref = function() {
+  // Transition state
+  stateTransition(this, UNREFERENCED);
+  // Get all proxies
+  var proxies = this.connectedProxies.concat(this.connectingProxies);
+  proxies.forEach(function(x) {
+    x.unref();
+  });
+
+  clearTimeout(this.haTimeoutId);
+};
+
+/**
+ * Destroy the server connection
+ * @param {boolean} [options.force=false] Force destroy the pool
+ * @method
+ */
+Mongos.prototype.destroy = function(options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = options || {};
+
+  stateTransition(this, DESTROYING);
+  if (this.haTimeoutId) {
+    clearTimeout(this.haTimeoutId);
+  }
+
+  const proxies = this.connectedProxies.concat(this.connectingProxies);
+  let serverCount = proxies.length;
+  const serverDestroyed = () => {
+    serverCount--;
+    if (serverCount > 0) {
+      return;
+    }
+
+    emitTopologyDescriptionChanged(this);
+    emitSDAMEvent(this, 'topologyClosed', { topologyId: this.id });
+    stateTransition(this, DESTROYED);
+    if (typeof callback === 'function') {
+      callback(null, null);
+    }
+  };
+
+  if (serverCount === 0) {
+    serverDestroyed();
+    return;
+  }
+
+  // Destroy all connecting servers
+  proxies.forEach(server => {
+    // Emit the sdam event
+    this.emit('serverClosed', {
+      topologyId: this.id,
+      address: server.name
+    });
+
+    destroyServer(server, options, serverDestroyed);
+    moveServerFrom(this.connectedProxies, this.disconnectedProxies, server);
+  });
+};
+
+/**
+ * Figure out if the server is connected
+ * @method
+ * @return {boolean}
+ */
+Mongos.prototype.isConnected = function() {
+  return this.connectedProxies.length > 0;
+};
+
+/**
+ * Figure out if the server instance was destroyed by calling destroy
+ * @method
+ * @return {boolean}
+ */
+Mongos.prototype.isDestroyed = function() {
+  return this.state === DESTROYED;
+};
+
+//
+// Operations
+//
+
+function executeWriteOperation(args, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // TODO: once we drop Node 4, use destructuring either here or in arguments.
+  const self = args.self;
+  const op = args.op;
+  const ns = args.ns;
+  const ops = args.ops;
+
+  // Pick a server
+  let server = pickProxy(self, options.session);
+  // No server found error out
+  if (!server) return callback(new MongoError('no mongos proxy available'));
+
+  const willRetryWrite =
+    !args.retrying &&
+    !!options.retryWrites &&
+    options.session &&
+    isRetryableWritesSupported(self) &&
+    !options.session.inTransaction() &&
+    options.explain === undefined;
+
+  const handler = (err, result) => {
+    if (!err) return callback(null, result);
+    if (!legacyIsRetryableWriteError(err, self) || !willRetryWrite) {
+      err = getMMAPError(err);
+      return callback(err);
+    }
+
+    // Pick another server
+    server = pickProxy(self, options.session);
+
+    // No server found error out with original error
+    if (!server) {
+      return callback(err);
+    }
+
+    const newArgs = Object.assign({}, args, { retrying: true });
+    return executeWriteOperation(newArgs, options, callback);
+  };
+
+  if (callback.operationId) {
+    handler.operationId = callback.operationId;
+  }
+
+  // increment and assign txnNumber
+  if (willRetryWrite) {
+    options.session.incrementTransactionNumber();
+    options.willRetryWrite = willRetryWrite;
+  }
+
+  // rerun the operation
+  server[op](ns, ops, options, handler);
+}
+
+/**
+ * Insert one or more documents
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of documents to insert
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+ * @param {opResultCallback} callback A callback function
+ */
+Mongos.prototype.insert = function(ns, ops, options, callback) {
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  if (this.state === DESTROYED) {
+    return callback(new MongoError(f('topology was destroyed')));
+  }
+
+  // Not connected but we have a disconnecthandler
+  if (!this.isConnected() && this.s.disconnectHandler != null) {
+    return this.s.disconnectHandler.add('insert', ns, ops, options, callback);
+  }
+
+  // No mongos proxy available
+  if (!this.isConnected()) {
+    return callback(new MongoError('no mongos proxy available'));
+  }
+
+  // Execute write operation
+  executeWriteOperation({ self: this, op: 'insert', ns, ops }, options, callback);
+};
+
+/**
+ * Perform one or more update operations
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of updates
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+ * @param {opResultCallback} callback A callback function
+ */
+Mongos.prototype.update = function(ns, ops, options, callback) {
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  if (this.state === DESTROYED) {
+    return callback(new MongoError(f('topology was destroyed')));
+  }
+
+  // Not connected but we have a disconnecthandler
+  if (!this.isConnected() && this.s.disconnectHandler != null) {
+    return this.s.disconnectHandler.add('update', ns, ops, options, callback);
+  }
+
+  // No mongos proxy available
+  if (!this.isConnected()) {
+    return callback(new MongoError('no mongos proxy available'));
+  }
+
+  // Execute write operation
+  executeWriteOperation({ self: this, op: 'update', ns, ops }, options, callback);
+};
+
+/**
+ * Perform one or more remove operations
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of removes
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+ * @param {opResultCallback} callback A callback function
+ */
+Mongos.prototype.remove = function(ns, ops, options, callback) {
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  if (this.state === DESTROYED) {
+    return callback(new MongoError(f('topology was destroyed')));
+  }
+
+  // Not connected but we have a disconnecthandler
+  if (!this.isConnected() && this.s.disconnectHandler != null) {
+    return this.s.disconnectHandler.add('remove', ns, ops, options, callback);
+  }
+
+  // No mongos proxy available
+  if (!this.isConnected()) {
+    return callback(new MongoError('no mongos proxy available'));
+  }
+
+  // Execute write operation
+  executeWriteOperation({ self: this, op: 'remove', ns, ops }, options, callback);
+};
+
+const RETRYABLE_WRITE_OPERATIONS = ['findAndModify', 'insert', 'update', 'delete'];
+
+function isWriteCommand(command) {
+  return RETRYABLE_WRITE_OPERATIONS.some(op => command[op]);
+}
+
+/**
+ * Execute a command
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object} cmd The command hash
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {Connection} [options.connection] Specify connection object to execute command against
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {opResultCallback} callback A callback function
+ */
+Mongos.prototype.command = function(ns, cmd, options, callback) {
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  if (this.state === DESTROYED) {
+    return callback(new MongoError(f('topology was destroyed')));
+  }
+
+  var self = this;
+
+  // Pick a proxy
+  var server = pickProxy(self, options.session);
+
+  // Topology is not connected, save the call in the provided store to be
+  // Executed at some point when the handler deems it's reconnected
+  if ((server == null || !server.isConnected()) && this.s.disconnectHandler != null) {
+    return this.s.disconnectHandler.add('command', ns, cmd, options, callback);
+  }
+
+  // No server returned we had an error
+  if (server == null) {
+    return callback(new MongoError('no mongos proxy available'));
+  }
+
+  // Cloned options
+  var clonedOptions = cloneOptions(options);
+  clonedOptions.topology = self;
+
+  const willRetryWrite =
+    !options.retrying &&
+    options.retryWrites &&
+    options.session &&
+    isRetryableWritesSupported(self) &&
+    !options.session.inTransaction() &&
+    isWriteCommand(cmd);
+
+  const cb = (err, result) => {
+    if (!err) return callback(null, result);
+    if (!legacyIsRetryableWriteError(err, self)) {
+      return callback(err);
+    }
+
+    if (willRetryWrite) {
+      const newOptions = Object.assign({}, clonedOptions, { retrying: true });
+      return this.command(ns, cmd, newOptions, callback);
+    }
+
+    return callback(err);
+  };
+
+  // increment and assign txnNumber
+  if (willRetryWrite) {
+    clonedOptions.session.incrementTransactionNumber();
+    clonedOptions.willRetryWrite = willRetryWrite;
+  }
+
+  // Execute the command
+  server.command(ns, cmd, clonedOptions, cb);
+};
+
+/**
+ * Get a new cursor
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object|Long} cmd Can be either a command returning a cursor or a cursorId
+ * @param {object} [options] Options for the cursor
+ * @param {object} [options.batchSize=0] Batchsize for the operation
+ * @param {array} [options.documents=[]] Initial documents list for cursor
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {object} [options.topology] The internal topology of the created cursor
+ * @returns {Cursor}
+ */
+Mongos.prototype.cursor = function(ns, cmd, options) {
+  options = options || {};
+  const topology = options.topology || this;
+
+  // Set up final cursor type
+  var FinalCursor = options.cursorFactory || this.s.Cursor;
+
+  // Return the cursor
+  return new FinalCursor(topology, ns, cmd, options);
+};
+
+/**
+ * Selects a server
+ *
+ * @method
+ * @param {function} selector Unused
+ * @param {ReadPreference} [options.readPreference] Unused
+ * @param {ClientSession} [options.session] Specify a session if it is being used
+ * @param {function} callback
+ */
+Mongos.prototype.selectServer = function(selector, options, callback) {
+  if (typeof selector === 'function' && typeof callback === 'undefined')
+    (callback = selector), (selector = undefined), (options = {});
+  if (typeof options === 'function')
+    (callback = options), (options = selector), (selector = undefined);
+  options = options || {};
+
+  const server = pickProxy(this, options.session);
+  if (server == null) {
+    callback(new MongoError('server selection failed'));
+    return;
+  }
+
+  if (this.s.debug) this.emit('pickedServer', null, server);
+  callback(null, server);
+};
+
+/**
+ * All raw connections
+ * @method
+ * @return {Connection[]}
+ */
+Mongos.prototype.connections = function() {
+  var connections = [];
+
+  for (var i = 0; i < this.connectedProxies.length; i++) {
+    connections = connections.concat(this.connectedProxies[i].connections());
+  }
+
+  return connections;
+};
+
+function emitTopologyDescriptionChanged(self) {
+  if (self.listeners('topologyDescriptionChanged').length > 0) {
+    var topology = 'Unknown';
+    if (self.connectedProxies.length > 0) {
+      topology = 'Sharded';
+    }
+
+    // Generate description
+    var description = {
+      topologyType: topology,
+      servers: []
+    };
+
+    // All proxies
+    var proxies = self.disconnectedProxies.concat(self.connectingProxies);
+
+    // Add all the disconnected proxies
+    description.servers = description.servers.concat(
+      proxies.map(function(x) {
+        var description = x.getDescription();
+        description.type = 'Unknown';
+        return description;
+      })
+    );
+
+    // Add all the connected proxies
+    description.servers = description.servers.concat(
+      self.connectedProxies.map(function(x) {
+        var description = x.getDescription();
+        description.type = 'Mongos';
+        return description;
+      })
+    );
+
+    // Get the diff
+    var diffResult = diff(self.topologyDescription, description);
+
+    // Create the result
+    var result = {
+      topologyId: self.id,
+      previousDescription: self.topologyDescription,
+      newDescription: description,
+      diff: diffResult
+    };
+
+    // Emit the topologyDescription change
+    if (diffResult.servers.length > 0) {
+      self.emit('topologyDescriptionChanged', result);
+    }
+
+    // Set the new description
+    self.topologyDescription = description;
+  }
+}
+
+/**
+ * A mongos connect event, used to verify that the connection is up and running
+ *
+ * @event Mongos#connect
+ * @type {Mongos}
+ */
+
+/**
+ * A mongos reconnect event, used to verify that the mongos topology has reconnected
+ *
+ * @event Mongos#reconnect
+ * @type {Mongos}
+ */
+
+/**
+ * A mongos fullsetup event, used to signal that all topology members have been contacted.
+ *
+ * @event Mongos#fullsetup
+ * @type {Mongos}
+ */
+
+/**
+ * A mongos all event, used to signal that all topology members have been contacted.
+ *
+ * @event Mongos#all
+ * @type {Mongos}
+ */
+
+/**
+ * A server member left the mongos list
+ *
+ * @event Mongos#left
+ * @type {Mongos}
+ * @param {string} type The type of member that left (mongos)
+ * @param {Server} server The server object that left
+ */
+
+/**
+ * A server member joined the mongos list
+ *
+ * @event Mongos#joined
+ * @type {Mongos}
+ * @param {string} type The type of member that left (mongos)
+ * @param {Server} server The server object that joined
+ */
+
+/**
+ * A server opening SDAM monitoring event
+ *
+ * @event Mongos#serverOpening
+ * @type {object}
+ */
+
+/**
+ * A server closed SDAM monitoring event
+ *
+ * @event Mongos#serverClosed
+ * @type {object}
+ */
+
+/**
+ * A server description SDAM change monitoring event
+ *
+ * @event Mongos#serverDescriptionChanged
+ * @type {object}
+ */
+
+/**
+ * A topology open SDAM event
+ *
+ * @event Mongos#topologyOpening
+ * @type {object}
+ */
+
+/**
+ * A topology closed SDAM event
+ *
+ * @event Mongos#topologyClosed
+ * @type {object}
+ */
+
+/**
+ * A topology structure SDAM change event
+ *
+ * @event Mongos#topologyDescriptionChanged
+ * @type {object}
+ */
+
+/**
+ * A topology serverHeartbeatStarted SDAM event
+ *
+ * @event Mongos#serverHeartbeatStarted
+ * @type {object}
+ */
+
+/**
+ * A topology serverHeartbeatFailed SDAM event
+ *
+ * @event Mongos#serverHeartbeatFailed
+ * @type {object}
+ */
+
+/**
+ * A topology serverHeartbeatSucceeded SDAM change event
+ *
+ * @event Mongos#serverHeartbeatSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command was started, if command monitoring is enabled
+ *
+ * @event Mongos#commandStarted
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command succeeded, if command monitoring is enabled
+ *
+ * @event Mongos#commandSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command failed, if command monitoring is enabled
+ *
+ * @event Mongos#commandFailed
+ * @type {object}
+ */
+
+module.exports = Mongos;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/topologies/read_preference.js b/NodeAPI/node_modules/mongodb/lib/core/topologies/read_preference.js
new file mode 100644
index 0000000000000000000000000000000000000000..afd2362f762da95bdc13a7ed8fd25558b6fd6fa0
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/topologies/read_preference.js
@@ -0,0 +1,267 @@
+'use strict';
+const emitWarningOnce = require('../../utils').emitWarningOnce;
+
+/**
+ * The **ReadPreference** class is a class that represents a MongoDB ReadPreference and is
+ * used to construct connections.
+ * @class
+ * @param {string} mode A string describing the read preference mode (primary|primaryPreferred|secondary|secondaryPreferred|nearest)
+ * @param {array} tags The tags object
+ * @param {object} [options] Additional read preference options
+ * @param {number} [options.maxStalenessSeconds] Max secondary read staleness in seconds, Minimum value is 90 seconds.
+ * @param {object} [options.hedge] Server mode in which the same query is dispatched in parallel to multiple replica set members.
+ * @param {boolean} [options.hedge.enabled] Explicitly enable or disable hedged reads.
+ * @see https://docs.mongodb.com/manual/core/read-preference/
+ * @return {ReadPreference}
+ */
+const ReadPreference = function(mode, tags, options) {
+  if (!ReadPreference.isValid(mode)) {
+    throw new TypeError(`Invalid read preference mode ${mode}`);
+  }
+
+  // TODO(major): tags MUST be an array of tagsets
+  if (tags && !Array.isArray(tags)) {
+    emitWarningOnce(
+      'ReadPreference tags must be an array, this will change in the next major version'
+    );
+
+    const tagsHasMaxStalenessSeconds = typeof tags.maxStalenessSeconds !== 'undefined';
+    const tagsHasHedge = typeof tags.hedge !== 'undefined';
+    const tagsHasOptions = tagsHasMaxStalenessSeconds || tagsHasHedge;
+    if (tagsHasOptions) {
+      // this is likely an options object
+      options = tags;
+      tags = undefined;
+    } else {
+      tags = [tags];
+    }
+  }
+
+  this.mode = mode;
+  this.tags = tags;
+  this.hedge = options && options.hedge;
+
+  options = options || {};
+  if (options.maxStalenessSeconds != null) {
+    if (options.maxStalenessSeconds <= 0) {
+      throw new TypeError('maxStalenessSeconds must be a positive integer');
+    }
+
+    this.maxStalenessSeconds = options.maxStalenessSeconds;
+
+    // NOTE: The minimum required wire version is 5 for this read preference. If the existing
+    //       topology has a lower value then a MongoError will be thrown during server selection.
+    this.minWireVersion = 5;
+  }
+
+  if (this.mode === ReadPreference.PRIMARY) {
+    if (this.tags && Array.isArray(this.tags) && this.tags.length > 0) {
+      throw new TypeError('Primary read preference cannot be combined with tags');
+    }
+
+    if (this.maxStalenessSeconds) {
+      throw new TypeError('Primary read preference cannot be combined with maxStalenessSeconds');
+    }
+
+    if (this.hedge) {
+      throw new TypeError('Primary read preference cannot be combined with hedge');
+    }
+  }
+};
+
+// Support the deprecated `preference` property introduced in the porcelain layer
+Object.defineProperty(ReadPreference.prototype, 'preference', {
+  enumerable: true,
+  get: function() {
+    return this.mode;
+  }
+});
+
+/*
+ * Read preference mode constants
+ */
+ReadPreference.PRIMARY = 'primary';
+ReadPreference.PRIMARY_PREFERRED = 'primaryPreferred';
+ReadPreference.SECONDARY = 'secondary';
+ReadPreference.SECONDARY_PREFERRED = 'secondaryPreferred';
+ReadPreference.NEAREST = 'nearest';
+
+const VALID_MODES = [
+  ReadPreference.PRIMARY,
+  ReadPreference.PRIMARY_PREFERRED,
+  ReadPreference.SECONDARY,
+  ReadPreference.SECONDARY_PREFERRED,
+  ReadPreference.NEAREST,
+  null
+];
+
+/**
+ * Construct a ReadPreference given an options object.
+ *
+ * @param {object} options The options object from which to extract the read preference.
+ * @return {ReadPreference}
+ */
+ReadPreference.fromOptions = function(options) {
+  if (!options) return null;
+  const readPreference = options.readPreference;
+  if (!readPreference) return null;
+  const readPreferenceTags = options.readPreferenceTags;
+  const maxStalenessSeconds = options.maxStalenessSeconds;
+  if (typeof readPreference === 'string') {
+    return new ReadPreference(readPreference, readPreferenceTags);
+  } else if (!(readPreference instanceof ReadPreference) && typeof readPreference === 'object') {
+    const mode = readPreference.mode || readPreference.preference;
+    if (mode && typeof mode === 'string') {
+      return new ReadPreference(mode, readPreference.tags, {
+        maxStalenessSeconds: readPreference.maxStalenessSeconds || maxStalenessSeconds,
+        hedge: readPreference.hedge
+      });
+    }
+  }
+
+  return readPreference;
+};
+
+/**
+ * Resolves a read preference based on well-defined inheritance rules. This method will not only
+ * determine the read preference (if there is one), but will also ensure the returned value is a
+ * properly constructed instance of `ReadPreference`.
+ *
+ * @param {Collection|Db|MongoClient} parent The parent of the operation on which to determine the read
+ * preference, used for determining the inherited read preference.
+ * @param {object} options The options passed into the method, potentially containing a read preference
+ * @returns {(ReadPreference|null)} The resolved read preference
+ */
+ReadPreference.resolve = function(parent, options) {
+  options = options || {};
+  const session = options.session;
+
+  const inheritedReadPreference = parent && parent.readPreference;
+
+  let readPreference;
+  if (options.readPreference) {
+    readPreference = ReadPreference.fromOptions(options);
+  } else if (session && session.inTransaction() && session.transaction.options.readPreference) {
+    // The transaction’s read preference MUST override all other user configurable read preferences.
+    readPreference = session.transaction.options.readPreference;
+  } else if (inheritedReadPreference != null) {
+    readPreference = inheritedReadPreference;
+  } else {
+    readPreference = ReadPreference.primary;
+  }
+
+  return typeof readPreference === 'string' ? new ReadPreference(readPreference) : readPreference;
+};
+
+/**
+ * Replaces options.readPreference with a ReadPreference instance
+ */
+ReadPreference.translate = function(options) {
+  if (options.readPreference == null) return options;
+  const r = options.readPreference;
+
+  if (typeof r === 'string') {
+    options.readPreference = new ReadPreference(r);
+  } else if (r && !(r instanceof ReadPreference) && typeof r === 'object') {
+    const mode = r.mode || r.preference;
+    if (mode && typeof mode === 'string') {
+      options.readPreference = new ReadPreference(mode, r.tags, {
+        maxStalenessSeconds: r.maxStalenessSeconds
+      });
+    }
+  } else if (!(r instanceof ReadPreference)) {
+    throw new TypeError('Invalid read preference: ' + r);
+  }
+
+  return options;
+};
+
+/**
+ * Validate if a mode is legal
+ *
+ * @method
+ * @param {string} mode The string representing the read preference mode.
+ * @return {boolean} True if a mode is valid
+ */
+ReadPreference.isValid = function(mode) {
+  return VALID_MODES.indexOf(mode) !== -1;
+};
+
+/**
+ * Validate if a mode is legal
+ *
+ * @method
+ * @param {string} mode The string representing the read preference mode.
+ * @return {boolean} True if a mode is valid
+ */
+ReadPreference.prototype.isValid = function(mode) {
+  return ReadPreference.isValid(typeof mode === 'string' ? mode : this.mode);
+};
+
+const needSlaveOk = ['primaryPreferred', 'secondary', 'secondaryPreferred', 'nearest'];
+
+/**
+ * Indicates that this readPreference needs the "slaveOk" bit when sent over the wire
+ * @method
+ * @return {boolean}
+ * @see https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#op-query
+ */
+ReadPreference.prototype.slaveOk = function() {
+  return needSlaveOk.indexOf(this.mode) !== -1;
+};
+
+/**
+ * Are the two read preference equal
+ * @method
+ * @param {ReadPreference} readPreference The read preference with which to check equality
+ * @return {boolean} True if the two ReadPreferences are equivalent
+ */
+ReadPreference.prototype.equals = function(readPreference) {
+  return readPreference.mode === this.mode;
+};
+
+/**
+ * Return JSON representation
+ * @method
+ * @return {Object} A JSON representation of the ReadPreference
+ */
+ReadPreference.prototype.toJSON = function() {
+  const readPreference = { mode: this.mode };
+  if (Array.isArray(this.tags)) readPreference.tags = this.tags;
+  if (this.maxStalenessSeconds) readPreference.maxStalenessSeconds = this.maxStalenessSeconds;
+  if (this.hedge) readPreference.hedge = this.hedge;
+  return readPreference;
+};
+
+/**
+ * Primary read preference
+ * @member
+ * @type {ReadPreference}
+ */
+ReadPreference.primary = new ReadPreference('primary');
+/**
+ * Primary Preferred read preference
+ * @member
+ * @type {ReadPreference}
+ */
+ReadPreference.primaryPreferred = new ReadPreference('primaryPreferred');
+/**
+ * Secondary read preference
+ * @member
+ * @type {ReadPreference}
+ */
+ReadPreference.secondary = new ReadPreference('secondary');
+/**
+ * Secondary Preferred read preference
+ * @member
+ * @type {ReadPreference}
+ */
+ReadPreference.secondaryPreferred = new ReadPreference('secondaryPreferred');
+/**
+ * Nearest read preference
+ * @member
+ * @type {ReadPreference}
+ */
+ReadPreference.nearest = new ReadPreference('nearest');
+
+module.exports = ReadPreference;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/topologies/replset.js b/NodeAPI/node_modules/mongodb/lib/core/topologies/replset.js
new file mode 100644
index 0000000000000000000000000000000000000000..03adc7cfe65b5627c196dcf46233c6fd93bb0d2e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/topologies/replset.js
@@ -0,0 +1,1565 @@
+'use strict';
+
+const inherits = require('util').inherits;
+const f = require('util').format;
+const EventEmitter = require('events').EventEmitter;
+const ReadPreference = require('./read_preference');
+const CoreCursor = require('../cursor').CoreCursor;
+const retrieveBSON = require('../connection/utils').retrieveBSON;
+const Logger = require('../connection/logger');
+const MongoError = require('../error').MongoError;
+const Server = require('./server');
+const ReplSetState = require('./replset_state');
+const Timeout = require('./shared').Timeout;
+const Interval = require('./shared').Interval;
+const SessionMixins = require('./shared').SessionMixins;
+const isRetryableWritesSupported = require('./shared').isRetryableWritesSupported;
+const relayEvents = require('../utils').relayEvents;
+const BSON = retrieveBSON();
+const getMMAPError = require('./shared').getMMAPError;
+const makeClientMetadata = require('../utils').makeClientMetadata;
+const legacyIsRetryableWriteError = require('./shared').legacyIsRetryableWriteError;
+const now = require('../../utils').now;
+const calculateDurationInMs = require('../../utils').calculateDurationInMs;
+
+//
+// States
+var DISCONNECTED = 'disconnected';
+var CONNECTING = 'connecting';
+var CONNECTED = 'connected';
+var UNREFERENCED = 'unreferenced';
+var DESTROYED = 'destroyed';
+
+function stateTransition(self, newState) {
+  var legalTransitions = {
+    disconnected: [CONNECTING, DESTROYED, DISCONNECTED],
+    connecting: [CONNECTING, DESTROYED, CONNECTED, DISCONNECTED],
+    connected: [CONNECTED, DISCONNECTED, DESTROYED, UNREFERENCED],
+    unreferenced: [UNREFERENCED, DESTROYED],
+    destroyed: [DESTROYED]
+  };
+
+  // Get current state
+  var legalStates = legalTransitions[self.state];
+  if (legalStates && legalStates.indexOf(newState) !== -1) {
+    self.state = newState;
+  } else {
+    self.s.logger.error(
+      f(
+        'Pool with id [%s] failed attempted illegal state transition from [%s] to [%s] only following state allowed [%s]',
+        self.id,
+        self.state,
+        newState,
+        legalStates
+      )
+    );
+  }
+}
+
+//
+// ReplSet instance id
+var id = 1;
+var handlers = ['connect', 'close', 'error', 'timeout', 'parseError'];
+
+/**
+ * Creates a new Replset instance
+ * @class
+ * @param {array} seedlist A list of seeds for the replicaset
+ * @param {boolean} options.setName The Replicaset set name
+ * @param {boolean} [options.secondaryOnlyConnectionAllowed=false] Allow connection to a secondary only replicaset
+ * @param {number} [options.haInterval=10000] The High availability period for replicaset inquiry
+ * @param {boolean} [options.emitError=false] Server will emit errors events
+ * @param {Cursor} [options.cursorFactory=Cursor] The cursor factory class used for all query cursors
+ * @param {number} [options.size=5] Server connection pool size
+ * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.keepAliveInitialDelay=120000] Initial delay before TCP keep alive enabled
+ * @param {boolean} [options.noDelay=true] TCP Connection no delay
+ * @param {number} [options.connectionTimeout=10000] TCP Connection timeout setting
+ * @param {number} [options.socketTimeout=0] TCP Socket timeout setting
+ * @param {boolean} [options.ssl=false] Use SSL for connection
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {Buffer} [options.ca] SSL Certificate store binary buffer
+ * @param {Buffer} [options.crl] SSL Certificate revocation store binary buffer
+ * @param {Buffer} [options.cert] SSL Certificate binary buffer
+ * @param {Buffer} [options.key] SSL Key file binary buffer
+ * @param {string} [options.passphrase] SSL Certificate pass phrase
+ * @param {string} [options.servername=null] String containing the server name requested via TLS SNI.
+ * @param {boolean} [options.rejectUnauthorized=true] Reject unauthorized server certificates
+ * @param {boolean} [options.promoteLongs=true] Convert Long values from the db into Numbers if they fit into 53 bits
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {number} [options.pingInterval=5000] Ping interval to check the response time to the different servers
+ * @param {number} [options.localThresholdMS=15] Cutoff latency point in MS for Replicaset member selection
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
+ * @return {ReplSet} A cursor instance
+ * @fires ReplSet#connect
+ * @fires ReplSet#ha
+ * @fires ReplSet#joined
+ * @fires ReplSet#left
+ * @fires ReplSet#failed
+ * @fires ReplSet#fullsetup
+ * @fires ReplSet#all
+ * @fires ReplSet#error
+ * @fires ReplSet#serverHeartbeatStarted
+ * @fires ReplSet#serverHeartbeatSucceeded
+ * @fires ReplSet#serverHeartbeatFailed
+ * @fires ReplSet#topologyOpening
+ * @fires ReplSet#topologyClosed
+ * @fires ReplSet#topologyDescriptionChanged
+ * @property {string} type the topology type.
+ * @property {string} parserType the parser type used (c++ or js).
+ */
+var ReplSet = function(seedlist, options) {
+  var self = this;
+  options = options || {};
+
+  // Validate seedlist
+  if (!Array.isArray(seedlist)) throw new MongoError('seedlist must be an array');
+  // Validate list
+  if (seedlist.length === 0) throw new MongoError('seedlist must contain at least one entry');
+  // Validate entries
+  seedlist.forEach(function(e) {
+    if (typeof e.host !== 'string' || typeof e.port !== 'number')
+      throw new MongoError('seedlist entry must contain a host and port');
+  });
+
+  // Add event listener
+  EventEmitter.call(this);
+
+  // Get replSet Id
+  this.id = id++;
+
+  // Get the localThresholdMS
+  var localThresholdMS = options.localThresholdMS || 15;
+  // Backward compatibility
+  if (options.acceptableLatency) localThresholdMS = options.acceptableLatency;
+
+  // Create a logger
+  var logger = Logger('ReplSet', options);
+
+  // Internal state
+  this.s = {
+    options: Object.assign({ metadata: makeClientMetadata(options) }, options),
+    // BSON instance
+    bson:
+      options.bson ||
+      new BSON([
+        BSON.Binary,
+        BSON.Code,
+        BSON.DBRef,
+        BSON.Decimal128,
+        BSON.Double,
+        BSON.Int32,
+        BSON.Long,
+        BSON.Map,
+        BSON.MaxKey,
+        BSON.MinKey,
+        BSON.ObjectId,
+        BSON.BSONRegExp,
+        BSON.Symbol,
+        BSON.Timestamp
+      ]),
+    // Factory overrides
+    Cursor: options.cursorFactory || CoreCursor,
+    // Logger instance
+    logger: logger,
+    // Seedlist
+    seedlist: seedlist,
+    // Replicaset state
+    replicaSetState: new ReplSetState({
+      id: this.id,
+      setName: options.setName,
+      acceptableLatency: localThresholdMS,
+      heartbeatFrequencyMS: options.haInterval ? options.haInterval : 10000,
+      logger: logger
+    }),
+    // Current servers we are connecting to
+    connectingServers: [],
+    // Ha interval
+    haInterval: options.haInterval ? options.haInterval : 10000,
+    // Minimum heartbeat frequency used if we detect a server close
+    minHeartbeatFrequencyMS: 500,
+    // Disconnect handler
+    disconnectHandler: options.disconnectHandler,
+    // Server selection index
+    index: 0,
+    // Connect function options passed in
+    connectOptions: {},
+    // Are we running in debug mode
+    debug: typeof options.debug === 'boolean' ? options.debug : false
+  };
+
+  // Add handler for topology change
+  this.s.replicaSetState.on('topologyDescriptionChanged', function(r) {
+    self.emit('topologyDescriptionChanged', r);
+  });
+
+  // Log info warning if the socketTimeout < haInterval as it will cause
+  // a lot of recycled connections to happen.
+  if (
+    this.s.logger.isWarn() &&
+    this.s.options.socketTimeout !== 0 &&
+    this.s.options.socketTimeout < this.s.haInterval
+  ) {
+    this.s.logger.warn(
+      f(
+        'warning socketTimeout %s is less than haInterval %s. This might cause unnecessary server reconnections due to socket timeouts',
+        this.s.options.socketTimeout,
+        this.s.haInterval
+      )
+    );
+  }
+
+  // Add forwarding of events from state handler
+  var types = ['joined', 'left'];
+  types.forEach(function(x) {
+    self.s.replicaSetState.on(x, function(t, s) {
+      self.emit(x, t, s);
+    });
+  });
+
+  // Connect stat
+  this.initialConnectState = {
+    connect: false,
+    fullsetup: false,
+    all: false
+  };
+
+  // Disconnected state
+  this.state = DISCONNECTED;
+  this.haTimeoutId = null;
+  // Last ismaster
+  this.ismaster = null;
+  // Contains the intervalId
+  this.intervalIds = [];
+
+  // Highest clusterTime seen in responses from the current deployment
+  this.clusterTime = null;
+};
+
+inherits(ReplSet, EventEmitter);
+Object.assign(ReplSet.prototype, SessionMixins);
+
+Object.defineProperty(ReplSet.prototype, 'type', {
+  enumerable: true,
+  get: function() {
+    return 'replset';
+  }
+});
+
+Object.defineProperty(ReplSet.prototype, 'parserType', {
+  enumerable: true,
+  get: function() {
+    return BSON.native ? 'c++' : 'js';
+  }
+});
+
+Object.defineProperty(ReplSet.prototype, 'logicalSessionTimeoutMinutes', {
+  enumerable: true,
+  get: function() {
+    return this.s.replicaSetState.logicalSessionTimeoutMinutes || null;
+  }
+});
+
+function rexecuteOperations(self) {
+  // If we have a primary and a disconnect handler, execute
+  // buffered operations
+  if (self.s.replicaSetState.hasPrimaryAndSecondary() && self.s.disconnectHandler) {
+    self.s.disconnectHandler.execute();
+  } else if (self.s.replicaSetState.hasPrimary() && self.s.disconnectHandler) {
+    self.s.disconnectHandler.execute({ executePrimary: true });
+  } else if (self.s.replicaSetState.hasSecondary() && self.s.disconnectHandler) {
+    self.s.disconnectHandler.execute({ executeSecondary: true });
+  }
+}
+
+function connectNewServers(self, servers, callback) {
+  // No new servers
+  if (servers.length === 0) {
+    return callback();
+  }
+
+  // Count lefts
+  var count = servers.length;
+  var error = null;
+
+  function done() {
+    count = count - 1;
+    if (count === 0) {
+      callback(error);
+    }
+  }
+
+  // Handle events
+  var _handleEvent = function(self, event) {
+    return function(err) {
+      var _self = this;
+
+      // Destroyed
+      if (self.state === DESTROYED || self.state === UNREFERENCED) {
+        this.destroy({ force: true });
+        return done();
+      }
+
+      if (event === 'connect') {
+        // Update the state
+        var result = self.s.replicaSetState.update(_self);
+        // Update the state with the new server
+        if (result) {
+          // Primary lastIsMaster store it
+          if (_self.lastIsMaster() && _self.lastIsMaster().ismaster) {
+            self.ismaster = _self.lastIsMaster();
+          }
+
+          // Remove the handlers
+          for (let i = 0; i < handlers.length; i++) {
+            _self.removeAllListeners(handlers[i]);
+          }
+
+          // Add stable state handlers
+          _self.on('error', handleEvent(self, 'error'));
+          _self.on('close', handleEvent(self, 'close'));
+          _self.on('timeout', handleEvent(self, 'timeout'));
+          _self.on('parseError', handleEvent(self, 'parseError'));
+
+          // Enalbe the monitoring of the new server
+          monitorServer(_self.lastIsMaster().me, self, {});
+
+          // Rexecute any stalled operation
+          rexecuteOperations(self);
+        } else {
+          _self.destroy({ force: true });
+        }
+      } else if (event === 'error') {
+        error = err;
+      }
+
+      // Rexecute any stalled operation
+      rexecuteOperations(self);
+      done();
+    };
+  };
+
+  // Execute method
+  function execute(_server, i) {
+    setTimeout(function() {
+      // Destroyed
+      if (self.state === DESTROYED || self.state === UNREFERENCED) {
+        return;
+      }
+
+      // remove existing connecting server if it's failed to connect, otherwise
+      // wait for that server to connect
+      const existingServerIdx = self.s.connectingServers.findIndex(s => s.name === _server);
+      if (existingServerIdx >= 0) {
+        const connectingServer = self.s.connectingServers[existingServerIdx];
+        connectingServer.destroy({ force: true });
+
+        self.s.connectingServers.splice(existingServerIdx, 1);
+        return done();
+      }
+
+      // Create a new server instance
+      var server = new Server(
+        Object.assign({}, self.s.options, {
+          host: _server.split(':')[0],
+          port: parseInt(_server.split(':')[1], 10),
+          reconnect: false,
+          monitoring: false,
+          parent: self
+        })
+      );
+
+      // Add temp handlers
+      server.once('connect', _handleEvent(self, 'connect'));
+      server.once('close', _handleEvent(self, 'close'));
+      server.once('timeout', _handleEvent(self, 'timeout'));
+      server.once('error', _handleEvent(self, 'error'));
+      server.once('parseError', _handleEvent(self, 'parseError'));
+
+      // SDAM Monitoring events
+      server.on('serverOpening', e => self.emit('serverOpening', e));
+      server.on('serverDescriptionChanged', e => self.emit('serverDescriptionChanged', e));
+      server.on('serverClosed', e => self.emit('serverClosed', e));
+
+      // Command Monitoring events
+      relayEvents(server, self, ['commandStarted', 'commandSucceeded', 'commandFailed']);
+
+      self.s.connectingServers.push(server);
+      server.connect(self.s.connectOptions);
+    }, i);
+  }
+
+  // Create new instances
+  for (var i = 0; i < servers.length; i++) {
+    execute(servers[i], i);
+  }
+}
+
+// Ping the server
+var pingServer = function(self, server, cb) {
+  // Measure running time
+  var start = new Date().getTime();
+
+  // Emit the server heartbeat start
+  emitSDAMEvent(self, 'serverHeartbeatStarted', { connectionId: server.name });
+
+  // Execute ismaster
+  // Set the socketTimeout for a monitoring message to a low number
+  // Ensuring ismaster calls are timed out quickly
+  server.command(
+    'admin.$cmd',
+    {
+      ismaster: true
+    },
+    {
+      monitoring: true,
+      socketTimeout: self.s.options.connectionTimeout || 2000
+    },
+    function(err, r) {
+      if (self.state === DESTROYED || self.state === UNREFERENCED) {
+        server.destroy({ force: true });
+        return cb(err, r);
+      }
+
+      // Calculate latency
+      var latencyMS = new Date().getTime() - start;
+
+      // Set the last updatedTime
+      server.lastUpdateTime = now();
+
+      // We had an error, remove it from the state
+      if (err) {
+        // Emit the server heartbeat failure
+        emitSDAMEvent(self, 'serverHeartbeatFailed', {
+          durationMS: latencyMS,
+          failure: err,
+          connectionId: server.name
+        });
+
+        // Remove server from the state
+        self.s.replicaSetState.remove(server);
+      } else {
+        // Update the server ismaster
+        server.ismaster = r.result;
+
+        // Check if we have a lastWriteDate convert it to MS
+        // and store on the server instance for later use
+        if (server.ismaster.lastWrite && server.ismaster.lastWrite.lastWriteDate) {
+          server.lastWriteDate = server.ismaster.lastWrite.lastWriteDate.getTime();
+        }
+
+        // Do we have a brand new server
+        if (server.lastIsMasterMS === -1) {
+          server.lastIsMasterMS = latencyMS;
+        } else if (server.lastIsMasterMS) {
+          // After the first measurement, average RTT MUST be computed using an
+          // exponentially-weighted moving average formula, with a weighting factor (alpha) of 0.2.
+          // If the prior average is denoted old_rtt, then the new average (new_rtt) is
+          // computed from a new RTT measurement (x) using the following formula:
+          // alpha = 0.2
+          // new_rtt = alpha * x + (1 - alpha) * old_rtt
+          server.lastIsMasterMS = 0.2 * latencyMS + (1 - 0.2) * server.lastIsMasterMS;
+        }
+
+        if (self.s.replicaSetState.update(server)) {
+          // Primary lastIsMaster store it
+          if (server.lastIsMaster() && server.lastIsMaster().ismaster) {
+            self.ismaster = server.lastIsMaster();
+          }
+        }
+
+        // Server heart beat event
+        emitSDAMEvent(self, 'serverHeartbeatSucceeded', {
+          durationMS: latencyMS,
+          reply: r.result,
+          connectionId: server.name
+        });
+      }
+
+      // Calculate the staleness for this server
+      self.s.replicaSetState.updateServerMaxStaleness(server, self.s.haInterval);
+
+      // Callback
+      cb(err, r);
+    }
+  );
+};
+
+// Each server is monitored in parallel in their own timeout loop
+var monitorServer = function(host, self, options) {
+  // If this is not the initial scan
+  // Is this server already being monitoried, then skip monitoring
+  if (!options.haInterval) {
+    for (var i = 0; i < self.intervalIds.length; i++) {
+      if (self.intervalIds[i].__host === host) {
+        return;
+      }
+    }
+  }
+
+  // Get the haInterval
+  var _process = options.haInterval ? Timeout : Interval;
+  var _haInterval = options.haInterval ? options.haInterval : self.s.haInterval;
+
+  // Create the interval
+  var intervalId = new _process(function() {
+    if (self.state === DESTROYED || self.state === UNREFERENCED) {
+      // clearInterval(intervalId);
+      intervalId.stop();
+      return;
+    }
+
+    // Do we already have server connection available for this host
+    var _server = self.s.replicaSetState.get(host);
+
+    // Check if we have a known server connection and reuse
+    if (_server) {
+      // Ping the server
+      return pingServer(self, _server, function(err) {
+        if (err) {
+          // NOTE: should something happen here?
+          return;
+        }
+
+        if (self.state === DESTROYED || self.state === UNREFERENCED) {
+          intervalId.stop();
+          return;
+        }
+
+        // Filter out all called intervaliIds
+        self.intervalIds = self.intervalIds.filter(function(intervalId) {
+          return intervalId.isRunning();
+        });
+
+        // Initial sweep
+        if (_process === Timeout) {
+          if (
+            self.state === CONNECTING &&
+            ((self.s.replicaSetState.hasSecondary() &&
+              self.s.options.secondaryOnlyConnectionAllowed) ||
+              self.s.replicaSetState.hasPrimary())
+          ) {
+            stateTransition(self, CONNECTED);
+
+            // Emit connected sign
+            process.nextTick(function() {
+              self.emit('connect', self);
+            });
+
+            // Start topology interval check
+            topologyMonitor(self, {});
+          }
+        } else {
+          if (
+            self.state === DISCONNECTED &&
+            ((self.s.replicaSetState.hasSecondary() &&
+              self.s.options.secondaryOnlyConnectionAllowed) ||
+              self.s.replicaSetState.hasPrimary())
+          ) {
+            stateTransition(self, CONNECTING);
+
+            // Rexecute any stalled operation
+            rexecuteOperations(self);
+
+            // Emit connected sign
+            process.nextTick(function() {
+              self.emit('reconnect', self);
+            });
+          }
+        }
+
+        if (
+          self.initialConnectState.connect &&
+          !self.initialConnectState.fullsetup &&
+          self.s.replicaSetState.hasPrimaryAndSecondary()
+        ) {
+          // Set initial connect state
+          self.initialConnectState.fullsetup = true;
+          self.initialConnectState.all = true;
+
+          process.nextTick(function() {
+            self.emit('fullsetup', self);
+            self.emit('all', self);
+          });
+        }
+      });
+    }
+  }, _haInterval);
+
+  // Start the interval
+  intervalId.start();
+  // Add the intervalId host name
+  intervalId.__host = host;
+  // Add the intervalId to our list of intervalIds
+  self.intervalIds.push(intervalId);
+};
+
+function topologyMonitor(self, options) {
+  if (self.state === DESTROYED || self.state === UNREFERENCED) return;
+  options = options || {};
+
+  // Get the servers
+  var servers = Object.keys(self.s.replicaSetState.set);
+
+  // Get the haInterval
+  var _process = options.haInterval ? Timeout : Interval;
+  var _haInterval = options.haInterval ? options.haInterval : self.s.haInterval;
+
+  if (_process === Timeout) {
+    return connectNewServers(self, self.s.replicaSetState.unknownServers, function(err) {
+      // Don't emit errors if the connection was already
+      if (self.state === DESTROYED || self.state === UNREFERENCED) {
+        return;
+      }
+
+      if (!self.s.replicaSetState.hasPrimary() && !self.s.options.secondaryOnlyConnectionAllowed) {
+        if (err) {
+          return self.emit('error', err);
+        }
+
+        self.emit(
+          'error',
+          new MongoError('no primary found in replicaset or invalid replica set name')
+        );
+        return self.destroy({ force: true });
+      } else if (
+        !self.s.replicaSetState.hasSecondary() &&
+        self.s.options.secondaryOnlyConnectionAllowed
+      ) {
+        if (err) {
+          return self.emit('error', err);
+        }
+
+        self.emit(
+          'error',
+          new MongoError('no secondary found in replicaset or invalid replica set name')
+        );
+        return self.destroy({ force: true });
+      }
+
+      for (var i = 0; i < servers.length; i++) {
+        monitorServer(servers[i], self, options);
+      }
+    });
+  } else {
+    for (var i = 0; i < servers.length; i++) {
+      monitorServer(servers[i], self, options);
+    }
+  }
+
+  // Run the reconnect process
+  function executeReconnect(self) {
+    return function() {
+      if (self.state === DESTROYED || self.state === UNREFERENCED) {
+        return;
+      }
+
+      connectNewServers(self, self.s.replicaSetState.unknownServers, function() {
+        var monitoringFrequencey = self.s.replicaSetState.hasPrimary()
+          ? _haInterval
+          : self.s.minHeartbeatFrequencyMS;
+
+        // Create a timeout
+        self.intervalIds.push(new Timeout(executeReconnect(self), monitoringFrequencey).start());
+      });
+    };
+  }
+
+  // Decide what kind of interval to use
+  var intervalTime = !self.s.replicaSetState.hasPrimary()
+    ? self.s.minHeartbeatFrequencyMS
+    : _haInterval;
+
+  self.intervalIds.push(new Timeout(executeReconnect(self), intervalTime).start());
+}
+
+function addServerToList(list, server) {
+  for (var i = 0; i < list.length; i++) {
+    if (list[i].name.toLowerCase() === server.name.toLowerCase()) return true;
+  }
+
+  list.push(server);
+}
+
+function handleEvent(self, event) {
+  return function() {
+    if (self.state === DESTROYED || self.state === UNREFERENCED) return;
+    // Debug log
+    if (self.s.logger.isDebug()) {
+      self.s.logger.debug(
+        f('handleEvent %s from server %s in replset with id %s', event, this.name, self.id)
+      );
+    }
+
+    // Remove from the replicaset state
+    self.s.replicaSetState.remove(this);
+
+    // Are we in a destroyed state return
+    if (self.state === DESTROYED || self.state === UNREFERENCED) return;
+
+    // If no primary and secondary available
+    if (
+      !self.s.replicaSetState.hasPrimary() &&
+      !self.s.replicaSetState.hasSecondary() &&
+      self.s.options.secondaryOnlyConnectionAllowed
+    ) {
+      stateTransition(self, DISCONNECTED);
+    } else if (!self.s.replicaSetState.hasPrimary()) {
+      stateTransition(self, DISCONNECTED);
+    }
+
+    addServerToList(self.s.connectingServers, this);
+  };
+}
+
+function shouldTriggerConnect(self) {
+  const isConnecting = self.state === CONNECTING;
+  const hasPrimary = self.s.replicaSetState.hasPrimary();
+  const hasSecondary = self.s.replicaSetState.hasSecondary();
+  const secondaryOnlyConnectionAllowed = self.s.options.secondaryOnlyConnectionAllowed;
+  const readPreferenceSecondary =
+    self.s.connectOptions.readPreference &&
+    self.s.connectOptions.readPreference.equals(ReadPreference.secondary);
+
+  return (
+    (isConnecting &&
+      ((readPreferenceSecondary && hasSecondary) || (!readPreferenceSecondary && hasPrimary))) ||
+    (hasSecondary && secondaryOnlyConnectionAllowed)
+  );
+}
+
+function handleInitialConnectEvent(self, event) {
+  return function() {
+    var _this = this;
+    // Debug log
+    if (self.s.logger.isDebug()) {
+      self.s.logger.debug(
+        f(
+          'handleInitialConnectEvent %s from server %s in replset with id %s',
+          event,
+          this.name,
+          self.id
+        )
+      );
+    }
+
+    // Destroy the instance
+    if (self.state === DESTROYED || self.state === UNREFERENCED) {
+      return this.destroy({ force: true });
+    }
+
+    // Check the type of server
+    if (event === 'connect') {
+      // Update the state
+      var result = self.s.replicaSetState.update(_this);
+      if (result === true) {
+        // Primary lastIsMaster store it
+        if (_this.lastIsMaster() && _this.lastIsMaster().ismaster) {
+          self.ismaster = _this.lastIsMaster();
+        }
+
+        // Debug log
+        if (self.s.logger.isDebug()) {
+          self.s.logger.debug(
+            f(
+              'handleInitialConnectEvent %s from server %s in replset with id %s has state [%s]',
+              event,
+              _this.name,
+              self.id,
+              JSON.stringify(self.s.replicaSetState.set)
+            )
+          );
+        }
+
+        // Remove the handlers
+        for (let i = 0; i < handlers.length; i++) {
+          _this.removeAllListeners(handlers[i]);
+        }
+
+        // Add stable state handlers
+        _this.on('error', handleEvent(self, 'error'));
+        _this.on('close', handleEvent(self, 'close'));
+        _this.on('timeout', handleEvent(self, 'timeout'));
+        _this.on('parseError', handleEvent(self, 'parseError'));
+
+        // Do we have a primary or primaryAndSecondary
+        if (shouldTriggerConnect(self)) {
+          // We are connected
+          stateTransition(self, CONNECTED);
+
+          // Set initial connect state
+          self.initialConnectState.connect = true;
+          // Emit connect event
+          process.nextTick(function() {
+            self.emit('connect', self);
+          });
+
+          topologyMonitor(self, {});
+        }
+      } else if (result instanceof MongoError) {
+        _this.destroy({ force: true });
+        self.destroy({ force: true });
+        return self.emit('error', result);
+      } else {
+        _this.destroy({ force: true });
+      }
+    } else {
+      // Emit failure to connect
+      self.emit('failed', this);
+
+      addServerToList(self.s.connectingServers, this);
+      // Remove from the state
+      self.s.replicaSetState.remove(this);
+    }
+
+    if (
+      self.initialConnectState.connect &&
+      !self.initialConnectState.fullsetup &&
+      self.s.replicaSetState.hasPrimaryAndSecondary()
+    ) {
+      // Set initial connect state
+      self.initialConnectState.fullsetup = true;
+      self.initialConnectState.all = true;
+
+      process.nextTick(function() {
+        self.emit('fullsetup', self);
+        self.emit('all', self);
+      });
+    }
+
+    // Remove from the list from connectingServers
+    for (var i = 0; i < self.s.connectingServers.length; i++) {
+      if (self.s.connectingServers[i].equals(this)) {
+        self.s.connectingServers.splice(i, 1);
+      }
+    }
+
+    // Trigger topologyMonitor
+    if (self.s.connectingServers.length === 0 && self.state === CONNECTING) {
+      topologyMonitor(self, { haInterval: 1 });
+    }
+  };
+}
+
+function connectServers(self, servers) {
+  // Update connectingServers
+  self.s.connectingServers = self.s.connectingServers.concat(servers);
+
+  // Index used to interleaf the server connects, avoiding
+  // runtime issues on io constrained vm's
+  var timeoutInterval = 0;
+
+  function connect(server, timeoutInterval) {
+    setTimeout(function() {
+      // Add the server to the state
+      if (self.s.replicaSetState.update(server)) {
+        // Primary lastIsMaster store it
+        if (server.lastIsMaster() && server.lastIsMaster().ismaster) {
+          self.ismaster = server.lastIsMaster();
+        }
+      }
+
+      // Add event handlers
+      server.once('close', handleInitialConnectEvent(self, 'close'));
+      server.once('timeout', handleInitialConnectEvent(self, 'timeout'));
+      server.once('parseError', handleInitialConnectEvent(self, 'parseError'));
+      server.once('error', handleInitialConnectEvent(self, 'error'));
+      server.once('connect', handleInitialConnectEvent(self, 'connect'));
+
+      // SDAM Monitoring events
+      server.on('serverOpening', e => self.emit('serverOpening', e));
+      server.on('serverDescriptionChanged', e => self.emit('serverDescriptionChanged', e));
+      server.on('serverClosed', e => self.emit('serverClosed', e));
+
+      // Command Monitoring events
+      relayEvents(server, self, ['commandStarted', 'commandSucceeded', 'commandFailed']);
+
+      // Start connection
+      server.connect(self.s.connectOptions);
+    }, timeoutInterval);
+  }
+
+  // Start all the servers
+  while (servers.length > 0) {
+    connect(servers.shift(), timeoutInterval++);
+  }
+}
+
+/**
+ * Emit event if it exists
+ * @method
+ */
+function emitSDAMEvent(self, event, description) {
+  if (self.listeners(event).length > 0) {
+    self.emit(event, description);
+  }
+}
+
+/**
+ * Initiate server connect
+ */
+ReplSet.prototype.connect = function(options) {
+  var self = this;
+  // Add any connect level options to the internal state
+  this.s.connectOptions = options || {};
+
+  // Set connecting state
+  stateTransition(this, CONNECTING);
+
+  // Create server instances
+  var servers = this.s.seedlist.map(function(x) {
+    return new Server(
+      Object.assign({}, self.s.options, x, options, {
+        reconnect: false,
+        monitoring: false,
+        parent: self
+      })
+    );
+  });
+
+  // Error out as high availability interval must be < than socketTimeout
+  if (
+    this.s.options.socketTimeout > 0 &&
+    this.s.options.socketTimeout <= this.s.options.haInterval
+  ) {
+    return self.emit(
+      'error',
+      new MongoError(
+        f(
+          'haInterval [%s] MS must be set to less than socketTimeout [%s] MS',
+          this.s.options.haInterval,
+          this.s.options.socketTimeout
+        )
+      )
+    );
+  }
+
+  // Emit the topology opening event
+  emitSDAMEvent(this, 'topologyOpening', { topologyId: this.id });
+  // Start all server connections
+  connectServers(self, servers);
+};
+
+/**
+ * Authenticate the topology.
+ * @method
+ * @param {MongoCredentials} credentials The credentials for authentication we are using
+ * @param {authResultCallback} callback A callback function
+ */
+ReplSet.prototype.auth = function(credentials, callback) {
+  if (typeof callback === 'function') callback(null, null);
+};
+
+/**
+ * Destroy the server connection
+ * @param {boolean} [options.force=false] Force destroy the pool
+ * @method
+ */
+ReplSet.prototype.destroy = function(options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = options || {};
+
+  let destroyCount = this.s.connectingServers.length + 1; // +1 for the callback from `replicaSetState.destroy`
+  const serverDestroyed = () => {
+    destroyCount--;
+    if (destroyCount > 0) {
+      return;
+    }
+
+    // Emit toplogy closing event
+    emitSDAMEvent(this, 'topologyClosed', { topologyId: this.id });
+
+    if (typeof callback === 'function') {
+      callback(null, null);
+    }
+  };
+
+  if (this.state === DESTROYED) {
+    if (typeof callback === 'function') callback(null, null);
+    return;
+  }
+
+  // Transition state
+  stateTransition(this, DESTROYED);
+
+  // Clear out any monitoring process
+  if (this.haTimeoutId) clearTimeout(this.haTimeoutId);
+
+  // Clear out all monitoring
+  for (var i = 0; i < this.intervalIds.length; i++) {
+    this.intervalIds[i].stop();
+  }
+
+  // Reset list of intervalIds
+  this.intervalIds = [];
+
+  if (destroyCount === 0) {
+    serverDestroyed();
+    return;
+  }
+
+  // Destroy the replicaset
+  this.s.replicaSetState.destroy(options, serverDestroyed);
+
+  // Destroy all connecting servers
+  this.s.connectingServers.forEach(function(x) {
+    x.destroy(options, serverDestroyed);
+  });
+};
+
+/**
+ * Unref all connections belong to this server
+ * @method
+ */
+ReplSet.prototype.unref = function() {
+  // Transition state
+  stateTransition(this, UNREFERENCED);
+
+  this.s.replicaSetState.allServers().forEach(function(x) {
+    x.unref();
+  });
+
+  clearTimeout(this.haTimeoutId);
+};
+
+/**
+ * Returns the last known ismaster document for this server
+ * @method
+ * @return {object}
+ */
+ReplSet.prototype.lastIsMaster = function() {
+  // If secondaryOnlyConnectionAllowed and no primary but secondary
+  // return the secondaries ismaster result.
+  if (
+    this.s.options.secondaryOnlyConnectionAllowed &&
+    !this.s.replicaSetState.hasPrimary() &&
+    this.s.replicaSetState.hasSecondary()
+  ) {
+    return this.s.replicaSetState.secondaries[0].lastIsMaster();
+  }
+
+  return this.s.replicaSetState.primary
+    ? this.s.replicaSetState.primary.lastIsMaster()
+    : this.ismaster;
+};
+
+/**
+ * All raw connections
+ * @method
+ * @return {Connection[]}
+ */
+ReplSet.prototype.connections = function() {
+  var servers = this.s.replicaSetState.allServers();
+  var connections = [];
+  for (var i = 0; i < servers.length; i++) {
+    connections = connections.concat(servers[i].connections());
+  }
+
+  return connections;
+};
+
+/**
+ * Figure out if the server is connected
+ * @method
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @return {boolean}
+ */
+ReplSet.prototype.isConnected = function(options) {
+  options = options || {};
+
+  // If we specified a read preference check if we are connected to something
+  // than can satisfy this
+  if (options.readPreference && options.readPreference.equals(ReadPreference.secondary)) {
+    return this.s.replicaSetState.hasSecondary();
+  }
+
+  if (options.readPreference && options.readPreference.equals(ReadPreference.primary)) {
+    return this.s.replicaSetState.hasPrimary();
+  }
+
+  if (options.readPreference && options.readPreference.equals(ReadPreference.primaryPreferred)) {
+    return this.s.replicaSetState.hasSecondary() || this.s.replicaSetState.hasPrimary();
+  }
+
+  if (options.readPreference && options.readPreference.equals(ReadPreference.secondaryPreferred)) {
+    return this.s.replicaSetState.hasSecondary() || this.s.replicaSetState.hasPrimary();
+  }
+
+  if (this.s.options.secondaryOnlyConnectionAllowed && this.s.replicaSetState.hasSecondary()) {
+    return true;
+  }
+
+  return this.s.replicaSetState.hasPrimary();
+};
+
+/**
+ * Figure out if the replicaset instance was destroyed by calling destroy
+ * @method
+ * @return {boolean}
+ */
+ReplSet.prototype.isDestroyed = function() {
+  return this.state === DESTROYED;
+};
+
+const SERVER_SELECTION_TIMEOUT_MS = 10000; // hardcoded `serverSelectionTimeoutMS` for legacy topology
+const SERVER_SELECTION_INTERVAL_MS = 1000; // time to wait between selection attempts
+/**
+ * Selects a server
+ *
+ * @method
+ * @param {function} selector Unused
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {ClientSession} [options.session] Unused
+ * @param {function} callback
+ */
+ReplSet.prototype.selectServer = function(selector, options, callback) {
+  if (typeof selector === 'function' && typeof callback === 'undefined')
+    (callback = selector), (selector = undefined), (options = {});
+  if (typeof options === 'function') (callback = options), (options = selector);
+  options = options || {};
+
+  let readPreference;
+  if (selector instanceof ReadPreference) {
+    readPreference = selector;
+  } else {
+    readPreference = options.readPreference || ReadPreference.primary;
+  }
+
+  let lastError;
+  const start = now();
+  const _selectServer = () => {
+    if (calculateDurationInMs(start) >= SERVER_SELECTION_TIMEOUT_MS) {
+      if (lastError != null) {
+        callback(lastError, null);
+      } else {
+        callback(new MongoError('Server selection timed out'));
+      }
+
+      return;
+    }
+
+    const server = this.s.replicaSetState.pickServer(readPreference);
+    if (server == null) {
+      setTimeout(_selectServer, SERVER_SELECTION_INTERVAL_MS);
+      return;
+    }
+
+    if (!(server instanceof Server)) {
+      lastError = server;
+      setTimeout(_selectServer, SERVER_SELECTION_INTERVAL_MS);
+      return;
+    }
+
+    if (this.s.debug) this.emit('pickedServer', options.readPreference, server);
+    callback(null, server);
+  };
+
+  _selectServer();
+};
+
+/**
+ * Get all connected servers
+ * @method
+ * @return {Server[]}
+ */
+ReplSet.prototype.getServers = function() {
+  return this.s.replicaSetState.allServers();
+};
+
+//
+// Execute write operation
+function executeWriteOperation(args, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // TODO: once we drop Node 4, use destructuring either here or in arguments.
+  const self = args.self;
+  const op = args.op;
+  const ns = args.ns;
+  const ops = args.ops;
+
+  if (self.state === DESTROYED) {
+    return callback(new MongoError(f('topology was destroyed')));
+  }
+
+  const willRetryWrite =
+    !args.retrying &&
+    !!options.retryWrites &&
+    options.session &&
+    isRetryableWritesSupported(self) &&
+    !options.session.inTransaction() &&
+    options.explain === undefined;
+
+  if (!self.s.replicaSetState.hasPrimary()) {
+    if (self.s.disconnectHandler) {
+      // Not connected but we have a disconnecthandler
+      return self.s.disconnectHandler.add(op, ns, ops, options, callback);
+    } else if (!willRetryWrite) {
+      // No server returned we had an error
+      return callback(new MongoError('no primary server found'));
+    }
+  }
+
+  const handler = (err, result) => {
+    if (!err) return callback(null, result);
+    if (!legacyIsRetryableWriteError(err, self)) {
+      err = getMMAPError(err);
+      return callback(err);
+    }
+
+    if (willRetryWrite) {
+      const newArgs = Object.assign({}, args, { retrying: true });
+      return executeWriteOperation(newArgs, options, callback);
+    }
+
+    // Per SDAM, remove primary from replicaset
+    if (self.s.replicaSetState.primary) {
+      self.s.replicaSetState.primary.destroy();
+      self.s.replicaSetState.remove(self.s.replicaSetState.primary, { force: true });
+    }
+
+    return callback(err);
+  };
+
+  if (callback.operationId) {
+    handler.operationId = callback.operationId;
+  }
+
+  // increment and assign txnNumber
+  if (willRetryWrite) {
+    options.session.incrementTransactionNumber();
+    options.willRetryWrite = willRetryWrite;
+  }
+
+  self.s.replicaSetState.primary[op](ns, ops, options, handler);
+}
+
+/**
+ * Insert one or more documents
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of documents to insert
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+ * @param {opResultCallback} callback A callback function
+ */
+ReplSet.prototype.insert = function(ns, ops, options, callback) {
+  // Execute write operation
+  executeWriteOperation({ self: this, op: 'insert', ns, ops }, options, callback);
+};
+
+/**
+ * Perform one or more update operations
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of updates
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+ * @param {opResultCallback} callback A callback function
+ */
+ReplSet.prototype.update = function(ns, ops, options, callback) {
+  // Execute write operation
+  executeWriteOperation({ self: this, op: 'update', ns, ops }, options, callback);
+};
+
+/**
+ * Perform one or more remove operations
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of removes
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {boolean} [options.retryWrites] Enable retryable writes for this operation
+ * @param {opResultCallback} callback A callback function
+ */
+ReplSet.prototype.remove = function(ns, ops, options, callback) {
+  // Execute write operation
+  executeWriteOperation({ self: this, op: 'remove', ns, ops }, options, callback);
+};
+
+const RETRYABLE_WRITE_OPERATIONS = ['findAndModify', 'insert', 'update', 'delete'];
+
+function isWriteCommand(command) {
+  return RETRYABLE_WRITE_OPERATIONS.some(op => command[op]);
+}
+
+/**
+ * Execute a command
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object} cmd The command hash
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {Connection} [options.connection] Specify connection object to execute command against
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {opResultCallback} callback A callback function
+ */
+ReplSet.prototype.command = function(ns, cmd, options, callback) {
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  if (this.state === DESTROYED) return callback(new MongoError(f('topology was destroyed')));
+  var self = this;
+
+  // Establish readPreference
+  var readPreference = options.readPreference ? options.readPreference : ReadPreference.primary;
+
+  // If the readPreference is primary and we have no primary, store it
+  if (
+    readPreference.preference === 'primary' &&
+    !this.s.replicaSetState.hasPrimary() &&
+    this.s.disconnectHandler != null
+  ) {
+    return this.s.disconnectHandler.add('command', ns, cmd, options, callback);
+  } else if (
+    readPreference.preference === 'secondary' &&
+    !this.s.replicaSetState.hasSecondary() &&
+    this.s.disconnectHandler != null
+  ) {
+    return this.s.disconnectHandler.add('command', ns, cmd, options, callback);
+  } else if (
+    readPreference.preference !== 'primary' &&
+    !this.s.replicaSetState.hasSecondary() &&
+    !this.s.replicaSetState.hasPrimary() &&
+    this.s.disconnectHandler != null
+  ) {
+    return this.s.disconnectHandler.add('command', ns, cmd, options, callback);
+  }
+
+  // Pick a server
+  var server = this.s.replicaSetState.pickServer(readPreference);
+  // We received an error, return it
+  if (!(server instanceof Server)) return callback(server);
+  // Emit debug event
+  if (self.s.debug) self.emit('pickedServer', ReadPreference.primary, server);
+
+  // No server returned we had an error
+  if (server == null) {
+    return callback(
+      new MongoError(
+        f('no server found that matches the provided readPreference %s', readPreference)
+      )
+    );
+  }
+
+  const willRetryWrite =
+    !options.retrying &&
+    !!options.retryWrites &&
+    options.session &&
+    isRetryableWritesSupported(self) &&
+    !options.session.inTransaction() &&
+    isWriteCommand(cmd);
+
+  const cb = (err, result) => {
+    if (!err) return callback(null, result);
+    if (!legacyIsRetryableWriteError(err, self)) {
+      return callback(err);
+    }
+
+    if (willRetryWrite) {
+      const newOptions = Object.assign({}, options, { retrying: true });
+      return this.command(ns, cmd, newOptions, callback);
+    }
+
+    // Per SDAM, remove primary from replicaset
+    if (this.s.replicaSetState.primary) {
+      this.s.replicaSetState.primary.destroy();
+      this.s.replicaSetState.remove(this.s.replicaSetState.primary, { force: true });
+    }
+
+    return callback(err);
+  };
+
+  // increment and assign txnNumber
+  if (willRetryWrite) {
+    options.session.incrementTransactionNumber();
+    options.willRetryWrite = willRetryWrite;
+  }
+
+  // Execute the command
+  server.command(ns, cmd, options, cb);
+};
+
+/**
+ * Get a new cursor
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object|Long} cmd Can be either a command returning a cursor or a cursorId
+ * @param {object} [options] Options for the cursor
+ * @param {object} [options.batchSize=0] Batchsize for the operation
+ * @param {array} [options.documents=[]] Initial documents list for cursor
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {object} [options.topology] The internal topology of the created cursor
+ * @returns {Cursor}
+ */
+ReplSet.prototype.cursor = function(ns, cmd, options) {
+  options = options || {};
+  const topology = options.topology || this;
+
+  // Set up final cursor type
+  var FinalCursor = options.cursorFactory || this.s.Cursor;
+
+  // Return the cursor
+  return new FinalCursor(topology, ns, cmd, options);
+};
+
+/**
+ * A replset connect event, used to verify that the connection is up and running
+ *
+ * @event ReplSet#connect
+ * @type {ReplSet}
+ */
+
+/**
+ * A replset reconnect event, used to verify that the topology reconnected
+ *
+ * @event ReplSet#reconnect
+ * @type {ReplSet}
+ */
+
+/**
+ * A replset fullsetup event, used to signal that all topology members have been contacted.
+ *
+ * @event ReplSet#fullsetup
+ * @type {ReplSet}
+ */
+
+/**
+ * A replset all event, used to signal that all topology members have been contacted.
+ *
+ * @event ReplSet#all
+ * @type {ReplSet}
+ */
+
+/**
+ * A replset failed event, used to signal that initial replset connection failed.
+ *
+ * @event ReplSet#failed
+ * @type {ReplSet}
+ */
+
+/**
+ * A server member left the replicaset
+ *
+ * @event ReplSet#left
+ * @type {function}
+ * @param {string} type The type of member that left (primary|secondary|arbiter)
+ * @param {Server} server The server object that left
+ */
+
+/**
+ * A server member joined the replicaset
+ *
+ * @event ReplSet#joined
+ * @type {function}
+ * @param {string} type The type of member that joined (primary|secondary|arbiter)
+ * @param {Server} server The server object that joined
+ */
+
+/**
+ * A server opening SDAM monitoring event
+ *
+ * @event ReplSet#serverOpening
+ * @type {object}
+ */
+
+/**
+ * A server closed SDAM monitoring event
+ *
+ * @event ReplSet#serverClosed
+ * @type {object}
+ */
+
+/**
+ * A server description SDAM change monitoring event
+ *
+ * @event ReplSet#serverDescriptionChanged
+ * @type {object}
+ */
+
+/**
+ * A topology open SDAM event
+ *
+ * @event ReplSet#topologyOpening
+ * @type {object}
+ */
+
+/**
+ * A topology closed SDAM event
+ *
+ * @event ReplSet#topologyClosed
+ * @type {object}
+ */
+
+/**
+ * A topology structure SDAM change event
+ *
+ * @event ReplSet#topologyDescriptionChanged
+ * @type {object}
+ */
+
+/**
+ * A topology serverHeartbeatStarted SDAM event
+ *
+ * @event ReplSet#serverHeartbeatStarted
+ * @type {object}
+ */
+
+/**
+ * A topology serverHeartbeatFailed SDAM event
+ *
+ * @event ReplSet#serverHeartbeatFailed
+ * @type {object}
+ */
+
+/**
+ * A topology serverHeartbeatSucceeded SDAM change event
+ *
+ * @event ReplSet#serverHeartbeatSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command was started, if command monitoring is enabled
+ *
+ * @event ReplSet#commandStarted
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command succeeded, if command monitoring is enabled
+ *
+ * @event ReplSet#commandSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command failed, if command monitoring is enabled
+ *
+ * @event ReplSet#commandFailed
+ * @type {object}
+ */
+
+module.exports = ReplSet;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/topologies/replset_state.js b/NodeAPI/node_modules/mongodb/lib/core/topologies/replset_state.js
new file mode 100644
index 0000000000000000000000000000000000000000..24c16d6d71e3e5aa1303205d5269d92ead376fac
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/topologies/replset_state.js
@@ -0,0 +1,1121 @@
+'use strict';
+
+var inherits = require('util').inherits,
+  f = require('util').format,
+  diff = require('./shared').diff,
+  EventEmitter = require('events').EventEmitter,
+  Logger = require('../connection/logger'),
+  ReadPreference = require('./read_preference'),
+  MongoError = require('../error').MongoError,
+  Buffer = require('safe-buffer').Buffer;
+
+var TopologyType = {
+  Single: 'Single',
+  ReplicaSetNoPrimary: 'ReplicaSetNoPrimary',
+  ReplicaSetWithPrimary: 'ReplicaSetWithPrimary',
+  Sharded: 'Sharded',
+  Unknown: 'Unknown'
+};
+
+var ServerType = {
+  Standalone: 'Standalone',
+  Mongos: 'Mongos',
+  PossiblePrimary: 'PossiblePrimary',
+  RSPrimary: 'RSPrimary',
+  RSSecondary: 'RSSecondary',
+  RSArbiter: 'RSArbiter',
+  RSOther: 'RSOther',
+  RSGhost: 'RSGhost',
+  Unknown: 'Unknown'
+};
+
+var ReplSetState = function(options) {
+  options = options || {};
+  // Add event listener
+  EventEmitter.call(this);
+  // Topology state
+  this.topologyType = TopologyType.ReplicaSetNoPrimary;
+  this.setName = options.setName;
+
+  // Server set
+  this.set = {};
+
+  // Unpacked options
+  this.id = options.id;
+  this.setName = options.setName;
+
+  // Replicaset logger
+  this.logger = options.logger || Logger('ReplSet', options);
+
+  // Server selection index
+  this.index = 0;
+  // Acceptable latency
+  this.acceptableLatency = options.acceptableLatency || 15;
+
+  // heartbeatFrequencyMS
+  this.heartbeatFrequencyMS = options.heartbeatFrequencyMS || 10000;
+
+  // Server side
+  this.primary = null;
+  this.secondaries = [];
+  this.arbiters = [];
+  this.passives = [];
+  this.ghosts = [];
+  // Current unknown hosts
+  this.unknownServers = [];
+  // In set status
+  this.set = {};
+  // Status
+  this.maxElectionId = null;
+  this.maxSetVersion = 0;
+  // Description of the Replicaset
+  this.replicasetDescription = {
+    topologyType: 'Unknown',
+    servers: []
+  };
+
+  this.logicalSessionTimeoutMinutes = undefined;
+};
+
+inherits(ReplSetState, EventEmitter);
+
+ReplSetState.prototype.hasPrimaryAndSecondary = function() {
+  return this.primary != null && this.secondaries.length > 0;
+};
+
+ReplSetState.prototype.hasPrimaryOrSecondary = function() {
+  return this.hasPrimary() || this.hasSecondary();
+};
+
+ReplSetState.prototype.hasPrimary = function() {
+  return this.primary != null;
+};
+
+ReplSetState.prototype.hasSecondary = function() {
+  return this.secondaries.length > 0;
+};
+
+ReplSetState.prototype.get = function(host) {
+  var servers = this.allServers();
+
+  for (var i = 0; i < servers.length; i++) {
+    if (servers[i].name.toLowerCase() === host.toLowerCase()) {
+      return servers[i];
+    }
+  }
+
+  return null;
+};
+
+ReplSetState.prototype.allServers = function(options) {
+  options = options || {};
+  var servers = this.primary ? [this.primary] : [];
+  servers = servers.concat(this.secondaries);
+  if (!options.ignoreArbiters) servers = servers.concat(this.arbiters);
+  servers = servers.concat(this.passives);
+  return servers;
+};
+
+ReplSetState.prototype.destroy = function(options, callback) {
+  const serversToDestroy = this.secondaries
+    .concat(this.arbiters)
+    .concat(this.passives)
+    .concat(this.ghosts);
+  if (this.primary) serversToDestroy.push(this.primary);
+
+  let serverCount = serversToDestroy.length;
+  const serverDestroyed = () => {
+    serverCount--;
+    if (serverCount > 0) {
+      return;
+    }
+
+    // Clear out the complete state
+    this.secondaries = [];
+    this.arbiters = [];
+    this.passives = [];
+    this.ghosts = [];
+    this.unknownServers = [];
+    this.set = {};
+    this.primary = null;
+
+    // Emit the topology changed
+    emitTopologyDescriptionChanged(this);
+
+    if (typeof callback === 'function') {
+      callback(null, null);
+    }
+  };
+
+  if (serverCount === 0) {
+    serverDestroyed();
+    return;
+  }
+
+  serversToDestroy.forEach(server => server.destroy(options, serverDestroyed));
+};
+
+ReplSetState.prototype.remove = function(server, options) {
+  options = options || {};
+
+  // Get the server name and lowerCase it
+  var serverName = server.name.toLowerCase();
+
+  // Only remove if the current server is not connected
+  var servers = this.primary ? [this.primary] : [];
+  servers = servers.concat(this.secondaries);
+  servers = servers.concat(this.arbiters);
+  servers = servers.concat(this.passives);
+
+  // Check if it's active and this is just a failed connection attempt
+  for (var i = 0; i < servers.length; i++) {
+    if (
+      !options.force &&
+      servers[i].equals(server) &&
+      servers[i].isConnected &&
+      servers[i].isConnected()
+    ) {
+      return;
+    }
+  }
+
+  // If we have it in the set remove it
+  if (this.set[serverName]) {
+    this.set[serverName].type = ServerType.Unknown;
+    this.set[serverName].electionId = null;
+    this.set[serverName].setName = null;
+    this.set[serverName].setVersion = null;
+  }
+
+  // Remove type
+  var removeType = null;
+
+  // Remove from any lists
+  if (this.primary && this.primary.equals(server)) {
+    this.primary = null;
+    this.topologyType = TopologyType.ReplicaSetNoPrimary;
+    removeType = 'primary';
+  }
+
+  // Remove from any other server lists
+  removeType = removeFrom(server, this.secondaries) ? 'secondary' : removeType;
+  removeType = removeFrom(server, this.arbiters) ? 'arbiter' : removeType;
+  removeType = removeFrom(server, this.passives) ? 'secondary' : removeType;
+  removeFrom(server, this.ghosts);
+  removeFrom(server, this.unknownServers);
+
+  // Push to unknownServers
+  this.unknownServers.push(serverName);
+
+  // Do we have a removeType
+  if (removeType) {
+    this.emit('left', removeType, server);
+  }
+};
+
+const isArbiter = ismaster => ismaster.arbiterOnly && ismaster.setName;
+
+ReplSetState.prototype.update = function(server) {
+  var self = this;
+  // Get the current ismaster
+  var ismaster = server.lastIsMaster();
+
+  // Get the server name and lowerCase it
+  var serverName = server.name.toLowerCase();
+
+  //
+  // Add any hosts
+  //
+  if (ismaster) {
+    // Join all the possible new hosts
+    var hosts = Array.isArray(ismaster.hosts) ? ismaster.hosts : [];
+    hosts = hosts.concat(Array.isArray(ismaster.arbiters) ? ismaster.arbiters : []);
+    hosts = hosts.concat(Array.isArray(ismaster.passives) ? ismaster.passives : []);
+    hosts = hosts.map(function(s) {
+      return s.toLowerCase();
+    });
+
+    // Add all hosts as unknownServers
+    for (var i = 0; i < hosts.length; i++) {
+      // Add to the list of unknown server
+      if (
+        this.unknownServers.indexOf(hosts[i]) === -1 &&
+        (!this.set[hosts[i]] || this.set[hosts[i]].type === ServerType.Unknown)
+      ) {
+        this.unknownServers.push(hosts[i].toLowerCase());
+      }
+
+      if (!this.set[hosts[i]]) {
+        this.set[hosts[i]] = {
+          type: ServerType.Unknown,
+          electionId: null,
+          setName: null,
+          setVersion: null
+        };
+      }
+    }
+  }
+
+  //
+  // Unknown server
+  //
+  if (!ismaster && !inList(ismaster, server, this.unknownServers)) {
+    self.set[serverName] = {
+      type: ServerType.Unknown,
+      setVersion: null,
+      electionId: null,
+      setName: null
+    };
+    // Update set information about the server instance
+    self.set[serverName].type = ServerType.Unknown;
+    self.set[serverName].electionId = ismaster ? ismaster.electionId : ismaster;
+    self.set[serverName].setName = ismaster ? ismaster.setName : ismaster;
+    self.set[serverName].setVersion = ismaster ? ismaster.setVersion : ismaster;
+
+    if (self.unknownServers.indexOf(server.name) === -1) {
+      self.unknownServers.push(serverName);
+    }
+
+    // Set the topology
+    return false;
+  }
+
+  // Update logicalSessionTimeoutMinutes
+  if (ismaster.logicalSessionTimeoutMinutes !== undefined && !isArbiter(ismaster)) {
+    if (
+      self.logicalSessionTimeoutMinutes === undefined ||
+      ismaster.logicalSessionTimeoutMinutes === null
+    ) {
+      self.logicalSessionTimeoutMinutes = ismaster.logicalSessionTimeoutMinutes;
+    } else {
+      self.logicalSessionTimeoutMinutes = Math.min(
+        self.logicalSessionTimeoutMinutes,
+        ismaster.logicalSessionTimeoutMinutes
+      );
+    }
+  }
+
+  //
+  // Is this a mongos
+  //
+  if (ismaster && ismaster.msg === 'isdbgrid') {
+    if (this.primary && this.primary.name === serverName) {
+      this.primary = null;
+      this.topologyType = TopologyType.ReplicaSetNoPrimary;
+    }
+
+    return false;
+  }
+
+  // A RSGhost instance
+  if (ismaster.isreplicaset) {
+    self.set[serverName] = {
+      type: ServerType.RSGhost,
+      setVersion: null,
+      electionId: null,
+      setName: ismaster.setName
+    };
+
+    if (this.primary && this.primary.name === serverName) {
+      this.primary = null;
+    }
+
+    // Set the topology
+    this.topologyType = this.primary
+      ? TopologyType.ReplicaSetWithPrimary
+      : TopologyType.ReplicaSetNoPrimary;
+    if (ismaster.setName) this.setName = ismaster.setName;
+
+    // Set the topology
+    return false;
+  }
+
+  // A RSOther instance
+  if (
+    (ismaster.setName && ismaster.hidden) ||
+    (ismaster.setName &&
+      !ismaster.ismaster &&
+      !ismaster.secondary &&
+      !ismaster.arbiterOnly &&
+      !ismaster.passive)
+  ) {
+    self.set[serverName] = {
+      type: ServerType.RSOther,
+      setVersion: null,
+      electionId: null,
+      setName: ismaster.setName
+    };
+
+    // Set the topology
+    this.topologyType = this.primary
+      ? TopologyType.ReplicaSetWithPrimary
+      : TopologyType.ReplicaSetNoPrimary;
+    if (ismaster.setName) this.setName = ismaster.setName;
+    return false;
+  }
+
+  //
+  // Standalone server, destroy and return
+  //
+  if (ismaster && ismaster.ismaster && !ismaster.setName) {
+    this.topologyType = this.primary ? TopologyType.ReplicaSetWithPrimary : TopologyType.Unknown;
+    this.remove(server, { force: true });
+    return false;
+  }
+
+  //
+  // Server in maintanance mode
+  //
+  if (ismaster && !ismaster.ismaster && !ismaster.secondary && !ismaster.arbiterOnly) {
+    this.remove(server, { force: true });
+    return false;
+  }
+
+  //
+  // If the .me field does not match the passed in server
+  //
+  if (ismaster.me && ismaster.me.toLowerCase() !== serverName) {
+    if (this.logger.isWarn()) {
+      this.logger.warn(
+        f(
+          'the seedlist server was removed due to its address %s not matching its ismaster.me address %s',
+          server.name,
+          ismaster.me
+        )
+      );
+    }
+
+    // Delete from the set
+    delete this.set[serverName];
+    // Delete unknown servers
+    removeFrom(server, self.unknownServers);
+
+    // Destroy the instance
+    server.destroy({ force: true });
+
+    // Set the type of topology we have
+    if (this.primary && !this.primary.equals(server)) {
+      this.topologyType = TopologyType.ReplicaSetWithPrimary;
+    } else {
+      this.topologyType = TopologyType.ReplicaSetNoPrimary;
+    }
+
+    //
+    // We have a potential primary
+    //
+    if (!this.primary && ismaster.primary) {
+      this.set[ismaster.primary.toLowerCase()] = {
+        type: ServerType.PossiblePrimary,
+        setName: null,
+        electionId: null,
+        setVersion: null
+      };
+    }
+
+    return false;
+  }
+
+  //
+  // Primary handling
+  //
+  if (!this.primary && ismaster.ismaster && ismaster.setName) {
+    var ismasterElectionId = server.lastIsMaster().electionId;
+    if (this.setName && this.setName !== ismaster.setName) {
+      this.topologyType = TopologyType.ReplicaSetNoPrimary;
+      return new MongoError(
+        f(
+          'setName from ismaster does not match provided connection setName [%s] != [%s]',
+          ismaster.setName,
+          this.setName
+        )
+      );
+    }
+
+    if (!this.maxElectionId && ismasterElectionId) {
+      this.maxElectionId = ismasterElectionId;
+    } else if (this.maxElectionId && ismasterElectionId) {
+      var result = compareObjectIds(this.maxElectionId, ismasterElectionId);
+      // Get the electionIds
+      var ismasterSetVersion = server.lastIsMaster().setVersion;
+
+      if (result === 1) {
+        this.topologyType = TopologyType.ReplicaSetNoPrimary;
+        return false;
+      } else if (result === 0 && ismasterSetVersion) {
+        if (ismasterSetVersion < this.maxSetVersion) {
+          this.topologyType = TopologyType.ReplicaSetNoPrimary;
+          return false;
+        }
+      }
+
+      this.maxSetVersion = ismasterSetVersion;
+      this.maxElectionId = ismasterElectionId;
+    }
+
+    // Hande normalization of server names
+    var normalizedHosts = ismaster.hosts.map(function(x) {
+      return x.toLowerCase();
+    });
+    var locationIndex = normalizedHosts.indexOf(serverName);
+
+    // Validate that the server exists in the host list
+    if (locationIndex !== -1) {
+      self.primary = server;
+      self.set[serverName] = {
+        type: ServerType.RSPrimary,
+        setVersion: ismaster.setVersion,
+        electionId: ismaster.electionId,
+        setName: ismaster.setName
+      };
+
+      // Set the topology
+      this.topologyType = TopologyType.ReplicaSetWithPrimary;
+      if (ismaster.setName) this.setName = ismaster.setName;
+      removeFrom(server, self.unknownServers);
+      removeFrom(server, self.secondaries);
+      removeFrom(server, self.passives);
+      self.emit('joined', 'primary', server);
+    } else {
+      this.topologyType = TopologyType.ReplicaSetNoPrimary;
+    }
+
+    emitTopologyDescriptionChanged(self);
+    return true;
+  } else if (ismaster.ismaster && ismaster.setName) {
+    // Get the electionIds
+    var currentElectionId = self.set[self.primary.name.toLowerCase()].electionId;
+    var currentSetVersion = self.set[self.primary.name.toLowerCase()].setVersion;
+    var currentSetName = self.set[self.primary.name.toLowerCase()].setName;
+    ismasterElectionId = server.lastIsMaster().electionId;
+    ismasterSetVersion = server.lastIsMaster().setVersion;
+    var ismasterSetName = server.lastIsMaster().setName;
+
+    // Is it the same server instance
+    if (this.primary.equals(server) && currentSetName === ismasterSetName) {
+      return false;
+    }
+
+    // If we do not have the same rs name
+    if (currentSetName && currentSetName !== ismasterSetName) {
+      if (!this.primary.equals(server)) {
+        this.topologyType = TopologyType.ReplicaSetWithPrimary;
+      } else {
+        this.topologyType = TopologyType.ReplicaSetNoPrimary;
+      }
+
+      return false;
+    }
+
+    // Check if we need to replace the server
+    if (currentElectionId && ismasterElectionId) {
+      result = compareObjectIds(currentElectionId, ismasterElectionId);
+
+      if (result === 1) {
+        return false;
+      } else if (result === 0 && currentSetVersion > ismasterSetVersion) {
+        return false;
+      }
+    } else if (!currentElectionId && ismasterElectionId && ismasterSetVersion) {
+      if (ismasterSetVersion < this.maxSetVersion) {
+        return false;
+      }
+    }
+
+    if (!this.maxElectionId && ismasterElectionId) {
+      this.maxElectionId = ismasterElectionId;
+    } else if (this.maxElectionId && ismasterElectionId) {
+      result = compareObjectIds(this.maxElectionId, ismasterElectionId);
+
+      if (result === 1) {
+        return false;
+      } else if (result === 0 && currentSetVersion && ismasterSetVersion) {
+        if (ismasterSetVersion < this.maxSetVersion) {
+          return false;
+        }
+      } else {
+        if (ismasterSetVersion < this.maxSetVersion) {
+          return false;
+        }
+      }
+
+      this.maxElectionId = ismasterElectionId;
+      this.maxSetVersion = ismasterSetVersion;
+    } else {
+      this.maxSetVersion = ismasterSetVersion;
+    }
+
+    // Modify the entry to unknown
+    self.set[self.primary.name.toLowerCase()] = {
+      type: ServerType.Unknown,
+      setVersion: null,
+      electionId: null,
+      setName: null
+    };
+
+    // Signal primary left
+    self.emit('left', 'primary', this.primary);
+    // Destroy the instance
+    self.primary.destroy({ force: true });
+    // Set the new instance
+    self.primary = server;
+    // Set the set information
+    self.set[serverName] = {
+      type: ServerType.RSPrimary,
+      setVersion: ismaster.setVersion,
+      electionId: ismaster.electionId,
+      setName: ismaster.setName
+    };
+
+    // Set the topology
+    this.topologyType = TopologyType.ReplicaSetWithPrimary;
+    if (ismaster.setName) this.setName = ismaster.setName;
+    removeFrom(server, self.unknownServers);
+    removeFrom(server, self.secondaries);
+    removeFrom(server, self.passives);
+    self.emit('joined', 'primary', server);
+    emitTopologyDescriptionChanged(self);
+    return true;
+  }
+
+  // A possible instance
+  if (!this.primary && ismaster.primary) {
+    self.set[ismaster.primary.toLowerCase()] = {
+      type: ServerType.PossiblePrimary,
+      setVersion: null,
+      electionId: null,
+      setName: null
+    };
+  }
+
+  //
+  // Secondary handling
+  //
+  if (
+    ismaster.secondary &&
+    ismaster.setName &&
+    !inList(ismaster, server, this.secondaries) &&
+    this.setName &&
+    this.setName === ismaster.setName
+  ) {
+    addToList(self, ServerType.RSSecondary, ismaster, server, this.secondaries);
+    // Set the topology
+    this.topologyType = this.primary
+      ? TopologyType.ReplicaSetWithPrimary
+      : TopologyType.ReplicaSetNoPrimary;
+    if (ismaster.setName) this.setName = ismaster.setName;
+    removeFrom(server, self.unknownServers);
+
+    // Remove primary
+    if (this.primary && this.primary.name.toLowerCase() === serverName) {
+      server.destroy({ force: true });
+      this.primary = null;
+      self.emit('left', 'primary', server);
+    }
+
+    // Emit secondary joined replicaset
+    self.emit('joined', 'secondary', server);
+    emitTopologyDescriptionChanged(self);
+    return true;
+  }
+
+  //
+  // Arbiter handling
+  //
+  if (
+    isArbiter(ismaster) &&
+    !inList(ismaster, server, this.arbiters) &&
+    this.setName &&
+    this.setName === ismaster.setName
+  ) {
+    addToList(self, ServerType.RSArbiter, ismaster, server, this.arbiters);
+    // Set the topology
+    this.topologyType = this.primary
+      ? TopologyType.ReplicaSetWithPrimary
+      : TopologyType.ReplicaSetNoPrimary;
+    if (ismaster.setName) this.setName = ismaster.setName;
+    removeFrom(server, self.unknownServers);
+    self.emit('joined', 'arbiter', server);
+    emitTopologyDescriptionChanged(self);
+    return true;
+  }
+
+  //
+  // Passive handling
+  //
+  if (
+    ismaster.passive &&
+    ismaster.setName &&
+    !inList(ismaster, server, this.passives) &&
+    this.setName &&
+    this.setName === ismaster.setName
+  ) {
+    addToList(self, ServerType.RSSecondary, ismaster, server, this.passives);
+    // Set the topology
+    this.topologyType = this.primary
+      ? TopologyType.ReplicaSetWithPrimary
+      : TopologyType.ReplicaSetNoPrimary;
+    if (ismaster.setName) this.setName = ismaster.setName;
+    removeFrom(server, self.unknownServers);
+
+    // Remove primary
+    if (this.primary && this.primary.name.toLowerCase() === serverName) {
+      server.destroy({ force: true });
+      this.primary = null;
+      self.emit('left', 'primary', server);
+    }
+
+    self.emit('joined', 'secondary', server);
+    emitTopologyDescriptionChanged(self);
+    return true;
+  }
+
+  //
+  // Remove the primary
+  //
+  if (this.set[serverName] && this.set[serverName].type === ServerType.RSPrimary) {
+    self.emit('left', 'primary', this.primary);
+    this.primary.destroy({ force: true });
+    this.primary = null;
+    this.topologyType = TopologyType.ReplicaSetNoPrimary;
+    return false;
+  }
+
+  this.topologyType = this.primary
+    ? TopologyType.ReplicaSetWithPrimary
+    : TopologyType.ReplicaSetNoPrimary;
+  return false;
+};
+
+/**
+ * Recalculate single server max staleness
+ * @method
+ */
+ReplSetState.prototype.updateServerMaxStaleness = function(server, haInterval) {
+  // Locate the max secondary lastwrite
+  var max = 0;
+  // Go over all secondaries
+  for (var i = 0; i < this.secondaries.length; i++) {
+    max = Math.max(max, this.secondaries[i].lastWriteDate);
+  }
+
+  // Perform this servers staleness calculation
+  if (server.ismaster.maxWireVersion >= 5 && server.ismaster.secondary && this.hasPrimary()) {
+    server.staleness =
+      server.lastUpdateTime -
+      server.lastWriteDate -
+      (this.primary.lastUpdateTime - this.primary.lastWriteDate) +
+      haInterval;
+  } else if (server.ismaster.maxWireVersion >= 5 && server.ismaster.secondary) {
+    server.staleness = max - server.lastWriteDate + haInterval;
+  }
+};
+
+/**
+ * Recalculate all the staleness values for secodaries
+ * @method
+ */
+ReplSetState.prototype.updateSecondariesMaxStaleness = function(haInterval) {
+  for (var i = 0; i < this.secondaries.length; i++) {
+    this.updateServerMaxStaleness(this.secondaries[i], haInterval);
+  }
+};
+
+/**
+ * Pick a server by the passed in ReadPreference
+ * @method
+ * @param {ReadPreference} readPreference The ReadPreference instance to use
+ */
+ReplSetState.prototype.pickServer = function(readPreference) {
+  // If no read Preference set to primary by default
+  readPreference = readPreference || ReadPreference.primary;
+
+  // maxStalenessSeconds is not allowed with a primary read
+  if (readPreference.preference === 'primary' && readPreference.maxStalenessSeconds != null) {
+    return new MongoError('primary readPreference incompatible with maxStalenessSeconds');
+  }
+
+  // Check if we have any non compatible servers for maxStalenessSeconds
+  var allservers = this.primary ? [this.primary] : [];
+  allservers = allservers.concat(this.secondaries);
+
+  // Does any of the servers not support the right wire protocol version
+  // for maxStalenessSeconds when maxStalenessSeconds specified on readPreference. Then error out
+  if (readPreference.maxStalenessSeconds != null) {
+    for (var i = 0; i < allservers.length; i++) {
+      if (allservers[i].ismaster.maxWireVersion < 5) {
+        return new MongoError(
+          'maxStalenessSeconds not supported by at least one of the replicaset members'
+        );
+      }
+    }
+  }
+
+  // Do we have the nearest readPreference
+  if (readPreference.preference === 'nearest' && readPreference.maxStalenessSeconds == null) {
+    return pickNearest(this, readPreference);
+  } else if (
+    readPreference.preference === 'nearest' &&
+    readPreference.maxStalenessSeconds != null
+  ) {
+    return pickNearestMaxStalenessSeconds(this, readPreference);
+  }
+
+  // Get all the secondaries
+  var secondaries = this.secondaries;
+
+  // Check if we can satisfy and of the basic read Preferences
+  if (readPreference.equals(ReadPreference.secondary) && secondaries.length === 0) {
+    return new MongoError('no secondary server available');
+  }
+
+  if (
+    readPreference.equals(ReadPreference.secondaryPreferred) &&
+    secondaries.length === 0 &&
+    this.primary == null
+  ) {
+    return new MongoError('no secondary or primary server available');
+  }
+
+  if (readPreference.equals(ReadPreference.primary) && this.primary == null) {
+    return new MongoError('no primary server available');
+  }
+
+  // Secondary preferred or just secondaries
+  if (
+    readPreference.equals(ReadPreference.secondaryPreferred) ||
+    readPreference.equals(ReadPreference.secondary)
+  ) {
+    if (secondaries.length > 0 && readPreference.maxStalenessSeconds == null) {
+      // Pick nearest of any other servers available
+      var server = pickNearest(this, readPreference);
+      // No server in the window return primary
+      if (server) {
+        return server;
+      }
+    } else if (secondaries.length > 0 && readPreference.maxStalenessSeconds != null) {
+      // Pick nearest of any other servers available
+      server = pickNearestMaxStalenessSeconds(this, readPreference);
+      // No server in the window return primary
+      if (server) {
+        return server;
+      }
+    }
+
+    if (readPreference.equals(ReadPreference.secondaryPreferred)) {
+      return this.primary;
+    }
+
+    return null;
+  }
+
+  // Primary preferred
+  if (readPreference.equals(ReadPreference.primaryPreferred)) {
+    server = null;
+
+    // We prefer the primary if it's available
+    if (this.primary) {
+      return this.primary;
+    }
+
+    // Pick a secondary
+    if (secondaries.length > 0 && readPreference.maxStalenessSeconds == null) {
+      server = pickNearest(this, readPreference);
+    } else if (secondaries.length > 0 && readPreference.maxStalenessSeconds != null) {
+      server = pickNearestMaxStalenessSeconds(this, readPreference);
+    }
+
+    //  Did we find a server
+    if (server) return server;
+  }
+
+  // Return the primary
+  return this.primary;
+};
+
+//
+// Filter serves by tags
+var filterByTags = function(readPreference, servers) {
+  if (readPreference.tags == null) return servers;
+  var filteredServers = [];
+  var tagsArray = Array.isArray(readPreference.tags) ? readPreference.tags : [readPreference.tags];
+
+  // Iterate over the tags
+  for (var j = 0; j < tagsArray.length; j++) {
+    var tags = tagsArray[j];
+
+    // Iterate over all the servers
+    for (var i = 0; i < servers.length; i++) {
+      var serverTag = servers[i].lastIsMaster().tags || {};
+
+      // Did we find the a matching server
+      var found = true;
+      // Check if the server is valid
+      for (var name in tags) {
+        if (serverTag[name] !== tags[name]) {
+          found = false;
+        }
+      }
+
+      // Add to candidate list
+      if (found) {
+        filteredServers.push(servers[i]);
+      }
+    }
+  }
+
+  // Returned filtered servers
+  return filteredServers;
+};
+
+function pickNearestMaxStalenessSeconds(self, readPreference) {
+  // Only get primary and secondaries as seeds
+  var servers = [];
+
+  // Get the maxStalenessMS
+  var maxStalenessMS = readPreference.maxStalenessSeconds * 1000;
+
+  // Check if the maxStalenessMS > 90 seconds
+  if (maxStalenessMS < 90 * 1000) {
+    return new MongoError('maxStalenessSeconds must be set to at least 90 seconds');
+  }
+
+  // Add primary to list if not a secondary read preference
+  if (
+    self.primary &&
+    readPreference.preference !== 'secondary' &&
+    readPreference.preference !== 'secondaryPreferred'
+  ) {
+    servers.push(self.primary);
+  }
+
+  // Add all the secondaries
+  for (var i = 0; i < self.secondaries.length; i++) {
+    servers.push(self.secondaries[i]);
+  }
+
+  // If we have a secondaryPreferred readPreference and no server add the primary
+  if (self.primary && servers.length === 0 && readPreference.preference !== 'secondaryPreferred') {
+    servers.push(self.primary);
+  }
+
+  // Filter by tags
+  servers = filterByTags(readPreference, servers);
+
+  // Filter by latency
+  servers = servers.filter(function(s) {
+    return s.staleness <= maxStalenessMS;
+  });
+
+  // Sort by time
+  servers.sort(function(a, b) {
+    return a.lastIsMasterMS - b.lastIsMasterMS;
+  });
+
+  // No servers, default to primary
+  if (servers.length === 0) {
+    return null;
+  }
+
+  // Ensure index does not overflow the number of available servers
+  self.index = self.index % servers.length;
+
+  // Get the server
+  var server = servers[self.index];
+  // Add to the index
+  self.index = self.index + 1;
+  // Return the first server of the sorted and filtered list
+  return server;
+}
+
+function pickNearest(self, readPreference) {
+  // Only get primary and secondaries as seeds
+  var servers = [];
+
+  // Add primary to list if not a secondary read preference
+  if (
+    self.primary &&
+    readPreference.preference !== 'secondary' &&
+    readPreference.preference !== 'secondaryPreferred'
+  ) {
+    servers.push(self.primary);
+  }
+
+  // Add all the secondaries
+  for (var i = 0; i < self.secondaries.length; i++) {
+    servers.push(self.secondaries[i]);
+  }
+
+  // If we have a secondaryPreferred readPreference and no server add the primary
+  if (servers.length === 0 && self.primary && readPreference.preference !== 'secondaryPreferred') {
+    servers.push(self.primary);
+  }
+
+  // Filter by tags
+  servers = filterByTags(readPreference, servers);
+
+  // Sort by time
+  servers.sort(function(a, b) {
+    return a.lastIsMasterMS - b.lastIsMasterMS;
+  });
+
+  // Locate lowest time (picked servers are lowest time + acceptable Latency margin)
+  var lowest = servers.length > 0 ? servers[0].lastIsMasterMS : 0;
+
+  // Filter by latency
+  servers = servers.filter(function(s) {
+    return s.lastIsMasterMS <= lowest + self.acceptableLatency;
+  });
+
+  // No servers, default to primary
+  if (servers.length === 0) {
+    return null;
+  }
+
+  // Ensure index does not overflow the number of available servers
+  self.index = self.index % servers.length;
+  // Get the server
+  var server = servers[self.index];
+  // Add to the index
+  self.index = self.index + 1;
+  // Return the first server of the sorted and filtered list
+  return server;
+}
+
+function inList(ismaster, server, list) {
+  for (var i = 0; i < list.length; i++) {
+    if (list[i] && list[i].name && list[i].name.toLowerCase() === server.name.toLowerCase())
+      return true;
+  }
+
+  return false;
+}
+
+function addToList(self, type, ismaster, server, list) {
+  var serverName = server.name.toLowerCase();
+  // Update set information about the server instance
+  self.set[serverName].type = type;
+  self.set[serverName].electionId = ismaster ? ismaster.electionId : ismaster;
+  self.set[serverName].setName = ismaster ? ismaster.setName : ismaster;
+  self.set[serverName].setVersion = ismaster ? ismaster.setVersion : ismaster;
+  // Add to the list
+  list.push(server);
+}
+
+function compareObjectIds(id1, id2) {
+  var a = Buffer.from(id1.toHexString(), 'hex');
+  var b = Buffer.from(id2.toHexString(), 'hex');
+
+  if (a === b) {
+    return 0;
+  }
+
+  if (typeof Buffer.compare === 'function') {
+    return Buffer.compare(a, b);
+  }
+
+  var x = a.length;
+  var y = b.length;
+  var len = Math.min(x, y);
+
+  for (var i = 0; i < len; i++) {
+    if (a[i] !== b[i]) {
+      break;
+    }
+  }
+
+  if (i !== len) {
+    x = a[i];
+    y = b[i];
+  }
+
+  return x < y ? -1 : y < x ? 1 : 0;
+}
+
+function removeFrom(server, list) {
+  for (var i = 0; i < list.length; i++) {
+    if (list[i].equals && list[i].equals(server)) {
+      list.splice(i, 1);
+      return true;
+    } else if (typeof list[i] === 'string' && list[i].toLowerCase() === server.name.toLowerCase()) {
+      list.splice(i, 1);
+      return true;
+    }
+  }
+
+  return false;
+}
+
+function emitTopologyDescriptionChanged(self) {
+  if (self.listeners('topologyDescriptionChanged').length > 0) {
+    var topology = 'Unknown';
+    var setName = self.setName;
+
+    if (self.hasPrimaryAndSecondary()) {
+      topology = 'ReplicaSetWithPrimary';
+    } else if (!self.hasPrimary() && self.hasSecondary()) {
+      topology = 'ReplicaSetNoPrimary';
+    }
+
+    // Generate description
+    var description = {
+      topologyType: topology,
+      setName: setName,
+      servers: []
+    };
+
+    // Add the primary to the list
+    if (self.hasPrimary()) {
+      var desc = self.primary.getDescription();
+      desc.type = 'RSPrimary';
+      description.servers.push(desc);
+    }
+
+    // Add all the secondaries
+    description.servers = description.servers.concat(
+      self.secondaries.map(function(x) {
+        var description = x.getDescription();
+        description.type = 'RSSecondary';
+        return description;
+      })
+    );
+
+    // Add all the arbiters
+    description.servers = description.servers.concat(
+      self.arbiters.map(function(x) {
+        var description = x.getDescription();
+        description.type = 'RSArbiter';
+        return description;
+      })
+    );
+
+    // Add all the passives
+    description.servers = description.servers.concat(
+      self.passives.map(function(x) {
+        var description = x.getDescription();
+        description.type = 'RSSecondary';
+        return description;
+      })
+    );
+
+    // Get the diff
+    var diffResult = diff(self.replicasetDescription, description);
+
+    // Create the result
+    var result = {
+      topologyId: self.id,
+      previousDescription: self.replicasetDescription,
+      newDescription: description,
+      diff: diffResult
+    };
+
+    // Emit the topologyDescription change
+    // if(diffResult.servers.length > 0) {
+    self.emit('topologyDescriptionChanged', result);
+    // }
+
+    // Set the new description
+    self.replicasetDescription = description;
+  }
+}
+
+module.exports = ReplSetState;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/topologies/server.js b/NodeAPI/node_modules/mongodb/lib/core/topologies/server.js
new file mode 100644
index 0000000000000000000000000000000000000000..c6a0bfa5db946f8cb7adeb36918c19a2ccafe211
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/topologies/server.js
@@ -0,0 +1,991 @@
+'use strict';
+
+var inherits = require('util').inherits,
+  f = require('util').format,
+  EventEmitter = require('events').EventEmitter,
+  ReadPreference = require('./read_preference'),
+  Logger = require('../connection/logger'),
+  debugOptions = require('../connection/utils').debugOptions,
+  retrieveBSON = require('../connection/utils').retrieveBSON,
+  Pool = require('../connection/pool'),
+  MongoError = require('../error').MongoError,
+  MongoNetworkError = require('../error').MongoNetworkError,
+  wireProtocol = require('../wireprotocol'),
+  CoreCursor = require('../cursor').CoreCursor,
+  sdam = require('./shared'),
+  createCompressionInfo = require('./shared').createCompressionInfo,
+  resolveClusterTime = require('./shared').resolveClusterTime,
+  SessionMixins = require('./shared').SessionMixins,
+  relayEvents = require('../utils').relayEvents;
+
+const collationNotSupported = require('../utils').collationNotSupported;
+const makeClientMetadata = require('../utils').makeClientMetadata;
+
+// Used for filtering out fields for loggin
+var debugFields = [
+  'reconnect',
+  'reconnectTries',
+  'reconnectInterval',
+  'emitError',
+  'cursorFactory',
+  'host',
+  'port',
+  'size',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'noDelay',
+  'connectionTimeout',
+  'checkServerIdentity',
+  'socketTimeout',
+  'ssl',
+  'ca',
+  'crl',
+  'cert',
+  'key',
+  'rejectUnauthorized',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'servername'
+];
+
+// Server instance id
+var id = 0;
+var serverAccounting = false;
+var servers = {};
+var BSON = retrieveBSON();
+
+function topologyId(server) {
+  return server.s.parent == null ? server.id : server.s.parent.id;
+}
+
+/**
+ * Creates a new Server instance
+ * @class
+ * @param {boolean} [options.reconnect=true] Server will attempt to reconnect on loss of connection
+ * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times
+ * @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
+ * @param {number} [options.monitoring=true] Enable the server state monitoring (calling ismaster at monitoringInterval)
+ * @param {number} [options.monitoringInterval=5000] The interval of calling ismaster when monitoring is enabled.
+ * @param {Cursor} [options.cursorFactory=Cursor] The cursor factory class used for all query cursors
+ * @param {string} options.host The server host
+ * @param {number} options.port The server port
+ * @param {number} [options.size=5] Server connection pool size
+ * @param {boolean} [options.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.keepAliveInitialDelay=120000] Initial delay before TCP keep alive enabled
+ * @param {boolean} [options.noDelay=true] TCP Connection no delay
+ * @param {number} [options.connectionTimeout=30000] TCP Connection timeout setting
+ * @param {number} [options.socketTimeout=0] TCP Socket timeout setting
+ * @param {boolean} [options.ssl=false] Use SSL for connection
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {Buffer} [options.ca] SSL Certificate store binary buffer
+ * @param {Buffer} [options.crl] SSL Certificate revocation store binary buffer
+ * @param {Buffer} [options.cert] SSL Certificate binary buffer
+ * @param {Buffer} [options.key] SSL Key file binary buffer
+ * @param {string} [options.passphrase] SSL Certificate pass phrase
+ * @param {boolean} [options.rejectUnauthorized=true] Reject unauthorized server certificates
+ * @param {string} [options.servername=null] String containing the server name requested via TLS SNI.
+ * @param {boolean} [options.promoteLongs=true] Convert Long values from the db into Numbers if they fit into 53 bits
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {string} [options.appname=null] Application name, passed in on ismaster call and logged in mongod server logs. Maximum size 128 bytes.
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
+ * @return {Server} A cursor instance
+ * @fires Server#connect
+ * @fires Server#close
+ * @fires Server#error
+ * @fires Server#timeout
+ * @fires Server#parseError
+ * @fires Server#reconnect
+ * @fires Server#reconnectFailed
+ * @fires Server#serverHeartbeatStarted
+ * @fires Server#serverHeartbeatSucceeded
+ * @fires Server#serverHeartbeatFailed
+ * @fires Server#topologyOpening
+ * @fires Server#topologyClosed
+ * @fires Server#topologyDescriptionChanged
+ * @property {string} type the topology type.
+ * @property {string} parserType the parser type used (c++ or js).
+ */
+var Server = function(options) {
+  options = options || {};
+
+  // Add event listener
+  EventEmitter.call(this);
+
+  // Server instance id
+  this.id = id++;
+
+  // Internal state
+  this.s = {
+    // Options
+    options: Object.assign({ metadata: makeClientMetadata(options) }, options),
+    // Logger
+    logger: Logger('Server', options),
+    // Factory overrides
+    Cursor: options.cursorFactory || CoreCursor,
+    // BSON instance
+    bson:
+      options.bson ||
+      new BSON([
+        BSON.Binary,
+        BSON.Code,
+        BSON.DBRef,
+        BSON.Decimal128,
+        BSON.Double,
+        BSON.Int32,
+        BSON.Long,
+        BSON.Map,
+        BSON.MaxKey,
+        BSON.MinKey,
+        BSON.ObjectId,
+        BSON.BSONRegExp,
+        BSON.Symbol,
+        BSON.Timestamp
+      ]),
+    // Pool
+    pool: null,
+    // Disconnect handler
+    disconnectHandler: options.disconnectHandler,
+    // Monitor thread (keeps the connection alive)
+    monitoring: typeof options.monitoring === 'boolean' ? options.monitoring : true,
+    // Is the server in a topology
+    inTopology: !!options.parent,
+    // Monitoring timeout
+    monitoringInterval:
+      typeof options.monitoringInterval === 'number' ? options.monitoringInterval : 5000,
+    compression: { compressors: createCompressionInfo(options) },
+    // Optional parent topology
+    parent: options.parent
+  };
+
+  // If this is a single deployment we need to track the clusterTime here
+  if (!this.s.parent) {
+    this.s.clusterTime = null;
+  }
+
+  // Curent ismaster
+  this.ismaster = null;
+  // Current ping time
+  this.lastIsMasterMS = -1;
+  // The monitoringProcessId
+  this.monitoringProcessId = null;
+  // Initial connection
+  this.initialConnect = true;
+  // Default type
+  this._type = 'server';
+
+  // Max Stalleness values
+  // last time we updated the ismaster state
+  this.lastUpdateTime = 0;
+  // Last write time
+  this.lastWriteDate = 0;
+  // Stalleness
+  this.staleness = 0;
+};
+
+inherits(Server, EventEmitter);
+Object.assign(Server.prototype, SessionMixins);
+
+Object.defineProperty(Server.prototype, 'type', {
+  enumerable: true,
+  get: function() {
+    return this._type;
+  }
+});
+
+Object.defineProperty(Server.prototype, 'parserType', {
+  enumerable: true,
+  get: function() {
+    return BSON.native ? 'c++' : 'js';
+  }
+});
+
+Object.defineProperty(Server.prototype, 'logicalSessionTimeoutMinutes', {
+  enumerable: true,
+  get: function() {
+    if (!this.ismaster) return null;
+    return this.ismaster.logicalSessionTimeoutMinutes || null;
+  }
+});
+
+Object.defineProperty(Server.prototype, 'clientMetadata', {
+  enumerable: true,
+  get: function() {
+    return this.s.options.metadata;
+  }
+});
+
+// In single server deployments we track the clusterTime directly on the topology, however
+// in Mongos and ReplSet deployments we instead need to delegate the clusterTime up to the
+// tracking objects so we can ensure we are gossiping the maximum time received from the
+// server.
+Object.defineProperty(Server.prototype, 'clusterTime', {
+  enumerable: true,
+  set: function(clusterTime) {
+    const settings = this.s.parent ? this.s.parent : this.s;
+    resolveClusterTime(settings, clusterTime);
+  },
+  get: function() {
+    const settings = this.s.parent ? this.s.parent : this.s;
+    return settings.clusterTime || null;
+  }
+});
+
+Server.enableServerAccounting = function() {
+  serverAccounting = true;
+  servers = {};
+};
+
+Server.disableServerAccounting = function() {
+  serverAccounting = false;
+};
+
+Server.servers = function() {
+  return servers;
+};
+
+Object.defineProperty(Server.prototype, 'name', {
+  enumerable: true,
+  get: function() {
+    return this.s.options.host + ':' + this.s.options.port;
+  }
+});
+
+function disconnectHandler(self, type, ns, cmd, options, callback) {
+  // Topology is not connected, save the call in the provided store to be
+  // Executed at some point when the handler deems it's reconnected
+  if (
+    !self.s.pool.isConnected() &&
+    self.s.options.reconnect &&
+    self.s.disconnectHandler != null &&
+    !options.monitoring
+  ) {
+    self.s.disconnectHandler.add(type, ns, cmd, options, callback);
+    return true;
+  }
+
+  // If we have no connection error
+  if (!self.s.pool.isConnected()) {
+    callback(new MongoError(f('no connection available to server %s', self.name)));
+    return true;
+  }
+}
+
+function monitoringProcess(self) {
+  return function() {
+    // Pool was destroyed do not continue process
+    if (self.s.pool.isDestroyed()) return;
+    // Emit monitoring Process event
+    self.emit('monitoring', self);
+    // Perform ismaster call
+    // Get start time
+    var start = new Date().getTime();
+
+    // Execute the ismaster query
+    self.command(
+      'admin.$cmd',
+      { ismaster: true },
+      {
+        socketTimeout:
+          typeof self.s.options.connectionTimeout !== 'number'
+            ? 2000
+            : self.s.options.connectionTimeout,
+        monitoring: true
+      },
+      (err, result) => {
+        // Set initial lastIsMasterMS
+        self.lastIsMasterMS = new Date().getTime() - start;
+        if (self.s.pool.isDestroyed()) return;
+        // Update the ismaster view if we have a result
+        if (result) {
+          self.ismaster = result.result;
+        }
+        // Re-schedule the monitoring process
+        self.monitoringProcessId = setTimeout(monitoringProcess(self), self.s.monitoringInterval);
+      }
+    );
+  };
+}
+
+var eventHandler = function(self, event) {
+  return function(err, conn) {
+    // Log information of received information if in info mode
+    if (self.s.logger.isInfo()) {
+      var object = err instanceof MongoError ? JSON.stringify(err) : {};
+      self.s.logger.info(
+        f('server %s fired event %s out with message %s', self.name, event, object)
+      );
+    }
+
+    // Handle connect event
+    if (event === 'connect') {
+      self.initialConnect = false;
+      self.ismaster = conn.ismaster;
+      self.lastIsMasterMS = conn.lastIsMasterMS;
+      if (conn.agreedCompressor) {
+        self.s.pool.options.agreedCompressor = conn.agreedCompressor;
+      }
+
+      if (conn.zlibCompressionLevel) {
+        self.s.pool.options.zlibCompressionLevel = conn.zlibCompressionLevel;
+      }
+
+      if (conn.ismaster.$clusterTime) {
+        const $clusterTime = conn.ismaster.$clusterTime;
+        self.clusterTime = $clusterTime;
+      }
+
+      // It's a proxy change the type so
+      // the wireprotocol will send $readPreference
+      if (self.ismaster.msg === 'isdbgrid') {
+        self._type = 'mongos';
+      }
+
+      // Have we defined self monitoring
+      if (self.s.monitoring) {
+        self.monitoringProcessId = setTimeout(monitoringProcess(self), self.s.monitoringInterval);
+      }
+
+      // Emit server description changed if something listening
+      sdam.emitServerDescriptionChanged(self, {
+        address: self.name,
+        arbiters: [],
+        hosts: [],
+        passives: [],
+        type: sdam.getTopologyType(self)
+      });
+
+      if (!self.s.inTopology) {
+        // Emit topology description changed if something listening
+        sdam.emitTopologyDescriptionChanged(self, {
+          topologyType: 'Single',
+          servers: [
+            {
+              address: self.name,
+              arbiters: [],
+              hosts: [],
+              passives: [],
+              type: sdam.getTopologyType(self)
+            }
+          ]
+        });
+      }
+
+      // Log the ismaster if available
+      if (self.s.logger.isInfo()) {
+        self.s.logger.info(
+          f('server %s connected with ismaster [%s]', self.name, JSON.stringify(self.ismaster))
+        );
+      }
+
+      // Emit connect
+      self.emit('connect', self);
+    } else if (
+      event === 'error' ||
+      event === 'parseError' ||
+      event === 'close' ||
+      event === 'timeout' ||
+      event === 'reconnect' ||
+      event === 'attemptReconnect' ||
+      event === 'reconnectFailed'
+    ) {
+      // Remove server instance from accounting
+      if (
+        serverAccounting &&
+        ['close', 'timeout', 'error', 'parseError', 'reconnectFailed'].indexOf(event) !== -1
+      ) {
+        // Emit toplogy opening event if not in topology
+        if (!self.s.inTopology) {
+          self.emit('topologyOpening', { topologyId: self.id });
+        }
+
+        delete servers[self.id];
+      }
+
+      if (event === 'close') {
+        // Closing emits a server description changed event going to unknown.
+        sdam.emitServerDescriptionChanged(self, {
+          address: self.name,
+          arbiters: [],
+          hosts: [],
+          passives: [],
+          type: 'Unknown'
+        });
+      }
+
+      // Reconnect failed return error
+      if (event === 'reconnectFailed') {
+        self.emit('reconnectFailed', err);
+        // Emit error if any listeners
+        if (self.listeners('error').length > 0) {
+          self.emit('error', err);
+        }
+        // Terminate
+        return;
+      }
+
+      // On first connect fail
+      if (
+        ['disconnected', 'connecting'].indexOf(self.s.pool.state) !== -1 &&
+        self.initialConnect &&
+        ['close', 'timeout', 'error', 'parseError'].indexOf(event) !== -1
+      ) {
+        self.initialConnect = false;
+        return self.emit(
+          'error',
+          new MongoNetworkError(
+            f('failed to connect to server [%s] on first connect [%s]', self.name, err)
+          )
+        );
+      }
+
+      // Reconnect event, emit the server
+      if (event === 'reconnect') {
+        // Reconnecting emits a server description changed event going from unknown to the
+        // current server type.
+        sdam.emitServerDescriptionChanged(self, {
+          address: self.name,
+          arbiters: [],
+          hosts: [],
+          passives: [],
+          type: sdam.getTopologyType(self)
+        });
+        return self.emit(event, self);
+      }
+
+      // Emit the event
+      self.emit(event, err);
+    }
+  };
+};
+
+/**
+ * Initiate server connect
+ */
+Server.prototype.connect = function(options) {
+  var self = this;
+  options = options || {};
+
+  // Set the connections
+  if (serverAccounting) servers[this.id] = this;
+
+  // Do not allow connect to be called on anything that's not disconnected
+  if (self.s.pool && !self.s.pool.isDisconnected() && !self.s.pool.isDestroyed()) {
+    throw new MongoError(f('server instance in invalid state %s', self.s.pool.state));
+  }
+
+  // Create a pool
+  self.s.pool = new Pool(this, Object.assign(self.s.options, options, { bson: this.s.bson }));
+
+  // Set up listeners
+  self.s.pool.on('close', eventHandler(self, 'close'));
+  self.s.pool.on('error', eventHandler(self, 'error'));
+  self.s.pool.on('timeout', eventHandler(self, 'timeout'));
+  self.s.pool.on('parseError', eventHandler(self, 'parseError'));
+  self.s.pool.on('connect', eventHandler(self, 'connect'));
+  self.s.pool.on('reconnect', eventHandler(self, 'reconnect'));
+  self.s.pool.on('reconnectFailed', eventHandler(self, 'reconnectFailed'));
+
+  // Set up listeners for command monitoring
+  relayEvents(self.s.pool, self, ['commandStarted', 'commandSucceeded', 'commandFailed']);
+
+  // Emit toplogy opening event if not in topology
+  if (!self.s.inTopology) {
+    this.emit('topologyOpening', { topologyId: topologyId(self) });
+  }
+
+  // Emit opening server event
+  self.emit('serverOpening', { topologyId: topologyId(self), address: self.name });
+
+  self.s.pool.connect();
+};
+
+/**
+ * Authenticate the topology.
+ * @method
+ * @param {MongoCredentials} credentials The credentials for authentication we are using
+ * @param {authResultCallback} callback A callback function
+ */
+Server.prototype.auth = function(credentials, callback) {
+  if (typeof callback === 'function') callback(null, null);
+};
+
+/**
+ * Get the server description
+ * @method
+ * @return {object}
+ */
+Server.prototype.getDescription = function() {
+  var ismaster = this.ismaster || {};
+  var description = {
+    type: sdam.getTopologyType(this),
+    address: this.name
+  };
+
+  // Add fields if available
+  if (ismaster.hosts) description.hosts = ismaster.hosts;
+  if (ismaster.arbiters) description.arbiters = ismaster.arbiters;
+  if (ismaster.passives) description.passives = ismaster.passives;
+  if (ismaster.setName) description.setName = ismaster.setName;
+  return description;
+};
+
+/**
+ * Returns the last known ismaster document for this server
+ * @method
+ * @return {object}
+ */
+Server.prototype.lastIsMaster = function() {
+  return this.ismaster;
+};
+
+/**
+ * Unref all connections belong to this server
+ * @method
+ */
+Server.prototype.unref = function() {
+  this.s.pool.unref();
+};
+
+/**
+ * Figure out if the server is connected
+ * @method
+ * @return {boolean}
+ */
+Server.prototype.isConnected = function() {
+  if (!this.s.pool) return false;
+  return this.s.pool.isConnected();
+};
+
+/**
+ * Figure out if the server instance was destroyed by calling destroy
+ * @method
+ * @return {boolean}
+ */
+Server.prototype.isDestroyed = function() {
+  if (!this.s.pool) return false;
+  return this.s.pool.isDestroyed();
+};
+
+function basicWriteValidations(self) {
+  if (!self.s.pool) return new MongoError('server instance is not connected');
+  if (self.s.pool.isDestroyed()) return new MongoError('server instance pool was destroyed');
+}
+
+function basicReadValidations(self, options) {
+  basicWriteValidations(self, options);
+
+  if (options.readPreference && !(options.readPreference instanceof ReadPreference)) {
+    throw new Error('readPreference must be an instance of ReadPreference');
+  }
+}
+
+/**
+ * Execute a command
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object} cmd The command hash
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.checkKeys=false] Specify if the bson parser should validate keys.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {Boolean} [options.fullResult=false] Return the full envelope instead of just the result document.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {opResultCallback} callback A callback function
+ */
+Server.prototype.command = function(ns, cmd, options, callback) {
+  var self = this;
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  var result = basicReadValidations(self, options);
+  if (result) return callback(result);
+
+  // Clone the options
+  options = Object.assign({}, options, { wireProtocolCommand: false });
+
+  // Debug log
+  if (self.s.logger.isDebug())
+    self.s.logger.debug(
+      f(
+        'executing command [%s] against %s',
+        JSON.stringify({
+          ns: ns,
+          cmd: cmd,
+          options: debugOptions(debugFields, options)
+        }),
+        self.name
+      )
+    );
+
+  // If we are not connected or have a disconnectHandler specified
+  if (disconnectHandler(self, 'command', ns, cmd, options, callback)) return;
+
+  // error if collation not supported
+  if (collationNotSupported(this, cmd)) {
+    return callback(new MongoError(`server ${this.name} does not support collation`));
+  }
+
+  wireProtocol.command(self, ns, cmd, options, callback);
+};
+
+/**
+ * Execute a query against the server
+ *
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object} cmd The command document for the query
+ * @param {object} options Optional settings
+ * @param {function} callback
+ */
+Server.prototype.query = function(ns, cmd, cursorState, options, callback) {
+  wireProtocol.query(this, ns, cmd, cursorState, options, callback);
+};
+
+/**
+ * Execute a `getMore` against the server
+ *
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object} cursorState State data associated with the cursor calling this method
+ * @param {object} options Optional settings
+ * @param {function} callback
+ */
+Server.prototype.getMore = function(ns, cursorState, batchSize, options, callback) {
+  wireProtocol.getMore(this, ns, cursorState, batchSize, options, callback);
+};
+
+/**
+ * Execute a `killCursors` command against the server
+ *
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object} cursorState State data associated with the cursor calling this method
+ * @param {function} callback
+ */
+Server.prototype.killCursors = function(ns, cursorState, callback) {
+  wireProtocol.killCursors(this, ns, cursorState, callback);
+};
+
+/**
+ * Insert one or more documents
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of documents to insert
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {opResultCallback} callback A callback function
+ */
+Server.prototype.insert = function(ns, ops, options, callback) {
+  var self = this;
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  var result = basicWriteValidations(self, options);
+  if (result) return callback(result);
+
+  // If we are not connected or have a disconnectHandler specified
+  if (disconnectHandler(self, 'insert', ns, ops, options, callback)) return;
+
+  // Setup the docs as an array
+  ops = Array.isArray(ops) ? ops : [ops];
+
+  // Execute write
+  return wireProtocol.insert(self, ns, ops, options, callback);
+};
+
+/**
+ * Perform one or more update operations
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of updates
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {opResultCallback} callback A callback function
+ */
+Server.prototype.update = function(ns, ops, options, callback) {
+  var self = this;
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  var result = basicWriteValidations(self, options);
+  if (result) return callback(result);
+
+  // If we are not connected or have a disconnectHandler specified
+  if (disconnectHandler(self, 'update', ns, ops, options, callback)) return;
+
+  // error if collation not supported
+  if (collationNotSupported(this, options)) {
+    return callback(new MongoError(`server ${this.name} does not support collation`));
+  }
+
+  // Setup the docs as an array
+  ops = Array.isArray(ops) ? ops : [ops];
+  // Execute write
+  return wireProtocol.update(self, ns, ops, options, callback);
+};
+
+/**
+ * Perform one or more remove operations
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {array} ops An array of removes
+ * @param {boolean} [options.ordered=true] Execute in order or out of order
+ * @param {object} [options.writeConcern={}] Write concern for the operation
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {opResultCallback} callback A callback function
+ */
+Server.prototype.remove = function(ns, ops, options, callback) {
+  var self = this;
+  if (typeof options === 'function') {
+    (callback = options), (options = {}), (options = options || {});
+  }
+
+  var result = basicWriteValidations(self, options);
+  if (result) return callback(result);
+
+  // If we are not connected or have a disconnectHandler specified
+  if (disconnectHandler(self, 'remove', ns, ops, options, callback)) return;
+
+  // error if collation not supported
+  if (collationNotSupported(this, options)) {
+    return callback(new MongoError(`server ${this.name} does not support collation`));
+  }
+
+  // Setup the docs as an array
+  ops = Array.isArray(ops) ? ops : [ops];
+  // Execute write
+  return wireProtocol.remove(self, ns, ops, options, callback);
+};
+
+/**
+ * Get a new cursor
+ * @method
+ * @param {string} ns The MongoDB fully qualified namespace (ex: db1.collection1)
+ * @param {object|Long} cmd Can be either a command returning a cursor or a cursorId
+ * @param {object} [options] Options for the cursor
+ * @param {object} [options.batchSize=0] Batchsize for the operation
+ * @param {array} [options.documents=[]] Initial documents list for cursor
+ * @param {ReadPreference} [options.readPreference] Specify read preference if command supports it
+ * @param {Boolean} [options.serializeFunctions=false] Specify if functions on an object should be serialized.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {ClientSession} [options.session=null] Session to use for the operation
+ * @param {object} [options.topology] The internal topology of the created cursor
+ * @returns {Cursor}
+ */
+Server.prototype.cursor = function(ns, cmd, options) {
+  options = options || {};
+  const topology = options.topology || this;
+
+  // Set up final cursor type
+  var FinalCursor = options.cursorFactory || this.s.Cursor;
+
+  // Return the cursor
+  return new FinalCursor(topology, ns, cmd, options);
+};
+
+/**
+ * Compare two server instances
+ * @method
+ * @param {Server} server Server to compare equality against
+ * @return {boolean}
+ */
+Server.prototype.equals = function(server) {
+  if (typeof server === 'string') return this.name.toLowerCase() === server.toLowerCase();
+  if (server.name) return this.name.toLowerCase() === server.name.toLowerCase();
+  return false;
+};
+
+/**
+ * All raw connections
+ * @method
+ * @return {Connection[]}
+ */
+Server.prototype.connections = function() {
+  return this.s.pool.allConnections();
+};
+
+/**
+ * Selects a server
+ * @method
+ * @param {function} selector Unused
+ * @param {ReadPreference} [options.readPreference] Unused
+ * @param {ClientSession} [options.session] Unused
+ * @return {Server}
+ */
+Server.prototype.selectServer = function(selector, options, callback) {
+  if (typeof selector === 'function' && typeof callback === 'undefined')
+    (callback = selector), (selector = undefined), (options = {});
+  if (typeof options === 'function')
+    (callback = options), (options = selector), (selector = undefined);
+
+  callback(null, this);
+};
+
+var listeners = ['close', 'error', 'timeout', 'parseError', 'connect'];
+
+/**
+ * Destroy the server connection
+ * @method
+ * @param {boolean} [options.emitClose=false] Emit close event on destroy
+ * @param {boolean} [options.emitDestroy=false] Emit destroy event on destroy
+ * @param {boolean} [options.force=false] Force destroy the pool
+ */
+Server.prototype.destroy = function(options, callback) {
+  if (this._destroyed) {
+    if (typeof callback === 'function') callback(null, null);
+    return;
+  }
+
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = options || {};
+  var self = this;
+
+  // Set the connections
+  if (serverAccounting) delete servers[this.id];
+
+  // Destroy the monitoring process if any
+  if (this.monitoringProcessId) {
+    clearTimeout(this.monitoringProcessId);
+  }
+
+  // No pool, return
+  if (!self.s.pool || this._destroyed) {
+    this._destroyed = true;
+    if (typeof callback === 'function') callback(null, null);
+    return;
+  }
+
+  this._destroyed = true;
+
+  // Emit close event
+  if (options.emitClose) {
+    self.emit('close', self);
+  }
+
+  // Emit destroy event
+  if (options.emitDestroy) {
+    self.emit('destroy', self);
+  }
+
+  // Remove all listeners
+  listeners.forEach(function(event) {
+    self.s.pool.removeAllListeners(event);
+  });
+
+  // Emit opening server event
+  if (self.listeners('serverClosed').length > 0)
+    self.emit('serverClosed', { topologyId: topologyId(self), address: self.name });
+
+  // Emit toplogy opening event if not in topology
+  if (self.listeners('topologyClosed').length > 0 && !self.s.inTopology) {
+    self.emit('topologyClosed', { topologyId: topologyId(self) });
+  }
+
+  if (self.s.logger.isDebug()) {
+    self.s.logger.debug(f('destroy called on server %s', self.name));
+  }
+
+  // Destroy the pool
+  this.s.pool.destroy(options.force, callback);
+};
+
+/**
+ * A server connect event, used to verify that the connection is up and running
+ *
+ * @event Server#connect
+ * @type {Server}
+ */
+
+/**
+ * A server reconnect event, used to verify that the server topology has reconnected
+ *
+ * @event Server#reconnect
+ * @type {Server}
+ */
+
+/**
+ * A server opening SDAM monitoring event
+ *
+ * @event Server#serverOpening
+ * @type {object}
+ */
+
+/**
+ * A server closed SDAM monitoring event
+ *
+ * @event Server#serverClosed
+ * @type {object}
+ */
+
+/**
+ * A server description SDAM change monitoring event
+ *
+ * @event Server#serverDescriptionChanged
+ * @type {object}
+ */
+
+/**
+ * A topology open SDAM event
+ *
+ * @event Server#topologyOpening
+ * @type {object}
+ */
+
+/**
+ * A topology closed SDAM event
+ *
+ * @event Server#topologyClosed
+ * @type {object}
+ */
+
+/**
+ * A topology structure SDAM change event
+ *
+ * @event Server#topologyDescriptionChanged
+ * @type {object}
+ */
+
+/**
+ * Server reconnect failed
+ *
+ * @event Server#reconnectFailed
+ * @type {Error}
+ */
+
+/**
+ * Server connection pool closed
+ *
+ * @event Server#close
+ * @type {object}
+ */
+
+/**
+ * Server connection pool caused an error
+ *
+ * @event Server#error
+ * @type {Error}
+ */
+
+/**
+ * Server destroyed was called
+ *
+ * @event Server#destroy
+ * @type {Server}
+ */
+
+module.exports = Server;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/topologies/shared.js b/NodeAPI/node_modules/mongodb/lib/core/topologies/shared.js
new file mode 100644
index 0000000000000000000000000000000000000000..1ec55919bbb1af2b90dd3b30be4761684c5abbb7
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/topologies/shared.js
@@ -0,0 +1,456 @@
+'use strict';
+const ReadPreference = require('./read_preference');
+const TopologyType = require('../sdam/common').TopologyType;
+const MongoError = require('../error').MongoError;
+const isRetryableWriteError = require('../error').isRetryableWriteError;
+const maxWireVersion = require('../utils').maxWireVersion;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const MMAPv1_RETRY_WRITES_ERROR_CODE = 20;
+
+/**
+ * Emit event if it exists
+ * @method
+ */
+function emitSDAMEvent(self, event, description) {
+  if (self.listeners(event).length > 0) {
+    self.emit(event, description);
+  }
+}
+
+function createCompressionInfo(options) {
+  if (!options.compression || !options.compression.compressors) {
+    return [];
+  }
+
+  // Check that all supplied compressors are valid
+  options.compression.compressors.forEach(function(compressor) {
+    if (compressor !== 'snappy' && compressor !== 'zlib') {
+      throw new Error('compressors must be at least one of snappy or zlib');
+    }
+  });
+
+  return options.compression.compressors;
+}
+
+function clone(object) {
+  return JSON.parse(JSON.stringify(object));
+}
+
+var getPreviousDescription = function(self) {
+  if (!self.s.serverDescription) {
+    self.s.serverDescription = {
+      address: self.name,
+      arbiters: [],
+      hosts: [],
+      passives: [],
+      type: 'Unknown'
+    };
+  }
+
+  return self.s.serverDescription;
+};
+
+var emitServerDescriptionChanged = function(self, description) {
+  if (self.listeners('serverDescriptionChanged').length > 0) {
+    // Emit the server description changed events
+    self.emit('serverDescriptionChanged', {
+      topologyId: self.s.topologyId !== -1 ? self.s.topologyId : self.id,
+      address: self.name,
+      previousDescription: getPreviousDescription(self),
+      newDescription: description
+    });
+
+    self.s.serverDescription = description;
+  }
+};
+
+var getPreviousTopologyDescription = function(self) {
+  if (!self.s.topologyDescription) {
+    self.s.topologyDescription = {
+      topologyType: 'Unknown',
+      servers: [
+        {
+          address: self.name,
+          arbiters: [],
+          hosts: [],
+          passives: [],
+          type: 'Unknown'
+        }
+      ]
+    };
+  }
+
+  return self.s.topologyDescription;
+};
+
+var emitTopologyDescriptionChanged = function(self, description) {
+  if (self.listeners('topologyDescriptionChanged').length > 0) {
+    // Emit the server description changed events
+    self.emit('topologyDescriptionChanged', {
+      topologyId: self.s.topologyId !== -1 ? self.s.topologyId : self.id,
+      address: self.name,
+      previousDescription: getPreviousTopologyDescription(self),
+      newDescription: description
+    });
+
+    self.s.serverDescription = description;
+  }
+};
+
+var changedIsMaster = function(self, currentIsmaster, ismaster) {
+  var currentType = getTopologyType(self, currentIsmaster);
+  var newType = getTopologyType(self, ismaster);
+  if (newType !== currentType) return true;
+  return false;
+};
+
+var getTopologyType = function(self, ismaster) {
+  if (!ismaster) {
+    ismaster = self.ismaster;
+  }
+
+  if (!ismaster) return 'Unknown';
+  if (ismaster.ismaster && ismaster.msg === 'isdbgrid') return 'Mongos';
+  if (ismaster.ismaster && !ismaster.hosts) return 'Standalone';
+  if (ismaster.ismaster) return 'RSPrimary';
+  if (ismaster.secondary) return 'RSSecondary';
+  if (ismaster.arbiterOnly) return 'RSArbiter';
+  return 'Unknown';
+};
+
+var inquireServerState = function(self) {
+  return function(callback) {
+    if (self.s.state === 'destroyed') return;
+    // Record response time
+    var start = new Date().getTime();
+
+    // emitSDAMEvent
+    emitSDAMEvent(self, 'serverHeartbeatStarted', { connectionId: self.name });
+
+    // Attempt to execute ismaster command
+    self.command('admin.$cmd', { ismaster: true }, { monitoring: true }, function(err, r) {
+      if (!err) {
+        // Legacy event sender
+        self.emit('ismaster', r, self);
+
+        // Calculate latencyMS
+        var latencyMS = new Date().getTime() - start;
+
+        // Server heart beat event
+        emitSDAMEvent(self, 'serverHeartbeatSucceeded', {
+          durationMS: latencyMS,
+          reply: r.result,
+          connectionId: self.name
+        });
+
+        // Did the server change
+        if (changedIsMaster(self, self.s.ismaster, r.result)) {
+          // Emit server description changed if something listening
+          emitServerDescriptionChanged(self, {
+            address: self.name,
+            arbiters: [],
+            hosts: [],
+            passives: [],
+            type: !self.s.inTopology ? 'Standalone' : getTopologyType(self)
+          });
+        }
+
+        // Updat ismaster view
+        self.s.ismaster = r.result;
+
+        // Set server response time
+        self.s.isMasterLatencyMS = latencyMS;
+      } else {
+        emitSDAMEvent(self, 'serverHeartbeatFailed', {
+          durationMS: latencyMS,
+          failure: err,
+          connectionId: self.name
+        });
+      }
+
+      // Peforming an ismaster monitoring callback operation
+      if (typeof callback === 'function') {
+        return callback(err, r);
+      }
+
+      // Perform another sweep
+      self.s.inquireServerStateTimeout = setTimeout(inquireServerState(self), self.s.haInterval);
+    });
+  };
+};
+
+//
+// Clone the options
+var cloneOptions = function(options) {
+  var opts = {};
+  for (var name in options) {
+    opts[name] = options[name];
+  }
+  return opts;
+};
+
+function Interval(fn, time) {
+  var timer = false;
+
+  this.start = function() {
+    if (!this.isRunning()) {
+      timer = setInterval(fn, time);
+    }
+
+    return this;
+  };
+
+  this.stop = function() {
+    clearInterval(timer);
+    timer = false;
+    return this;
+  };
+
+  this.isRunning = function() {
+    return timer !== false;
+  };
+}
+
+function Timeout(fn, time) {
+  var timer = false;
+  var func = () => {
+    if (timer) {
+      clearTimeout(timer);
+      timer = false;
+
+      fn();
+    }
+  };
+
+  this.start = function() {
+    if (!this.isRunning()) {
+      timer = setTimeout(func, time);
+    }
+    return this;
+  };
+
+  this.stop = function() {
+    clearTimeout(timer);
+    timer = false;
+    return this;
+  };
+
+  this.isRunning = function() {
+    return timer !== false;
+  };
+}
+
+function diff(previous, current) {
+  // Difference document
+  var diff = {
+    servers: []
+  };
+
+  // Previous entry
+  if (!previous) {
+    previous = { servers: [] };
+  }
+
+  // Check if we have any previous servers missing in the current ones
+  for (var i = 0; i < previous.servers.length; i++) {
+    var found = false;
+
+    for (var j = 0; j < current.servers.length; j++) {
+      if (current.servers[j].address.toLowerCase() === previous.servers[i].address.toLowerCase()) {
+        found = true;
+        break;
+      }
+    }
+
+    if (!found) {
+      // Add to the diff
+      diff.servers.push({
+        address: previous.servers[i].address,
+        from: previous.servers[i].type,
+        to: 'Unknown'
+      });
+    }
+  }
+
+  // Check if there are any severs that don't exist
+  for (j = 0; j < current.servers.length; j++) {
+    found = false;
+
+    // Go over all the previous servers
+    for (i = 0; i < previous.servers.length; i++) {
+      if (previous.servers[i].address.toLowerCase() === current.servers[j].address.toLowerCase()) {
+        found = true;
+        break;
+      }
+    }
+
+    // Add the server to the diff
+    if (!found) {
+      diff.servers.push({
+        address: current.servers[j].address,
+        from: 'Unknown',
+        to: current.servers[j].type
+      });
+    }
+  }
+
+  // Got through all the servers
+  for (i = 0; i < previous.servers.length; i++) {
+    var prevServer = previous.servers[i];
+
+    // Go through all current servers
+    for (j = 0; j < current.servers.length; j++) {
+      var currServer = current.servers[j];
+
+      // Matching server
+      if (prevServer.address.toLowerCase() === currServer.address.toLowerCase()) {
+        // We had a change in state
+        if (prevServer.type !== currServer.type) {
+          diff.servers.push({
+            address: prevServer.address,
+            from: prevServer.type,
+            to: currServer.type
+          });
+        }
+      }
+    }
+  }
+
+  // Return difference
+  return diff;
+}
+
+/**
+ * Shared function to determine clusterTime for a given topology
+ *
+ * @param {*} topology
+ * @param {*} clusterTime
+ */
+function resolveClusterTime(topology, $clusterTime) {
+  if (topology.clusterTime == null) {
+    topology.clusterTime = $clusterTime;
+  } else {
+    if ($clusterTime.clusterTime.greaterThan(topology.clusterTime.clusterTime)) {
+      topology.clusterTime = $clusterTime;
+    }
+  }
+}
+
+// NOTE: this is a temporary move until the topologies can be more formally refactored
+//       to share code.
+const SessionMixins = {
+  endSessions: function(sessions, callback) {
+    if (!Array.isArray(sessions)) {
+      sessions = [sessions];
+    }
+
+    // TODO:
+    //   When connected to a sharded cluster the endSessions command
+    //   can be sent to any mongos. When connected to a replica set the
+    //   endSessions command MUST be sent to the primary if the primary
+    //   is available, otherwise it MUST be sent to any available secondary.
+    //   Is it enough to use: ReadPreference.primaryPreferred ?
+    this.command(
+      'admin.$cmd',
+      { endSessions: sessions },
+      { readPreference: ReadPreference.primaryPreferred },
+      () => {
+        // intentionally ignored, per spec
+        if (typeof callback === 'function') callback();
+      }
+    );
+  }
+};
+
+function topologyType(topology) {
+  if (topology.description) {
+    return topology.description.type;
+  }
+
+  if (topology.type === 'mongos') {
+    return TopologyType.Sharded;
+  } else if (topology.type === 'replset') {
+    return TopologyType.ReplicaSetWithPrimary;
+  }
+
+  return TopologyType.Single;
+}
+
+const RETRYABLE_WIRE_VERSION = 6;
+
+/**
+ * Determines whether the provided topology supports retryable writes
+ *
+ * @param {Mongos|Replset} topology
+ */
+const isRetryableWritesSupported = function(topology) {
+  const maxWireVersion = topology.lastIsMaster().maxWireVersion;
+  if (maxWireVersion < RETRYABLE_WIRE_VERSION) {
+    return false;
+  }
+
+  if (!topology.logicalSessionTimeoutMinutes) {
+    return false;
+  }
+
+  if (topologyType(topology) === TopologyType.Single) {
+    return false;
+  }
+
+  return true;
+};
+
+const MMAPv1_RETRY_WRITES_ERROR_MESSAGE =
+  'This MongoDB deployment does not support retryable writes. Please add retryWrites=false to your connection string.';
+
+function getMMAPError(err) {
+  if (err.code !== MMAPv1_RETRY_WRITES_ERROR_CODE || !err.errmsg.includes('Transaction numbers')) {
+    return err;
+  }
+
+  // According to the retryable writes spec, we must replace the error message in this case.
+  // We need to replace err.message so the thrown message is correct and we need to replace err.errmsg to meet the spec requirement.
+  const newErr = new MongoError({
+    message: MMAPv1_RETRY_WRITES_ERROR_MESSAGE,
+    errmsg: MMAPv1_RETRY_WRITES_ERROR_MESSAGE,
+    originalError: err
+  });
+  return newErr;
+}
+
+// NOTE: only used for legacy topology types
+function legacyIsRetryableWriteError(err, topology) {
+  if (!(err instanceof MongoError)) {
+    return false;
+  }
+
+  // if pre-4.4 server, then add error label if its a retryable write error
+  if (
+    isRetryableWritesSupported(topology) &&
+    (err instanceof MongoNetworkError ||
+      (maxWireVersion(topology) < 9 && isRetryableWriteError(err)))
+  ) {
+    err.addErrorLabel('RetryableWriteError');
+  }
+
+  return err.hasErrorLabel('RetryableWriteError');
+}
+
+module.exports = {
+  SessionMixins,
+  resolveClusterTime,
+  inquireServerState,
+  getTopologyType,
+  emitServerDescriptionChanged,
+  emitTopologyDescriptionChanged,
+  cloneOptions,
+  createCompressionInfo,
+  clone,
+  diff,
+  Interval,
+  Timeout,
+  isRetryableWritesSupported,
+  getMMAPError,
+  topologyType,
+  legacyIsRetryableWriteError
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/transactions.js b/NodeAPI/node_modules/mongodb/lib/core/transactions.js
new file mode 100644
index 0000000000000000000000000000000000000000..d0b0b73d6e798d4e889d3773dd0a48388565e9b9
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/transactions.js
@@ -0,0 +1,179 @@
+'use strict';
+const MongoError = require('./error').MongoError;
+const ReadPreference = require('./topologies/read_preference');
+const ReadConcern = require('../read_concern');
+const WriteConcern = require('../write_concern');
+
+let TxnState;
+let stateMachine;
+
+(() => {
+  const NO_TRANSACTION = 'NO_TRANSACTION';
+  const STARTING_TRANSACTION = 'STARTING_TRANSACTION';
+  const TRANSACTION_IN_PROGRESS = 'TRANSACTION_IN_PROGRESS';
+  const TRANSACTION_COMMITTED = 'TRANSACTION_COMMITTED';
+  const TRANSACTION_COMMITTED_EMPTY = 'TRANSACTION_COMMITTED_EMPTY';
+  const TRANSACTION_ABORTED = 'TRANSACTION_ABORTED';
+
+  TxnState = {
+    NO_TRANSACTION,
+    STARTING_TRANSACTION,
+    TRANSACTION_IN_PROGRESS,
+    TRANSACTION_COMMITTED,
+    TRANSACTION_COMMITTED_EMPTY,
+    TRANSACTION_ABORTED
+  };
+
+  stateMachine = {
+    [NO_TRANSACTION]: [NO_TRANSACTION, STARTING_TRANSACTION],
+    [STARTING_TRANSACTION]: [
+      TRANSACTION_IN_PROGRESS,
+      TRANSACTION_COMMITTED,
+      TRANSACTION_COMMITTED_EMPTY,
+      TRANSACTION_ABORTED
+    ],
+    [TRANSACTION_IN_PROGRESS]: [
+      TRANSACTION_IN_PROGRESS,
+      TRANSACTION_COMMITTED,
+      TRANSACTION_ABORTED
+    ],
+    [TRANSACTION_COMMITTED]: [
+      TRANSACTION_COMMITTED,
+      TRANSACTION_COMMITTED_EMPTY,
+      STARTING_TRANSACTION,
+      NO_TRANSACTION
+    ],
+    [TRANSACTION_ABORTED]: [STARTING_TRANSACTION, NO_TRANSACTION],
+    [TRANSACTION_COMMITTED_EMPTY]: [TRANSACTION_COMMITTED_EMPTY, NO_TRANSACTION]
+  };
+})();
+
+/**
+ * The MongoDB ReadConcern, which allows for control of the consistency and isolation properties
+ * of the data read from replica sets and replica set shards.
+ * @typedef {Object} ReadConcern
+ * @property {'local'|'available'|'majority'|'linearizable'|'snapshot'} level The readConcern Level
+ * @see https://docs.mongodb.com/manual/reference/read-concern/
+ */
+
+/**
+ * A MongoDB WriteConcern, which describes the level of acknowledgement
+ * requested from MongoDB for write operations.
+ * @typedef {Object} WriteConcern
+ * @property {number|'majority'|string} [w=1] requests acknowledgement that the write operation has
+ * propagated to a specified number of mongod hosts
+ * @property {boolean} [j=false] requests acknowledgement from MongoDB that the write operation has
+ * been written to the journal
+ * @property {number} [wtimeout] a time limit, in milliseconds, for the write concern
+ * @see https://docs.mongodb.com/manual/reference/write-concern/
+ */
+
+/**
+ * Configuration options for a transaction.
+ * @typedef {Object} TransactionOptions
+ * @property {ReadConcern} [readConcern] A default read concern for commands in this transaction
+ * @property {WriteConcern} [writeConcern] A default writeConcern for commands in this transaction
+ * @property {ReadPreference} [readPreference] A default read preference for commands in this transaction
+ */
+
+/**
+ * A class maintaining state related to a server transaction. Internal Only
+ * @ignore
+ */
+class Transaction {
+  /**
+   * Create a transaction
+   *
+   * @ignore
+   * @param {TransactionOptions} [options] Optional settings
+   */
+  constructor(options) {
+    options = options || {};
+
+    this.state = TxnState.NO_TRANSACTION;
+    this.options = {};
+
+    const writeConcern = WriteConcern.fromOptions(options);
+    if (writeConcern) {
+      if (writeConcern.w <= 0) {
+        throw new MongoError('Transactions do not support unacknowledged write concern');
+      }
+
+      this.options.writeConcern = writeConcern;
+    }
+
+    if (options.readConcern) {
+      this.options.readConcern = ReadConcern.fromOptions(options);
+    }
+
+    if (options.readPreference) {
+      this.options.readPreference = ReadPreference.fromOptions(options);
+    }
+
+    if (options.maxCommitTimeMS) {
+      this.options.maxTimeMS = options.maxCommitTimeMS;
+    }
+
+    // TODO: This isn't technically necessary
+    this._pinnedServer = undefined;
+    this._recoveryToken = undefined;
+  }
+
+  get server() {
+    return this._pinnedServer;
+  }
+
+  get recoveryToken() {
+    return this._recoveryToken;
+  }
+
+  get isPinned() {
+    return !!this.server;
+  }
+
+  /**
+   * @ignore
+   * @return Whether this session is presently in a transaction
+   */
+  get isActive() {
+    return (
+      [TxnState.STARTING_TRANSACTION, TxnState.TRANSACTION_IN_PROGRESS].indexOf(this.state) !== -1
+    );
+  }
+
+  /**
+   * Transition the transaction in the state machine
+   * @ignore
+   * @param {TxnState} state The new state to transition to
+   */
+  transition(nextState) {
+    const nextStates = stateMachine[this.state];
+    if (nextStates && nextStates.indexOf(nextState) !== -1) {
+      this.state = nextState;
+      if (this.state === TxnState.NO_TRANSACTION || this.state === TxnState.STARTING_TRANSACTION) {
+        this.unpinServer();
+      }
+      return;
+    }
+
+    throw new MongoError(
+      `Attempted illegal state transition from [${this.state}] to [${nextState}]`
+    );
+  }
+
+  pinServer(server) {
+    if (this.isActive) {
+      this._pinnedServer = server;
+    }
+  }
+
+  unpinServer() {
+    this._pinnedServer = undefined;
+  }
+}
+
+function isTransactionCommand(command) {
+  return !!(command.commitTransaction || command.abortTransaction);
+}
+
+module.exports = { TxnState, Transaction, isTransactionCommand };
diff --git a/NodeAPI/node_modules/mongodb/lib/core/uri_parser.js b/NodeAPI/node_modules/mongodb/lib/core/uri_parser.js
new file mode 100644
index 0000000000000000000000000000000000000000..bcb7dd3748ccd868b034cb73f7d67899b9ccd54e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/uri_parser.js
@@ -0,0 +1,731 @@
+'use strict';
+const URL = require('url');
+const qs = require('querystring');
+const dns = require('dns');
+const MongoParseError = require('./error').MongoParseError;
+const ReadPreference = require('./topologies/read_preference');
+const emitWarningOnce = require('../utils').emitWarningOnce;
+
+/**
+ * The following regular expression validates a connection string and breaks the
+ * provide string into the following capture groups: [protocol, username, password, hosts]
+ */
+const HOSTS_RX = /(mongodb(?:\+srv|)):\/\/(?: (?:[^:]*) (?: : ([^@]*) )? @ )?([^/?]*)(?:\/|)(.*)/;
+
+// Options that reference file paths should not be parsed
+const FILE_PATH_OPTIONS = new Set(
+  ['sslCA', 'sslCert', 'sslKey', 'tlsCAFile', 'tlsCertificateKeyFile'].map(key => key.toLowerCase())
+);
+
+/**
+ * Determines whether a provided address matches the provided parent domain in order
+ * to avoid certain attack vectors.
+ *
+ * @param {String} srvAddress The address to check against a domain
+ * @param {String} parentDomain The domain to check the provided address against
+ * @return {Boolean} Whether the provided address matches the parent domain
+ */
+function matchesParentDomain(srvAddress, parentDomain) {
+  const regex = /^.*?\./;
+  const srv = `.${srvAddress.replace(regex, '')}`;
+  const parent = `.${parentDomain.replace(regex, '')}`;
+  return srv.endsWith(parent);
+}
+
+/**
+ * Lookup a `mongodb+srv` connection string, combine the parts and reparse it as a normal
+ * connection string.
+ *
+ * @param {string} uri The connection string to parse
+ * @param {object} options Optional user provided connection string options
+ * @param {function} callback
+ */
+function parseSrvConnectionString(uri, options, callback) {
+  const result = URL.parse(uri, true);
+
+  if (options.directConnection || options.directconnection) {
+    return callback(new MongoParseError('directConnection not supported with SRV URI'));
+  }
+
+  if (result.hostname.split('.').length < 3) {
+    return callback(new MongoParseError('URI does not have hostname, domain name and tld'));
+  }
+
+  result.domainLength = result.hostname.split('.').length;
+  if (result.pathname && result.pathname.match(',')) {
+    return callback(new MongoParseError('Invalid URI, cannot contain multiple hostnames'));
+  }
+
+  if (result.port) {
+    return callback(new MongoParseError(`Ports not accepted with '${PROTOCOL_MONGODB_SRV}' URIs`));
+  }
+
+  // Resolve the SRV record and use the result as the list of hosts to connect to.
+  const lookupAddress = result.host;
+  dns.resolveSrv(`_mongodb._tcp.${lookupAddress}`, (err, addresses) => {
+    if (err) return callback(err);
+
+    if (addresses.length === 0) {
+      return callback(new MongoParseError('No addresses found at host'));
+    }
+
+    for (let i = 0; i < addresses.length; i++) {
+      if (!matchesParentDomain(addresses[i].name, result.hostname, result.domainLength)) {
+        return callback(
+          new MongoParseError('Server record does not share hostname with parent URI')
+        );
+      }
+    }
+
+    // Convert the original URL to a non-SRV URL.
+    result.protocol = 'mongodb';
+    result.host = addresses.map(address => `${address.name}:${address.port}`).join(',');
+
+    // Default to SSL true if it's not specified.
+    if (
+      !('ssl' in options) &&
+      (!result.search || !('ssl' in result.query) || result.query.ssl === null)
+    ) {
+      result.query.ssl = true;
+    }
+
+    // Resolve TXT record and add options from there if they exist.
+    dns.resolveTxt(lookupAddress, (err, record) => {
+      if (err) {
+        if (err.code !== 'ENODATA' && err.code !== 'ENOTFOUND') {
+          return callback(err);
+        }
+        record = null;
+      }
+
+      if (record) {
+        if (record.length > 1) {
+          return callback(new MongoParseError('Multiple text records not allowed'));
+        }
+
+        record = qs.parse(record[0].join(''));
+        if (Object.keys(record).some(key => key !== 'authSource' && key !== 'replicaSet')) {
+          return callback(
+            new MongoParseError('Text record must only set `authSource` or `replicaSet`')
+          );
+        }
+
+        result.query = Object.assign({}, record, result.query);
+      }
+
+      // Set completed options back into the URL object.
+      result.search = qs.stringify(result.query);
+
+      const finalString = URL.format(result);
+      parseConnectionString(finalString, options, (err, ret) => {
+        if (err) {
+          callback(err);
+          return;
+        }
+
+        callback(null, Object.assign({}, ret, { srvHost: lookupAddress }));
+      });
+    });
+  });
+}
+
+/**
+ * Parses a query string item according to the connection string spec
+ *
+ * @param {string} key The key for the parsed value
+ * @param {Array|String} value The value to parse
+ * @return {Array|Object|String} The parsed value
+ */
+function parseQueryStringItemValue(key, value) {
+  if (Array.isArray(value)) {
+    // deduplicate and simplify arrays
+    value = value.filter((v, idx) => value.indexOf(v) === idx);
+    if (value.length === 1) value = value[0];
+  } else if (value.indexOf(':') > 0) {
+    value = value.split(',').reduce((result, pair) => {
+      const parts = pair.split(':');
+      result[parts[0]] = parseQueryStringItemValue(key, parts[1]);
+      return result;
+    }, {});
+  } else if (value.indexOf(',') > 0) {
+    value = value.split(',').map(v => {
+      return parseQueryStringItemValue(key, v);
+    });
+  } else if (value.toLowerCase() === 'true' || value.toLowerCase() === 'false') {
+    value = value.toLowerCase() === 'true';
+  } else if (!Number.isNaN(value) && !STRING_OPTIONS.has(key)) {
+    const numericValue = parseFloat(value);
+    if (!Number.isNaN(numericValue)) {
+      value = parseFloat(value);
+    }
+  }
+
+  return value;
+}
+
+// Options that are known boolean types
+const BOOLEAN_OPTIONS = new Set([
+  'slaveok',
+  'slave_ok',
+  'sslvalidate',
+  'fsync',
+  'safe',
+  'retrywrites',
+  'j'
+]);
+
+// Known string options, only used to bypass Number coercion in `parseQueryStringItemValue`
+const STRING_OPTIONS = new Set(['authsource', 'replicaset']);
+
+// Supported text representations of auth mechanisms
+// NOTE: this list exists in native already, if it is merged here we should deduplicate
+const AUTH_MECHANISMS = new Set([
+  'GSSAPI',
+  'MONGODB-AWS',
+  'MONGODB-X509',
+  'MONGODB-CR',
+  'DEFAULT',
+  'SCRAM-SHA-1',
+  'SCRAM-SHA-256',
+  'PLAIN'
+]);
+
+// Lookup table used to translate normalized (lower-cased) forms of connection string
+// options to their expected camelCase version
+const CASE_TRANSLATION = {
+  replicaset: 'replicaSet',
+  connecttimeoutms: 'connectTimeoutMS',
+  sockettimeoutms: 'socketTimeoutMS',
+  maxpoolsize: 'maxPoolSize',
+  minpoolsize: 'minPoolSize',
+  maxidletimems: 'maxIdleTimeMS',
+  waitqueuemultiple: 'waitQueueMultiple',
+  waitqueuetimeoutms: 'waitQueueTimeoutMS',
+  wtimeoutms: 'wtimeoutMS',
+  readconcern: 'readConcern',
+  readconcernlevel: 'readConcernLevel',
+  readpreference: 'readPreference',
+  maxstalenessseconds: 'maxStalenessSeconds',
+  readpreferencetags: 'readPreferenceTags',
+  authsource: 'authSource',
+  authmechanism: 'authMechanism',
+  authmechanismproperties: 'authMechanismProperties',
+  gssapiservicename: 'gssapiServiceName',
+  localthresholdms: 'localThresholdMS',
+  serverselectiontimeoutms: 'serverSelectionTimeoutMS',
+  serverselectiontryonce: 'serverSelectionTryOnce',
+  heartbeatfrequencyms: 'heartbeatFrequencyMS',
+  retrywrites: 'retryWrites',
+  uuidrepresentation: 'uuidRepresentation',
+  zlibcompressionlevel: 'zlibCompressionLevel',
+  tlsallowinvalidcertificates: 'tlsAllowInvalidCertificates',
+  tlsallowinvalidhostnames: 'tlsAllowInvalidHostnames',
+  tlsinsecure: 'tlsInsecure',
+  tlscafile: 'tlsCAFile',
+  tlscertificatekeyfile: 'tlsCertificateKeyFile',
+  tlscertificatekeyfilepassword: 'tlsCertificateKeyFilePassword',
+  wtimeout: 'wTimeoutMS',
+  j: 'journal',
+  directconnection: 'directConnection'
+};
+
+/**
+ * Sets the value for `key`, allowing for any required translation
+ *
+ * @param {object} obj The object to set the key on
+ * @param {string} key The key to set the value for
+ * @param {*} value The value to set
+ * @param {object} options The options used for option parsing
+ */
+function applyConnectionStringOption(obj, key, value, options) {
+  // simple key translation
+  if (key === 'journal') {
+    key = 'j';
+  } else if (key === 'wtimeoutms') {
+    key = 'wtimeout';
+  }
+
+  // more complicated translation
+  if (BOOLEAN_OPTIONS.has(key)) {
+    value = value === 'true' || value === true;
+  } else if (key === 'appname') {
+    value = decodeURIComponent(value);
+  } else if (key === 'readconcernlevel') {
+    obj['readConcernLevel'] = value;
+    key = 'readconcern';
+    value = { level: value };
+  }
+
+  // simple validation
+  if (key === 'compressors') {
+    value = Array.isArray(value) ? value : [value];
+
+    if (!value.every(c => c === 'snappy' || c === 'zlib')) {
+      throw new MongoParseError(
+        'Value for `compressors` must be at least one of: `snappy`, `zlib`'
+      );
+    }
+  }
+
+  if (key === 'authmechanism' && !AUTH_MECHANISMS.has(value)) {
+    throw new MongoParseError(
+      `Value for authMechanism must be one of: ${Array.from(AUTH_MECHANISMS).join(
+        ', '
+      )}, found: ${value}`
+    );
+  }
+
+  if (key === 'readpreference' && !ReadPreference.isValid(value)) {
+    throw new MongoParseError(
+      'Value for `readPreference` must be one of: `primary`, `primaryPreferred`, `secondary`, `secondaryPreferred`, `nearest`'
+    );
+  }
+
+  if (key === 'zlibcompressionlevel' && (value < -1 || value > 9)) {
+    throw new MongoParseError('zlibCompressionLevel must be an integer between -1 and 9');
+  }
+
+  // special cases
+  if (key === 'compressors' || key === 'zlibcompressionlevel') {
+    obj.compression = obj.compression || {};
+    obj = obj.compression;
+  }
+
+  if (key === 'authmechanismproperties') {
+    if (typeof value.SERVICE_NAME === 'string') obj.gssapiServiceName = value.SERVICE_NAME;
+    if (typeof value.SERVICE_REALM === 'string') obj.gssapiServiceRealm = value.SERVICE_REALM;
+    if (typeof value.CANONICALIZE_HOST_NAME !== 'undefined') {
+      obj.gssapiCanonicalizeHostName = value.CANONICALIZE_HOST_NAME;
+    }
+  }
+
+  if (key === 'readpreferencetags') {
+    value = Array.isArray(value) ? splitArrayOfMultipleReadPreferenceTags(value) : [value];
+  }
+
+  // set the actual value
+  if (options.caseTranslate && CASE_TRANSLATION[key]) {
+    obj[CASE_TRANSLATION[key]] = value;
+    return;
+  }
+
+  obj[key] = value;
+}
+
+const USERNAME_REQUIRED_MECHANISMS = new Set([
+  'GSSAPI',
+  'MONGODB-CR',
+  'PLAIN',
+  'SCRAM-SHA-1',
+  'SCRAM-SHA-256'
+]);
+
+function splitArrayOfMultipleReadPreferenceTags(value) {
+  const parsedTags = [];
+
+  for (let i = 0; i < value.length; i++) {
+    parsedTags[i] = {};
+    value[i].split(',').forEach(individualTag => {
+      const splitTag = individualTag.split(':');
+      parsedTags[i][splitTag[0]] = splitTag[1];
+    });
+  }
+
+  return parsedTags;
+}
+
+/**
+ * Modifies the parsed connection string object taking into account expectations we
+ * have for authentication-related options.
+ *
+ * @param {object} parsed The parsed connection string result
+ * @return The parsed connection string result possibly modified for auth expectations
+ */
+function applyAuthExpectations(parsed) {
+  if (parsed.options == null) {
+    return;
+  }
+
+  const options = parsed.options;
+  const authSource = options.authsource || options.authSource;
+  if (authSource != null) {
+    parsed.auth = Object.assign({}, parsed.auth, { db: authSource });
+  }
+
+  const authMechanism = options.authmechanism || options.authMechanism;
+  if (authMechanism != null) {
+    if (
+      USERNAME_REQUIRED_MECHANISMS.has(authMechanism) &&
+      (!parsed.auth || parsed.auth.username == null)
+    ) {
+      throw new MongoParseError(`Username required for mechanism \`${authMechanism}\``);
+    }
+
+    if (authMechanism === 'GSSAPI') {
+      if (authSource != null && authSource !== '$external') {
+        throw new MongoParseError(
+          `Invalid source \`${authSource}\` for mechanism \`${authMechanism}\` specified.`
+        );
+      }
+
+      parsed.auth = Object.assign({}, parsed.auth, { db: '$external' });
+    }
+
+    if (authMechanism === 'MONGODB-AWS') {
+      if (authSource != null && authSource !== '$external') {
+        throw new MongoParseError(
+          `Invalid source \`${authSource}\` for mechanism \`${authMechanism}\` specified.`
+        );
+      }
+
+      parsed.auth = Object.assign({}, parsed.auth, { db: '$external' });
+    }
+
+    if (authMechanism === 'MONGODB-X509') {
+      if (parsed.auth && parsed.auth.password != null) {
+        throw new MongoParseError(`Password not allowed for mechanism \`${authMechanism}\``);
+      }
+
+      if (authSource != null && authSource !== '$external') {
+        throw new MongoParseError(
+          `Invalid source \`${authSource}\` for mechanism \`${authMechanism}\` specified.`
+        );
+      }
+
+      parsed.auth = Object.assign({}, parsed.auth, { db: '$external' });
+    }
+
+    if (authMechanism === 'PLAIN') {
+      if (parsed.auth && parsed.auth.db == null) {
+        parsed.auth = Object.assign({}, parsed.auth, { db: '$external' });
+      }
+    }
+  }
+
+  // default to `admin` if nothing else was resolved
+  if (parsed.auth && parsed.auth.db == null) {
+    parsed.auth = Object.assign({}, parsed.auth, { db: 'admin' });
+  }
+
+  return parsed;
+}
+
+/**
+ * Parses a query string according the connection string spec.
+ *
+ * @param {String} query The query string to parse
+ * @param {object} [options] The options used for options parsing
+ * @return {Object|Error} The parsed query string as an object, or an error if one was encountered
+ */
+function parseQueryString(query, options) {
+  const result = {};
+  let parsedQueryString = qs.parse(query);
+
+  checkTLSOptions(parsedQueryString);
+
+  for (const key in parsedQueryString) {
+    const value = parsedQueryString[key];
+    if (value === '' || value == null) {
+      throw new MongoParseError('Incomplete key value pair for option');
+    }
+
+    const normalizedKey = key.toLowerCase();
+    const parsedValue = FILE_PATH_OPTIONS.has(normalizedKey)
+      ? value
+      : parseQueryStringItemValue(normalizedKey, value);
+    applyConnectionStringOption(result, normalizedKey, parsedValue, options);
+  }
+
+  // special cases for known deprecated options
+  if (result.wtimeout && result.wtimeoutms) {
+    delete result.wtimeout;
+    emitWarningOnce('Unsupported option `wtimeout` specified');
+  }
+
+  return Object.keys(result).length ? result : null;
+}
+
+/// Adds support for modern `tls` variants of out `ssl` options
+function translateTLSOptions(queryString) {
+  if (queryString.tls) {
+    queryString.ssl = queryString.tls;
+  }
+
+  if (queryString.tlsInsecure) {
+    queryString.checkServerIdentity = false;
+    queryString.sslValidate = false;
+  } else {
+    Object.assign(queryString, {
+      checkServerIdentity: queryString.tlsAllowInvalidHostnames ? false : true,
+      sslValidate: queryString.tlsAllowInvalidCertificates ? false : true
+    });
+  }
+
+  if (queryString.tlsCAFile) {
+    queryString.ssl = true;
+    queryString.sslCA = queryString.tlsCAFile;
+  }
+
+  if (queryString.tlsCertificateKeyFile) {
+    queryString.ssl = true;
+    if (queryString.tlsCertificateFile) {
+      queryString.sslCert = queryString.tlsCertificateFile;
+      queryString.sslKey = queryString.tlsCertificateKeyFile;
+    } else {
+      queryString.sslKey = queryString.tlsCertificateKeyFile;
+      queryString.sslCert = queryString.tlsCertificateKeyFile;
+    }
+  }
+
+  if (queryString.tlsCertificateKeyFilePassword) {
+    queryString.ssl = true;
+    queryString.sslPass = queryString.tlsCertificateKeyFilePassword;
+  }
+
+  return queryString;
+}
+
+/**
+ * Checks a query string for invalid tls options according to the URI options spec.
+ *
+ * @param {string} queryString The query string to check
+ * @throws {MongoParseError}
+ */
+function checkTLSOptions(queryString) {
+  const queryStringKeys = Object.keys(queryString);
+  if (
+    queryStringKeys.indexOf('tlsInsecure') !== -1 &&
+    (queryStringKeys.indexOf('tlsAllowInvalidCertificates') !== -1 ||
+      queryStringKeys.indexOf('tlsAllowInvalidHostnames') !== -1)
+  ) {
+    throw new MongoParseError(
+      'The `tlsInsecure` option cannot be used with `tlsAllowInvalidCertificates` or `tlsAllowInvalidHostnames`.'
+    );
+  }
+
+  const tlsValue = assertTlsOptionsAreEqual('tls', queryString, queryStringKeys);
+  const sslValue = assertTlsOptionsAreEqual('ssl', queryString, queryStringKeys);
+
+  if (tlsValue != null && sslValue != null) {
+    if (tlsValue !== sslValue) {
+      throw new MongoParseError('All values of `tls` and `ssl` must be the same.');
+    }
+  }
+}
+
+/**
+ * Checks a query string to ensure all tls/ssl options are the same.
+ *
+ * @param {string} key The key (tls or ssl) to check
+ * @param {string} queryString The query string to check
+ * @throws {MongoParseError}
+ * @return The value of the tls/ssl option
+ */
+function assertTlsOptionsAreEqual(optionName, queryString, queryStringKeys) {
+  const queryStringHasTLSOption = queryStringKeys.indexOf(optionName) !== -1;
+
+  let optionValue;
+  if (Array.isArray(queryString[optionName])) {
+    optionValue = queryString[optionName][0];
+  } else {
+    optionValue = queryString[optionName];
+  }
+
+  if (queryStringHasTLSOption) {
+    if (Array.isArray(queryString[optionName])) {
+      const firstValue = queryString[optionName][0];
+      queryString[optionName].forEach(tlsValue => {
+        if (tlsValue !== firstValue) {
+          throw new MongoParseError(`All values of ${optionName} must be the same.`);
+        }
+      });
+    }
+  }
+
+  return optionValue;
+}
+
+const PROTOCOL_MONGODB = 'mongodb';
+const PROTOCOL_MONGODB_SRV = 'mongodb+srv';
+const SUPPORTED_PROTOCOLS = [PROTOCOL_MONGODB, PROTOCOL_MONGODB_SRV];
+
+/**
+ * Parses a MongoDB connection string
+ *
+ * @param {*} uri the MongoDB connection string to parse
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.caseTranslate] Whether the parser should translate options back into camelCase after normalization
+ * @param {parseCallback} callback
+ */
+function parseConnectionString(uri, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, { caseTranslate: true }, options);
+
+  // Check for bad uris before we parse
+  try {
+    URL.parse(uri);
+  } catch (e) {
+    return callback(new MongoParseError('URI malformed, cannot be parsed'));
+  }
+
+  const cap = uri.match(HOSTS_RX);
+  if (!cap) {
+    return callback(new MongoParseError('Invalid connection string'));
+  }
+
+  const protocol = cap[1];
+  if (SUPPORTED_PROTOCOLS.indexOf(protocol) === -1) {
+    return callback(new MongoParseError('Invalid protocol provided'));
+  }
+
+  const dbAndQuery = cap[4].split('?');
+  const db = dbAndQuery.length > 0 ? dbAndQuery[0] : null;
+  const query = dbAndQuery.length > 1 ? dbAndQuery[1] : null;
+
+  let parsedOptions;
+  try {
+    parsedOptions = parseQueryString(query, options);
+  } catch (parseError) {
+    return callback(parseError);
+  }
+
+  parsedOptions = Object.assign({}, parsedOptions, options);
+
+  if (protocol === PROTOCOL_MONGODB_SRV) {
+    return parseSrvConnectionString(uri, parsedOptions, callback);
+  }
+
+  const auth = { username: null, password: null, db: db && db !== '' ? qs.unescape(db) : null };
+  if (parsedOptions.auth) {
+    // maintain support for legacy options passed into `MongoClient`
+    if (parsedOptions.auth.username) auth.username = parsedOptions.auth.username;
+    if (parsedOptions.auth.user) auth.username = parsedOptions.auth.user;
+    if (parsedOptions.auth.password) auth.password = parsedOptions.auth.password;
+  } else {
+    if (parsedOptions.username) auth.username = parsedOptions.username;
+    if (parsedOptions.user) auth.username = parsedOptions.user;
+    if (parsedOptions.password) auth.password = parsedOptions.password;
+  }
+
+  if (cap[4].split('?')[0].indexOf('@') !== -1) {
+    return callback(new MongoParseError('Unescaped slash in userinfo section'));
+  }
+
+  const authorityParts = cap[3].split('@');
+  if (authorityParts.length > 2) {
+    return callback(new MongoParseError('Unescaped at-sign in authority section'));
+  }
+
+  if (authorityParts[0] == null || authorityParts[0] === '') {
+    return callback(new MongoParseError('No username provided in authority section'));
+  }
+
+  if (authorityParts.length > 1) {
+    const authParts = authorityParts.shift().split(':');
+    if (authParts.length > 2) {
+      return callback(new MongoParseError('Unescaped colon in authority section'));
+    }
+
+    if (authParts[0] === '') {
+      return callback(new MongoParseError('Invalid empty username provided'));
+    }
+
+    if (!auth.username) auth.username = qs.unescape(authParts[0]);
+    if (!auth.password) auth.password = authParts[1] ? qs.unescape(authParts[1]) : null;
+  }
+
+  let hostParsingError = null;
+  const hosts = authorityParts
+    .shift()
+    .split(',')
+    .map(host => {
+      let parsedHost = URL.parse(`mongodb://${host}`);
+      if (parsedHost.path === '/:') {
+        hostParsingError = new MongoParseError('Double colon in host identifier');
+        return null;
+      }
+
+      // heuristically determine if we're working with a domain socket
+      if (host.match(/\.sock/)) {
+        parsedHost.hostname = qs.unescape(host);
+        parsedHost.port = null;
+      }
+
+      if (Number.isNaN(parsedHost.port)) {
+        hostParsingError = new MongoParseError('Invalid port (non-numeric string)');
+        return;
+      }
+
+      const result = {
+        host: parsedHost.hostname,
+        port: parsedHost.port ? parseInt(parsedHost.port) : 27017
+      };
+
+      if (result.port === 0) {
+        hostParsingError = new MongoParseError('Invalid port (zero) with hostname');
+        return;
+      }
+
+      if (result.port > 65535) {
+        hostParsingError = new MongoParseError('Invalid port (larger than 65535) with hostname');
+        return;
+      }
+
+      if (result.port < 0) {
+        hostParsingError = new MongoParseError('Invalid port (negative number)');
+        return;
+      }
+
+      return result;
+    })
+    .filter(host => !!host);
+
+  if (hostParsingError) {
+    return callback(hostParsingError);
+  }
+
+  if (hosts.length === 0 || hosts[0].host === '' || hosts[0].host === null) {
+    return callback(new MongoParseError('No hostname or hostnames provided in connection string'));
+  }
+
+  const directConnection = !!parsedOptions.directConnection;
+  if (directConnection && hosts.length !== 1) {
+    // If the option is set to true, the driver MUST validate that there is exactly one host given
+    // in the host list in the URI, and fail client creation otherwise.
+    return callback(new MongoParseError('directConnection option requires exactly one host'));
+  }
+
+  // NOTE: this behavior will go away in v4.0, we will always auto discover there
+  if (
+    parsedOptions.directConnection == null &&
+    hosts.length === 1 &&
+    parsedOptions.replicaSet == null
+  ) {
+    parsedOptions.directConnection = true;
+  }
+
+  const result = {
+    hosts: hosts,
+    auth: auth.db || auth.username ? auth : null,
+    options: Object.keys(parsedOptions).length ? parsedOptions : null
+  };
+
+  if (result.auth && result.auth.db) {
+    result.defaultDatabase = result.auth.db;
+  } else {
+    result.defaultDatabase = 'test';
+  }
+
+  // support modern `tls` variants to SSL options
+  result.options = translateTLSOptions(result.options);
+
+  try {
+    applyAuthExpectations(result);
+  } catch (authError) {
+    return callback(authError);
+  }
+
+  callback(null, result);
+}
+
+module.exports = parseConnectionString;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/utils.js b/NodeAPI/node_modules/mongodb/lib/core/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..631c4a9b3b22b321345ac232e91f5f257f4b795e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/utils.js
@@ -0,0 +1,294 @@
+'use strict';
+const os = require('os');
+const crypto = require('crypto');
+const requireOptional = require('optional-require')(require);
+
+/**
+ * Generate a UUIDv4
+ */
+const uuidV4 = () => {
+  const result = crypto.randomBytes(16);
+  result[6] = (result[6] & 0x0f) | 0x40;
+  result[8] = (result[8] & 0x3f) | 0x80;
+  return result;
+};
+
+/**
+ * Relays events for a given listener and emitter
+ *
+ * @param {EventEmitter} listener the EventEmitter to listen to the events from
+ * @param {EventEmitter} emitter the EventEmitter to relay the events to
+ */
+function relayEvents(listener, emitter, events) {
+  events.forEach(eventName => listener.on(eventName, event => emitter.emit(eventName, event)));
+}
+
+function retrieveKerberos() {
+  let kerberos;
+
+  try {
+    kerberos = requireOptional('kerberos');
+  } catch (err) {
+    if (err.code === 'MODULE_NOT_FOUND') {
+      throw new Error('The `kerberos` module was not found. Please install it and try again.');
+    }
+
+    throw err;
+  }
+
+  return kerberos;
+}
+
+// Throw an error if an attempt to use EJSON is made when it is not installed
+const noEJSONError = function() {
+  throw new Error('The `mongodb-extjson` module was not found. Please install it and try again.');
+};
+
+// Facilitate loading EJSON optionally
+function retrieveEJSON() {
+  let EJSON = requireOptional('mongodb-extjson');
+  if (!EJSON) {
+    EJSON = {
+      parse: noEJSONError,
+      deserialize: noEJSONError,
+      serialize: noEJSONError,
+      stringify: noEJSONError,
+      setBSONModule: noEJSONError,
+      BSON: noEJSONError
+    };
+  }
+
+  return EJSON;
+}
+
+/**
+ * A helper function for determining `maxWireVersion` between legacy and new topology
+ * instances
+ *
+ * @private
+ * @param {(Topology|Server)} topologyOrServer
+ */
+function maxWireVersion(topologyOrServer) {
+  if (topologyOrServer) {
+    if (topologyOrServer.ismaster) {
+      return topologyOrServer.ismaster.maxWireVersion;
+    }
+
+    if (typeof topologyOrServer.lastIsMaster === 'function') {
+      const lastIsMaster = topologyOrServer.lastIsMaster();
+      if (lastIsMaster) {
+        return lastIsMaster.maxWireVersion;
+      }
+    }
+
+    if (topologyOrServer.description) {
+      return topologyOrServer.description.maxWireVersion;
+    }
+  }
+
+  return 0;
+}
+
+/*
+ * Checks that collation is supported by server.
+ *
+ * @param {Server} [server] to check against
+ * @param {object} [cmd] object where collation may be specified
+ * @param {function} [callback] callback function
+ * @return true if server does not support collation
+ */
+function collationNotSupported(server, cmd) {
+  return cmd && cmd.collation && maxWireVersion(server) < 5;
+}
+
+/**
+ * Checks if a given value is a Promise
+ *
+ * @param {*} maybePromise
+ * @return true if the provided value is a Promise
+ */
+function isPromiseLike(maybePromise) {
+  return maybePromise && typeof maybePromise.then === 'function';
+}
+
+/**
+ * Applies the function `eachFn` to each item in `arr`, in parallel.
+ *
+ * @param {array} arr an array of items to asynchronusly iterate over
+ * @param {function} eachFn A function to call on each item of the array. The callback signature is `(item, callback)`, where the callback indicates iteration is complete.
+ * @param {function} callback The callback called after every item has been iterated
+ */
+function eachAsync(arr, eachFn, callback) {
+  arr = arr || [];
+
+  let idx = 0;
+  let awaiting = 0;
+  for (idx = 0; idx < arr.length; ++idx) {
+    awaiting++;
+    eachFn(arr[idx], eachCallback);
+  }
+
+  if (awaiting === 0) {
+    callback();
+    return;
+  }
+
+  function eachCallback(err) {
+    awaiting--;
+    if (err) {
+      callback(err);
+      return;
+    }
+
+    if (idx === arr.length && awaiting <= 0) {
+      callback();
+    }
+  }
+}
+
+function eachAsyncSeries(arr, eachFn, callback) {
+  arr = arr || [];
+
+  let idx = 0;
+  let awaiting = arr.length;
+  if (awaiting === 0) {
+    callback();
+    return;
+  }
+
+  function eachCallback(err) {
+    idx++;
+    awaiting--;
+    if (err) {
+      callback(err);
+      return;
+    }
+
+    if (idx === arr.length && awaiting <= 0) {
+      callback();
+      return;
+    }
+
+    eachFn(arr[idx], eachCallback);
+  }
+
+  eachFn(arr[idx], eachCallback);
+}
+
+function isUnifiedTopology(topology) {
+  return topology.description != null;
+}
+
+function arrayStrictEqual(arr, arr2) {
+  if (!Array.isArray(arr) || !Array.isArray(arr2)) {
+    return false;
+  }
+
+  return arr.length === arr2.length && arr.every((elt, idx) => elt === arr2[idx]);
+}
+
+function tagsStrictEqual(tags, tags2) {
+  const tagsKeys = Object.keys(tags);
+  const tags2Keys = Object.keys(tags2);
+  return tagsKeys.length === tags2Keys.length && tagsKeys.every(key => tags2[key] === tags[key]);
+}
+
+function errorStrictEqual(lhs, rhs) {
+  if (lhs === rhs) {
+    return true;
+  }
+
+  if ((lhs == null && rhs != null) || (lhs != null && rhs == null)) {
+    return false;
+  }
+
+  if (lhs.constructor.name !== rhs.constructor.name) {
+    return false;
+  }
+
+  if (lhs.message !== rhs.message) {
+    return false;
+  }
+
+  return true;
+}
+
+function makeStateMachine(stateTable) {
+  return function stateTransition(target, newState) {
+    const legalStates = stateTable[target.s.state];
+    if (legalStates && legalStates.indexOf(newState) < 0) {
+      throw new TypeError(
+        `illegal state transition from [${target.s.state}] => [${newState}], allowed: [${legalStates}]`
+      );
+    }
+
+    target.emit('stateChanged', target.s.state, newState);
+    target.s.state = newState;
+  };
+}
+
+function makeClientMetadata(options) {
+  options = options || {};
+
+  const metadata = {
+    driver: {
+      name: 'nodejs',
+      version: require('../../package.json').version
+    },
+    os: {
+      type: os.type(),
+      name: process.platform,
+      architecture: process.arch,
+      version: os.release()
+    },
+    platform: `'Node.js ${process.version}, ${os.endianness} (${
+      options.useUnifiedTopology ? 'unified' : 'legacy'
+    })`
+  };
+
+  // support optionally provided wrapping driver info
+  if (options.driverInfo) {
+    if (options.driverInfo.name) {
+      metadata.driver.name = `${metadata.driver.name}|${options.driverInfo.name}`;
+    }
+
+    if (options.driverInfo.version) {
+      metadata.version = `${metadata.driver.version}|${options.driverInfo.version}`;
+    }
+
+    if (options.driverInfo.platform) {
+      metadata.platform = `${metadata.platform}|${options.driverInfo.platform}`;
+    }
+  }
+
+  if (options.appname) {
+    // MongoDB requires the appname not exceed a byte length of 128
+    const buffer = Buffer.from(options.appname);
+    metadata.application = {
+      name: buffer.length > 128 ? buffer.slice(0, 128).toString('utf8') : options.appname
+    };
+  }
+
+  return metadata;
+}
+
+const noop = () => {};
+
+module.exports = {
+  uuidV4,
+  relayEvents,
+  collationNotSupported,
+  retrieveEJSON,
+  retrieveKerberos,
+  maxWireVersion,
+  isPromiseLike,
+  eachAsync,
+  eachAsyncSeries,
+  isUnifiedTopology,
+  arrayStrictEqual,
+  tagsStrictEqual,
+  errorStrictEqual,
+  makeStateMachine,
+  makeClientMetadata,
+  noop
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/command.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/command.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e687f8c95775ac71d6280ae9ee871b601d70fcb
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/command.js
@@ -0,0 +1,182 @@
+'use strict';
+
+const Query = require('../connection/commands').Query;
+const Msg = require('../connection/msg').Msg;
+const MongoError = require('../error').MongoError;
+const getReadPreference = require('./shared').getReadPreference;
+const isSharded = require('./shared').isSharded;
+const databaseNamespace = require('./shared').databaseNamespace;
+const isTransactionCommand = require('../transactions').isTransactionCommand;
+const applySession = require('../sessions').applySession;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const maxWireVersion = require('../utils').maxWireVersion;
+
+function isClientEncryptionEnabled(server) {
+  const wireVersion = maxWireVersion(server);
+  return wireVersion && server.autoEncrypter;
+}
+
+function command(server, ns, cmd, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  if (cmd == null) {
+    return callback(new MongoError(`command ${JSON.stringify(cmd)} does not return a cursor`));
+  }
+
+  if (!isClientEncryptionEnabled(server)) {
+    _command(server, ns, cmd, options, callback);
+    return;
+  }
+
+  const wireVersion = maxWireVersion(server);
+  if (typeof wireVersion !== 'number' || wireVersion < 8) {
+    callback(new MongoError('Auto-encryption requires a minimum MongoDB version of 4.2'));
+    return;
+  }
+
+  _cryptCommand(server, ns, cmd, options, callback);
+}
+
+function _command(server, ns, cmd, options, callback) {
+  const bson = server.s.bson;
+  const pool = server.s.pool;
+  const readPreference = getReadPreference(cmd, options);
+  const shouldUseOpMsg = supportsOpMsg(server);
+  const session = options.session;
+
+  const serverClusterTime = server.clusterTime;
+  let clusterTime = serverClusterTime;
+  let finalCmd = Object.assign({}, cmd);
+  if (hasSessionSupport(server) && session) {
+    const sessionClusterTime = session.clusterTime;
+    if (
+      serverClusterTime &&
+      serverClusterTime.clusterTime &&
+      sessionClusterTime &&
+      sessionClusterTime.clusterTime &&
+      sessionClusterTime.clusterTime.greaterThan(serverClusterTime.clusterTime)
+    ) {
+      clusterTime = sessionClusterTime;
+    }
+
+    const err = applySession(session, finalCmd, options);
+    if (err) {
+      return callback(err);
+    }
+  }
+
+  if (clusterTime) {
+    // if we have a known cluster time, gossip it
+    finalCmd.$clusterTime = clusterTime;
+  }
+
+  if (isSharded(server) && !shouldUseOpMsg && readPreference && readPreference.mode !== 'primary') {
+    finalCmd = {
+      $query: finalCmd,
+      $readPreference: readPreference.toJSON()
+    };
+  }
+
+  const commandOptions = Object.assign(
+    {
+      command: true,
+      numberToSkip: 0,
+      numberToReturn: -1,
+      checkKeys: false
+    },
+    options
+  );
+
+  // This value is not overridable
+  commandOptions.slaveOk = readPreference.slaveOk();
+
+  const cmdNs = `${databaseNamespace(ns)}.$cmd`;
+  const message = shouldUseOpMsg
+    ? new Msg(bson, cmdNs, finalCmd, commandOptions)
+    : new Query(bson, cmdNs, finalCmd, commandOptions);
+
+  const inTransaction = session && (session.inTransaction() || isTransactionCommand(finalCmd));
+  const commandResponseHandler = inTransaction
+    ? function(err) {
+        // We need to add a TransientTransactionError errorLabel, as stated in the transaction spec.
+        if (
+          err &&
+          err instanceof MongoNetworkError &&
+          !err.hasErrorLabel('TransientTransactionError')
+        ) {
+          err.addErrorLabel('TransientTransactionError');
+        }
+
+        if (
+          !cmd.commitTransaction &&
+          err &&
+          err instanceof MongoError &&
+          err.hasErrorLabel('TransientTransactionError')
+        ) {
+          session.transaction.unpinServer();
+        }
+
+        return callback.apply(null, arguments);
+      }
+    : callback;
+
+  try {
+    pool.write(message, commandOptions, commandResponseHandler);
+  } catch (err) {
+    commandResponseHandler(err);
+  }
+}
+
+function hasSessionSupport(topology) {
+  if (topology == null) return false;
+  if (topology.description) {
+    return topology.description.maxWireVersion >= 6;
+  }
+
+  return topology.ismaster == null ? false : topology.ismaster.maxWireVersion >= 6;
+}
+
+function supportsOpMsg(topologyOrServer) {
+  const description = topologyOrServer.ismaster
+    ? topologyOrServer.ismaster
+    : topologyOrServer.description;
+
+  if (description == null) {
+    return false;
+  }
+
+  return description.maxWireVersion >= 6 && description.__nodejs_mock_server__ == null;
+}
+
+function _cryptCommand(server, ns, cmd, options, callback) {
+  const autoEncrypter = server.autoEncrypter;
+  function commandResponseHandler(err, response) {
+    if (err || response == null) {
+      callback(err, response);
+      return;
+    }
+
+    autoEncrypter.decrypt(response.result, options, (err, decrypted) => {
+      if (err) {
+        callback(err, null);
+        return;
+      }
+
+      response.result = decrypted;
+      response.message.documents = [decrypted];
+      callback(null, response);
+    });
+  }
+
+  autoEncrypter.encrypt(ns, cmd, options, (err, encrypted) => {
+    if (err) {
+      callback(err, null);
+      return;
+    }
+
+    _command(server, ns, encrypted, options, commandResponseHandler);
+  });
+}
+
+module.exports = command;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/compression.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/compression.js
new file mode 100644
index 0000000000000000000000000000000000000000..b1e15835b8b923fd640af0fd7102bb9280f7ef39
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/compression.js
@@ -0,0 +1,73 @@
+'use strict';
+
+const Snappy = require('../connection/utils').retrieveSnappy();
+const zlib = require('zlib');
+
+const compressorIDs = {
+  snappy: 1,
+  zlib: 2
+};
+
+const uncompressibleCommands = new Set([
+  'ismaster',
+  'saslStart',
+  'saslContinue',
+  'getnonce',
+  'authenticate',
+  'createUser',
+  'updateUser',
+  'copydbSaslStart',
+  'copydbgetnonce',
+  'copydb'
+]);
+
+// Facilitate compressing a message using an agreed compressor
+function compress(self, dataToBeCompressed, callback) {
+  switch (self.options.agreedCompressor) {
+    case 'snappy':
+      Snappy.compress(dataToBeCompressed, callback);
+      break;
+    case 'zlib':
+      // Determine zlibCompressionLevel
+      var zlibOptions = {};
+      if (self.options.zlibCompressionLevel) {
+        zlibOptions.level = self.options.zlibCompressionLevel;
+      }
+      zlib.deflate(dataToBeCompressed, zlibOptions, callback);
+      break;
+    default:
+      throw new Error(
+        'Attempt to compress message using unknown compressor "' +
+          self.options.agreedCompressor +
+          '".'
+      );
+  }
+}
+
+// Decompress a message using the given compressor
+function decompress(compressorID, compressedData, callback) {
+  if (compressorID < 0 || compressorID > compressorIDs.length) {
+    throw new Error(
+      'Server sent message compressed using an unsupported compressor. (Received compressor ID ' +
+        compressorID +
+        ')'
+    );
+  }
+  switch (compressorID) {
+    case compressorIDs.snappy:
+      Snappy.uncompress(compressedData, callback);
+      break;
+    case compressorIDs.zlib:
+      zlib.inflate(compressedData, callback);
+      break;
+    default:
+      callback(null, compressedData);
+  }
+}
+
+module.exports = {
+  compressorIDs,
+  uncompressibleCommands,
+  compress,
+  decompress
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/constants.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/constants.js
new file mode 100644
index 0000000000000000000000000000000000000000..49893f8fecfcebb05020c93efbb854c6ad3bce87
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/constants.js
@@ -0,0 +1,13 @@
+'use strict';
+
+const MIN_SUPPORTED_SERVER_VERSION = '2.6';
+const MAX_SUPPORTED_SERVER_VERSION = '4.4';
+const MIN_SUPPORTED_WIRE_VERSION = 2;
+const MAX_SUPPORTED_WIRE_VERSION = 9;
+
+module.exports = {
+  MIN_SUPPORTED_SERVER_VERSION,
+  MAX_SUPPORTED_SERVER_VERSION,
+  MIN_SUPPORTED_WIRE_VERSION,
+  MAX_SUPPORTED_WIRE_VERSION
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/get_more.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/get_more.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e452f6ec0e2abfd7b1020589d8c5b06559dd0ae
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/get_more.js
@@ -0,0 +1,95 @@
+'use strict';
+
+const GetMore = require('../connection/commands').GetMore;
+const retrieveBSON = require('../connection/utils').retrieveBSON;
+const MongoError = require('../error').MongoError;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const BSON = retrieveBSON();
+const Long = BSON.Long;
+const collectionNamespace = require('./shared').collectionNamespace;
+const maxWireVersion = require('../utils').maxWireVersion;
+const applyCommonQueryOptions = require('./shared').applyCommonQueryOptions;
+const command = require('./command');
+
+function getMore(server, ns, cursorState, batchSize, options, callback) {
+  options = options || {};
+
+  const wireVersion = maxWireVersion(server);
+  function queryCallback(err, result) {
+    if (err) return callback(err);
+    const response = result.message;
+
+    // If we have a timed out query or a cursor that was killed
+    if (response.cursorNotFound) {
+      return callback(new MongoNetworkError('cursor killed or timed out'), null);
+    }
+
+    if (wireVersion < 4) {
+      const cursorId =
+        typeof response.cursorId === 'number'
+          ? Long.fromNumber(response.cursorId)
+          : response.cursorId;
+
+      cursorState.documents = response.documents;
+      cursorState.cursorId = cursorId;
+
+      callback(null, null, response.connection);
+      return;
+    }
+
+    // We have an error detected
+    if (response.documents[0].ok === 0) {
+      return callback(new MongoError(response.documents[0]));
+    }
+
+    // Ensure we have a Long valid cursor id
+    const cursorId =
+      typeof response.documents[0].cursor.id === 'number'
+        ? Long.fromNumber(response.documents[0].cursor.id)
+        : response.documents[0].cursor.id;
+
+    cursorState.documents = response.documents[0].cursor.nextBatch;
+    cursorState.cursorId = cursorId;
+
+    callback(null, response.documents[0], response.connection);
+  }
+
+  if (wireVersion < 4) {
+    const bson = server.s.bson;
+    const getMoreOp = new GetMore(bson, ns, cursorState.cursorId, { numberToReturn: batchSize });
+    const queryOptions = applyCommonQueryOptions({}, cursorState);
+    server.s.pool.write(getMoreOp, queryOptions, queryCallback);
+    return;
+  }
+
+  const cursorId =
+    cursorState.cursorId instanceof Long
+      ? cursorState.cursorId
+      : Long.fromNumber(cursorState.cursorId);
+
+  const getMoreCmd = {
+    getMore: cursorId,
+    collection: collectionNamespace(ns),
+    batchSize: Math.abs(batchSize)
+  };
+
+  if (cursorState.cmd.tailable && typeof cursorState.cmd.maxAwaitTimeMS === 'number') {
+    getMoreCmd.maxTimeMS = cursorState.cmd.maxAwaitTimeMS;
+  }
+
+  const commandOptions = Object.assign(
+    {
+      returnFieldSelector: null,
+      documentsReturnedIn: 'nextBatch'
+    },
+    options
+  );
+
+  if (cursorState.session) {
+    commandOptions.session = cursorState.session;
+  }
+
+  command(server, ns, getMoreCmd, commandOptions, queryCallback);
+}
+
+module.exports = getMore;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/index.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..b6ffda7c2db46a3847cef87cf46ac82e3ee28afb
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/index.js
@@ -0,0 +1,18 @@
+'use strict';
+const writeCommand = require('./write_command');
+
+module.exports = {
+  insert: function insert(server, ns, ops, options, callback) {
+    writeCommand(server, 'insert', 'documents', ns, ops, options, callback);
+  },
+  update: function update(server, ns, ops, options, callback) {
+    writeCommand(server, 'update', 'updates', ns, ops, options, callback);
+  },
+  remove: function remove(server, ns, ops, options, callback) {
+    writeCommand(server, 'delete', 'deletes', ns, ops, options, callback);
+  },
+  killCursors: require('./kill_cursors'),
+  getMore: require('./get_more'),
+  query: require('./query'),
+  command: require('./command')
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.js
new file mode 100644
index 0000000000000000000000000000000000000000..22744794f90421f6ecbdc4f90fb52761d4184551
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/kill_cursors.js
@@ -0,0 +1,71 @@
+'use strict';
+
+const KillCursor = require('../connection/commands').KillCursor;
+const MongoError = require('../error').MongoError;
+const MongoNetworkError = require('../error').MongoNetworkError;
+const collectionNamespace = require('./shared').collectionNamespace;
+const maxWireVersion = require('../utils').maxWireVersion;
+const emitWarning = require('../utils').emitWarning;
+const command = require('./command');
+
+function killCursors(server, ns, cursorState, callback) {
+  callback = typeof callback === 'function' ? callback : () => {};
+  const cursorId = cursorState.cursorId;
+
+  if (maxWireVersion(server) < 4) {
+    const bson = server.s.bson;
+    const pool = server.s.pool;
+    const killCursor = new KillCursor(bson, ns, [cursorId]);
+    const options = {
+      immediateRelease: true,
+      noResponse: true
+    };
+
+    if (typeof cursorState.session === 'object') {
+      options.session = cursorState.session;
+    }
+
+    if (pool && pool.isConnected()) {
+      try {
+        pool.write(killCursor, options, callback);
+      } catch (err) {
+        if (typeof callback === 'function') {
+          callback(err, null);
+        } else {
+          emitWarning(err);
+        }
+      }
+    }
+
+    return;
+  }
+
+  const killCursorCmd = {
+    killCursors: collectionNamespace(ns),
+    cursors: [cursorId]
+  };
+
+  const options = {};
+  if (typeof cursorState.session === 'object') options.session = cursorState.session;
+
+  command(server, ns, killCursorCmd, options, (err, result) => {
+    if (err) {
+      return callback(err);
+    }
+
+    const response = result.message;
+    if (response.cursorNotFound) {
+      return callback(new MongoNetworkError('cursor killed or timed out'), null);
+    }
+
+    if (!Array.isArray(response.documents) || response.documents.length === 0) {
+      return callback(
+        new MongoError(`invalid killCursors result returned for cursor id ${cursorId}`)
+      );
+    }
+
+    callback(null, response.documents[0]);
+  });
+}
+
+module.exports = killCursors;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/query.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/query.js
new file mode 100644
index 0000000000000000000000000000000000000000..66ba531ce6c6da6f8d54e63e0e250aeff940e3a7
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/query.js
@@ -0,0 +1,236 @@
+'use strict';
+
+const Query = require('../connection/commands').Query;
+const MongoError = require('../error').MongoError;
+const getReadPreference = require('./shared').getReadPreference;
+const collectionNamespace = require('./shared').collectionNamespace;
+const isSharded = require('./shared').isSharded;
+const maxWireVersion = require('../utils').maxWireVersion;
+const applyCommonQueryOptions = require('./shared').applyCommonQueryOptions;
+const command = require('./command');
+const decorateWithExplain = require('../../utils').decorateWithExplain;
+const Explain = require('../../explain').Explain;
+
+function query(server, ns, cmd, cursorState, options, callback) {
+  options = options || {};
+  if (cursorState.cursorId != null) {
+    return callback();
+  }
+
+  if (cmd == null) {
+    return callback(new MongoError(`command ${JSON.stringify(cmd)} does not return a cursor`));
+  }
+
+  if (maxWireVersion(server) < 4) {
+    const query = prepareLegacyFindQuery(server, ns, cmd, cursorState, options);
+    const queryOptions = applyCommonQueryOptions({}, cursorState);
+    if (typeof query.documentsReturnedIn === 'string') {
+      queryOptions.documentsReturnedIn = query.documentsReturnedIn;
+    }
+
+    server.s.pool.write(query, queryOptions, callback);
+    return;
+  }
+
+  const readPreference = getReadPreference(cmd, options);
+  let findCmd = prepareFindCommand(server, ns, cmd, cursorState, options);
+
+  // If we have explain, we need to rewrite the find command
+  // to wrap it in the explain command
+  const explain = Explain.fromOptions(options);
+  if (explain) {
+    findCmd = decorateWithExplain(findCmd, explain);
+  }
+
+  // NOTE: This actually modifies the passed in cmd, and our code _depends_ on this
+  //       side-effect. Change this ASAP
+  cmd.virtual = false;
+
+  const commandOptions = Object.assign(
+    {
+      documentsReturnedIn: 'firstBatch',
+      numberToReturn: 1,
+      slaveOk: readPreference.slaveOk()
+    },
+    options
+  );
+
+  if (cmd.readPreference) {
+    commandOptions.readPreference = readPreference;
+  }
+
+  if (cursorState.session) {
+    commandOptions.session = cursorState.session;
+  }
+
+  command(server, ns, findCmd, commandOptions, callback);
+}
+
+function prepareFindCommand(server, ns, cmd, cursorState) {
+  cursorState.batchSize = cmd.batchSize || cursorState.batchSize;
+  const findCmd = {
+    find: collectionNamespace(ns)
+  };
+
+  if (cmd.query) {
+    if (cmd.query['$query']) {
+      findCmd.filter = cmd.query['$query'];
+    } else {
+      findCmd.filter = cmd.query;
+    }
+  }
+
+  let sortValue = cmd.sort;
+  if (Array.isArray(sortValue)) {
+    const sortObject = {};
+
+    if (sortValue.length > 0 && !Array.isArray(sortValue[0])) {
+      let sortDirection = sortValue[1];
+      if (sortDirection === 'asc') {
+        sortDirection = 1;
+      } else if (sortDirection === 'desc') {
+        sortDirection = -1;
+      }
+
+      sortObject[sortValue[0]] = sortDirection;
+    } else {
+      for (let i = 0; i < sortValue.length; i++) {
+        let sortDirection = sortValue[i][1];
+        if (sortDirection === 'asc') {
+          sortDirection = 1;
+        } else if (sortDirection === 'desc') {
+          sortDirection = -1;
+        }
+
+        sortObject[sortValue[i][0]] = sortDirection;
+      }
+    }
+
+    sortValue = sortObject;
+  }
+
+  if (typeof cmd.allowDiskUse === 'boolean') {
+    findCmd.allowDiskUse = cmd.allowDiskUse;
+  }
+
+  if (cmd.sort) findCmd.sort = sortValue;
+  if (cmd.fields) findCmd.projection = cmd.fields;
+  if (cmd.hint) findCmd.hint = cmd.hint;
+  if (cmd.skip) findCmd.skip = cmd.skip;
+  if (cmd.limit) findCmd.limit = cmd.limit;
+  if (cmd.limit < 0) {
+    findCmd.limit = Math.abs(cmd.limit);
+    findCmd.singleBatch = true;
+  }
+
+  if (typeof cmd.batchSize === 'number') {
+    if (cmd.batchSize < 0) {
+      if (cmd.limit !== 0 && Math.abs(cmd.batchSize) < Math.abs(cmd.limit)) {
+        findCmd.limit = Math.abs(cmd.batchSize);
+      }
+
+      findCmd.singleBatch = true;
+    }
+
+    findCmd.batchSize = Math.abs(cmd.batchSize);
+  }
+
+  if (cmd.comment) findCmd.comment = cmd.comment;
+  if (cmd.maxScan) findCmd.maxScan = cmd.maxScan;
+  if (cmd.maxTimeMS) findCmd.maxTimeMS = cmd.maxTimeMS;
+  if (cmd.min) findCmd.min = cmd.min;
+  if (cmd.max) findCmd.max = cmd.max;
+  findCmd.returnKey = cmd.returnKey ? cmd.returnKey : false;
+  findCmd.showRecordId = cmd.showDiskLoc ? cmd.showDiskLoc : false;
+  if (cmd.snapshot) findCmd.snapshot = cmd.snapshot;
+  if (cmd.tailable) findCmd.tailable = cmd.tailable;
+  if (cmd.oplogReplay) findCmd.oplogReplay = cmd.oplogReplay;
+  if (cmd.noCursorTimeout) findCmd.noCursorTimeout = cmd.noCursorTimeout;
+  if (cmd.awaitData) findCmd.awaitData = cmd.awaitData;
+  if (cmd.awaitdata) findCmd.awaitData = cmd.awaitdata;
+  if (cmd.partial) findCmd.partial = cmd.partial;
+  if (cmd.collation) findCmd.collation = cmd.collation;
+  if (cmd.readConcern) findCmd.readConcern = cmd.readConcern;
+
+  return findCmd;
+}
+
+function prepareLegacyFindQuery(server, ns, cmd, cursorState, options) {
+  options = options || {};
+  const bson = server.s.bson;
+  const readPreference = getReadPreference(cmd, options);
+  cursorState.batchSize = cmd.batchSize || cursorState.batchSize;
+
+  let numberToReturn = 0;
+  if (
+    cursorState.limit < 0 ||
+    (cursorState.limit !== 0 && cursorState.limit < cursorState.batchSize) ||
+    (cursorState.limit > 0 && cursorState.batchSize === 0)
+  ) {
+    numberToReturn = cursorState.limit;
+  } else {
+    numberToReturn = cursorState.batchSize;
+  }
+
+  const numberToSkip = cursorState.skip || 0;
+
+  const findCmd = {};
+  if (isSharded(server) && readPreference) {
+    findCmd['$readPreference'] = readPreference.toJSON();
+  }
+
+  if (cmd.sort) findCmd['$orderby'] = cmd.sort;
+  if (cmd.hint) findCmd['$hint'] = cmd.hint;
+  if (cmd.snapshot) findCmd['$snapshot'] = cmd.snapshot;
+  if (typeof cmd.returnKey !== 'undefined') findCmd['$returnKey'] = cmd.returnKey;
+  if (cmd.maxScan) findCmd['$maxScan'] = cmd.maxScan;
+  if (cmd.min) findCmd['$min'] = cmd.min;
+  if (cmd.max) findCmd['$max'] = cmd.max;
+  if (typeof cmd.showDiskLoc !== 'undefined') findCmd['$showDiskLoc'] = cmd.showDiskLoc;
+  if (cmd.comment) findCmd['$comment'] = cmd.comment;
+  if (cmd.maxTimeMS) findCmd['$maxTimeMS'] = cmd.maxTimeMS;
+  if (options.explain !== undefined) {
+    // nToReturn must be 0 (match all) or negative (match N and close cursor)
+    // nToReturn > 0 will give explain results equivalent to limit(0)
+    numberToReturn = -Math.abs(cmd.limit || 0);
+    findCmd['$explain'] = true;
+  }
+
+  findCmd['$query'] = cmd.query;
+  if (cmd.readConcern && cmd.readConcern.level !== 'local') {
+    throw new MongoError(
+      `server find command does not support a readConcern level of ${cmd.readConcern.level}`
+    );
+  }
+
+  if (cmd.readConcern) {
+    cmd = Object.assign({}, cmd);
+    delete cmd['readConcern'];
+  }
+
+  const serializeFunctions =
+    typeof options.serializeFunctions === 'boolean' ? options.serializeFunctions : false;
+  const ignoreUndefined =
+    typeof options.ignoreUndefined === 'boolean' ? options.ignoreUndefined : false;
+
+  const query = new Query(bson, ns, findCmd, {
+    numberToSkip: numberToSkip,
+    numberToReturn: numberToReturn,
+    pre32Limit: typeof cmd.limit !== 'undefined' ? cmd.limit : undefined,
+    checkKeys: false,
+    returnFieldSelector: cmd.fields,
+    serializeFunctions: serializeFunctions,
+    ignoreUndefined: ignoreUndefined
+  });
+
+  if (typeof cmd.tailable === 'boolean') query.tailable = cmd.tailable;
+  if (typeof cmd.oplogReplay === 'boolean') query.oplogReplay = cmd.oplogReplay;
+  if (typeof cmd.noCursorTimeout === 'boolean') query.noCursorTimeout = cmd.noCursorTimeout;
+  if (typeof cmd.awaitData === 'boolean') query.awaitData = cmd.awaitData;
+  if (typeof cmd.partial === 'boolean') query.partial = cmd.partial;
+
+  query.slaveOk = readPreference.slaveOk();
+  return query;
+}
+
+module.exports = query;
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/shared.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/shared.js
new file mode 100644
index 0000000000000000000000000000000000000000..c586f057546a06d1cdc4ce5ae94c3a1e716bb14b
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/shared.js
@@ -0,0 +1,115 @@
+'use strict';
+
+const ReadPreference = require('../topologies/read_preference');
+const MongoError = require('../error').MongoError;
+const ServerType = require('../sdam/common').ServerType;
+const TopologyDescription = require('../sdam/topology_description').TopologyDescription;
+
+const MESSAGE_HEADER_SIZE = 16;
+const COMPRESSION_DETAILS_SIZE = 9; // originalOpcode + uncompressedSize, compressorID
+
+// OPCODE Numbers
+// Defined at https://docs.mongodb.com/manual/reference/mongodb-wire-protocol/#request-opcodes
+var opcodes = {
+  OP_REPLY: 1,
+  OP_UPDATE: 2001,
+  OP_INSERT: 2002,
+  OP_QUERY: 2004,
+  OP_GETMORE: 2005,
+  OP_DELETE: 2006,
+  OP_KILL_CURSORS: 2007,
+  OP_COMPRESSED: 2012,
+  OP_MSG: 2013
+};
+
+var getReadPreference = function(cmd, options) {
+  // Default to command version of the readPreference
+  var readPreference = cmd.readPreference || new ReadPreference('primary');
+  // If we have an option readPreference override the command one
+  if (options.readPreference) {
+    readPreference = options.readPreference;
+  }
+
+  if (typeof readPreference === 'string') {
+    readPreference = new ReadPreference(readPreference);
+  }
+
+  if (!(readPreference instanceof ReadPreference)) {
+    throw new MongoError('read preference must be a ReadPreference instance');
+  }
+
+  return readPreference;
+};
+
+// Parses the header of a wire protocol message
+var parseHeader = function(message) {
+  return {
+    length: message.readInt32LE(0),
+    requestId: message.readInt32LE(4),
+    responseTo: message.readInt32LE(8),
+    opCode: message.readInt32LE(12)
+  };
+};
+
+function applyCommonQueryOptions(queryOptions, options) {
+  Object.assign(queryOptions, {
+    raw: typeof options.raw === 'boolean' ? options.raw : false,
+    promoteLongs: typeof options.promoteLongs === 'boolean' ? options.promoteLongs : true,
+    promoteValues: typeof options.promoteValues === 'boolean' ? options.promoteValues : true,
+    promoteBuffers: typeof options.promoteBuffers === 'boolean' ? options.promoteBuffers : false,
+    monitoring: typeof options.monitoring === 'boolean' ? options.monitoring : false,
+    fullResult: typeof options.fullResult === 'boolean' ? options.fullResult : false
+  });
+
+  if (typeof options.socketTimeout === 'number') {
+    queryOptions.socketTimeout = options.socketTimeout;
+  }
+
+  if (options.session) {
+    queryOptions.session = options.session;
+  }
+
+  if (typeof options.documentsReturnedIn === 'string') {
+    queryOptions.documentsReturnedIn = options.documentsReturnedIn;
+  }
+
+  return queryOptions;
+}
+
+function isSharded(topologyOrServer) {
+  if (topologyOrServer.type === 'mongos') return true;
+  if (topologyOrServer.description && topologyOrServer.description.type === ServerType.Mongos) {
+    return true;
+  }
+
+  // NOTE: This is incredibly inefficient, and should be removed once command construction
+  //       happens based on `Server` not `Topology`.
+  if (topologyOrServer.description && topologyOrServer.description instanceof TopologyDescription) {
+    const servers = Array.from(topologyOrServer.description.servers.values());
+    return servers.some(server => server.type === ServerType.Mongos);
+  }
+
+  return false;
+}
+
+function databaseNamespace(ns) {
+  return ns.split('.')[0];
+}
+function collectionNamespace(ns) {
+  return ns
+    .split('.')
+    .slice(1)
+    .join('.');
+}
+
+module.exports = {
+  getReadPreference,
+  MESSAGE_HEADER_SIZE,
+  COMPRESSION_DETAILS_SIZE,
+  opcodes,
+  parseHeader,
+  applyCommonQueryOptions,
+  isSharded,
+  databaseNamespace,
+  collectionNamespace
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/write_command.js b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/write_command.js
new file mode 100644
index 0000000000000000000000000000000000000000..e6babc3b30790a497130dfe78615c2b717433ca0
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/core/wireprotocol/write_command.js
@@ -0,0 +1,59 @@
+'use strict';
+
+const MongoError = require('../error').MongoError;
+const collectionNamespace = require('./shared').collectionNamespace;
+const command = require('./command');
+const decorateWithExplain = require('../../utils').decorateWithExplain;
+const Explain = require('../../explain').Explain;
+
+function writeCommand(server, type, opsField, ns, ops, options, callback) {
+  if (ops.length === 0) throw new MongoError(`${type} must contain at least one document`);
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = options || {};
+  const ordered = typeof options.ordered === 'boolean' ? options.ordered : true;
+  const writeConcern = options.writeConcern;
+
+  let writeCommand = {};
+  writeCommand[type] = collectionNamespace(ns);
+  writeCommand[opsField] = ops;
+  writeCommand.ordered = ordered;
+
+  if (writeConcern && Object.keys(writeConcern).length > 0) {
+    writeCommand.writeConcern = writeConcern;
+  }
+
+  if (options.collation) {
+    for (let i = 0; i < writeCommand[opsField].length; i++) {
+      if (!writeCommand[opsField][i].collation) {
+        writeCommand[opsField][i].collation = options.collation;
+      }
+    }
+  }
+
+  if (options.bypassDocumentValidation === true) {
+    writeCommand.bypassDocumentValidation = options.bypassDocumentValidation;
+  }
+
+  // If a command is to be explained, we need to reformat the command after
+  // the other command properties are specified.
+  const explain = Explain.fromOptions(options);
+  if (explain) {
+    writeCommand = decorateWithExplain(writeCommand, explain);
+  }
+
+  const commandOptions = Object.assign(
+    {
+      checkKeys: type === 'insert',
+      numberToReturn: 1
+    },
+    options
+  );
+
+  command(server, ns, writeCommand, commandOptions, callback);
+}
+
+module.exports = writeCommand;
diff --git a/NodeAPI/node_modules/mongodb/lib/cursor.js b/NodeAPI/node_modules/mongodb/lib/cursor.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c17f43d7885a596bcda8cbe9ea1c9cccfe945d5
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/cursor.js
@@ -0,0 +1,1137 @@
+'use strict';
+
+const Transform = require('stream').Transform;
+const PassThrough = require('stream').PassThrough;
+const deprecate = require('util').deprecate;
+const handleCallback = require('./utils').handleCallback;
+const ReadPreference = require('./core').ReadPreference;
+const MongoError = require('./core').MongoError;
+const CoreCursor = require('./core/cursor').CoreCursor;
+const CursorState = require('./core/cursor').CursorState;
+const Map = require('./core').BSON.Map;
+const maybePromise = require('./utils').maybePromise;
+const executeOperation = require('./operations/execute_operation');
+const formattedOrderClause = require('./utils').formattedOrderClause;
+const Explain = require('./explain').Explain;
+const Aspect = require('./operations/operation').Aspect;
+
+const each = require('./operations/cursor_ops').each;
+const CountOperation = require('./operations/count');
+
+/**
+ * @fileOverview The **Cursor** class is an internal class that embodies a cursor on MongoDB
+ * allowing for iteration over the results returned from the underlying query. It supports
+ * one by one document iteration, conversion to an array or can be iterated as a Node 4.X
+ * or higher stream
+ *
+ * **CURSORS Cannot directly be instantiated**
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   // Create a collection we want to drop later
+ *   const col = client.db(dbName).collection('createIndexExample1');
+ *   // Insert a bunch of documents
+ *   col.insert([{a:1, b:1}
+ *     , {a:2, b:2}, {a:3, b:3}
+ *     , {a:4, b:4}], {w:1}, function(err, result) {
+ *     test.equal(null, err);
+ *     // Show that duplicate records got dropped
+ *     col.find({}).toArray(function(err, items) {
+ *       test.equal(null, err);
+ *       test.equal(4, items.length);
+ *       client.close();
+ *     });
+ *   });
+ * });
+ */
+
+/**
+ * Namespace provided by the code module
+ * @external CoreCursor
+ * @external Readable
+ */
+
+// Flags allowed for cursor
+const flags = ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'exhaust', 'partial'];
+const fields = ['numberOfRetries', 'tailableRetryInterval'];
+
+/**
+ * Creates a new Cursor instance (INTERNAL TYPE, do not instantiate directly)
+ * @class Cursor
+ * @extends external:CoreCursor
+ * @extends external:Readable
+ * @property {string} sortValue Cursor query sort setting.
+ * @property {boolean} timeout Is Cursor able to time out.
+ * @property {ReadPreference} readPreference Get cursor ReadPreference.
+ * @fires Cursor#data
+ * @fires Cursor#end
+ * @fires Cursor#close
+ * @fires Cursor#readable
+ * @return {Cursor} a Cursor instance.
+ * @example
+ * Cursor cursor options.
+ *
+ * collection.find({}).project({a:1})                             // Create a projection of field a
+ * collection.find({}).skip(1).limit(10)                          // Skip 1 and limit 10
+ * collection.find({}).batchSize(5)                               // Set batchSize on cursor to 5
+ * collection.find({}).filter({a:1})                              // Set query on the cursor
+ * collection.find({}).comment('add a comment')                   // Add a comment to the query, allowing to correlate queries
+ * collection.find({}).addCursorFlag('tailable', true)            // Set cursor as tailable
+ * collection.find({}).addCursorFlag('noCursorTimeout', true)     // Set cursor as noCursorTimeout
+ * collection.find({}).addCursorFlag('awaitData', true)           // Set cursor as awaitData
+ * collection.find({}).addCursorFlag('partial', true)             // Set cursor as partial
+ * collection.find({}).addQueryModifier('$orderby', {a:1})        // Set $orderby {a:1}
+ * collection.find({}).max(10)                                    // Set the cursor max
+ * collection.find({}).maxTimeMS(1000)                            // Set the cursor maxTimeMS
+ * collection.find({}).min(100)                                   // Set the cursor min
+ * collection.find({}).returnKey(true)                            // Set the cursor returnKey
+ * collection.find({}).setReadPreference(ReadPreference.PRIMARY)  // Set the cursor readPreference
+ * collection.find({}).showRecordId(true)                         // Set the cursor showRecordId
+ * collection.find({}).sort([['a', 1]])                           // Sets the sort order of the cursor query
+ * collection.find({}).hint('a_1')                                // Set the cursor hint
+ *
+ * All options are chainable, so one can do the following.
+ *
+ * collection.find({}).maxTimeMS(1000).maxScan(100).skip(1).toArray(..)
+ */
+class Cursor extends CoreCursor {
+  constructor(topology, ns, cmd, options) {
+    super(topology, ns, cmd, options);
+    if (this.operation) {
+      options = this.operation.options;
+    }
+
+    // Tailable cursor options
+    const numberOfRetries = options.numberOfRetries || 5;
+    const tailableRetryInterval = options.tailableRetryInterval || 500;
+    const currentNumberOfRetries = numberOfRetries;
+
+    // Get the promiseLibrary
+    const promiseLibrary = options.promiseLibrary || Promise;
+
+    // Internal cursor state
+    this.s = {
+      // Tailable cursor options
+      numberOfRetries: numberOfRetries,
+      tailableRetryInterval: tailableRetryInterval,
+      currentNumberOfRetries: currentNumberOfRetries,
+      // State
+      state: CursorState.INIT,
+      // Promise library
+      promiseLibrary,
+      // explicitlyIgnoreSession
+      explicitlyIgnoreSession: !!options.explicitlyIgnoreSession
+    };
+
+    // Optional ClientSession
+    if (!options.explicitlyIgnoreSession && options.session) {
+      this.cursorState.session = options.session;
+    }
+
+    // Translate correctly
+    if (this.options.noCursorTimeout === true) {
+      this.addCursorFlag('noCursorTimeout', true);
+    }
+
+    // Get the batchSize
+    let batchSize = 1000;
+    if (this.cmd.cursor && this.cmd.cursor.batchSize) {
+      batchSize = this.cmd.cursor.batchSize;
+    } else if (options.cursor && options.cursor.batchSize) {
+      batchSize = options.cursor.batchSize;
+    } else if (typeof options.batchSize === 'number') {
+      batchSize = options.batchSize;
+    }
+
+    // Set the batchSize
+    this.setCursorBatchSize(batchSize);
+  }
+
+  get readPreference() {
+    if (this.operation) {
+      return this.operation.readPreference;
+    }
+
+    return this.options.readPreference;
+  }
+
+  get sortValue() {
+    return this.cmd.sort;
+  }
+
+  _initializeCursor(callback) {
+    if (this.operation && this.operation.session != null) {
+      this.cursorState.session = this.operation.session;
+    } else {
+      // implicitly create a session if one has not been provided
+      if (
+        !this.s.explicitlyIgnoreSession &&
+        !this.cursorState.session &&
+        this.topology.hasSessionSupport()
+      ) {
+        this.cursorState.session = this.topology.startSession({ owner: this });
+
+        if (this.operation) {
+          this.operation.session = this.cursorState.session;
+        }
+      }
+    }
+
+    super._initializeCursor(callback);
+  }
+
+  /**
+   * Check if there is any document still available in the cursor
+   * @method
+   * @param {Cursor~resultCallback} [callback] The result callback.
+   * @throws {MongoError}
+   * @return {Promise} returns Promise if no callback passed
+   */
+  hasNext(callback) {
+    if (this.s.state === CursorState.CLOSED || (this.isDead && this.isDead())) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    return maybePromise(this, callback, cb => {
+      const cursor = this;
+      if (cursor.isNotified()) {
+        return cb(null, false);
+      }
+
+      cursor._next((err, doc) => {
+        if (err) return cb(err);
+        if (doc == null || cursor.s.state === Cursor.CLOSED || cursor.isDead()) {
+          return cb(null, false);
+        }
+
+        cursor.s.state = CursorState.OPEN;
+
+        // NODE-2482: merge this into the core cursor implementation
+        cursor.cursorState.cursorIndex--;
+        if (cursor.cursorState.limit > 0) {
+          cursor.cursorState.currentLimit--;
+        }
+
+        cb(null, true);
+      });
+    });
+  }
+
+  /**
+   * Get the next available document from the cursor, returns null if no more documents are available.
+   * @method
+   * @param {Cursor~resultCallback} [callback] The result callback.
+   * @throws {MongoError}
+   * @return {Promise} returns Promise if no callback passed
+   */
+  next(callback) {
+    return maybePromise(this, callback, cb => {
+      const cursor = this;
+      if (cursor.s.state === CursorState.CLOSED || (cursor.isDead && cursor.isDead())) {
+        cb(MongoError.create({ message: 'Cursor is closed', driver: true }));
+        return;
+      }
+
+      if (cursor.s.state === CursorState.INIT && cursor.cmd.sort) {
+        try {
+          cursor.cmd.sort = formattedOrderClause(cursor.cmd.sort);
+        } catch (err) {
+          return cb(err);
+        }
+      }
+
+      cursor._next((err, doc) => {
+        if (err) return cb(err);
+        cursor.s.state = CursorState.OPEN;
+        cb(null, doc);
+      });
+    });
+  }
+
+  /**
+   * Set the cursor query
+   * @method
+   * @param {object} filter The filter object used for the cursor.
+   * @return {Cursor}
+   */
+  filter(filter) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.query = filter;
+    return this;
+  }
+
+  /**
+   * Set the cursor maxScan
+   * @method
+   * @param {object} maxScan Constrains the query to only scan the specified number of documents when fulfilling the query
+   * @deprecated as of MongoDB 4.0
+   * @return {Cursor}
+   */
+  maxScan(maxScan) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.maxScan = maxScan;
+    return this;
+  }
+
+  /**
+   * Set the cursor hint
+   * @method
+   * @param {object} hint If specified, then the query system will only consider plans using the hinted index.
+   * @return {Cursor}
+   */
+  hint(hint) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.hint = hint;
+    return this;
+  }
+
+  /**
+   * Set the cursor min
+   * @method
+   * @param {object} min Specify a $min value to specify the inclusive lower bound for a specific index in order to constrain the results of find(). The $min specifies the lower bound for all keys of a specific index in order.
+   * @return {Cursor}
+   */
+  min(min) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.min = min;
+    return this;
+  }
+
+  /**
+   * Set the cursor max
+   * @method
+   * @param {object} max Specify a $max value to specify the exclusive upper bound for a specific index in order to constrain the results of find(). The $max specifies the upper bound for all keys of a specific index in order.
+   * @return {Cursor}
+   */
+  max(max) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.max = max;
+    return this;
+  }
+
+  /**
+   * Set the cursor returnKey. If set to true, modifies the cursor to only return the index field or fields for the results of the query, rather than documents. If set to true and the query does not use an index to perform the read operation, the returned documents will not contain any fields.
+   * @method
+   * @param {bool} returnKey the returnKey value.
+   * @return {Cursor}
+   */
+  returnKey(value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.returnKey = value;
+    return this;
+  }
+
+  /**
+   * Set the cursor showRecordId
+   * @method
+   * @param {object} showRecordId The $showDiskLoc option has now been deprecated and replaced with the showRecordId field. $showDiskLoc will still be accepted for OP_QUERY stye find.
+   * @return {Cursor}
+   */
+  showRecordId(value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.showDiskLoc = value;
+    return this;
+  }
+
+  /**
+   * Set the cursor snapshot
+   * @method
+   * @param {object} snapshot The $snapshot operator prevents the cursor from returning a document more than once because an intervening write operation results in a move of the document.
+   * @deprecated as of MongoDB 4.0
+   * @return {Cursor}
+   */
+  snapshot(value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.snapshot = value;
+    return this;
+  }
+
+  /**
+   * Set a node.js specific cursor option
+   * @method
+   * @param {string} field The cursor option to set ['numberOfRetries', 'tailableRetryInterval'].
+   * @param {object} value The field value.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  setCursorOption(field, value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (fields.indexOf(field) === -1) {
+      throw MongoError.create({
+        message: `option ${field} is not a supported option ${fields}`,
+        driver: true
+      });
+    }
+
+    this.s[field] = value;
+    if (field === 'numberOfRetries') this.s.currentNumberOfRetries = value;
+    return this;
+  }
+
+  /**
+   * Add a cursor flag to the cursor
+   * @method
+   * @param {string} flag The flag to set, must be one of following ['tailable', 'oplogReplay', 'noCursorTimeout', 'awaitData', 'partial'].
+   * @param {boolean} value The flag boolean value.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  addCursorFlag(flag, value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (flags.indexOf(flag) === -1) {
+      throw MongoError.create({
+        message: `flag ${flag} is not a supported flag ${flags}`,
+        driver: true
+      });
+    }
+
+    if (typeof value !== 'boolean') {
+      throw MongoError.create({ message: `flag ${flag} must be a boolean value`, driver: true });
+    }
+
+    this.cmd[flag] = value;
+    return this;
+  }
+
+  /**
+   * Add a query modifier to the cursor query
+   * @method
+   * @param {string} name The query modifier (must start with $, such as $orderby etc)
+   * @param {string|boolean|number} value The modifier value.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  addQueryModifier(name, value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (name[0] !== '$') {
+      throw MongoError.create({ message: `${name} is not a valid query modifier`, driver: true });
+    }
+
+    // Strip of the $
+    const field = name.substr(1);
+    // Set on the command
+    this.cmd[field] = value;
+    // Deal with the special case for sort
+    if (field === 'orderby') this.cmd.sort = this.cmd[field];
+    return this;
+  }
+
+  /**
+   * Add a comment to the cursor query allowing for tracking the comment in the log.
+   * @method
+   * @param {string} value The comment attached to this query.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  comment(value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.comment = value;
+    return this;
+  }
+
+  /**
+   * Set a maxAwaitTimeMS on a tailing cursor query to allow to customize the timeout value for the option awaitData (Only supported on MongoDB 3.2 or higher, ignored otherwise)
+   * @method
+   * @param {number} value Number of milliseconds to wait before aborting the tailed query.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  maxAwaitTimeMS(value) {
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'maxAwaitTimeMS must be a number', driver: true });
+    }
+
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.maxAwaitTimeMS = value;
+    return this;
+  }
+
+  /**
+   * Set a maxTimeMS on the cursor query, allowing for hard timeout limits on queries (Only supported on MongoDB 2.6 or higher)
+   * @method
+   * @param {number} value Number of milliseconds to wait before aborting the query.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  maxTimeMS(value) {
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'maxTimeMS must be a number', driver: true });
+    }
+
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.maxTimeMS = value;
+    return this;
+  }
+
+  /**
+   * Sets a field projection for the query.
+   * @method
+   * @param {object} value The field projection object.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  project(value) {
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    this.cmd.fields = value;
+    return this;
+  }
+
+  /**
+   * Sets the sort order of the cursor query.
+   * @method
+   * @param {(string|array|object)} keyOrList The key or keys set for the sort.
+   * @param {number} [direction] The direction of the sorting (1 or -1).
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  sort(keyOrList, direction) {
+    if (this.options.tailable) {
+      throw MongoError.create({ message: "Tailable cursor doesn't support sorting", driver: true });
+    }
+
+    if (this.s.state === CursorState.CLOSED || this.s.state === CursorState.OPEN || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    let order = keyOrList;
+
+    // We have an array of arrays, we need to preserve the order of the sort
+    // so we will us a Map
+    if (Array.isArray(order) && Array.isArray(order[0])) {
+      order = new Map(
+        order.map(x => {
+          const value = [x[0], null];
+          if (x[1] === 'asc') {
+            value[1] = 1;
+          } else if (x[1] === 'desc') {
+            value[1] = -1;
+          } else if (x[1] === 1 || x[1] === -1 || x[1].$meta) {
+            value[1] = x[1];
+          } else {
+            throw new MongoError(
+              "Illegal sort clause, must be of the form [['field1', '(ascending|descending)'], ['field2', '(ascending|descending)']]"
+            );
+          }
+
+          return value;
+        })
+      );
+    }
+
+    if (direction != null) {
+      order = [[keyOrList, direction]];
+    }
+
+    this.cmd.sort = order;
+    return this;
+  }
+
+  /**
+   * Set the batch size for the cursor.
+   * @method
+   * @param {number} value The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find/|find command documentation}.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  batchSize(value) {
+    if (this.options.tailable) {
+      throw MongoError.create({
+        message: "Tailable cursor doesn't support batchSize",
+        driver: true
+      });
+    }
+
+    if (this.s.state === CursorState.CLOSED || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'batchSize requires an integer', driver: true });
+    }
+
+    this.cmd.batchSize = value;
+    this.setCursorBatchSize(value);
+    return this;
+  }
+
+  /**
+   * Set the collation options for the cursor.
+   * @method
+   * @param {object} value The cursor collation options (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  collation(value) {
+    this.cmd.collation = value;
+    return this;
+  }
+
+  /**
+   * Set the limit for the cursor.
+   * @method
+   * @param {number} value The limit for the cursor query.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  limit(value) {
+    if (this.options.tailable) {
+      throw MongoError.create({ message: "Tailable cursor doesn't support limit", driver: true });
+    }
+
+    if (this.s.state === CursorState.OPEN || this.s.state === CursorState.CLOSED || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'limit requires an integer', driver: true });
+    }
+
+    this.cmd.limit = value;
+    this.setCursorLimit(value);
+    return this;
+  }
+
+  /**
+   * Set the skip for the cursor.
+   * @method
+   * @param {number} value The skip for the cursor query.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  skip(value) {
+    if (this.options.tailable) {
+      throw MongoError.create({ message: "Tailable cursor doesn't support skip", driver: true });
+    }
+
+    if (this.s.state === CursorState.OPEN || this.s.state === CursorState.CLOSED || this.isDead()) {
+      throw MongoError.create({ message: 'Cursor is closed', driver: true });
+    }
+
+    if (typeof value !== 'number') {
+      throw MongoError.create({ message: 'skip requires an integer', driver: true });
+    }
+
+    this.cmd.skip = value;
+    this.setCursorSkip(value);
+    return this;
+  }
+
+  /**
+   * The callback format for results
+   * @callback Cursor~resultCallback
+   * @param {MongoError} error An error instance representing the error during the execution.
+   * @param {(object|null|boolean)} result The result object if the command was executed successfully.
+   */
+
+  /**
+   * Clone the cursor
+   * @function external:CoreCursor#clone
+   * @return {Cursor}
+   */
+
+  /**
+   * Resets the cursor
+   * @function external:CoreCursor#rewind
+   * @return {null}
+   */
+
+  /**
+   * Iterates over all the documents for this cursor. As with **{cursor.toArray}**,
+   * not all of the elements will be iterated if this cursor had been previously accessed.
+   * In that case, **{cursor.rewind}** can be used to reset the cursor. However, unlike
+   * **{cursor.toArray}**, the cursor will only hold a maximum of batch size elements
+   * at any given time if batch size is specified. Otherwise, the caller is responsible
+   * for making sure that the entire result can fit the memory.
+   * @method
+   * @deprecated
+   * @param {Cursor~resultCallback} callback The result callback.
+   * @throws {MongoError}
+   * @return {null}
+   */
+  each(callback) {
+    // Rewind cursor state
+    this.rewind();
+    // Set current cursor to INIT
+    this.s.state = CursorState.INIT;
+    // Run the query
+    each(this, callback);
+  }
+
+  /**
+   * The callback format for the forEach iterator method
+   * @callback Cursor~iteratorCallback
+   * @param {Object} doc An emitted document for the iterator
+   */
+
+  /**
+   * The callback error format for the forEach iterator method
+   * @callback Cursor~endCallback
+   * @param {MongoError} error An error instance representing the error during the execution.
+   */
+
+  /**
+   * Iterates over all the documents for this cursor using the iterator, callback pattern.
+   * @method
+   * @param {Cursor~iteratorCallback} iterator The iteration callback.
+   * @param {Cursor~endCallback} callback The end callback.
+   * @throws {MongoError}
+   * @return {Promise} if no callback supplied
+   */
+  forEach(iterator, callback) {
+    // Rewind cursor state
+    this.rewind();
+
+    // Set current cursor to INIT
+    this.s.state = CursorState.INIT;
+
+    if (typeof callback === 'function') {
+      each(this, (err, doc) => {
+        if (err) {
+          callback(err);
+          return false;
+        }
+        if (doc != null) {
+          iterator(doc);
+          return true;
+        }
+        if (doc == null && callback) {
+          const internalCallback = callback;
+          callback = null;
+          internalCallback(null);
+          return false;
+        }
+      });
+    } else {
+      return new this.s.promiseLibrary((fulfill, reject) => {
+        each(this, (err, doc) => {
+          if (err) {
+            reject(err);
+            return false;
+          } else if (doc == null) {
+            fulfill(null);
+            return false;
+          } else {
+            iterator(doc);
+            return true;
+          }
+        });
+      });
+    }
+  }
+
+  /**
+   * Set the ReadPreference for the cursor.
+   * @method
+   * @param {(string|ReadPreference)} readPreference The new read preference for the cursor.
+   * @throws {MongoError}
+   * @return {Cursor}
+   */
+  setReadPreference(readPreference) {
+    if (this.s.state !== CursorState.INIT) {
+      throw MongoError.create({
+        message: 'cannot change cursor readPreference after cursor has been accessed',
+        driver: true
+      });
+    }
+
+    if (readPreference instanceof ReadPreference) {
+      this.options.readPreference = readPreference;
+    } else if (typeof readPreference === 'string') {
+      this.options.readPreference = new ReadPreference(readPreference);
+    } else {
+      throw new TypeError('Invalid read preference: ' + readPreference);
+    }
+
+    return this;
+  }
+
+  /**
+   * The callback format for results
+   * @callback Cursor~toArrayResultCallback
+   * @param {MongoError} error An error instance representing the error during the execution.
+   * @param {object[]} documents All the documents the satisfy the cursor.
+   */
+
+  /**
+   * Returns an array of documents. The caller is responsible for making sure that there
+   * is enough memory to store the results. Note that the array only contains partial
+   * results when this cursor had been previously accessed. In that case,
+   * cursor.rewind() can be used to reset the cursor.
+   * @method
+   * @param {Cursor~toArrayResultCallback} [callback] The result callback.
+   * @throws {MongoError}
+   * @return {Promise} returns Promise if no callback passed
+   */
+  toArray(callback) {
+    if (this.options.tailable) {
+      throw MongoError.create({
+        message: 'Tailable cursor cannot be converted to array',
+        driver: true
+      });
+    }
+
+    return maybePromise(this, callback, cb => {
+      const cursor = this;
+      const items = [];
+
+      // Reset cursor
+      cursor.rewind();
+      cursor.s.state = CursorState.INIT;
+
+      // Fetch all the documents
+      const fetchDocs = () => {
+        cursor._next((err, doc) => {
+          if (err) {
+            return handleCallback(cb, err);
+          }
+
+          if (doc == null) {
+            return cursor.close({ skipKillCursors: true }, () => handleCallback(cb, null, items));
+          }
+
+          // Add doc to items
+          items.push(doc);
+
+          // Get all buffered objects
+          if (cursor.bufferedCount() > 0) {
+            let docs = cursor.readBufferedDocuments(cursor.bufferedCount());
+            Array.prototype.push.apply(items, docs);
+          }
+
+          // Attempt a fetch
+          fetchDocs();
+        });
+      };
+
+      fetchDocs();
+    });
+  }
+
+  /**
+   * The callback format for results
+   * @callback Cursor~countResultCallback
+   * @param {MongoError} error An error instance representing the error during the execution.
+   * @param {number} count The count of documents.
+   */
+
+  /**
+   * Get the count of documents for this cursor
+   * @method
+   * @param {boolean} [applySkipLimit=true] Should the count command apply limit and skip settings on the cursor or in the passed in options.
+   * @param {object} [options] Optional settings.
+   * @param {number} [options.skip] The number of documents to skip.
+   * @param {number} [options.limit] The maximum amounts to count before aborting.
+   * @param {number} [options.maxTimeMS] Number of milliseconds to wait before aborting the query.
+   * @param {string} [options.hint] An index name hint for the query.
+   * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+   * @param {Cursor~countResultCallback} [callback] The result callback.
+   * @return {Promise} returns Promise if no callback passed
+   */
+  count(applySkipLimit, opts, callback) {
+    if (this.cmd.query == null)
+      throw MongoError.create({
+        message: 'count can only be used with find command',
+        driver: true
+      });
+    if (typeof opts === 'function') (callback = opts), (opts = {});
+    opts = opts || {};
+
+    if (typeof applySkipLimit === 'function') {
+      callback = applySkipLimit;
+      applySkipLimit = true;
+    }
+
+    if (this.cursorState.session) {
+      opts = Object.assign({}, opts, { session: this.cursorState.session });
+    }
+
+    const countOperation = new CountOperation(this, applySkipLimit, opts);
+
+    return executeOperation(this.topology, countOperation, callback);
+  }
+
+  /**
+   * Close the cursor, sending a KillCursor command and emitting close.
+   * @method
+   * @param {object} [options] Optional settings.
+   * @param {boolean} [options.skipKillCursors] Bypass calling killCursors when closing the cursor.
+   * @param {Cursor~resultCallback} [callback] The result callback.
+   * @return {Promise} returns Promise if no callback passed
+   */
+  close(options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = Object.assign({}, { skipKillCursors: false }, options);
+
+    return maybePromise(this, callback, cb => {
+      this.s.state = CursorState.CLOSED;
+      if (!options.skipKillCursors) {
+        // Kill the cursor
+        this.kill();
+      }
+
+      this._endSession(() => {
+        this.emit('close');
+        cb(null, this);
+      });
+    });
+  }
+
+  /**
+   * Map all documents using the provided function
+   * @method
+   * @param {function} [transform] The mapping transformation method.
+   * @return {Cursor}
+   */
+  map(transform) {
+    if (this.cursorState.transforms && this.cursorState.transforms.doc) {
+      const oldTransform = this.cursorState.transforms.doc;
+      this.cursorState.transforms.doc = doc => {
+        return transform(oldTransform(doc));
+      };
+    } else {
+      this.cursorState.transforms = { doc: transform };
+    }
+
+    return this;
+  }
+
+  /**
+   * Is the cursor closed
+   * @method
+   * @return {boolean}
+   */
+  isClosed() {
+    return this.isDead();
+  }
+
+  destroy(err) {
+    if (err) this.emit('error', err);
+    this.pause();
+    this.close();
+  }
+
+  /**
+   * Return a modified Readable stream including a possible transform method.
+   * @method
+   * @param {object} [options] Optional settings.
+   * @param {function} [options.transform] A transformation method applied to each document emitted by the stream.
+   * @return {Cursor}
+   * TODO: replace this method with transformStream in next major release
+   */
+  stream(options) {
+    this.cursorState.streamOptions = options || {};
+    return this;
+  }
+
+  /**
+   * Return a modified Readable stream that applies a given transform function, if supplied. If none supplied,
+   * returns a stream of unmodified docs.
+   * @method
+   * @param {object} [options] Optional settings.
+   * @param {function} [options.transform] A transformation method applied to each document emitted by the stream.
+   * @return {stream}
+   */
+  transformStream(options) {
+    const streamOptions = options || {};
+    if (typeof streamOptions.transform === 'function') {
+      const stream = new Transform({
+        objectMode: true,
+        transform: function(chunk, encoding, callback) {
+          this.push(streamOptions.transform(chunk));
+          callback();
+        }
+      });
+
+      return this.pipe(stream);
+    }
+
+    return this.pipe(new PassThrough({ objectMode: true }));
+  }
+
+  /**
+   * Execute the explain for the cursor
+   *
+   * For backwards compatibility, a verbosity of true is interpreted as "allPlansExecution"
+   * and false as "queryPlanner". Prior to server version 3.6, aggregate()
+   * ignores the verbosity parameter and executes in "queryPlanner".
+   *
+   * @method
+   * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [verbosity=true] - An optional mode in which to run the explain.
+   * @param {Cursor~resultCallback} [callback] The result callback.
+   * @return {Promise} returns Promise if no callback passed
+   */
+  explain(verbosity, callback) {
+    if (typeof verbosity === 'function') (callback = verbosity), (verbosity = true);
+    if (verbosity === undefined) verbosity = true;
+
+    if (!this.operation || !this.operation.hasAspect(Aspect.EXPLAINABLE)) {
+      throw new MongoError('This command cannot be explained');
+    }
+    this.operation.explain = new Explain(verbosity);
+
+    return maybePromise(this, callback, cb => {
+      CoreCursor.prototype._next.apply(this, [cb]);
+    });
+  }
+
+  /**
+   * Return the cursor logger
+   * @method
+   * @return {Logger} return the cursor logger
+   * @ignore
+   */
+  getLogger() {
+    return this.logger;
+  }
+}
+
+/**
+ * Cursor stream data event, fired for each document in the cursor.
+ *
+ * @event Cursor#data
+ * @type {object}
+ */
+
+/**
+ * Cursor stream end event
+ *
+ * @event Cursor#end
+ * @type {null}
+ */
+
+/**
+ * Cursor stream close event
+ *
+ * @event Cursor#close
+ * @type {null}
+ */
+
+/**
+ * Cursor stream readable event
+ *
+ * @event Cursor#readable
+ * @type {null}
+ */
+
+// aliases
+Cursor.prototype.maxTimeMs = Cursor.prototype.maxTimeMS;
+
+// deprecated methods
+deprecate(Cursor.prototype.each, 'Cursor.each is deprecated. Use Cursor.forEach instead.');
+deprecate(
+  Cursor.prototype.maxScan,
+  'Cursor.maxScan is deprecated, and will be removed in a later version'
+);
+
+deprecate(
+  Cursor.prototype.snapshot,
+  'Cursor Snapshot is deprecated, and will be removed in a later version'
+);
+
+/**
+ * The read() method pulls some data out of the internal buffer and returns it. If there is no data available, then it will return null.
+ * @function external:Readable#read
+ * @param {number} size Optional argument to specify how much data to read.
+ * @return {(String | Buffer | null)}
+ */
+
+/**
+ * Call this function to cause the stream to return strings of the specified encoding instead of Buffer objects.
+ * @function external:Readable#setEncoding
+ * @param {string} encoding The encoding to use.
+ * @return {null}
+ */
+
+/**
+ * This method will cause the readable stream to resume emitting data events.
+ * @function external:Readable#resume
+ * @return {null}
+ */
+
+/**
+ * This method will cause a stream in flowing-mode to stop emitting data events. Any data that becomes available will remain in the internal buffer.
+ * @function external:Readable#pause
+ * @return {null}
+ */
+
+/**
+ * This method pulls all the data out of a readable stream, and writes it to the supplied destination, automatically managing the flow so that the destination is not overwhelmed by a fast readable stream.
+ * @function external:Readable#pipe
+ * @param {Writable} destination The destination for writing data
+ * @param {object} [options] Pipe options
+ * @return {null}
+ */
+
+/**
+ * This method will remove the hooks set up for a previous pipe() call.
+ * @function external:Readable#unpipe
+ * @param {Writable} [destination] The destination for writing data
+ * @return {null}
+ */
+
+/**
+ * This is useful in certain cases where a stream is being consumed by a parser, which needs to "un-consume" some data that it has optimistically pulled out of the source, so that the stream can be passed on to some other party.
+ * @function external:Readable#unshift
+ * @param {(Buffer|string)} chunk Chunk of data to unshift onto the read queue.
+ * @return {null}
+ */
+
+/**
+ * Versions of Node prior to v0.10 had streams that did not implement the entire Streams API as it is today. (See "Compatibility" below for more information.)
+ * @function external:Readable#wrap
+ * @param {Stream} stream An "old style" readable stream.
+ * @return {null}
+ */
+
+module.exports = Cursor;
diff --git a/NodeAPI/node_modules/mongodb/lib/db.js b/NodeAPI/node_modules/mongodb/lib/db.js
new file mode 100644
index 0000000000000000000000000000000000000000..54e16bf769c2c2333ba626b69acabacd42824f76
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/db.js
@@ -0,0 +1,1054 @@
+'use strict';
+
+const EventEmitter = require('events').EventEmitter;
+const inherits = require('util').inherits;
+const getSingleProperty = require('./utils').getSingleProperty;
+const CommandCursor = require('./command_cursor');
+const handleCallback = require('./utils').handleCallback;
+const filterOptions = require('./utils').filterOptions;
+const toError = require('./utils').toError;
+const ReadPreference = require('./core').ReadPreference;
+const MongoError = require('./core').MongoError;
+const ObjectID = require('./core').ObjectID;
+const Logger = require('./core').Logger;
+const Collection = require('./collection');
+const conditionallyMergeWriteConcern = require('./utils').conditionallyMergeWriteConcern;
+const executeLegacyOperation = require('./utils').executeLegacyOperation;
+const ChangeStream = require('./change_stream');
+const deprecate = require('util').deprecate;
+const deprecateOptions = require('./utils').deprecateOptions;
+const MongoDBNamespace = require('./utils').MongoDBNamespace;
+const CONSTANTS = require('./constants');
+const WriteConcern = require('./write_concern');
+const ReadConcern = require('./read_concern');
+const AggregationCursor = require('./aggregation_cursor');
+
+// Operations
+const createListener = require('./operations/db_ops').createListener;
+const ensureIndex = require('./operations/db_ops').ensureIndex;
+const evaluate = require('./operations/db_ops').evaluate;
+const profilingInfo = require('./operations/db_ops').profilingInfo;
+const validateDatabaseName = require('./operations/db_ops').validateDatabaseName;
+
+const AggregateOperation = require('./operations/aggregate');
+const AddUserOperation = require('./operations/add_user');
+const CollectionsOperation = require('./operations/collections');
+const CommandOperation = require('./operations/command');
+const RunCommandOperation = require('./operations/run_command');
+const CreateCollectionOperation = require('./operations/create_collection');
+const CreateIndexesOperation = require('./operations/create_indexes');
+const DropCollectionOperation = require('./operations/drop').DropCollectionOperation;
+const DropDatabaseOperation = require('./operations/drop').DropDatabaseOperation;
+const ExecuteDbAdminCommandOperation = require('./operations/execute_db_admin_command');
+const IndexInformationOperation = require('./operations/index_information');
+const ListCollectionsOperation = require('./operations/list_collections');
+const ProfilingLevelOperation = require('./operations/profiling_level');
+const RemoveUserOperation = require('./operations/remove_user');
+const RenameOperation = require('./operations/rename');
+const SetProfilingLevelOperation = require('./operations/set_profiling_level');
+
+const executeOperation = require('./operations/execute_operation');
+
+/**
+ * @fileOverview The **Db** class is a class that represents a MongoDB Database.
+ *
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   // Select the database by name
+ *   const testDb = client.db(dbName);
+ *   client.close();
+ * });
+ */
+
+// Allowed parameters
+const legalOptionNames = [
+  'w',
+  'wtimeout',
+  'fsync',
+  'j',
+  'writeConcern',
+  'readPreference',
+  'readPreferenceTags',
+  'native_parser',
+  'forceServerObjectId',
+  'pkFactory',
+  'serializeFunctions',
+  'raw',
+  'bufferMaxEntries',
+  'authSource',
+  'ignoreUndefined',
+  'promoteLongs',
+  'promiseLibrary',
+  'readConcern',
+  'retryMiliSeconds',
+  'numberOfRetries',
+  'parentDb',
+  'noListener',
+  'loggerLevel',
+  'logger',
+  'promoteBuffers',
+  'promoteLongs',
+  'promoteValues',
+  'compression',
+  'retryWrites'
+];
+
+/**
+ * Creates a new Db instance
+ * @class
+ * @param {string} databaseName The name of the database this instance represents.
+ * @param {(Server|ReplSet|Mongos)} topology The server topology for the database.
+ * @param {object} [options] Optional settings.
+ * @param {string} [options.authSource] If the database authentication is dependent on another databaseName.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.forceServerObjectId=false] Force server to assign _id values instead of driver.
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {Boolean} [options.ignoreUndefined=false] Specify if the BSON serializer should ignore undefined fields.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {number} [options.bufferMaxEntries=-1] Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys.
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {object} [options.readConcern] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported)
+ * @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
+ * @property {(Server|ReplSet|Mongos)} serverConfig Get the current db topology.
+ * @property {number} bufferMaxEntries Current bufferMaxEntries value for the database
+ * @property {string} databaseName The name of the database this instance represents.
+ * @property {object} options The options associated with the db instance.
+ * @property {boolean} native_parser The current value of the parameter native_parser.
+ * @property {boolean} slaveOk The current slaveOk value for the db instance.
+ * @property {object} writeConcern The current write concern values.
+ * @property {object} topology Access the topology object (single server, replicaset or mongos).
+ * @fires Db#close
+ * @fires Db#reconnect
+ * @fires Db#error
+ * @fires Db#timeout
+ * @fires Db#parseError
+ * @fires Db#fullsetup
+ * @return {Db} a Db instance.
+ */
+function Db(databaseName, topology, options) {
+  options = options || {};
+  if (!(this instanceof Db)) return new Db(databaseName, topology, options);
+  EventEmitter.call(this);
+
+  // Get the promiseLibrary
+  const promiseLibrary = options.promiseLibrary || Promise;
+
+  // Filter the options
+  options = filterOptions(options, legalOptionNames);
+
+  // Ensure we put the promiseLib in the options
+  options.promiseLibrary = promiseLibrary;
+
+  // Internal state of the db object
+  this.s = {
+    // DbCache
+    dbCache: {},
+    // Children db's
+    children: [],
+    // Topology
+    topology: topology,
+    // Options
+    options: options,
+    // Logger instance
+    logger: Logger('Db', options),
+    // Get the bson parser
+    bson: topology ? topology.bson : null,
+    // Unpack read preference
+    readPreference: ReadPreference.fromOptions(options),
+    // Set buffermaxEntries
+    bufferMaxEntries: typeof options.bufferMaxEntries === 'number' ? options.bufferMaxEntries : -1,
+    // Parent db (if chained)
+    parentDb: options.parentDb || null,
+    // Set up the primary key factory or fallback to ObjectID
+    pkFactory: options.pkFactory || ObjectID,
+    // Get native parser
+    nativeParser: options.nativeParser || options.native_parser,
+    // Promise library
+    promiseLibrary: promiseLibrary,
+    // No listener
+    noListener: typeof options.noListener === 'boolean' ? options.noListener : false,
+    // ReadConcern
+    readConcern: ReadConcern.fromOptions(options),
+    writeConcern: WriteConcern.fromOptions(options),
+    // Namespace
+    namespace: new MongoDBNamespace(databaseName)
+  };
+
+  // Ensure we have a valid db name
+  validateDatabaseName(databaseName);
+
+  // Add a read Only property
+  getSingleProperty(this, 'serverConfig', this.s.topology);
+  getSingleProperty(this, 'bufferMaxEntries', this.s.bufferMaxEntries);
+  getSingleProperty(this, 'databaseName', this.s.namespace.db);
+
+  // This is a child db, do not register any listeners
+  if (options.parentDb) return;
+  if (this.s.noListener) return;
+
+  // Add listeners
+  topology.on('error', createListener(this, 'error', this));
+  topology.on('timeout', createListener(this, 'timeout', this));
+  topology.on('close', createListener(this, 'close', this));
+  topology.on('parseError', createListener(this, 'parseError', this));
+  topology.once('open', createListener(this, 'open', this));
+  topology.once('fullsetup', createListener(this, 'fullsetup', this));
+  topology.once('all', createListener(this, 'all', this));
+  topology.on('reconnect', createListener(this, 'reconnect', this));
+}
+
+inherits(Db, EventEmitter);
+
+Db.prototype.on = deprecate(function() {
+  return Db.super_.prototype.on.apply(this, arguments);
+}, 'Listening to events on the Db class has been deprecated and will be removed in the next major version.');
+
+Db.prototype.once = deprecate(function() {
+  return Db.super_.prototype.once.apply(this, arguments);
+}, 'Listening to events on the Db class has been deprecated and will be removed in the next major version.');
+
+// Topology
+Object.defineProperty(Db.prototype, 'topology', {
+  enumerable: true,
+  get: function() {
+    return this.s.topology;
+  }
+});
+
+// Options
+Object.defineProperty(Db.prototype, 'options', {
+  enumerable: true,
+  get: function() {
+    return this.s.options;
+  }
+});
+
+// slaveOk specified
+Object.defineProperty(Db.prototype, 'slaveOk', {
+  enumerable: true,
+  get: function() {
+    if (
+      this.s.options.readPreference != null &&
+      (this.s.options.readPreference !== 'primary' ||
+        this.s.options.readPreference.mode !== 'primary')
+    ) {
+      return true;
+    }
+    return false;
+  }
+});
+
+Object.defineProperty(Db.prototype, 'readConcern', {
+  enumerable: true,
+  get: function() {
+    return this.s.readConcern;
+  }
+});
+
+Object.defineProperty(Db.prototype, 'readPreference', {
+  enumerable: true,
+  get: function() {
+    if (this.s.readPreference == null) {
+      // TODO: check client
+      return ReadPreference.primary;
+    }
+
+    return this.s.readPreference;
+  }
+});
+
+// get the write Concern
+Object.defineProperty(Db.prototype, 'writeConcern', {
+  enumerable: true,
+  get: function() {
+    return this.s.writeConcern;
+  }
+});
+
+Object.defineProperty(Db.prototype, 'namespace', {
+  enumerable: true,
+  get: function() {
+    return this.s.namespace.toString();
+  }
+});
+
+/**
+ * Execute a command
+ * @method
+ * @param {object} command The command hash
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.command = function(command, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options);
+
+  const commandOperation = new RunCommandOperation(this, command, options);
+
+  return executeOperation(this.s.topology, commandOperation, callback);
+};
+
+/**
+ * Execute an aggregation framework pipeline against the database, needs MongoDB >= 3.6
+ * @method
+ * @param {object} [pipeline=[]] Array containing all the aggregation framework commands for the execution.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {object} [options.cursor] Return the query as cursor, on 2.6 > it returns as a real cursor on pre 2.6 it returns as an emulated cursor.
+ * @param {number} [options.cursor.batchSize=1000] Deprecated. Use `options.batchSize`
+ * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output.
+ * @param {boolean} [options.allowDiskUse=false] allowDiskUse lets the server know if it can use disk to store temporary results for the aggregation (requires mongodb 2.6 >).
+ * @param {number} [options.maxTimeMS] maxTimeMS specifies a cumulative time limit in milliseconds for processing operations on the cursor. MongoDB interrupts the operation at the earliest following interrupt point.
+ * @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a tailable cursor query.
+ * @param {boolean} [options.bypassDocumentValidation=false] Allow driver to bypass schema validation in MongoDB 3.2 or higher.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {boolean} [options.promoteLongs=true] Promotes Long values to number if they fit inside the 53 bits resolution.
+ * @param {boolean} [options.promoteValues=true] Promotes BSON values to native types where possible, set to false to only receive wrapper types.
+ * @param {boolean} [options.promoteBuffers=false] Promotes Binary BSON values to native Node Buffers.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {string} [options.comment] Add a comment to an aggregation command
+ * @param {string|object} [options.hint] Add an index selection hint to an aggregation command
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Database~aggregationCallback} callback The command result callback
+ * @return {(null|AggregationCursor)}
+ */
+Db.prototype.aggregate = function(pipeline, options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  // If we have no options or callback we are doing
+  // a cursor based aggregation
+  if (options == null && callback == null) {
+    options = {};
+  }
+
+  const cursor = new AggregationCursor(
+    this.s.topology,
+    new AggregateOperation(this, pipeline, options),
+    options
+  );
+
+  // TODO: remove this when NODE-2074 is resolved
+  if (typeof callback === 'function') {
+    callback(null, cursor);
+    return;
+  }
+
+  return cursor;
+};
+
+/**
+ * Return the Admin db instance
+ * @method
+ * @return {Admin} return the new Admin db instance
+ */
+Db.prototype.admin = function() {
+  const Admin = require('./admin');
+
+  return new Admin(this, this.s.topology, this.s.promiseLibrary);
+};
+
+/**
+ * The callback format for the collection method, must be used if strict is specified
+ * @callback Db~collectionResultCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection} collection The collection instance.
+ */
+
+/**
+ * The callback format for an aggregation call
+ * @callback Database~aggregationCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {AggregationCursor} cursor The cursor if the aggregation command was executed successfully.
+ */
+
+const COLLECTION_OPTION_KEYS = [
+  'pkFactory',
+  'readPreference',
+  'serializeFunctions',
+  'strict',
+  'readConcern',
+  'ignoreUndefined',
+  'promoteValues',
+  'promoteBuffers',
+  'promoteLongs'
+];
+
+/**
+ * Fetch a specific collection (containing the actual collection information). If the application does not use strict mode you
+ * can use it without a callback in the following way: `const collection = db.collection('mycollection');`
+ *
+ * @method
+ * @param {string} name the collection name we wish to access.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.strict=false] Returns an error if the collection does not exist
+ * @param {object} [options.readConcern] Specify a read concern for the collection. (only MongoDB 3.2 or higher supported)
+ * @param {ReadConcernLevel} [options.readConcern.level='local'] Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
+ * @param {Db~collectionResultCallback} [callback] The collection result callback
+ * @return {Collection} return the new Collection instance if not in strict mode
+ */
+Db.prototype.collection = function(name, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+  options = Object.assign({}, options);
+
+  // Set the promise library
+  options.promiseLibrary = this.s.promiseLibrary;
+
+  // If we have not set a collection level readConcern set the db level one
+  options.readConcern = options.readConcern
+    ? new ReadConcern(options.readConcern.level)
+    : this.readConcern;
+
+  // Do we have ignoreUndefined set
+  if (this.s.options.ignoreUndefined) {
+    options.ignoreUndefined = this.s.options.ignoreUndefined;
+  }
+
+  for (const collectionOptionKey of COLLECTION_OPTION_KEYS) {
+    if (!(collectionOptionKey in options) && this.s.options[collectionOptionKey] !== undefined) {
+      options[collectionOptionKey] = this.s.options[collectionOptionKey];
+    }
+  }
+
+  // Merge in all needed options and ensure correct writeConcern merging from db level
+  options = conditionallyMergeWriteConcern(options, this.s.options);
+
+  // Execute
+  if (options == null || !options.strict) {
+    try {
+      const collection = new Collection(
+        this,
+        this.s.topology,
+        this.databaseName,
+        name,
+        this.s.pkFactory,
+        options
+      );
+      if (callback) callback(null, collection);
+      return collection;
+    } catch (err) {
+      if (err instanceof MongoError && callback) return callback(err);
+      throw err;
+    }
+  }
+
+  // Strict mode
+  if (typeof callback !== 'function') {
+    throw toError(`A callback is required in strict mode. While getting collection ${name}`);
+  }
+
+  // Did the user destroy the topology
+  if (this.serverConfig && this.serverConfig.isDestroyed()) {
+    return callback(new MongoError('topology was destroyed'));
+  }
+
+  const listCollectionOptions = Object.assign({}, options, { nameOnly: true });
+
+  // Strict mode
+  this.listCollections({ name: name }, listCollectionOptions).toArray((err, collections) => {
+    if (err != null) return handleCallback(callback, err, null);
+    if (collections.length === 0)
+      return handleCallback(
+        callback,
+        toError(`Collection ${name} does not exist. Currently in strict mode.`),
+        null
+      );
+
+    try {
+      return handleCallback(
+        callback,
+        null,
+        new Collection(this, this.s.topology, this.databaseName, name, this.s.pkFactory, options)
+      );
+    } catch (err) {
+      return handleCallback(callback, err, null);
+    }
+  });
+};
+
+/**
+ * Create a new collection on a server with the specified options. Use this to create capped collections.
+ * More information about command options available at https://docs.mongodb.com/manual/reference/command/create/
+ *
+ * @method
+ * @param {string} name the collection name we wish to access.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.raw=false] Return document results as raw BSON buffers.
+ * @param {object} [options.pkFactory] A primary key factory object for generation of custom _id keys.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {boolean} [options.serializeFunctions=false] Serialize functions on any object.
+ * @param {boolean} [options.strict=false] DEPRECATED: Returns an error if the collection does not exist
+ * @param {boolean} [options.capped=false] Create a capped collection.
+ * @param {boolean} [options.autoIndexId=true] DEPRECATED: Create an index on the _id field of the document, True by default on MongoDB 2.6 - 3.0
+ * @param {number} [options.size] The size of the capped collection in bytes.
+ * @param {number} [options.max] The maximum number of documents in the capped collection.
+ * @param {number} [options.flags] Optional. Available for the MMAPv1 storage engine only to set the usePowerOf2Sizes and the noPadding flag.
+ * @param {object} [options.storageEngine] Allows users to specify configuration to the storage engine on a per-collection basis when creating a collection on MongoDB 3.0 or higher.
+ * @param {object} [options.validator] Allows users to specify validation rules or expressions for the collection. For more information, see Document Validation on MongoDB 3.2 or higher.
+ * @param {string} [options.validationLevel] Determines how strictly MongoDB applies the validation rules to existing documents during an update on MongoDB 3.2 or higher.
+ * @param {string} [options.validationAction] Determines whether to error on invalid documents or just warn about the violations but allow invalid documents to be inserted on MongoDB 3.2 or higher.
+ * @param {object} [options.indexOptionDefaults] Allows users to specify a default configuration for indexes when creating a collection on MongoDB 3.2 or higher.
+ * @param {string} [options.viewOn] The name of the source collection or view from which to create the view. The name is not the full namespace of the collection or view; i.e. does not include the database name and implies the same database as the view to create on MongoDB 3.4 or higher.
+ * @param {array} [options.pipeline] An array that consists of the aggregation pipeline stage. Creates the view by applying the specified pipeline to the viewOn collection or view on MongoDB 3.4 or higher.
+ * @param {object} [options.collation] Specify collation (MongoDB 3.4 or higher) settings for update operation (see 3.4 documentation for available fields).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~collectionResultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.createCollection = deprecateOptions(
+  {
+    name: 'Db.createCollection',
+    deprecatedOptions: ['autoIndexId', 'strict', 'w', 'wtimeout', 'j'],
+    optionsIndex: 1
+  },
+  function(name, options, callback) {
+    if (typeof options === 'function') (callback = options), (options = {});
+    options = options || {};
+    options.promiseLibrary = options.promiseLibrary || this.s.promiseLibrary;
+    options.readConcern = options.readConcern
+      ? new ReadConcern(options.readConcern.level)
+      : this.readConcern;
+    const createCollectionOperation = new CreateCollectionOperation(this, name, options);
+
+    return executeOperation(this.s.topology, createCollectionOperation, callback);
+  }
+);
+
+/**
+ * Get all the db statistics.
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.scale] Divide the returned sizes by scale value.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The collection result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.stats = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+  // Build command object
+  const commandObject = { dbStats: true };
+  // Check if we have the scale value
+  if (options['scale'] != null) commandObject['scale'] = options['scale'];
+
+  // If we have a readPreference set
+  if (options.readPreference == null && this.s.readPreference) {
+    options.readPreference = this.s.readPreference;
+  }
+
+  const statsOperation = new CommandOperation(this, options, null, commandObject);
+
+  // Execute the command
+  return executeOperation(this.s.topology, statsOperation, callback);
+};
+
+/**
+ * Get the list of all collection information for the specified db.
+ *
+ * @method
+ * @param {object} [filter={}] Query to filter collections by
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.nameOnly=false] Since 4.0: If true, will only return the collection name in the response, and will omit additional info
+ * @param {number} [options.batchSize=1000] The batchSize for the returned command cursor or if pre 2.8 the systems batch collection
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @return {CommandCursor}
+ */
+Db.prototype.listCollections = function(filter, options) {
+  filter = filter || {};
+  options = options || {};
+
+  return new CommandCursor(
+    this.s.topology,
+    new ListCollectionsOperation(this, filter, options),
+    options
+  );
+};
+
+/**
+ * Evaluate JavaScript on the server
+ *
+ * @method
+ * @param {Code} code JavaScript to execute on server.
+ * @param {(object|array)} parameters The parameters for the call.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.nolock=false] Tell MongoDB not to block on the evaluation of the javascript.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The results callback
+ * @deprecated Eval is deprecated on MongoDB 3.2 and forward
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.eval = deprecate(function(code, parameters, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  parameters = args.length ? args.shift() : parameters;
+  options = args.length ? args.shift() || {} : {};
+
+  return executeLegacyOperation(this.s.topology, evaluate, [
+    this,
+    code,
+    parameters,
+    options,
+    callback
+  ]);
+}, 'Db.eval is deprecated as of MongoDB version 3.2');
+
+/**
+ * Rename a collection.
+ *
+ * @method
+ * @param {string} fromCollection Name of current collection to rename.
+ * @param {string} toCollection New name of of the collection.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.dropTarget=false] Drop the target name collection if it previously exists.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~collectionResultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.renameCollection = function(fromCollection, toCollection, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = Object.assign({}, options, { readPreference: ReadPreference.PRIMARY });
+
+  // Add return new collection
+  options.new_collection = true;
+
+  const renameOperation = new RenameOperation(
+    this.collection(fromCollection),
+    toCollection,
+    options
+  );
+
+  return executeOperation(this.s.topology, renameOperation, callback);
+};
+
+/**
+ * Drop a collection from the database, removing it permanently. New accesses will create a new collection.
+ *
+ * @method
+ * @param {string} name Name of collection to drop
+ * @param {Object} [options] Optional settings
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.dropCollection = function(name, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const dropCollectionOperation = new DropCollectionOperation(this, name, options);
+
+  return executeOperation(this.s.topology, dropCollectionOperation, callback);
+};
+
+/**
+ * Drop a database, removing it permanently from the server.
+ *
+ * @method
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.dropDatabase = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const dropDatabaseOperation = new DropDatabaseOperation(this, options);
+
+  return executeOperation(this.s.topology, dropDatabaseOperation, callback);
+};
+
+/**
+ * Fetch all collections for the current db.
+ *
+ * @method
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~collectionsResultCallback} [callback] The results callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.collections = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const collectionsOperation = new CollectionsOperation(this, options);
+
+  return executeOperation(this.s.topology, collectionsOperation, callback);
+};
+
+/**
+ * Runs a command on the database as admin.
+ * @method
+ * @param {object} command The command hash
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.executeDbAdminCommand = function(selector, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+  options.readPreference = ReadPreference.resolve(this, options);
+
+  const executeDbAdminCommandOperation = new ExecuteDbAdminCommandOperation(
+    this,
+    selector,
+    options
+  );
+
+  return executeOperation(this.s.topology, executeDbAdminCommandOperation, callback);
+};
+
+/**
+ * Creates an index on the db and collection.
+ * @method
+ * @param {string} name Name of the collection to create the index on.
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.unique=false] Creates an unique index.
+ * @param {boolean} [options.sparse=false] Creates a sparse index.
+ * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible.
+ * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value
+ * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates.
+ * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates.
+ * @param {number} [options.v] Specify the format version of the indexes.
+ * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher)
+ * @param {string} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes)
+ * @param {object} [options.partialFilterExpression] Creates a partial index based on the given filter object (MongoDB 3.2 or higher)
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {(number|string)} [options.commitQuorum] (MongoDB 4.4. or higher) Specifies how many data-bearing members of a replica set, including the primary, must complete the index builds successfully before the primary marks the indexes as ready. This option accepts the same values for the "w" field in a write concern plus "votingMembers", which indicates all voting data-bearing nodes.
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.createIndex = function(name, fieldOrSpec, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options ? Object.assign({}, options) : {};
+
+  const createIndexesOperation = new CreateIndexesOperation(this, name, fieldOrSpec, options);
+
+  return executeOperation(this.s.topology, createIndexesOperation, callback);
+};
+
+/**
+ * Ensures that an index exists, if it does not it creates it
+ * @method
+ * @deprecated since version 2.0
+ * @param {string} name The index name
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.unique=false] Creates an unique index.
+ * @param {boolean} [options.sparse=false] Creates a sparse index.
+ * @param {boolean} [options.background=false] Creates the index in the background, yielding whenever possible.
+ * @param {boolean} [options.dropDups=false] A unique index cannot be created on a key that has pre-existing duplicate values. If you would like to create the index anyway, keeping the first document the database indexes and deleting all subsequent documents that have duplicate value
+ * @param {number} [options.min] For geospatial indexes set the lower bound for the co-ordinates.
+ * @param {number} [options.max] For geospatial indexes set the high bound for the co-ordinates.
+ * @param {number} [options.v] Specify the format version of the indexes.
+ * @param {number} [options.expireAfterSeconds] Allows you to expire data on indexes applied to a data (MongoDB 2.2 or higher)
+ * @param {number} [options.name] Override the autogenerated index name (useful if the resulting name is larger than 128 bytes)
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.ensureIndex = deprecate(function(name, fieldOrSpec, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.s.topology, ensureIndex, [
+    this,
+    name,
+    fieldOrSpec,
+    options,
+    callback
+  ]);
+}, 'Db.ensureIndex is deprecated as of MongoDB version 3.0 / driver version 2.0');
+
+Db.prototype.addChild = function(db) {
+  if (this.s.parentDb) return this.s.parentDb.addChild(db);
+  this.s.children.push(db);
+};
+
+/**
+ * Add a user to the database.
+ * @method
+ * @param {string} username The username.
+ * @param {string} password The password.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {object} [options.customData] Custom data associated with the user (only Mongodb 2.6 or higher)
+ * @param {object[]} [options.roles] Roles associated with the created user (only Mongodb 2.6 or higher)
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.addUser = function(username, password, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  // Special case where there is no password ($external users)
+  if (typeof username === 'string' && password != null && typeof password === 'object') {
+    options = password;
+    password = null;
+  }
+
+  const addUserOperation = new AddUserOperation(this, username, password, options);
+
+  return executeOperation(this.s.topology, addUserOperation, callback);
+};
+
+/**
+ * Remove a user from a database
+ * @method
+ * @param {string} username The username.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.removeUser = function(username, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const removeUserOperation = new RemoveUserOperation(this, username, options);
+
+  return executeOperation(this.s.topology, removeUserOperation, callback);
+};
+
+/**
+ * Set the current profiling level of MongoDB
+ *
+ * @param {string} level The new profiling level (off, slow_only, all).
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.setProfilingLevel = function(level, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const setProfilingLevelOperation = new SetProfilingLevelOperation(this, level, options);
+
+  return executeOperation(this.s.topology, setProfilingLevelOperation, callback);
+};
+
+/**
+ * Retrieve the current profiling information for MongoDB
+ *
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Query the system.profile collection directly.
+ */
+Db.prototype.profilingInfo = deprecate(function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.s.topology, profilingInfo, [this, options, callback]);
+}, 'Db.profilingInfo is deprecated. Query the system.profile collection directly.');
+
+/**
+ * Retrieve the current profiling Level for MongoDB
+ *
+ * @param {Object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.profilingLevel = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const profilingLevelOperation = new ProfilingLevelOperation(this, options);
+
+  return executeOperation(this.s.topology, profilingLevelOperation, callback);
+};
+
+/**
+ * Retrieves this collections index info.
+ * @method
+ * @param {string} name The name of the collection.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.full=false] Returns the full raw index information.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {Db~resultCallback} [callback] The command result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+Db.prototype.indexInformation = function(name, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  const indexInformationOperation = new IndexInformationOperation(this, name, options);
+
+  return executeOperation(this.s.topology, indexInformationOperation, callback);
+};
+
+/**
+ * Unref all sockets
+ * @method
+ */
+Db.prototype.unref = function() {
+  this.s.topology.unref();
+};
+
+/**
+ * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this database. Will ignore all changes to system collections.
+ * @method
+ * @since 3.1.0
+ * @param {Array} [pipeline] An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.
+ * @param {object} [options] Optional settings
+ * @param {string} [options.fullDocument='default'] Allowed values: ‘default’, ‘updateLookup’. When set to ‘updateLookup’, the change stream will include both a delta describing the changes to the document, as well as a copy of the entire document that was changed from some time after the change occurred.
+ * @param {object} [options.resumeAfter] Specifies the logical starting point for the new change stream. This should be the _id field from a previously returned change stream document.
+ * @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a change stream query
+ * @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {ReadPreference} [options.readPreference] The read preference. Defaults to the read preference of the database. See {@link https://docs.mongodb.com/manual/reference/read-preference|read preference documentation}.
+ * @param {Timestamp} [options.startAtOperationTime] receive change events that occur after the specified timestamp
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @return {ChangeStream} a ChangeStream instance.
+ */
+Db.prototype.watch = function(pipeline, options) {
+  pipeline = pipeline || [];
+  options = options || {};
+
+  // Allow optionally not specifying a pipeline
+  if (!Array.isArray(pipeline)) {
+    options = pipeline;
+    pipeline = [];
+  }
+
+  return new ChangeStream(this, pipeline, options);
+};
+
+/**
+ * Return the db logger
+ * @method
+ * @return {Logger} return the db logger
+ * @ignore
+ */
+Db.prototype.getLogger = function() {
+  return this.s.logger;
+};
+
+/**
+ * Db close event
+ *
+ * Emitted after a socket closed against a single server or mongos proxy.
+ *
+ * @event Db#close
+ * @type {MongoError}
+ */
+
+/**
+ * Db reconnect event
+ *
+ *  * Server: Emitted when the driver has reconnected and re-authenticated.
+ *  * ReplicaSet: N/A
+ *  * Mongos: Emitted when the driver reconnects and re-authenticates successfully against a Mongos.
+ *
+ * @event Db#reconnect
+ * @type {object}
+ */
+
+/**
+ * Db error event
+ *
+ * Emitted after an error occurred against a single server or mongos proxy.
+ *
+ * @event Db#error
+ * @type {MongoError}
+ */
+
+/**
+ * Db timeout event
+ *
+ * Emitted after a socket timeout occurred against a single server or mongos proxy.
+ *
+ * @event Db#timeout
+ * @type {MongoError}
+ */
+
+/**
+ * Db parseError event
+ *
+ * The parseError event is emitted if the driver detects illegal or corrupt BSON being received from the server.
+ *
+ * @event Db#parseError
+ * @type {MongoError}
+ */
+
+/**
+ * Db fullsetup event, emitted when all servers in the topology have been connected to at start up time.
+ *
+ * * Server: Emitted when the driver has connected to the single server and has authenticated.
+ * * ReplSet: Emitted after the driver has attempted to connect to all replicaset members.
+ * * Mongos: Emitted after the driver has attempted to connect to all mongos proxies.
+ *
+ * @event Db#fullsetup
+ * @type {Db}
+ */
+
+// Constants
+Db.SYSTEM_NAMESPACE_COLLECTION = CONSTANTS.SYSTEM_NAMESPACE_COLLECTION;
+Db.SYSTEM_INDEX_COLLECTION = CONSTANTS.SYSTEM_INDEX_COLLECTION;
+Db.SYSTEM_PROFILE_COLLECTION = CONSTANTS.SYSTEM_PROFILE_COLLECTION;
+Db.SYSTEM_USER_COLLECTION = CONSTANTS.SYSTEM_USER_COLLECTION;
+Db.SYSTEM_COMMAND_COLLECTION = CONSTANTS.SYSTEM_COMMAND_COLLECTION;
+Db.SYSTEM_JS_COLLECTION = CONSTANTS.SYSTEM_JS_COLLECTION;
+
+module.exports = Db;
diff --git a/NodeAPI/node_modules/mongodb/lib/dynamic_loaders.js b/NodeAPI/node_modules/mongodb/lib/dynamic_loaders.js
new file mode 100644
index 0000000000000000000000000000000000000000..c4610023970d90ccc18f655fc09c15b8f5643dc0
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/dynamic_loaders.js
@@ -0,0 +1,32 @@
+'use strict';
+
+let collection;
+let cursor;
+let db;
+
+function loadCollection() {
+  if (!collection) {
+    collection = require('./collection');
+  }
+  return collection;
+}
+
+function loadCursor() {
+  if (!cursor) {
+    cursor = require('./cursor');
+  }
+  return cursor;
+}
+
+function loadDb() {
+  if (!db) {
+    db = require('./db');
+  }
+  return db;
+}
+
+module.exports = {
+  loadCollection,
+  loadCursor,
+  loadDb
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/encrypter.js b/NodeAPI/node_modules/mongodb/lib/encrypter.js
new file mode 100644
index 0000000000000000000000000000000000000000..4f0155d3616fcbe133a03e3a30d61a28758063f6
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/encrypter.js
@@ -0,0 +1,163 @@
+'use strict';
+const MongoClient = require('./mongo_client');
+const BSON = require('./core/connection/utils').retrieveBSON();
+const MongoError = require('./core/error').MongoError;
+
+try {
+  require.resolve('mongodb-client-encryption');
+} catch (err) {
+  throw new MongoError(
+    'Auto-encryption requested, but the module is not installed. ' +
+      'Please add `mongodb-client-encryption` as a dependency of your project'
+  );
+}
+
+const mongodbClientEncryption = require('mongodb-client-encryption');
+if (typeof mongodbClientEncryption.extension !== 'function') {
+  throw new MongoError(
+    'loaded version of `mongodb-client-encryption` does not have property `extension`. ' +
+      'Please make sure you are loading the correct version of `mongodb-client-encryption`'
+  );
+}
+const AutoEncrypter = mongodbClientEncryption.extension(require('../index')).AutoEncrypter;
+
+const kInternalClient = Symbol('internalClient');
+
+class Encrypter {
+  /**
+   * @param {MongoClient} client
+   * @param {{autoEncryption: import('./mongo_client').AutoEncryptionOptions, bson: object}} options
+   */
+  constructor(client, options) {
+    this.bypassAutoEncryption = !!options.autoEncryption.bypassAutoEncryption;
+    this.needsConnecting = false;
+
+    if (options.maxPoolSize === 0 && options.autoEncryption.keyVaultClient == null) {
+      options.autoEncryption.keyVaultClient = client;
+    } else if (options.autoEncryption.keyVaultClient == null) {
+      options.autoEncryption.keyVaultClient = this.getInternalClient(client);
+    }
+
+    if (this.bypassAutoEncryption) {
+      options.autoEncryption.metadataClient = undefined;
+    } else if (options.maxPoolSize === 0) {
+      options.autoEncryption.metadataClient = client;
+    } else {
+      options.autoEncryption.metadataClient = this.getInternalClient(client);
+    }
+
+    options.autoEncryption.bson = Encrypter.makeBSON(options);
+
+    this.autoEncrypter = new AutoEncrypter(client, options.autoEncryption);
+  }
+
+  getInternalClient(client) {
+    if (!this[kInternalClient]) {
+      const clonedOptions = {};
+
+      for (const key of Object.keys(client.s.options)) {
+        if (
+          ['autoEncryption', 'minPoolSize', 'servers', 'caseTranslate', 'dbName'].indexOf(key) !==
+          -1
+        )
+          continue;
+        clonedOptions[key] = client.s.options[key];
+      }
+
+      clonedOptions.minPoolSize = 0;
+
+      const allEvents = [
+        // APM
+        'commandStarted',
+        'commandSucceeded',
+        'commandFailed',
+
+        // SDAM
+        'serverOpening',
+        'serverClosed',
+        'serverDescriptionChanged',
+        'serverHeartbeatStarted',
+        'serverHeartbeatSucceeded',
+        'serverHeartbeatFailed',
+        'topologyOpening',
+        'topologyClosed',
+        'topologyDescriptionChanged',
+
+        // Legacy
+        'joined',
+        'left',
+        'ping',
+        'ha',
+
+        // CMAP
+        'connectionPoolCreated',
+        'connectionPoolClosed',
+        'connectionCreated',
+        'connectionReady',
+        'connectionClosed',
+        'connectionCheckOutStarted',
+        'connectionCheckOutFailed',
+        'connectionCheckedOut',
+        'connectionCheckedIn',
+        'connectionPoolCleared'
+      ];
+
+      this[kInternalClient] = new MongoClient(client.s.url, clonedOptions);
+
+      for (const eventName of allEvents) {
+        for (const listener of client.listeners(eventName)) {
+          this[kInternalClient].on(eventName, listener);
+        }
+      }
+
+      client.on('newListener', (eventName, listener) => {
+        this[kInternalClient].on(eventName, listener);
+      });
+
+      this.needsConnecting = true;
+    }
+    return this[kInternalClient];
+  }
+
+  connectInternalClient(callback) {
+    if (this.needsConnecting) {
+      this.needsConnecting = false;
+      return this[kInternalClient].connect(callback);
+    }
+
+    return callback();
+  }
+
+  close(client, force, callback) {
+    this.autoEncrypter.teardown(e => {
+      if (this[kInternalClient] && client !== this[kInternalClient]) {
+        return this[kInternalClient].close(force, callback);
+      }
+      callback(e);
+    });
+  }
+
+  static makeBSON(options) {
+    return (
+      (options || {}).bson ||
+      new BSON([
+        BSON.Binary,
+        BSON.Code,
+        BSON.DBRef,
+        BSON.Decimal128,
+        BSON.Double,
+        BSON.Int32,
+        BSON.Long,
+        BSON.Map,
+        BSON.MaxKey,
+        BSON.MinKey,
+        BSON.ObjectId,
+        BSON.BSONRegExp,
+        BSON.Symbol,
+        BSON.Timestamp
+      ])
+    );
+  }
+}
+
+module.exports = { Encrypter };
diff --git a/NodeAPI/node_modules/mongodb/lib/error.js b/NodeAPI/node_modules/mongodb/lib/error.js
new file mode 100644
index 0000000000000000000000000000000000000000..b2d026ce9027484111aad8ee16111eb3f59e02f6
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/error.js
@@ -0,0 +1,43 @@
+'use strict';
+
+const MongoNetworkError = require('./core').MongoNetworkError;
+
+// From spec@https://github.com/mongodb/specifications/blob/f93d78191f3db2898a59013a7ed5650352ef6da8/source/change-streams/change-streams.rst#resumable-error
+const GET_MORE_RESUMABLE_CODES = new Set([
+  6, // HostUnreachable
+  7, // HostNotFound
+  89, // NetworkTimeout
+  91, // ShutdownInProgress
+  189, // PrimarySteppedDown
+  262, // ExceededTimeLimit
+  9001, // SocketException
+  10107, // NotMaster
+  11600, // InterruptedAtShutdown
+  11602, // InterruptedDueToReplStateChange
+  13435, // NotMasterNoSlaveOk
+  13436, // NotMasterOrSecondary
+  63, // StaleShardVersion
+  150, // StaleEpoch
+  13388, // StaleConfig
+  234, // RetryChangeStream
+  133, // FailedToSatisfyReadPreference
+  43 // CursorNotFound
+]);
+
+function isResumableError(error, wireVersion) {
+  if (error instanceof MongoNetworkError) {
+    return true;
+  }
+
+  if (wireVersion >= 9) {
+    // DRIVERS-1308: For 4.4 drivers running against 4.4 servers, drivers will add a special case to treat the CursorNotFound error code as resumable
+    if (error.code === 43) {
+      return true;
+    }
+    return error.hasErrorLabel('ResumableChangeStreamError');
+  }
+
+  return GET_MORE_RESUMABLE_CODES.has(error.code);
+}
+
+module.exports = { GET_MORE_RESUMABLE_CODES, isResumableError };
diff --git a/NodeAPI/node_modules/mongodb/lib/explain.js b/NodeAPI/node_modules/mongodb/lib/explain.js
new file mode 100644
index 0000000000000000000000000000000000000000..14ec6f438aebeff4fb9819dde71a023bf6af3128
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/explain.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const MongoError = require('./core/error').MongoError;
+
+const ExplainVerbosity = {
+  queryPlanner: 'queryPlanner',
+  queryPlannerExtended: 'queryPlannerExtended',
+  executionStats: 'executionStats',
+  allPlansExecution: 'allPlansExecution'
+};
+
+/**
+ * @class
+ * @property {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'} verbosity The verbosity mode for the explain output.
+ */
+class Explain {
+  /**
+   * Constructs an Explain from the explain verbosity.
+   *
+   * For backwards compatibility, true is interpreted as "allPlansExecution"
+   * and false as "queryPlanner". Prior to server version 3.6, aggregate()
+   * ignores the verbosity parameter and executes in "queryPlanner".
+   *
+   * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [verbosity] The verbosity mode for the explain output.
+   */
+  constructor(verbosity) {
+    if (typeof verbosity === 'boolean') {
+      this.verbosity = verbosity ? 'allPlansExecution' : 'queryPlanner';
+    } else {
+      this.verbosity = verbosity;
+    }
+  }
+
+  /**
+   * Construct an Explain given an options object.
+   *
+   * @param {object} [options] The options object from which to extract the explain.
+   * @param {'queryPlanner'|'queryPlannerExtended'|'executionStats'|'allPlansExecution'|boolean} [options.explain] The verbosity mode for the explain output
+   * @return {Explain}
+   */
+  static fromOptions(options) {
+    if (options == null || options.explain === undefined) {
+      return;
+    }
+
+    const explain = options.explain;
+    if (typeof explain === 'boolean' || explain in ExplainVerbosity) {
+      return new Explain(options.explain);
+    }
+
+    throw new MongoError(`explain must be one of ${Object.keys(ExplainVerbosity)} or a boolean`);
+  }
+}
+
+module.exports = { Explain };
diff --git a/NodeAPI/node_modules/mongodb/lib/gridfs-stream/download.js b/NodeAPI/node_modules/mongodb/lib/gridfs-stream/download.js
new file mode 100644
index 0000000000000000000000000000000000000000..0aab5dc34f2ca8889752c9caf657bdc9749658fb
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/gridfs-stream/download.js
@@ -0,0 +1,433 @@
+'use strict';
+
+var stream = require('stream'),
+  util = require('util');
+
+module.exports = GridFSBucketReadStream;
+
+/**
+ * A readable stream that enables you to read buffers from GridFS.
+ *
+ * Do not instantiate this class directly. Use `openDownloadStream()` instead.
+ *
+ * @class
+ * @extends external:Readable
+ * @param {Collection} chunks Handle for chunks collection
+ * @param {Collection} files Handle for files collection
+ * @param {Object} readPreference The read preference to use
+ * @param {Object} filter The query to use to find the file document
+ * @param {Object} [options] Optional settings.
+ * @param {Number} [options.sort] Optional sort for the file find query
+ * @param {Number} [options.skip] Optional skip for the file find query
+ * @param {Number} [options.start] Optional 0-based offset in bytes to start streaming from
+ * @param {Number} [options.end] Optional 0-based offset in bytes to stop streaming before
+ * @fires GridFSBucketReadStream#error
+ * @fires GridFSBucketReadStream#file
+ */
+function GridFSBucketReadStream(chunks, files, readPreference, filter, options) {
+  this.s = {
+    bytesRead: 0,
+    chunks: chunks,
+    cursor: null,
+    expected: 0,
+    files: files,
+    filter: filter,
+    init: false,
+    expectedEnd: 0,
+    file: null,
+    options: options,
+    readPreference: readPreference
+  };
+
+  stream.Readable.call(this);
+}
+
+util.inherits(GridFSBucketReadStream, stream.Readable);
+
+/**
+ * An error occurred
+ *
+ * @event GridFSBucketReadStream#error
+ * @type {Error}
+ */
+
+/**
+ * Fires when the stream loaded the file document corresponding to the
+ * provided id.
+ *
+ * @event GridFSBucketReadStream#file
+ * @type {object}
+ */
+
+/**
+ * Emitted when a chunk of data is available to be consumed.
+ *
+ * @event GridFSBucketReadStream#data
+ * @type {object}
+ */
+
+/**
+ * Fired when the stream is exhausted (no more data events).
+ *
+ * @event GridFSBucketReadStream#end
+ * @type {object}
+ */
+
+/**
+ * Fired when the stream is exhausted and the underlying cursor is killed
+ *
+ * @event GridFSBucketReadStream#close
+ * @type {object}
+ */
+
+/**
+ * Reads from the cursor and pushes to the stream.
+ * Private Impl, do not call directly
+ * @ignore
+ * @method
+ */
+
+GridFSBucketReadStream.prototype._read = function() {
+  var _this = this;
+  if (this.destroyed) {
+    return;
+  }
+
+  waitForFile(_this, function() {
+    doRead(_this);
+  });
+};
+
+/**
+ * Sets the 0-based offset in bytes to start streaming from. Throws
+ * an error if this stream has entered flowing mode
+ * (e.g. if you've already called `on('data')`)
+ * @method
+ * @param {Number} start Offset in bytes to start reading at
+ * @return {GridFSBucketReadStream} Reference to Self
+ */
+
+GridFSBucketReadStream.prototype.start = function(start) {
+  throwIfInitialized(this);
+  this.s.options.start = start;
+  return this;
+};
+
+/**
+ * Sets the 0-based offset in bytes to start streaming from. Throws
+ * an error if this stream has entered flowing mode
+ * (e.g. if you've already called `on('data')`)
+ * @method
+ * @param {Number} end Offset in bytes to stop reading at
+ * @return {GridFSBucketReadStream} Reference to self
+ */
+
+GridFSBucketReadStream.prototype.end = function(end) {
+  throwIfInitialized(this);
+  this.s.options.end = end;
+  return this;
+};
+
+/**
+ * Marks this stream as aborted (will never push another `data` event)
+ * and kills the underlying cursor. Will emit the 'end' event, and then
+ * the 'close' event once the cursor is successfully killed.
+ *
+ * @method
+ * @param {GridFSBucket~errorCallback} [callback] called when the cursor is successfully closed or an error occurred.
+ * @fires GridFSBucketWriteStream#close
+ * @fires GridFSBucketWriteStream#end
+ */
+
+GridFSBucketReadStream.prototype.abort = function(callback) {
+  var _this = this;
+  this.push(null);
+  this.destroyed = true;
+  if (this.s.cursor) {
+    this.s.cursor.close(function(error) {
+      _this.emit('close');
+      callback && callback(error);
+    });
+  } else {
+    if (!this.s.init) {
+      // If not initialized, fire close event because we will never
+      // get a cursor
+      _this.emit('close');
+    }
+    callback && callback();
+  }
+};
+
+/**
+ * @ignore
+ */
+
+function throwIfInitialized(self) {
+  if (self.s.init) {
+    throw new Error('You cannot change options after the stream has entered' + 'flowing mode!');
+  }
+}
+
+/**
+ * @ignore
+ */
+
+function doRead(_this) {
+  if (_this.destroyed) {
+    return;
+  }
+
+  _this.s.cursor.next(function(error, doc) {
+    if (_this.destroyed) {
+      return;
+    }
+    if (error) {
+      return __handleError(_this, error);
+    }
+    if (!doc) {
+      _this.push(null);
+
+      process.nextTick(() => {
+        _this.s.cursor.close(function(error) {
+          if (error) {
+            __handleError(_this, error);
+            return;
+          }
+
+          _this.emit('close');
+        });
+      });
+
+      return;
+    }
+
+    var bytesRemaining = _this.s.file.length - _this.s.bytesRead;
+    var expectedN = _this.s.expected++;
+    var expectedLength = Math.min(_this.s.file.chunkSize, bytesRemaining);
+
+    if (doc.n > expectedN) {
+      var errmsg = 'ChunkIsMissing: Got unexpected n: ' + doc.n + ', expected: ' + expectedN;
+      return __handleError(_this, new Error(errmsg));
+    }
+
+    if (doc.n < expectedN) {
+      errmsg = 'ExtraChunk: Got unexpected n: ' + doc.n + ', expected: ' + expectedN;
+      return __handleError(_this, new Error(errmsg));
+    }
+
+    var buf = Buffer.isBuffer(doc.data) ? doc.data : doc.data.buffer;
+
+    if (buf.length !== expectedLength) {
+      if (bytesRemaining <= 0) {
+        errmsg = 'ExtraChunk: Got unexpected n: ' + doc.n;
+        return __handleError(_this, new Error(errmsg));
+      }
+
+      errmsg =
+        'ChunkIsWrongSize: Got unexpected length: ' + buf.length + ', expected: ' + expectedLength;
+      return __handleError(_this, new Error(errmsg));
+    }
+
+    _this.s.bytesRead += buf.length;
+
+    if (buf.length === 0) {
+      return _this.push(null);
+    }
+
+    var sliceStart = null;
+    var sliceEnd = null;
+
+    if (_this.s.bytesToSkip != null) {
+      sliceStart = _this.s.bytesToSkip;
+      _this.s.bytesToSkip = 0;
+    }
+
+    const atEndOfStream = expectedN === _this.s.expectedEnd - 1;
+    const bytesLeftToRead = _this.s.options.end - _this.s.bytesToSkip;
+    if (atEndOfStream && _this.s.bytesToTrim != null) {
+      sliceEnd = _this.s.file.chunkSize - _this.s.bytesToTrim;
+    } else if (_this.s.options.end && bytesLeftToRead < doc.data.length()) {
+      sliceEnd = bytesLeftToRead;
+    }
+
+    if (sliceStart != null || sliceEnd != null) {
+      buf = buf.slice(sliceStart || 0, sliceEnd || buf.length);
+    }
+
+    _this.push(buf);
+  });
+}
+
+/**
+ * @ignore
+ */
+
+function init(self) {
+  var findOneOptions = {};
+  if (self.s.readPreference) {
+    findOneOptions.readPreference = self.s.readPreference;
+  }
+  if (self.s.options && self.s.options.sort) {
+    findOneOptions.sort = self.s.options.sort;
+  }
+  if (self.s.options && self.s.options.skip) {
+    findOneOptions.skip = self.s.options.skip;
+  }
+
+  self.s.files.findOne(self.s.filter, findOneOptions, function(error, doc) {
+    if (error) {
+      return __handleError(self, error);
+    }
+
+    if (!doc) {
+      var identifier = self.s.filter._id ? self.s.filter._id.toString() : self.s.filter.filename;
+      var errmsg = 'FileNotFound: file ' + identifier + ' was not found';
+      var err = new Error(errmsg);
+      err.code = 'ENOENT';
+      return __handleError(self, err);
+    }
+
+    // If document is empty, kill the stream immediately and don't
+    // execute any reads
+    if (doc.length <= 0) {
+      self.push(null);
+      return;
+    }
+
+    if (self.destroyed) {
+      // If user destroys the stream before we have a cursor, wait
+      // until the query is done to say we're 'closed' because we can't
+      // cancel a query.
+      self.emit('close');
+      return;
+    }
+
+    try {
+      self.s.bytesToSkip = handleStartOption(self, doc, self.s.options);
+    } catch (error) {
+      return __handleError(self, error);
+    }
+
+    var filter = { files_id: doc._id };
+
+    // Currently (MongoDB 3.4.4) skip function does not support the index,
+    // it needs to retrieve all the documents first and then skip them. (CS-25811)
+    // As work around we use $gte on the "n" field.
+    if (self.s.options && self.s.options.start != null) {
+      var skip = Math.floor(self.s.options.start / doc.chunkSize);
+      if (skip > 0) {
+        filter['n'] = { $gte: skip };
+      }
+    }
+    self.s.cursor = self.s.chunks.find(filter).sort({ n: 1 });
+
+    if (self.s.readPreference) {
+      self.s.cursor.setReadPreference(self.s.readPreference);
+    }
+
+    self.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize);
+    self.s.file = doc;
+
+    try {
+      self.s.bytesToTrim = handleEndOption(self, doc, self.s.cursor, self.s.options);
+    } catch (error) {
+      return __handleError(self, error);
+    }
+
+    self.emit('file', doc);
+  });
+}
+
+/**
+ * @ignore
+ */
+
+function waitForFile(_this, callback) {
+  if (_this.s.file) {
+    return callback();
+  }
+
+  if (!_this.s.init) {
+    init(_this);
+    _this.s.init = true;
+  }
+
+  _this.once('file', function() {
+    callback();
+  });
+}
+
+/**
+ * @ignore
+ */
+
+function handleStartOption(stream, doc, options) {
+  if (options && options.start != null) {
+    if (options.start > doc.length) {
+      throw new Error(
+        'Stream start (' +
+          options.start +
+          ') must not be ' +
+          'more than the length of the file (' +
+          doc.length +
+          ')'
+      );
+    }
+    if (options.start < 0) {
+      throw new Error('Stream start (' + options.start + ') must not be ' + 'negative');
+    }
+    if (options.end != null && options.end < options.start) {
+      throw new Error(
+        'Stream start (' +
+          options.start +
+          ') must not be ' +
+          'greater than stream end (' +
+          options.end +
+          ')'
+      );
+    }
+
+    stream.s.bytesRead = Math.floor(options.start / doc.chunkSize) * doc.chunkSize;
+    stream.s.expected = Math.floor(options.start / doc.chunkSize);
+
+    return options.start - stream.s.bytesRead;
+  }
+}
+
+/**
+ * @ignore
+ */
+
+function handleEndOption(stream, doc, cursor, options) {
+  if (options && options.end != null) {
+    if (options.end > doc.length) {
+      throw new Error(
+        'Stream end (' +
+          options.end +
+          ') must not be ' +
+          'more than the length of the file (' +
+          doc.length +
+          ')'
+      );
+    }
+    if (options.start < 0) {
+      throw new Error('Stream end (' + options.end + ') must not be ' + 'negative');
+    }
+
+    var start = options.start != null ? Math.floor(options.start / doc.chunkSize) : 0;
+
+    cursor.limit(Math.ceil(options.end / doc.chunkSize) - start);
+
+    stream.s.expectedEnd = Math.ceil(options.end / doc.chunkSize);
+
+    return Math.ceil(options.end / doc.chunkSize) * doc.chunkSize - options.end;
+  }
+}
+
+/**
+ * @ignore
+ */
+
+function __handleError(_this, error) {
+  _this.emit('error', error);
+}
diff --git a/NodeAPI/node_modules/mongodb/lib/gridfs-stream/index.js b/NodeAPI/node_modules/mongodb/lib/gridfs-stream/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..65098395187b400b9fdfea262c70bc0a2d607e15
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/gridfs-stream/index.js
@@ -0,0 +1,359 @@
+'use strict';
+
+var Emitter = require('events').EventEmitter;
+var GridFSBucketReadStream = require('./download');
+var GridFSBucketWriteStream = require('./upload');
+var shallowClone = require('../utils').shallowClone;
+var toError = require('../utils').toError;
+var util = require('util');
+var executeLegacyOperation = require('../utils').executeLegacyOperation;
+
+var DEFAULT_GRIDFS_BUCKET_OPTIONS = {
+  bucketName: 'fs',
+  chunkSizeBytes: 255 * 1024
+};
+
+module.exports = GridFSBucket;
+
+/**
+ * Constructor for a streaming GridFS interface
+ * @class
+ * @extends external:EventEmitter
+ * @param {Db} db A db handle
+ * @param {object} [options] Optional settings.
+ * @param {string} [options.bucketName="fs"] The 'files' and 'chunks' collections will be prefixed with the bucket name followed by a dot.
+ * @param {number} [options.chunkSizeBytes=255 * 1024] Number of bytes stored in each chunk. Defaults to 255KB
+ * @param {object} [options.writeConcern] Optional write concern to be passed to write operations, for instance `{ w: 1 }`
+ * @param {object} [options.readPreference] Optional read preference to be passed to read operations
+ * @fires GridFSBucketWriteStream#index
+ */
+
+function GridFSBucket(db, options) {
+  Emitter.apply(this);
+  this.setMaxListeners(0);
+
+  if (options && typeof options === 'object') {
+    options = shallowClone(options);
+    var keys = Object.keys(DEFAULT_GRIDFS_BUCKET_OPTIONS);
+    for (var i = 0; i < keys.length; ++i) {
+      if (!options[keys[i]]) {
+        options[keys[i]] = DEFAULT_GRIDFS_BUCKET_OPTIONS[keys[i]];
+      }
+    }
+  } else {
+    options = DEFAULT_GRIDFS_BUCKET_OPTIONS;
+  }
+
+  this.s = {
+    db: db,
+    options: options,
+    _chunksCollection: db.collection(options.bucketName + '.chunks'),
+    _filesCollection: db.collection(options.bucketName + '.files'),
+    checkedIndexes: false,
+    calledOpenUploadStream: false,
+    promiseLibrary: db.s.promiseLibrary || Promise
+  };
+}
+
+util.inherits(GridFSBucket, Emitter);
+
+/**
+ * When the first call to openUploadStream is made, the upload stream will
+ * check to see if it needs to create the proper indexes on the chunks and
+ * files collections. This event is fired either when 1) it determines that
+ * no index creation is necessary, 2) when it successfully creates the
+ * necessary indexes.
+ *
+ * @event GridFSBucket#index
+ * @type {Error}
+ */
+
+/**
+ * Returns a writable stream (GridFSBucketWriteStream) for writing
+ * buffers to GridFS. The stream's 'id' property contains the resulting
+ * file's id.
+ * @method
+ * @param {string} filename The value of the 'filename' key in the files doc
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.chunkSizeBytes] Optional overwrite this bucket's chunkSizeBytes for this file
+ * @param {object} [options.metadata] Optional object to store in the file document's `metadata` field
+ * @param {string} [options.contentType] Optional string to store in the file document's `contentType` field
+ * @param {array} [options.aliases] Optional array of strings to store in the file document's `aliases` field
+ * @param {boolean} [options.disableMD5=false] If true, disables adding an md5 field to file data
+ * @return {GridFSBucketWriteStream}
+ */
+
+GridFSBucket.prototype.openUploadStream = function(filename, options) {
+  if (options) {
+    options = shallowClone(options);
+  } else {
+    options = {};
+  }
+  if (!options.chunkSizeBytes) {
+    options.chunkSizeBytes = this.s.options.chunkSizeBytes;
+  }
+  return new GridFSBucketWriteStream(this, filename, options);
+};
+
+/**
+ * Returns a writable stream (GridFSBucketWriteStream) for writing
+ * buffers to GridFS for a custom file id. The stream's 'id' property contains the resulting
+ * file's id.
+ * @method
+ * @param {string|number|object} id A custom id used to identify the file
+ * @param {string} filename The value of the 'filename' key in the files doc
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.chunkSizeBytes] Optional overwrite this bucket's chunkSizeBytes for this file
+ * @param {object} [options.metadata] Optional object to store in the file document's `metadata` field
+ * @param {string} [options.contentType] Optional string to store in the file document's `contentType` field
+ * @param {array} [options.aliases] Optional array of strings to store in the file document's `aliases` field
+ * @param {boolean} [options.disableMD5=false] If true, disables adding an md5 field to file data
+ * @return {GridFSBucketWriteStream}
+ */
+
+GridFSBucket.prototype.openUploadStreamWithId = function(id, filename, options) {
+  if (options) {
+    options = shallowClone(options);
+  } else {
+    options = {};
+  }
+
+  if (!options.chunkSizeBytes) {
+    options.chunkSizeBytes = this.s.options.chunkSizeBytes;
+  }
+
+  options.id = id;
+
+  return new GridFSBucketWriteStream(this, filename, options);
+};
+
+/**
+ * Returns a readable stream (GridFSBucketReadStream) for streaming file
+ * data from GridFS.
+ * @method
+ * @param {ObjectId} id The id of the file doc
+ * @param {Object} [options] Optional settings.
+ * @param {Number} [options.start] Optional 0-based offset in bytes to start streaming from
+ * @param {Number} [options.end] Optional 0-based offset in bytes to stop streaming before
+ * @return {GridFSBucketReadStream}
+ */
+
+GridFSBucket.prototype.openDownloadStream = function(id, options) {
+  var filter = { _id: id };
+  options = {
+    start: options && options.start,
+    end: options && options.end
+  };
+
+  return new GridFSBucketReadStream(
+    this.s._chunksCollection,
+    this.s._filesCollection,
+    this.s.options.readPreference,
+    filter,
+    options
+  );
+};
+
+/**
+ * Deletes a file with the given id
+ * @method
+ * @param {ObjectId} id The id of the file doc
+ * @param {GridFSBucket~errorCallback} [callback]
+ */
+
+GridFSBucket.prototype.delete = function(id, callback) {
+  return executeLegacyOperation(this.s.db.s.topology, _delete, [this, id, callback], {
+    skipSessions: true
+  });
+};
+
+/**
+ * @ignore
+ */
+
+function _delete(_this, id, callback) {
+  _this.s._filesCollection.deleteOne({ _id: id }, function(error, res) {
+    if (error) {
+      return callback(error);
+    }
+
+    _this.s._chunksCollection.deleteMany({ files_id: id }, function(error) {
+      if (error) {
+        return callback(error);
+      }
+
+      // Delete orphaned chunks before returning FileNotFound
+      if (!res.result.n) {
+        var errmsg = 'FileNotFound: no file with id ' + id + ' found';
+        return callback(new Error(errmsg));
+      }
+
+      callback();
+    });
+  });
+}
+
+/**
+ * Convenience wrapper around find on the files collection
+ * @method
+ * @param {Object} filter
+ * @param {Object} [options] Optional settings for cursor
+ * @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/find|find command documentation}.
+ * @param {number} [options.limit] Optional limit for cursor
+ * @param {number} [options.maxTimeMS] Optional maxTimeMS for cursor
+ * @param {boolean} [options.noCursorTimeout] Optionally set cursor's `noCursorTimeout` flag
+ * @param {number} [options.skip] Optional skip for cursor
+ * @param {object} [options.sort] Optional sort for cursor
+ * @return {Cursor}
+ */
+
+GridFSBucket.prototype.find = function(filter, options) {
+  filter = filter || {};
+  options = options || {};
+
+  var cursor = this.s._filesCollection.find(filter);
+
+  if (options.batchSize != null) {
+    cursor.batchSize(options.batchSize);
+  }
+  if (options.limit != null) {
+    cursor.limit(options.limit);
+  }
+  if (options.maxTimeMS != null) {
+    cursor.maxTimeMS(options.maxTimeMS);
+  }
+  if (options.noCursorTimeout != null) {
+    cursor.addCursorFlag('noCursorTimeout', options.noCursorTimeout);
+  }
+  if (options.skip != null) {
+    cursor.skip(options.skip);
+  }
+  if (options.sort != null) {
+    cursor.sort(options.sort);
+  }
+
+  return cursor;
+};
+
+/**
+ * Returns a readable stream (GridFSBucketReadStream) for streaming the
+ * file with the given name from GridFS. If there are multiple files with
+ * the same name, this will stream the most recent file with the given name
+ * (as determined by the `uploadDate` field). You can set the `revision`
+ * option to change this behavior.
+ * @method
+ * @param {String} filename The name of the file to stream
+ * @param {Object} [options] Optional settings
+ * @param {number} [options.revision=-1] The revision number relative to the oldest file with the given filename. 0 gets you the oldest file, 1 gets you the 2nd oldest, -1 gets you the newest.
+ * @param {Number} [options.start] Optional 0-based offset in bytes to start streaming from
+ * @param {Number} [options.end] Optional 0-based offset in bytes to stop streaming before
+ * @return {GridFSBucketReadStream}
+ */
+
+GridFSBucket.prototype.openDownloadStreamByName = function(filename, options) {
+  var sort = { uploadDate: -1 };
+  var skip = null;
+  if (options && options.revision != null) {
+    if (options.revision >= 0) {
+      sort = { uploadDate: 1 };
+      skip = options.revision;
+    } else {
+      skip = -options.revision - 1;
+    }
+  }
+
+  var filter = { filename: filename };
+  options = {
+    sort: sort,
+    skip: skip,
+    start: options && options.start,
+    end: options && options.end
+  };
+  return new GridFSBucketReadStream(
+    this.s._chunksCollection,
+    this.s._filesCollection,
+    this.s.options.readPreference,
+    filter,
+    options
+  );
+};
+
+/**
+ * Renames the file with the given _id to the given string
+ * @method
+ * @param {ObjectId} id the id of the file to rename
+ * @param {String} filename new name for the file
+ * @param {GridFSBucket~errorCallback} [callback]
+ */
+
+GridFSBucket.prototype.rename = function(id, filename, callback) {
+  return executeLegacyOperation(this.s.db.s.topology, _rename, [this, id, filename, callback], {
+    skipSessions: true
+  });
+};
+
+/**
+ * @ignore
+ */
+
+function _rename(_this, id, filename, callback) {
+  var filter = { _id: id };
+  var update = { $set: { filename: filename } };
+  _this.s._filesCollection.updateOne(filter, update, function(error, res) {
+    if (error) {
+      return callback(error);
+    }
+    if (!res.result.n) {
+      return callback(toError('File with id ' + id + ' not found'));
+    }
+    callback();
+  });
+}
+
+/**
+ * Removes this bucket's files collection, followed by its chunks collection.
+ * @method
+ * @param {GridFSBucket~errorCallback} [callback]
+ */
+
+GridFSBucket.prototype.drop = function(callback) {
+  return executeLegacyOperation(this.s.db.s.topology, _drop, [this, callback], {
+    skipSessions: true
+  });
+};
+
+/**
+ * Return the db logger
+ * @method
+ * @return {Logger} return the db logger
+ * @ignore
+ */
+GridFSBucket.prototype.getLogger = function() {
+  return this.s.db.s.logger;
+};
+
+/**
+ * @ignore
+ */
+
+function _drop(_this, callback) {
+  _this.s._filesCollection.drop(function(error) {
+    if (error) {
+      return callback(error);
+    }
+    _this.s._chunksCollection.drop(function(error) {
+      if (error) {
+        return callback(error);
+      }
+
+      return callback();
+    });
+  });
+}
+
+/**
+ * Callback format for all GridFSBucket methods that can accept a callback.
+ * @callback GridFSBucket~errorCallback
+ * @param {MongoError|undefined} error If present, an error instance representing any errors that occurred
+ * @param {*} result If present, a returned result for the method
+ */
diff --git a/NodeAPI/node_modules/mongodb/lib/gridfs-stream/upload.js b/NodeAPI/node_modules/mongodb/lib/gridfs-stream/upload.js
new file mode 100644
index 0000000000000000000000000000000000000000..4caa5c22f77968d7f3b538c24e536269e6376d27
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/gridfs-stream/upload.js
@@ -0,0 +1,541 @@
+'use strict';
+
+var core = require('../core');
+var crypto = require('crypto');
+var stream = require('stream');
+var util = require('util');
+var Buffer = require('safe-buffer').Buffer;
+
+var ERROR_NAMESPACE_NOT_FOUND = 26;
+
+module.exports = GridFSBucketWriteStream;
+
+/**
+ * A writable stream that enables you to write buffers to GridFS.
+ *
+ * Do not instantiate this class directly. Use `openUploadStream()` instead.
+ *
+ * @class
+ * @extends external:Writable
+ * @param {GridFSBucket} bucket Handle for this stream's corresponding bucket
+ * @param {string} filename The value of the 'filename' key in the files doc
+ * @param {object} [options] Optional settings.
+ * @param {string|number|object} [options.id] Custom file id for the GridFS file.
+ * @param {number} [options.chunkSizeBytes] The chunk size to use, in bytes
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {boolean} [options.disableMD5=false] If true, disables adding an md5 field to file data
+ * @fires GridFSBucketWriteStream#error
+ * @fires GridFSBucketWriteStream#finish
+ */
+
+function GridFSBucketWriteStream(bucket, filename, options) {
+  options = options || {};
+  stream.Writable.call(this, options);
+  this.bucket = bucket;
+  this.chunks = bucket.s._chunksCollection;
+  this.filename = filename;
+  this.files = bucket.s._filesCollection;
+  this.options = options;
+  // Signals the write is all done
+  this.done = false;
+
+  this.id = options.id ? options.id : core.BSON.ObjectId();
+  this.chunkSizeBytes = this.options.chunkSizeBytes;
+  this.bufToStore = Buffer.alloc(this.chunkSizeBytes);
+  this.length = 0;
+  this.md5 = !options.disableMD5 && crypto.createHash('md5');
+  this.n = 0;
+  this.pos = 0;
+  this.state = {
+    streamEnd: false,
+    outstandingRequests: 0,
+    errored: false,
+    aborted: false,
+    promiseLibrary: this.bucket.s.promiseLibrary
+  };
+
+  if (!this.bucket.s.calledOpenUploadStream) {
+    this.bucket.s.calledOpenUploadStream = true;
+
+    var _this = this;
+    checkIndexes(this, function() {
+      _this.bucket.s.checkedIndexes = true;
+      _this.bucket.emit('index');
+    });
+  }
+}
+
+util.inherits(GridFSBucketWriteStream, stream.Writable);
+
+/**
+ * An error occurred
+ *
+ * @event GridFSBucketWriteStream#error
+ * @type {Error}
+ */
+
+/**
+ * `end()` was called and the write stream successfully wrote the file
+ * metadata and all the chunks to MongoDB.
+ *
+ * @event GridFSBucketWriteStream#finish
+ * @type {object}
+ */
+
+/**
+ * Write a buffer to the stream.
+ *
+ * @method
+ * @param {Buffer} chunk Buffer to write
+ * @param {String} encoding Optional encoding for the buffer
+ * @param {GridFSBucket~errorCallback} callback Function to call when the chunk was added to the buffer, or if the entire chunk was persisted to MongoDB if this chunk caused a flush.
+ * @return {Boolean} False if this write required flushing a chunk to MongoDB. True otherwise.
+ */
+
+GridFSBucketWriteStream.prototype.write = function(chunk, encoding, callback) {
+  var _this = this;
+  return waitForIndexes(this, function() {
+    return doWrite(_this, chunk, encoding, callback);
+  });
+};
+
+/**
+ * Places this write stream into an aborted state (all future writes fail)
+ * and deletes all chunks that have already been written.
+ *
+ * @method
+ * @param {GridFSBucket~errorCallback} callback called when chunks are successfully removed or error occurred
+ * @return {Promise} if no callback specified
+ */
+
+GridFSBucketWriteStream.prototype.abort = function(callback) {
+  if (this.state.streamEnd) {
+    var error = new Error('Cannot abort a stream that has already completed');
+    if (typeof callback === 'function') {
+      return callback(error);
+    }
+    return this.state.promiseLibrary.reject(error);
+  }
+  if (this.state.aborted) {
+    error = new Error('Cannot call abort() on a stream twice');
+    if (typeof callback === 'function') {
+      return callback(error);
+    }
+    return this.state.promiseLibrary.reject(error);
+  }
+  this.state.aborted = true;
+  this.chunks.deleteMany({ files_id: this.id }, function(error) {
+    if (typeof callback === 'function') callback(error);
+  });
+};
+
+/**
+ * Tells the stream that no more data will be coming in. The stream will
+ * persist the remaining data to MongoDB, write the files document, and
+ * then emit a 'finish' event.
+ *
+ * @method
+ * @param {Buffer} chunk Buffer to write
+ * @param {String} encoding Optional encoding for the buffer
+ * @param {GridFSBucket~errorCallback} callback Function to call when all files and chunks have been persisted to MongoDB
+ */
+
+GridFSBucketWriteStream.prototype.end = function(chunk, encoding, callback) {
+  var _this = this;
+  if (typeof chunk === 'function') {
+    (callback = chunk), (chunk = null), (encoding = null);
+  } else if (typeof encoding === 'function') {
+    (callback = encoding), (encoding = null);
+  }
+
+  if (checkAborted(this, callback)) {
+    return;
+  }
+  this.state.streamEnd = true;
+
+  if (callback) {
+    this.once('finish', function(result) {
+      callback(null, result);
+    });
+  }
+
+  if (!chunk) {
+    waitForIndexes(this, function() {
+      writeRemnant(_this);
+    });
+    return;
+  }
+
+  this.write(chunk, encoding, function() {
+    writeRemnant(_this);
+  });
+};
+
+/**
+ * @ignore
+ */
+
+function __handleError(_this, error, callback) {
+  if (_this.state.errored) {
+    return;
+  }
+  _this.state.errored = true;
+  if (callback) {
+    return callback(error);
+  }
+  _this.emit('error', error);
+}
+
+/**
+ * @ignore
+ */
+
+function createChunkDoc(filesId, n, data) {
+  return {
+    _id: core.BSON.ObjectId(),
+    files_id: filesId,
+    n: n,
+    data: data
+  };
+}
+
+/**
+ * @ignore
+ */
+
+function checkChunksIndex(_this, callback) {
+  _this.chunks.listIndexes().toArray(function(error, indexes) {
+    if (error) {
+      // Collection doesn't exist so create index
+      if (error.code === ERROR_NAMESPACE_NOT_FOUND) {
+        var index = { files_id: 1, n: 1 };
+        _this.chunks.createIndex(index, { background: false, unique: true }, function(error) {
+          if (error) {
+            return callback(error);
+          }
+
+          callback();
+        });
+        return;
+      }
+      return callback(error);
+    }
+
+    var hasChunksIndex = false;
+    indexes.forEach(function(index) {
+      if (index.key) {
+        var keys = Object.keys(index.key);
+        if (keys.length === 2 && index.key.files_id === 1 && index.key.n === 1) {
+          hasChunksIndex = true;
+        }
+      }
+    });
+
+    if (hasChunksIndex) {
+      callback();
+    } else {
+      index = { files_id: 1, n: 1 };
+      var indexOptions = getWriteOptions(_this);
+
+      indexOptions.background = false;
+      indexOptions.unique = true;
+
+      _this.chunks.createIndex(index, indexOptions, function(error) {
+        if (error) {
+          return callback(error);
+        }
+
+        callback();
+      });
+    }
+  });
+}
+
+/**
+ * @ignore
+ */
+
+function checkDone(_this, callback) {
+  if (_this.done) return true;
+  if (_this.state.streamEnd && _this.state.outstandingRequests === 0 && !_this.state.errored) {
+    // Set done so we dont' trigger duplicate createFilesDoc
+    _this.done = true;
+    // Create a new files doc
+    var filesDoc = createFilesDoc(
+      _this.id,
+      _this.length,
+      _this.chunkSizeBytes,
+      _this.md5 && _this.md5.digest('hex'),
+      _this.filename,
+      _this.options.contentType,
+      _this.options.aliases,
+      _this.options.metadata
+    );
+
+    if (checkAborted(_this, callback)) {
+      return false;
+    }
+
+    _this.files.insertOne(filesDoc, getWriteOptions(_this), function(error) {
+      if (error) {
+        return __handleError(_this, error, callback);
+      }
+      _this.emit('finish', filesDoc);
+      _this.emit('close');
+    });
+
+    return true;
+  }
+
+  return false;
+}
+
+/**
+ * @ignore
+ */
+
+function checkIndexes(_this, callback) {
+  _this.files.findOne({}, { _id: 1 }, function(error, doc) {
+    if (error) {
+      return callback(error);
+    }
+    if (doc) {
+      return callback();
+    }
+
+    _this.files.listIndexes().toArray(function(error, indexes) {
+      if (error) {
+        // Collection doesn't exist so create index
+        if (error.code === ERROR_NAMESPACE_NOT_FOUND) {
+          var index = { filename: 1, uploadDate: 1 };
+          _this.files.createIndex(index, { background: false }, function(error) {
+            if (error) {
+              return callback(error);
+            }
+
+            checkChunksIndex(_this, callback);
+          });
+          return;
+        }
+        return callback(error);
+      }
+
+      var hasFileIndex = false;
+      indexes.forEach(function(index) {
+        var keys = Object.keys(index.key);
+        if (keys.length === 2 && index.key.filename === 1 && index.key.uploadDate === 1) {
+          hasFileIndex = true;
+        }
+      });
+
+      if (hasFileIndex) {
+        checkChunksIndex(_this, callback);
+      } else {
+        index = { filename: 1, uploadDate: 1 };
+
+        var indexOptions = getWriteOptions(_this);
+
+        indexOptions.background = false;
+
+        _this.files.createIndex(index, indexOptions, function(error) {
+          if (error) {
+            return callback(error);
+          }
+
+          checkChunksIndex(_this, callback);
+        });
+      }
+    });
+  });
+}
+
+/**
+ * @ignore
+ */
+
+function createFilesDoc(_id, length, chunkSize, md5, filename, contentType, aliases, metadata) {
+  var ret = {
+    _id: _id,
+    length: length,
+    chunkSize: chunkSize,
+    uploadDate: new Date(),
+    filename: filename
+  };
+
+  if (md5) {
+    ret.md5 = md5;
+  }
+
+  if (contentType) {
+    ret.contentType = contentType;
+  }
+
+  if (aliases) {
+    ret.aliases = aliases;
+  }
+
+  if (metadata) {
+    ret.metadata = metadata;
+  }
+
+  return ret;
+}
+
+/**
+ * @ignore
+ */
+
+function doWrite(_this, chunk, encoding, callback) {
+  if (checkAborted(_this, callback)) {
+    return false;
+  }
+
+  var inputBuf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding);
+
+  _this.length += inputBuf.length;
+
+  // Input is small enough to fit in our buffer
+  if (_this.pos + inputBuf.length < _this.chunkSizeBytes) {
+    inputBuf.copy(_this.bufToStore, _this.pos);
+    _this.pos += inputBuf.length;
+
+    callback && callback();
+
+    // Note that we reverse the typical semantics of write's return value
+    // to be compatible with node's `.pipe()` function.
+    // True means client can keep writing.
+    return true;
+  }
+
+  // Otherwise, buffer is too big for current chunk, so we need to flush
+  // to MongoDB.
+  var inputBufRemaining = inputBuf.length;
+  var spaceRemaining = _this.chunkSizeBytes - _this.pos;
+  var numToCopy = Math.min(spaceRemaining, inputBuf.length);
+  var outstandingRequests = 0;
+  while (inputBufRemaining > 0) {
+    var inputBufPos = inputBuf.length - inputBufRemaining;
+    inputBuf.copy(_this.bufToStore, _this.pos, inputBufPos, inputBufPos + numToCopy);
+    _this.pos += numToCopy;
+    spaceRemaining -= numToCopy;
+    if (spaceRemaining === 0) {
+      if (_this.md5) {
+        _this.md5.update(_this.bufToStore);
+      }
+      var doc = createChunkDoc(_this.id, _this.n, Buffer.from(_this.bufToStore));
+      ++_this.state.outstandingRequests;
+      ++outstandingRequests;
+
+      if (checkAborted(_this, callback)) {
+        return false;
+      }
+
+      _this.chunks.insertOne(doc, getWriteOptions(_this), function(error) {
+        if (error) {
+          return __handleError(_this, error);
+        }
+        --_this.state.outstandingRequests;
+        --outstandingRequests;
+
+        if (!outstandingRequests) {
+          _this.emit('drain', doc);
+          callback && callback();
+          checkDone(_this);
+        }
+      });
+
+      spaceRemaining = _this.chunkSizeBytes;
+      _this.pos = 0;
+      ++_this.n;
+    }
+    inputBufRemaining -= numToCopy;
+    numToCopy = Math.min(spaceRemaining, inputBufRemaining);
+  }
+
+  // Note that we reverse the typical semantics of write's return value
+  // to be compatible with node's `.pipe()` function.
+  // False means the client should wait for the 'drain' event.
+  return false;
+}
+
+/**
+ * @ignore
+ */
+
+function getWriteOptions(_this) {
+  var obj = {};
+  if (_this.options.writeConcern) {
+    obj.w = _this.options.writeConcern.w;
+    obj.wtimeout = _this.options.writeConcern.wtimeout;
+    obj.j = _this.options.writeConcern.j;
+  }
+  return obj;
+}
+
+/**
+ * @ignore
+ */
+
+function waitForIndexes(_this, callback) {
+  if (_this.bucket.s.checkedIndexes) {
+    return callback(false);
+  }
+
+  _this.bucket.once('index', function() {
+    callback(true);
+  });
+
+  return true;
+}
+
+/**
+ * @ignore
+ */
+
+function writeRemnant(_this, callback) {
+  // Buffer is empty, so don't bother to insert
+  if (_this.pos === 0) {
+    return checkDone(_this, callback);
+  }
+
+  ++_this.state.outstandingRequests;
+
+  // Create a new buffer to make sure the buffer isn't bigger than it needs
+  // to be.
+  var remnant = Buffer.alloc(_this.pos);
+  _this.bufToStore.copy(remnant, 0, 0, _this.pos);
+  if (_this.md5) {
+    _this.md5.update(remnant);
+  }
+  var doc = createChunkDoc(_this.id, _this.n, remnant);
+
+  // If the stream was aborted, do not write remnant
+  if (checkAborted(_this, callback)) {
+    return false;
+  }
+
+  _this.chunks.insertOne(doc, getWriteOptions(_this), function(error) {
+    if (error) {
+      return __handleError(_this, error);
+    }
+    --_this.state.outstandingRequests;
+    checkDone(_this);
+  });
+}
+
+/**
+ * @ignore
+ */
+
+function checkAborted(_this, callback) {
+  if (_this.state.aborted) {
+    if (typeof callback === 'function') {
+      callback(new Error('this stream has been aborted'));
+    }
+    return true;
+  }
+  return false;
+}
diff --git a/NodeAPI/node_modules/mongodb/lib/gridfs/chunk.js b/NodeAPI/node_modules/mongodb/lib/gridfs/chunk.js
new file mode 100644
index 0000000000000000000000000000000000000000..d276d720476e56cb53853da3d755b0d7e7e92aa2
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/gridfs/chunk.js
@@ -0,0 +1,236 @@
+'use strict';
+
+var Binary = require('../core').BSON.Binary,
+  ObjectID = require('../core').BSON.ObjectID;
+
+var Buffer = require('safe-buffer').Buffer;
+
+/**
+ * Class for representing a single chunk in GridFS.
+ *
+ * @class
+ *
+ * @param file {GridStore} The {@link GridStore} object holding this chunk.
+ * @param mongoObject {object} The mongo object representation of this chunk.
+ *
+ * @throws Error when the type of data field for {@link mongoObject} is not
+ *     supported. Currently supported types for data field are instances of
+ *     {@link String}, {@link Array}, {@link Binary} and {@link Binary}
+ *     from the bson module
+ *
+ * @see Chunk#buildMongoObject
+ */
+var Chunk = function(file, mongoObject, writeConcern) {
+  if (!(this instanceof Chunk)) return new Chunk(file, mongoObject);
+
+  this.file = file;
+  var mongoObjectFinal = mongoObject == null ? {} : mongoObject;
+  this.writeConcern = writeConcern || { w: 1 };
+  this.objectId = mongoObjectFinal._id == null ? new ObjectID() : mongoObjectFinal._id;
+  this.chunkNumber = mongoObjectFinal.n == null ? 0 : mongoObjectFinal.n;
+  this.data = new Binary();
+
+  if (typeof mongoObjectFinal.data === 'string') {
+    var buffer = Buffer.alloc(mongoObjectFinal.data.length);
+    buffer.write(mongoObjectFinal.data, 0, mongoObjectFinal.data.length, 'binary');
+    this.data = new Binary(buffer);
+  } else if (Array.isArray(mongoObjectFinal.data)) {
+    buffer = Buffer.alloc(mongoObjectFinal.data.length);
+    var data = mongoObjectFinal.data.join('');
+    buffer.write(data, 0, data.length, 'binary');
+    this.data = new Binary(buffer);
+  } else if (mongoObjectFinal.data && mongoObjectFinal.data._bsontype === 'Binary') {
+    this.data = mongoObjectFinal.data;
+  } else if (!Buffer.isBuffer(mongoObjectFinal.data) && !(mongoObjectFinal.data == null)) {
+    throw Error('Illegal chunk format');
+  }
+
+  // Update position
+  this.internalPosition = 0;
+};
+
+/**
+ * Writes a data to this object and advance the read/write head.
+ *
+ * @param data {string} the data to write
+ * @param callback {function(*, GridStore)} This will be called after executing
+ *     this method. The first parameter will contain null and the second one
+ *     will contain a reference to this object.
+ */
+Chunk.prototype.write = function(data, callback) {
+  this.data.write(data, this.internalPosition, data.length, 'binary');
+  this.internalPosition = this.data.length();
+  if (callback != null) return callback(null, this);
+  return this;
+};
+
+/**
+ * Reads data and advances the read/write head.
+ *
+ * @param length {number} The length of data to read.
+ *
+ * @return {string} The data read if the given length will not exceed the end of
+ *     the chunk. Returns an empty String otherwise.
+ */
+Chunk.prototype.read = function(length) {
+  // Default to full read if no index defined
+  length = length == null || length === 0 ? this.length() : length;
+
+  if (this.length() - this.internalPosition + 1 >= length) {
+    var data = this.data.read(this.internalPosition, length);
+    this.internalPosition = this.internalPosition + length;
+    return data;
+  } else {
+    return '';
+  }
+};
+
+Chunk.prototype.readSlice = function(length) {
+  if (this.length() - this.internalPosition >= length) {
+    var data = null;
+    if (this.data.buffer != null) {
+      //Pure BSON
+      data = this.data.buffer.slice(this.internalPosition, this.internalPosition + length);
+    } else {
+      //Native BSON
+      data = Buffer.alloc(length);
+      length = this.data.readInto(data, this.internalPosition);
+    }
+    this.internalPosition = this.internalPosition + length;
+    return data;
+  } else {
+    return null;
+  }
+};
+
+/**
+ * Checks if the read/write head is at the end.
+ *
+ * @return {boolean} Whether the read/write head has reached the end of this
+ *     chunk.
+ */
+Chunk.prototype.eof = function() {
+  return this.internalPosition === this.length() ? true : false;
+};
+
+/**
+ * Reads one character from the data of this chunk and advances the read/write
+ * head.
+ *
+ * @return {string} a single character data read if the the read/write head is
+ *     not at the end of the chunk. Returns an empty String otherwise.
+ */
+Chunk.prototype.getc = function() {
+  return this.read(1);
+};
+
+/**
+ * Clears the contents of the data in this chunk and resets the read/write head
+ * to the initial position.
+ */
+Chunk.prototype.rewind = function() {
+  this.internalPosition = 0;
+  this.data = new Binary();
+};
+
+/**
+ * Saves this chunk to the database. Also overwrites existing entries having the
+ * same id as this chunk.
+ *
+ * @param callback {function(*, GridStore)} This will be called after executing
+ *     this method. The first parameter will contain null and the second one
+ *     will contain a reference to this object.
+ */
+Chunk.prototype.save = function(options, callback) {
+  var self = this;
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  self.file.chunkCollection(function(err, collection) {
+    if (err) return callback(err);
+
+    // Merge the options
+    var writeOptions = { upsert: true };
+    for (var name in options) writeOptions[name] = options[name];
+    for (name in self.writeConcern) writeOptions[name] = self.writeConcern[name];
+
+    if (self.data.length() > 0) {
+      self.buildMongoObject(function(mongoObject) {
+        var options = { forceServerObjectId: true };
+        for (var name in self.writeConcern) {
+          options[name] = self.writeConcern[name];
+        }
+
+        collection.replaceOne({ _id: self.objectId }, mongoObject, writeOptions, function(err) {
+          callback(err, self);
+        });
+      });
+    } else {
+      callback(null, self);
+    }
+    // });
+  });
+};
+
+/**
+ * Creates a mongoDB object representation of this chunk.
+ *
+ * @param callback {function(Object)} This will be called after executing this
+ *     method. The object will be passed to the first parameter and will have
+ *     the structure:
+ *
+ *        <pre><code>
+ *        {
+ *          '_id' : , // {number} id for this chunk
+ *          'files_id' : , // {number} foreign key to the file collection
+ *          'n' : , // {number} chunk number
+ *          'data' : , // {bson#Binary} the chunk data itself
+ *        }
+ *        </code></pre>
+ *
+ * @see <a href="http://www.mongodb.org/display/DOCS/GridFS+Specification#GridFSSpecification-{{chunks}}">MongoDB GridFS Chunk Object Structure</a>
+ */
+Chunk.prototype.buildMongoObject = function(callback) {
+  var mongoObject = {
+    files_id: this.file.fileId,
+    n: this.chunkNumber,
+    data: this.data
+  };
+  // If we are saving using a specific ObjectId
+  if (this.objectId != null) mongoObject._id = this.objectId;
+
+  callback(mongoObject);
+};
+
+/**
+ * @return {number} the length of the data
+ */
+Chunk.prototype.length = function() {
+  return this.data.length();
+};
+
+/**
+ * The position of the read/write head
+ * @name position
+ * @lends Chunk#
+ * @field
+ */
+Object.defineProperty(Chunk.prototype, 'position', {
+  enumerable: true,
+  get: function() {
+    return this.internalPosition;
+  },
+  set: function(value) {
+    this.internalPosition = value;
+  }
+});
+
+/**
+ * The default chunk size
+ * @constant
+ */
+Chunk.DEFAULT_CHUNK_SIZE = 1024 * 255;
+
+module.exports = Chunk;
diff --git a/NodeAPI/node_modules/mongodb/lib/gridfs/grid_store.js b/NodeAPI/node_modules/mongodb/lib/gridfs/grid_store.js
new file mode 100644
index 0000000000000000000000000000000000000000..4f229a03782a3e0e95a4cb1774bde8a122bb7dfd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/gridfs/grid_store.js
@@ -0,0 +1,1925 @@
+'use strict';
+
+/**
+ * @fileOverview GridFS is a tool for MongoDB to store files to the database.
+ * Because of the restrictions of the object size the database can hold, a
+ * facility to split a file into several chunks is needed. The {@link GridStore}
+ * class offers a simplified api to interact with files while managing the
+ * chunks of split files behind the scenes. More information about GridFS can be
+ * found <a href="http://www.mongodb.org/display/DOCS/GridFS">here</a>.
+ *
+ * @example
+ * const MongoClient = require('mongodb').MongoClient;
+ * const GridStore = require('mongodb').GridStore;
+ * const ObjectID = require('mongodb').ObjectID;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   const db = client.db(dbName);
+ *   const gridStore = new GridStore(db, null, "w");
+ *   gridStore.open(function(err, gridStore) {
+ *     gridStore.write("hello world!", function(err, gridStore) {
+ *       gridStore.close(function(err, result) {
+ *         // Let's read the file using object Id
+ *         GridStore.read(db, result._id, function(err, data) {
+ *           test.equal('hello world!', data);
+ *           client.close();
+ *           test.done();
+ *         });
+ *       });
+ *     });
+ *   });
+ * });
+ */
+const Chunk = require('./chunk');
+const ObjectID = require('../core').BSON.ObjectID;
+const ReadPreference = require('../core').ReadPreference;
+const Buffer = require('safe-buffer').Buffer;
+const fs = require('fs');
+const f = require('util').format;
+const util = require('util');
+const MongoError = require('../core').MongoError;
+const inherits = util.inherits;
+const Duplex = require('stream').Duplex;
+const shallowClone = require('../utils').shallowClone;
+const executeLegacyOperation = require('../utils').executeLegacyOperation;
+const deprecate = require('util').deprecate;
+
+var REFERENCE_BY_FILENAME = 0,
+  REFERENCE_BY_ID = 1;
+
+const deprecationFn = deprecate(() => {},
+'GridStore is deprecated, and will be removed in a future version. Please use GridFSBucket instead');
+
+/**
+ * Namespace provided by the core module
+ * @external Duplex
+ */
+
+/**
+ * Create a new GridStore instance
+ *
+ * Modes
+ *  - **"r"** - read only. This is the default mode.
+ *  - **"w"** - write in truncate mode. Existing data will be overwritten.
+ *
+ * @class
+ * @param {Db} db A database instance to interact with.
+ * @param {object} [id] optional unique id for this file
+ * @param {string} [filename] optional filename for this file, no unique constrain on the field
+ * @param {string} mode set the mode for this file.
+ * @param {object} [options] Optional settings.
+ * @param {(number|string)} [options.w] **Deprecated** The write concern. Use writeConcern instead.
+ * @param {number} [options.wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @param {boolean} [options.j=false] **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @param {boolean} [options.fsync=false] **Deprecated** Specify a file sync write concern. Use writeConcern instead.
+ * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+ * @param {string} [options.root] Root collection to use. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**.
+ * @param {string} [options.content_type] MIME type of the file. Defaults to **{GridStore.DEFAULT_CONTENT_TYPE}**.
+ * @param {number} [options.chunk_size=261120] Size for the chunk. Defaults to **{Chunk.DEFAULT_CHUNK_SIZE}**.
+ * @param {object} [options.metadata] Arbitrary data the user wants to store.
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @property {number} chunkSize Get the gridstore chunk size.
+ * @property {number} md5 The md5 checksum for this file.
+ * @property {number} chunkNumber The current chunk number the gridstore has materialized into memory
+ * @return {GridStore} a GridStore instance.
+ * @deprecated Use GridFSBucket API instead
+ */
+var GridStore = function GridStore(db, id, filename, mode, options) {
+  deprecationFn();
+  if (!(this instanceof GridStore)) return new GridStore(db, id, filename, mode, options);
+  this.db = db;
+
+  // Handle options
+  if (typeof options === 'undefined') options = {};
+  // Handle mode
+  if (typeof mode === 'undefined') {
+    mode = filename;
+    filename = undefined;
+  } else if (typeof mode === 'object') {
+    options = mode;
+    mode = filename;
+    filename = undefined;
+  }
+
+  if (id && id._bsontype === 'ObjectID') {
+    this.referenceBy = REFERENCE_BY_ID;
+    this.fileId = id;
+    this.filename = filename;
+  } else if (typeof filename === 'undefined') {
+    this.referenceBy = REFERENCE_BY_FILENAME;
+    this.filename = id;
+    if (mode.indexOf('w') != null) {
+      this.fileId = new ObjectID();
+    }
+  } else {
+    this.referenceBy = REFERENCE_BY_ID;
+    this.fileId = id;
+    this.filename = filename;
+  }
+
+  // Set up the rest
+  this.mode = mode == null ? 'r' : mode;
+  this.options = options || {};
+
+  // Opened
+  this.isOpen = false;
+
+  // Set the root if overridden
+  this.root =
+    this.options['root'] == null ? GridStore.DEFAULT_ROOT_COLLECTION : this.options['root'];
+  this.position = 0;
+  this.readPreference =
+    this.options.readPreference || db.options.readPreference || ReadPreference.primary;
+  this.writeConcern = _getWriteConcern(db, this.options);
+  // Set default chunk size
+  this.internalChunkSize =
+    this.options['chunkSize'] == null ? Chunk.DEFAULT_CHUNK_SIZE : this.options['chunkSize'];
+
+  // Get the promiseLibrary
+  var promiseLibrary = this.options.promiseLibrary || Promise;
+
+  // Set the promiseLibrary
+  this.promiseLibrary = promiseLibrary;
+
+  Object.defineProperty(this, 'chunkSize', {
+    enumerable: true,
+    get: function() {
+      return this.internalChunkSize;
+    },
+    set: function(value) {
+      if (!(this.mode[0] === 'w' && this.position === 0 && this.uploadDate == null)) {
+        // eslint-disable-next-line no-self-assign
+        this.internalChunkSize = this.internalChunkSize;
+      } else {
+        this.internalChunkSize = value;
+      }
+    }
+  });
+
+  Object.defineProperty(this, 'md5', {
+    enumerable: true,
+    get: function() {
+      return this.internalMd5;
+    }
+  });
+
+  Object.defineProperty(this, 'chunkNumber', {
+    enumerable: true,
+    get: function() {
+      return this.currentChunk && this.currentChunk.chunkNumber
+        ? this.currentChunk.chunkNumber
+        : null;
+    }
+  });
+};
+
+/**
+ * The callback format for the Gridstore.open method
+ * @callback GridStore~openCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {GridStore} gridStore The GridStore instance if the open method was successful.
+ */
+
+/**
+ * Opens the file from the database and initialize this object. Also creates a
+ * new one if file does not exist.
+ *
+ * @method
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~openCallback} [callback] this will be called after executing this method
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.open = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  if (this.mode !== 'w' && this.mode !== 'w+' && this.mode !== 'r') {
+    throw MongoError.create({ message: 'Illegal mode ' + this.mode, driver: true });
+  }
+
+  return executeLegacyOperation(this.db.s.topology, open, [this, options, callback], {
+    skipSessions: true
+  });
+};
+
+var open = function(self, options, callback) {
+  // Get the write concern
+  var writeConcern = _getWriteConcern(self.db, self.options);
+
+  // If we are writing we need to ensure we have the right indexes for md5's
+  if (self.mode === 'w' || self.mode === 'w+') {
+    // Get files collection
+    var collection = self.collection();
+    // Put index on filename
+    collection.ensureIndex([['filename', 1]], writeConcern, function() {
+      // Get chunk collection
+      var chunkCollection = self.chunkCollection();
+      // Make an unique index for compatibility with mongo-cxx-driver:legacy
+      var chunkIndexOptions = shallowClone(writeConcern);
+      chunkIndexOptions.unique = true;
+      // Ensure index on chunk collection
+      chunkCollection.ensureIndex(
+        [
+          ['files_id', 1],
+          ['n', 1]
+        ],
+        chunkIndexOptions,
+        function() {
+          // Open the connection
+          _open(self, writeConcern, function(err, r) {
+            if (err) return callback(err);
+            self.isOpen = true;
+            callback(err, r);
+          });
+        }
+      );
+    });
+  } else {
+    // Open the gridstore
+    _open(self, writeConcern, function(err, r) {
+      if (err) return callback(err);
+      self.isOpen = true;
+      callback(err, r);
+    });
+  }
+};
+
+/**
+ * Verify if the file is at EOF.
+ *
+ * @method
+ * @return {boolean} true if the read/write head is at the end of this file.
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.eof = function() {
+  return this.position === this.length ? true : false;
+};
+
+/**
+ * The callback result format.
+ * @callback GridStore~resultCallback
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {object} result The result from the callback.
+ */
+
+/**
+ * Retrieves a single character from this file.
+ *
+ * @method
+ * @param {GridStore~resultCallback} [callback] this gets called after this method is executed. Passes null to the first parameter and the character read to the second or null to the second if the read/write head is at the end of the file.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.getc = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.db.s.topology, getc, [this, options, callback], {
+    skipSessions: true
+  });
+};
+
+var getc = function(self, options, callback) {
+  if (self.eof()) {
+    callback(null, null);
+  } else if (self.currentChunk.eof()) {
+    nthChunk(self, self.currentChunk.chunkNumber + 1, function(err, chunk) {
+      self.currentChunk = chunk;
+      self.position = self.position + 1;
+      callback(err, self.currentChunk.getc());
+    });
+  } else {
+    self.position = self.position + 1;
+    callback(null, self.currentChunk.getc());
+  }
+};
+
+/**
+ * Writes a string to the file with a newline character appended at the end if
+ * the given string does not have one.
+ *
+ * @method
+ * @param {string} string the string to write.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.puts = function(string, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  var finalString = string.match(/\n$/) == null ? string + '\n' : string;
+  return executeLegacyOperation(
+    this.db.s.topology,
+    this.write.bind(this),
+    [finalString, options, callback],
+    { skipSessions: true }
+  );
+};
+
+/**
+ * Return a modified Readable stream including a possible transform method.
+ *
+ * @method
+ * @return {GridStoreStream}
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.stream = function() {
+  return new GridStoreStream(this);
+};
+
+/**
+ * Writes some data. This method will work properly only if initialized with mode "w" or "w+".
+ *
+ * @method
+ * @param {(string|Buffer)} data the data to write.
+ * @param {boolean} [close] closes this file after writing if set to true.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.write = function write(data, close, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(
+    this.db.s.topology,
+    _writeNormal,
+    [this, data, close, options, callback],
+    { skipSessions: true }
+  );
+};
+
+/**
+ * Handles the destroy part of a stream
+ *
+ * @method
+ * @result {null}
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.destroy = function destroy() {
+  // close and do not emit any more events. queued data is not sent.
+  if (!this.writable) return;
+  this.readable = false;
+  if (this.writable) {
+    this.writable = false;
+    this._q.length = 0;
+    this.emit('close');
+  }
+};
+
+/**
+ * Stores a file from the file system to the GridFS database.
+ *
+ * @method
+ * @param {(string|Buffer|FileHandle)} file the file to store.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.writeFile = function(file, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.db.s.topology, writeFile, [this, file, options, callback], {
+    skipSessions: true
+  });
+};
+
+var writeFile = function(self, file, options, callback) {
+  if (typeof file === 'string') {
+    fs.open(file, 'r', function(err, fd) {
+      if (err) return callback(err);
+      self.writeFile(fd, callback);
+    });
+    return;
+  }
+
+  self.open(function(err, self) {
+    if (err) return callback(err, self);
+
+    fs.fstat(file, function(err, stats) {
+      if (err) return callback(err, self);
+
+      var offset = 0;
+      var index = 0;
+
+      // Write a chunk
+      var writeChunk = function() {
+        // Allocate the buffer
+        var _buffer = Buffer.alloc(self.chunkSize);
+        // Read the file
+        fs.read(file, _buffer, 0, _buffer.length, offset, function(err, bytesRead, data) {
+          if (err) return callback(err, self);
+
+          offset = offset + bytesRead;
+
+          // Create a new chunk for the data
+          var chunk = new Chunk(self, { n: index++ }, self.writeConcern);
+          chunk.write(data.slice(0, bytesRead), function(err, chunk) {
+            if (err) return callback(err, self);
+
+            chunk.save({}, function(err) {
+              if (err) return callback(err, self);
+
+              self.position = self.position + bytesRead;
+
+              // Point to current chunk
+              self.currentChunk = chunk;
+
+              if (offset >= stats.size) {
+                fs.close(file, function(err) {
+                  if (err) return callback(err);
+
+                  self.close(function(err) {
+                    if (err) return callback(err, self);
+                    return callback(null, self);
+                  });
+                });
+              } else {
+                return process.nextTick(writeChunk);
+              }
+            });
+          });
+        });
+      };
+
+      // Process the first write
+      process.nextTick(writeChunk);
+    });
+  });
+};
+
+/**
+ * Saves this file to the database. This will overwrite the old entry if it
+ * already exists. This will work properly only if mode was initialized to
+ * "w" or "w+".
+ *
+ * @method
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.close = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.db.s.topology, close, [this, options, callback], {
+    skipSessions: true
+  });
+};
+
+var close = function(self, options, callback) {
+  if (self.mode[0] === 'w') {
+    // Set up options
+    options = Object.assign({}, self.writeConcern, options);
+
+    if (self.currentChunk != null && self.currentChunk.position > 0) {
+      self.currentChunk.save({}, function(err) {
+        if (err && typeof callback === 'function') return callback(err);
+
+        self.collection(function(err, files) {
+          if (err && typeof callback === 'function') return callback(err);
+
+          // Build the mongo object
+          if (self.uploadDate != null) {
+            buildMongoObject(self, function(err, mongoObject) {
+              if (err) {
+                if (typeof callback === 'function') return callback(err);
+                else throw err;
+              }
+
+              files.save(mongoObject, options, function(err) {
+                if (typeof callback === 'function') callback(err, mongoObject);
+              });
+            });
+          } else {
+            self.uploadDate = new Date();
+            buildMongoObject(self, function(err, mongoObject) {
+              if (err) {
+                if (typeof callback === 'function') return callback(err);
+                else throw err;
+              }
+
+              files.save(mongoObject, options, function(err) {
+                if (typeof callback === 'function') callback(err, mongoObject);
+              });
+            });
+          }
+        });
+      });
+    } else {
+      self.collection(function(err, files) {
+        if (err && typeof callback === 'function') return callback(err);
+
+        self.uploadDate = new Date();
+        buildMongoObject(self, function(err, mongoObject) {
+          if (err) {
+            if (typeof callback === 'function') return callback(err);
+            else throw err;
+          }
+
+          files.save(mongoObject, options, function(err) {
+            if (typeof callback === 'function') callback(err, mongoObject);
+          });
+        });
+      });
+    }
+  } else if (self.mode[0] === 'r') {
+    if (typeof callback === 'function') callback(null, null);
+  } else {
+    if (typeof callback === 'function')
+      callback(MongoError.create({ message: f('Illegal mode %s', self.mode), driver: true }));
+  }
+};
+
+/**
+ * The collection callback format.
+ * @callback GridStore~collectionCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Collection} collection The collection from the command execution.
+ */
+
+/**
+ * Retrieve this file's chunks collection.
+ *
+ * @method
+ * @param {GridStore~collectionCallback} callback the command callback.
+ * @return {Collection}
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.chunkCollection = function(callback) {
+  if (typeof callback === 'function') return this.db.collection(this.root + '.chunks', callback);
+  return this.db.collection(this.root + '.chunks');
+};
+
+/**
+ * Deletes all the chunks of this file in the database.
+ *
+ * @method
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.unlink = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.db.s.topology, unlink, [this, options, callback], {
+    skipSessions: true
+  });
+};
+
+var unlink = function(self, options, callback) {
+  deleteChunks(self, function(err) {
+    if (err !== null) {
+      err.message = 'at deleteChunks: ' + err.message;
+      return callback(err);
+    }
+
+    self.collection(function(err, collection) {
+      if (err !== null) {
+        err.message = 'at collection: ' + err.message;
+        return callback(err);
+      }
+
+      collection.remove({ _id: self.fileId }, self.writeConcern, function(err) {
+        callback(err, self);
+      });
+    });
+  });
+};
+
+/**
+ * Retrieves the file collection associated with this object.
+ *
+ * @method
+ * @param {GridStore~collectionCallback} callback the command callback.
+ * @return {Collection}
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.collection = function(callback) {
+  if (typeof callback === 'function') this.db.collection(this.root + '.files', callback);
+  return this.db.collection(this.root + '.files');
+};
+
+/**
+ * The readlines callback format.
+ * @callback GridStore~readlinesCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {string[]} strings The array of strings returned.
+ */
+
+/**
+ * Read the entire file as a list of strings splitting by the provided separator.
+ *
+ * @method
+ * @param {string} [separator] The character to be recognized as the newline separator.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~readlinesCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.readlines = function(separator, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  separator = args.length ? args.shift() : '\n';
+  separator = separator || '\n';
+  options = args.length ? args.shift() : {};
+
+  return executeLegacyOperation(
+    this.db.s.topology,
+    readlines,
+    [this, separator, options, callback],
+    { skipSessions: true }
+  );
+};
+
+var readlines = function(self, separator, options, callback) {
+  self.read(function(err, data) {
+    if (err) return callback(err);
+
+    var items = data.toString().split(separator);
+    items = items.length > 0 ? items.splice(0, items.length - 1) : [];
+    for (var i = 0; i < items.length; i++) {
+      items[i] = items[i] + separator;
+    }
+
+    callback(null, items);
+  });
+};
+
+/**
+ * Deletes all the chunks of this file in the database if mode was set to "w" or
+ * "w+" and resets the read/write head to the initial position.
+ *
+ * @method
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] this will be called after executing this method. The first parameter will contain null and the second one will contain a reference to this object.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.rewind = function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  return executeLegacyOperation(this.db.s.topology, rewind, [this, options, callback], {
+    skipSessions: true
+  });
+};
+
+var rewind = function(self, options, callback) {
+  if (self.currentChunk.chunkNumber !== 0) {
+    if (self.mode[0] === 'w') {
+      deleteChunks(self, function(err) {
+        if (err) return callback(err);
+        self.currentChunk = new Chunk(self, { n: 0 }, self.writeConcern);
+        self.position = 0;
+        callback(null, self);
+      });
+    } else {
+      self.currentChunk(0, function(err, chunk) {
+        if (err) return callback(err);
+        self.currentChunk = chunk;
+        self.currentChunk.rewind();
+        self.position = 0;
+        callback(null, self);
+      });
+    }
+  } else {
+    self.currentChunk.rewind();
+    self.position = 0;
+    callback(null, self);
+  }
+};
+
+/**
+ * The read callback format.
+ * @callback GridStore~readCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {Buffer} data The data read from the GridStore object
+ */
+
+/**
+ * Retrieves the contents of this file and advances the read/write head. Works with Buffers only.
+ *
+ * There are 3 signatures for this method:
+ *
+ * (callback)
+ * (length, callback)
+ * (length, buffer, callback)
+ *
+ * @method
+ * @param {number} [length] the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified.
+ * @param {(string|Buffer)} [buffer] a string to hold temporary data. This is used for storing the string data read so far when recursively calling this method.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~readCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.read = function(length, buffer, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  length = args.length ? args.shift() : null;
+  buffer = args.length ? args.shift() : null;
+  options = args.length ? args.shift() : {};
+
+  return executeLegacyOperation(
+    this.db.s.topology,
+    read,
+    [this, length, buffer, options, callback],
+    { skipSessions: true }
+  );
+};
+
+var read = function(self, length, buffer, options, callback) {
+  // The data is a c-terminated string and thus the length - 1
+  var finalLength = length == null ? self.length - self.position : length;
+  var finalBuffer = buffer == null ? Buffer.alloc(finalLength) : buffer;
+  // Add a index to buffer to keep track of writing position or apply current index
+  finalBuffer._index = buffer != null && buffer._index != null ? buffer._index : 0;
+
+  if (self.currentChunk.length() - self.currentChunk.position + finalBuffer._index >= finalLength) {
+    var slice = self.currentChunk.readSlice(finalLength - finalBuffer._index);
+    // Copy content to final buffer
+    slice.copy(finalBuffer, finalBuffer._index);
+    // Update internal position
+    self.position = self.position + finalBuffer.length;
+    // Check if we don't have a file at all
+    if (finalLength === 0 && finalBuffer.length === 0)
+      return callback(MongoError.create({ message: 'File does not exist', driver: true }), null);
+    // Else return data
+    return callback(null, finalBuffer);
+  }
+
+  // Read the next chunk
+  slice = self.currentChunk.readSlice(self.currentChunk.length() - self.currentChunk.position);
+  // Copy content to final buffer
+  slice.copy(finalBuffer, finalBuffer._index);
+  // Update index position
+  finalBuffer._index += slice.length;
+
+  // Load next chunk and read more
+  nthChunk(self, self.currentChunk.chunkNumber + 1, function(err, chunk) {
+    if (err) return callback(err);
+
+    if (chunk.length() > 0) {
+      self.currentChunk = chunk;
+      self.read(length, finalBuffer, callback);
+    } else {
+      if (finalBuffer._index > 0) {
+        callback(null, finalBuffer);
+      } else {
+        callback(
+          MongoError.create({
+            message: 'no chunks found for file, possibly corrupt',
+            driver: true
+          }),
+          null
+        );
+      }
+    }
+  });
+};
+
+/**
+ * The tell callback format.
+ * @callback GridStore~tellCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {number} position The current read position in the GridStore.
+ */
+
+/**
+ * Retrieves the position of the read/write head of this file.
+ *
+ * @method
+ * @param {number} [length] the number of characters to read. Reads all the characters from the read/write head to the EOF if not specified.
+ * @param {(string|Buffer)} [buffer] a string to hold temporary data. This is used for storing the string data read so far when recursively calling this method.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~tellCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.tell = function(callback) {
+  var self = this;
+  // We provided a callback leg
+  if (typeof callback === 'function') return callback(null, this.position);
+  // Return promise
+  return new self.promiseLibrary(function(resolve) {
+    resolve(self.position);
+  });
+};
+
+/**
+ * The tell callback format.
+ * @callback GridStore~gridStoreCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {GridStore} gridStore The gridStore.
+ */
+
+/**
+ * Moves the read/write head to a new location.
+ *
+ * There are 3 signatures for this method
+ *
+ * Seek Location Modes
+ *  - **GridStore.IO_SEEK_SET**, **(default)** set the position from the start of the file.
+ *  - **GridStore.IO_SEEK_CUR**, set the position from the current position in the file.
+ *  - **GridStore.IO_SEEK_END**, set the position from the end of the file.
+ *
+ * @method
+ * @param {number} [position] the position to seek to
+ * @param {number} [seekLocation] seek mode. Use one of the Seek Location modes.
+ * @param {object} [options] Optional settings
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~gridStoreCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.prototype.seek = function(position, seekLocation, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  seekLocation = args.length ? args.shift() : null;
+  options = args.length ? args.shift() : {};
+
+  return executeLegacyOperation(
+    this.db.s.topology,
+    seek,
+    [this, position, seekLocation, options, callback],
+    { skipSessions: true }
+  );
+};
+
+var seek = function(self, position, seekLocation, options, callback) {
+  // Seek only supports read mode
+  if (self.mode !== 'r') {
+    return callback(
+      MongoError.create({ message: 'seek is only supported for mode r', driver: true })
+    );
+  }
+
+  var seekLocationFinal = seekLocation == null ? GridStore.IO_SEEK_SET : seekLocation;
+  var finalPosition = position;
+  var targetPosition = 0;
+
+  // Calculate the position
+  if (seekLocationFinal === GridStore.IO_SEEK_CUR) {
+    targetPosition = self.position + finalPosition;
+  } else if (seekLocationFinal === GridStore.IO_SEEK_END) {
+    targetPosition = self.length + finalPosition;
+  } else {
+    targetPosition = finalPosition;
+  }
+
+  // Get the chunk
+  var newChunkNumber = Math.floor(targetPosition / self.chunkSize);
+  var seekChunk = function() {
+    nthChunk(self, newChunkNumber, function(err, chunk) {
+      if (err) return callback(err, null);
+      if (chunk == null) return callback(new Error('no chunk found'));
+
+      // Set the current chunk
+      self.currentChunk = chunk;
+      self.position = targetPosition;
+      self.currentChunk.position = self.position % self.chunkSize;
+      callback(err, self);
+    });
+  };
+
+  seekChunk();
+};
+
+/**
+ * @ignore
+ */
+var _open = function(self, options, callback) {
+  var collection = self.collection();
+  // Create the query
+  var query =
+    self.referenceBy === REFERENCE_BY_ID ? { _id: self.fileId } : { filename: self.filename };
+  query = null == self.fileId && self.filename == null ? null : query;
+  options.readPreference = self.readPreference;
+
+  // Fetch the chunks
+  if (query != null) {
+    collection.findOne(query, options, function(err, doc) {
+      if (err) {
+        return error(err);
+      }
+
+      // Check if the collection for the files exists otherwise prepare the new one
+      if (doc != null) {
+        self.fileId = doc._id;
+        // Prefer a new filename over the existing one if this is a write
+        self.filename =
+          self.mode === 'r' || self.filename === undefined ? doc.filename : self.filename;
+        self.contentType = doc.contentType;
+        self.internalChunkSize = doc.chunkSize;
+        self.uploadDate = doc.uploadDate;
+        self.aliases = doc.aliases;
+        self.length = doc.length;
+        self.metadata = doc.metadata;
+        self.internalMd5 = doc.md5;
+      } else if (self.mode !== 'r') {
+        self.fileId = self.fileId == null ? new ObjectID() : self.fileId;
+        self.contentType = GridStore.DEFAULT_CONTENT_TYPE;
+        self.internalChunkSize =
+          self.internalChunkSize == null ? Chunk.DEFAULT_CHUNK_SIZE : self.internalChunkSize;
+        self.length = 0;
+      } else {
+        self.length = 0;
+        var txtId = self.fileId._bsontype === 'ObjectID' ? self.fileId.toHexString() : self.fileId;
+        return error(
+          MongoError.create({
+            message: f(
+              'file with id %s not opened for writing',
+              self.referenceBy === REFERENCE_BY_ID ? txtId : self.filename
+            ),
+            driver: true
+          }),
+          self
+        );
+      }
+
+      // Process the mode of the object
+      if (self.mode === 'r') {
+        nthChunk(self, 0, options, function(err, chunk) {
+          if (err) return error(err);
+          self.currentChunk = chunk;
+          self.position = 0;
+          callback(null, self);
+        });
+      } else if (self.mode === 'w' && doc) {
+        // Delete any existing chunks
+        deleteChunks(self, options, function(err) {
+          if (err) return error(err);
+          self.currentChunk = new Chunk(self, { n: 0 }, self.writeConcern);
+          self.contentType =
+            self.options['content_type'] == null ? self.contentType : self.options['content_type'];
+          self.internalChunkSize =
+            self.options['chunk_size'] == null
+              ? self.internalChunkSize
+              : self.options['chunk_size'];
+          self.metadata =
+            self.options['metadata'] == null ? self.metadata : self.options['metadata'];
+          self.aliases = self.options['aliases'] == null ? self.aliases : self.options['aliases'];
+          self.position = 0;
+          callback(null, self);
+        });
+      } else if (self.mode === 'w') {
+        self.currentChunk = new Chunk(self, { n: 0 }, self.writeConcern);
+        self.contentType =
+          self.options['content_type'] == null ? self.contentType : self.options['content_type'];
+        self.internalChunkSize =
+          self.options['chunk_size'] == null ? self.internalChunkSize : self.options['chunk_size'];
+        self.metadata = self.options['metadata'] == null ? self.metadata : self.options['metadata'];
+        self.aliases = self.options['aliases'] == null ? self.aliases : self.options['aliases'];
+        self.position = 0;
+        callback(null, self);
+      } else if (self.mode === 'w+') {
+        nthChunk(self, lastChunkNumber(self), options, function(err, chunk) {
+          if (err) return error(err);
+          // Set the current chunk
+          self.currentChunk = chunk == null ? new Chunk(self, { n: 0 }, self.writeConcern) : chunk;
+          self.currentChunk.position = self.currentChunk.data.length();
+          self.metadata =
+            self.options['metadata'] == null ? self.metadata : self.options['metadata'];
+          self.aliases = self.options['aliases'] == null ? self.aliases : self.options['aliases'];
+          self.position = self.length;
+          callback(null, self);
+        });
+      }
+    });
+  } else {
+    // Write only mode
+    self.fileId = null == self.fileId ? new ObjectID() : self.fileId;
+    self.contentType = GridStore.DEFAULT_CONTENT_TYPE;
+    self.internalChunkSize =
+      self.internalChunkSize == null ? Chunk.DEFAULT_CHUNK_SIZE : self.internalChunkSize;
+    self.length = 0;
+
+    // No file exists set up write mode
+    if (self.mode === 'w') {
+      // Delete any existing chunks
+      deleteChunks(self, options, function(err) {
+        if (err) return error(err);
+        self.currentChunk = new Chunk(self, { n: 0 }, self.writeConcern);
+        self.contentType =
+          self.options['content_type'] == null ? self.contentType : self.options['content_type'];
+        self.internalChunkSize =
+          self.options['chunk_size'] == null ? self.internalChunkSize : self.options['chunk_size'];
+        self.metadata = self.options['metadata'] == null ? self.metadata : self.options['metadata'];
+        self.aliases = self.options['aliases'] == null ? self.aliases : self.options['aliases'];
+        self.position = 0;
+        callback(null, self);
+      });
+    } else if (self.mode === 'w+') {
+      nthChunk(self, lastChunkNumber(self), options, function(err, chunk) {
+        if (err) return error(err);
+        // Set the current chunk
+        self.currentChunk = chunk == null ? new Chunk(self, { n: 0 }, self.writeConcern) : chunk;
+        self.currentChunk.position = self.currentChunk.data.length();
+        self.metadata = self.options['metadata'] == null ? self.metadata : self.options['metadata'];
+        self.aliases = self.options['aliases'] == null ? self.aliases : self.options['aliases'];
+        self.position = self.length;
+        callback(null, self);
+      });
+    }
+  }
+
+  // only pass error to callback once
+  function error(err) {
+    if (error.err) return;
+    callback((error.err = err));
+  }
+};
+
+/**
+ * @ignore
+ */
+var writeBuffer = function(self, buffer, close, callback) {
+  if (typeof close === 'function') {
+    callback = close;
+    close = null;
+  }
+  var finalClose = typeof close === 'boolean' ? close : false;
+
+  if (self.mode !== 'w') {
+    callback(
+      MongoError.create({
+        message: f(
+          'file with id %s not opened for writing',
+          self.referenceBy === REFERENCE_BY_ID ? self.referenceBy : self.filename
+        ),
+        driver: true
+      }),
+      null
+    );
+  } else {
+    if (self.currentChunk.position + buffer.length >= self.chunkSize) {
+      // Write out the current Chunk and then keep writing until we have less data left than a chunkSize left
+      // to a new chunk (recursively)
+      var previousChunkNumber = self.currentChunk.chunkNumber;
+      var leftOverDataSize = self.chunkSize - self.currentChunk.position;
+      var firstChunkData = buffer.slice(0, leftOverDataSize);
+      var leftOverData = buffer.slice(leftOverDataSize);
+      // A list of chunks to write out
+      var chunksToWrite = [self.currentChunk.write(firstChunkData)];
+      // If we have more data left than the chunk size let's keep writing new chunks
+      while (leftOverData.length >= self.chunkSize) {
+        // Create a new chunk and write to it
+        var newChunk = new Chunk(self, { n: previousChunkNumber + 1 }, self.writeConcern);
+        firstChunkData = leftOverData.slice(0, self.chunkSize);
+        leftOverData = leftOverData.slice(self.chunkSize);
+        // Update chunk number
+        previousChunkNumber = previousChunkNumber + 1;
+        // Write data
+        newChunk.write(firstChunkData);
+        // Push chunk to save list
+        chunksToWrite.push(newChunk);
+      }
+
+      // Set current chunk with remaining data
+      self.currentChunk = new Chunk(self, { n: previousChunkNumber + 1 }, self.writeConcern);
+      // If we have left over data write it
+      if (leftOverData.length > 0) self.currentChunk.write(leftOverData);
+
+      // Update the position for the gridstore
+      self.position = self.position + buffer.length;
+      // Total number of chunks to write
+      var numberOfChunksToWrite = chunksToWrite.length;
+
+      for (var i = 0; i < chunksToWrite.length; i++) {
+        chunksToWrite[i].save({}, function(err) {
+          if (err) return callback(err);
+
+          numberOfChunksToWrite = numberOfChunksToWrite - 1;
+
+          if (numberOfChunksToWrite <= 0) {
+            // We care closing the file before returning
+            if (finalClose) {
+              return self.close(function(err) {
+                callback(err, self);
+              });
+            }
+
+            // Return normally
+            return callback(null, self);
+          }
+        });
+      }
+    } else {
+      // Update the position for the gridstore
+      self.position = self.position + buffer.length;
+      // We have less data than the chunk size just write it and callback
+      self.currentChunk.write(buffer);
+      // We care closing the file before returning
+      if (finalClose) {
+        return self.close(function(err) {
+          callback(err, self);
+        });
+      }
+      // Return normally
+      return callback(null, self);
+    }
+  }
+};
+
+/**
+ * Creates a mongoDB object representation of this object.
+ *
+ *        <pre><code>
+ *        {
+ *          '_id' : , // {number} id for this file
+ *          'filename' : , // {string} name for this file
+ *          'contentType' : , // {string} mime type for this file
+ *          'length' : , // {number} size of this file?
+ *          'chunksize' : , // {number} chunk size used by this file
+ *          'uploadDate' : , // {Date}
+ *          'aliases' : , // {array of string}
+ *          'metadata' : , // {string}
+ *        }
+ *        </code></pre>
+ *
+ * @ignore
+ */
+var buildMongoObject = function(self, callback) {
+  // Calcuate the length
+  var mongoObject = {
+    _id: self.fileId,
+    filename: self.filename,
+    contentType: self.contentType,
+    length: self.position ? self.position : 0,
+    chunkSize: self.chunkSize,
+    uploadDate: self.uploadDate,
+    aliases: self.aliases,
+    metadata: self.metadata
+  };
+
+  var md5Command = { filemd5: self.fileId, root: self.root };
+  self.db.command(md5Command, function(err, results) {
+    if (err) return callback(err);
+
+    mongoObject.md5 = results.md5;
+    callback(null, mongoObject);
+  });
+};
+
+/**
+ * Gets the nth chunk of this file.
+ * @ignore
+ */
+var nthChunk = function(self, chunkNumber, options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = options || self.writeConcern;
+  options.readPreference = self.readPreference;
+  // Get the nth chunk
+  self
+    .chunkCollection()
+    .findOne({ files_id: self.fileId, n: chunkNumber }, options, function(err, chunk) {
+      if (err) return callback(err);
+
+      var finalChunk = chunk == null ? {} : chunk;
+      callback(null, new Chunk(self, finalChunk, self.writeConcern));
+    });
+};
+
+/**
+ * @ignore
+ */
+var lastChunkNumber = function(self) {
+  return Math.floor((self.length ? self.length - 1 : 0) / self.chunkSize);
+};
+
+/**
+ * Deletes all the chunks of this file in the database.
+ *
+ * @ignore
+ */
+var deleteChunks = function(self, options, callback) {
+  if (typeof options === 'function') {
+    callback = options;
+    options = {};
+  }
+
+  options = options || self.writeConcern;
+
+  if (self.fileId != null) {
+    self.chunkCollection().remove({ files_id: self.fileId }, options, function(err) {
+      if (err) return callback(err, false);
+      callback(null, true);
+    });
+  } else {
+    callback(null, true);
+  }
+};
+
+/**
+ * The collection to be used for holding the files and chunks collection.
+ *
+ * @classconstant DEFAULT_ROOT_COLLECTION
+ */
+GridStore.DEFAULT_ROOT_COLLECTION = 'fs';
+
+/**
+ * Default file mime type
+ *
+ * @classconstant DEFAULT_CONTENT_TYPE
+ */
+GridStore.DEFAULT_CONTENT_TYPE = 'binary/octet-stream';
+
+/**
+ * Seek mode where the given length is absolute.
+ *
+ * @classconstant IO_SEEK_SET
+ */
+GridStore.IO_SEEK_SET = 0;
+
+/**
+ * Seek mode where the given length is an offset to the current read/write head.
+ *
+ * @classconstant IO_SEEK_CUR
+ */
+GridStore.IO_SEEK_CUR = 1;
+
+/**
+ * Seek mode where the given length is an offset to the end of the file.
+ *
+ * @classconstant IO_SEEK_END
+ */
+GridStore.IO_SEEK_END = 2;
+
+/**
+ * Checks if a file exists in the database.
+ *
+ * @method
+ * @static
+ * @param {Db} db the database to query.
+ * @param {string} name The name of the file to look for.
+ * @param {string} [rootCollection] The root collection that holds the files and chunks collection. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] result from exists.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.exist = function(db, fileIdObject, rootCollection, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 2);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  rootCollection = args.length ? args.shift() : null;
+  options = args.length ? args.shift() : {};
+  options = options || {};
+
+  return executeLegacyOperation(
+    db.s.topology,
+    exists,
+    [db, fileIdObject, rootCollection, options, callback],
+    { skipSessions: true }
+  );
+};
+
+var exists = function(db, fileIdObject, rootCollection, options, callback) {
+  // Establish read preference
+  var readPreference = options.readPreference || ReadPreference.PRIMARY;
+  // Fetch collection
+  var rootCollectionFinal =
+    rootCollection != null ? rootCollection : GridStore.DEFAULT_ROOT_COLLECTION;
+  db.collection(rootCollectionFinal + '.files', function(err, collection) {
+    if (err) return callback(err);
+
+    // Build query
+    var query =
+      typeof fileIdObject === 'string' ||
+      Object.prototype.toString.call(fileIdObject) === '[object RegExp]'
+        ? { filename: fileIdObject }
+        : { _id: fileIdObject }; // Attempt to locate file
+
+    // We have a specific query
+    if (
+      fileIdObject != null &&
+      typeof fileIdObject === 'object' &&
+      Object.prototype.toString.call(fileIdObject) !== '[object RegExp]'
+    ) {
+      query = fileIdObject;
+    }
+
+    // Check if the entry exists
+    collection.findOne(query, { readPreference: readPreference }, function(err, item) {
+      if (err) return callback(err);
+      callback(null, item == null ? false : true);
+    });
+  });
+};
+
+/**
+ * Gets the list of files stored in the GridFS.
+ *
+ * @method
+ * @static
+ * @param {Db} db the database to query.
+ * @param {string} [rootCollection] The root collection that holds the files and chunks collection. Defaults to **{GridStore.DEFAULT_ROOT_COLLECTION}**.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] result from exists.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.list = function(db, rootCollection, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  rootCollection = args.length ? args.shift() : null;
+  options = args.length ? args.shift() : {};
+  options = options || {};
+
+  return executeLegacyOperation(db.s.topology, list, [db, rootCollection, options, callback], {
+    skipSessions: true
+  });
+};
+
+var list = function(db, rootCollection, options, callback) {
+  // Ensure we have correct values
+  if (rootCollection != null && typeof rootCollection === 'object') {
+    options = rootCollection;
+    rootCollection = null;
+  }
+
+  // Establish read preference
+  var readPreference = options.readPreference || ReadPreference.primary;
+  // Check if we are returning by id not filename
+  var byId = options['id'] != null ? options['id'] : false;
+  // Fetch item
+  var rootCollectionFinal =
+    rootCollection != null ? rootCollection : GridStore.DEFAULT_ROOT_COLLECTION;
+  var items = [];
+  db.collection(rootCollectionFinal + '.files', function(err, collection) {
+    if (err) return callback(err);
+
+    collection.find({}, { readPreference: readPreference }, function(err, cursor) {
+      if (err) return callback(err);
+
+      cursor.each(function(err, item) {
+        if (item != null) {
+          items.push(byId ? item._id : item.filename);
+        } else {
+          callback(err, items);
+        }
+      });
+    });
+  });
+};
+
+/**
+ * Reads the contents of a file.
+ *
+ * This method has the following signatures
+ *
+ * (db, name, callback)
+ * (db, name, length, callback)
+ * (db, name, length, offset, callback)
+ * (db, name, length, offset, options, callback)
+ *
+ * @method
+ * @static
+ * @param {Db} db the database to query.
+ * @param {string} name The name of the file.
+ * @param {number} [length] The size of data to read.
+ * @param {number} [offset] The offset from the head of the file of which to start reading from.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~readCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.read = function(db, name, length, offset, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 2);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  length = args.length ? args.shift() : null;
+  offset = args.length ? args.shift() : null;
+  options = args.length ? args.shift() : null;
+  options = options || {};
+
+  return executeLegacyOperation(
+    db.s.topology,
+    readStatic,
+    [db, name, length, offset, options, callback],
+    { skipSessions: true }
+  );
+};
+
+var readStatic = function(db, name, length, offset, options, callback) {
+  new GridStore(db, name, 'r', options).open(function(err, gridStore) {
+    if (err) return callback(err);
+    // Make sure we are not reading out of bounds
+    if (offset && offset >= gridStore.length)
+      return callback('offset larger than size of file', null);
+    if (length && length > gridStore.length)
+      return callback('length is larger than the size of the file', null);
+    if (offset && length && offset + length > gridStore.length)
+      return callback('offset and length is larger than the size of the file', null);
+
+    if (offset != null) {
+      gridStore.seek(offset, function(err, gridStore) {
+        if (err) return callback(err);
+        gridStore.read(length, callback);
+      });
+    } else {
+      gridStore.read(length, callback);
+    }
+  });
+};
+
+/**
+ * Read the entire file as a list of strings splitting by the provided separator.
+ *
+ * @method
+ * @static
+ * @param {Db} db the database to query.
+ * @param {(String|object)} name the name of the file.
+ * @param {string} [separator] The character to be recognized as the newline separator.
+ * @param {object} [options] Optional settings.
+ * @param {(ReadPreference|string)} [options.readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~readlinesCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.readlines = function(db, name, separator, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 2);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  separator = args.length ? args.shift() : null;
+  options = args.length ? args.shift() : null;
+  options = options || {};
+
+  return executeLegacyOperation(
+    db.s.topology,
+    readlinesStatic,
+    [db, name, separator, options, callback],
+    { skipSessions: true }
+  );
+};
+
+var readlinesStatic = function(db, name, separator, options, callback) {
+  var finalSeperator = separator == null ? '\n' : separator;
+  new GridStore(db, name, 'r', options).open(function(err, gridStore) {
+    if (err) return callback(err);
+    gridStore.readlines(finalSeperator, callback);
+  });
+};
+
+/**
+ * Deletes the chunks and metadata information of a file from GridFS.
+ *
+ * @method
+ * @static
+ * @param {Db} db The database to query.
+ * @param {(string|array)} names The name/names of the files to delete.
+ * @param {object} [options] Optional settings.
+ * @param {object} [options.promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @param {GridStore~resultCallback} [callback] the command callback.
+ * @return {Promise} returns Promise if no callback passed
+ * @deprecated Use GridFSBucket API instead
+ */
+GridStore.unlink = function(db, names, options, callback) {
+  var args = Array.prototype.slice.call(arguments, 2);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  options = args.length ? args.shift() : {};
+  options = options || {};
+
+  return executeLegacyOperation(db.s.topology, unlinkStatic, [this, db, names, options, callback], {
+    skipSessions: true
+  });
+};
+
+var unlinkStatic = function(self, db, names, options, callback) {
+  // Get the write concern
+  var writeConcern = _getWriteConcern(db, options);
+
+  // List of names
+  if (names.constructor === Array) {
+    var tc = 0;
+    for (var i = 0; i < names.length; i++) {
+      ++tc;
+      GridStore.unlink(db, names[i], options, function() {
+        if (--tc === 0) {
+          callback(null, self);
+        }
+      });
+    }
+  } else {
+    new GridStore(db, names, 'w', options).open(function(err, gridStore) {
+      if (err) return callback(err);
+      deleteChunks(gridStore, function(err) {
+        if (err) return callback(err);
+        gridStore.collection(function(err, collection) {
+          if (err) return callback(err);
+          collection.remove({ _id: gridStore.fileId }, writeConcern, function(err) {
+            callback(err, self);
+          });
+        });
+      });
+    });
+  }
+};
+
+/**
+ *  @ignore
+ */
+var _writeNormal = function(self, data, close, options, callback) {
+  // If we have a buffer write it using the writeBuffer method
+  if (Buffer.isBuffer(data)) {
+    return writeBuffer(self, data, close, callback);
+  } else {
+    return writeBuffer(self, Buffer.from(data, 'binary'), close, callback);
+  }
+};
+
+/**
+ * @ignore
+ */
+var _setWriteConcernHash = function(options) {
+  const baseOptions = Object.assign(options, options.writeConcern);
+  var finalOptions = {};
+  if (baseOptions.w != null) finalOptions.w = baseOptions.w;
+  if (baseOptions.journal === true) finalOptions.j = baseOptions.journal;
+  if (baseOptions.j === true) finalOptions.j = baseOptions.j;
+  if (baseOptions.fsync === true) finalOptions.fsync = baseOptions.fsync;
+  if (baseOptions.wtimeout != null) finalOptions.wtimeout = baseOptions.wtimeout;
+  return finalOptions;
+};
+
+/**
+ * @ignore
+ */
+var _getWriteConcern = function(self, options) {
+  // Final options
+  var finalOptions = { w: 1 };
+  options = options || {};
+
+  // Local options verification
+  if (
+    options.writeConcern != null ||
+    options.w != null ||
+    typeof options.j === 'boolean' ||
+    typeof options.journal === 'boolean' ||
+    typeof options.fsync === 'boolean'
+  ) {
+    finalOptions = _setWriteConcernHash(options);
+  } else if (options.safe != null && typeof options.safe === 'object') {
+    finalOptions = _setWriteConcernHash(options.safe);
+  } else if (typeof options.safe === 'boolean') {
+    finalOptions = { w: options.safe ? 1 : 0 };
+  } else if (
+    self.options.writeConcern != null ||
+    self.options.w != null ||
+    typeof self.options.j === 'boolean' ||
+    typeof self.options.journal === 'boolean' ||
+    typeof self.options.fsync === 'boolean'
+  ) {
+    finalOptions = _setWriteConcernHash(self.options);
+  } else if (
+    self.safe &&
+    (self.safe.w != null ||
+      typeof self.safe.j === 'boolean' ||
+      typeof self.safe.journal === 'boolean' ||
+      typeof self.safe.fsync === 'boolean')
+  ) {
+    finalOptions = _setWriteConcernHash(self.safe);
+  } else if (typeof self.safe === 'boolean') {
+    finalOptions = { w: self.safe ? 1 : 0 };
+  }
+
+  // Ensure we don't have an invalid combination of write concerns
+  if (
+    finalOptions.w < 1 &&
+    (finalOptions.journal === true || finalOptions.j === true || finalOptions.fsync === true)
+  )
+    throw MongoError.create({
+      message: 'No acknowledgement using w < 1 cannot be combined with journal:true or fsync:true',
+      driver: true
+    });
+
+  // Return the options
+  return finalOptions;
+};
+
+/**
+ * Create a new GridStoreStream instance (INTERNAL TYPE, do not instantiate directly)
+ *
+ * @class
+ * @extends external:Duplex
+ * @return {GridStoreStream} a GridStoreStream instance.
+ * @deprecated Use GridFSBucket API instead
+ */
+var GridStoreStream = function(gs) {
+  // Initialize the duplex stream
+  Duplex.call(this);
+
+  // Get the gridstore
+  this.gs = gs;
+
+  // End called
+  this.endCalled = false;
+
+  // If we have a seek
+  this.totalBytesToRead = this.gs.length - this.gs.position;
+  this.seekPosition = this.gs.position;
+};
+
+//
+// Inherit duplex
+inherits(GridStoreStream, Duplex);
+
+GridStoreStream.prototype._pipe = GridStoreStream.prototype.pipe;
+
+// Set up override
+GridStoreStream.prototype.pipe = function(destination) {
+  var self = this;
+
+  // Only open gridstore if not already open
+  if (!self.gs.isOpen) {
+    self.gs.open(function(err) {
+      if (err) return self.emit('error', err);
+      self.totalBytesToRead = self.gs.length - self.gs.position;
+      self._pipe.apply(self, [destination]);
+    });
+  } else {
+    self.totalBytesToRead = self.gs.length - self.gs.position;
+    self._pipe.apply(self, [destination]);
+  }
+
+  return destination;
+};
+
+// Called by stream
+GridStoreStream.prototype._read = function() {
+  var self = this;
+
+  var read = function() {
+    // Read data
+    self.gs.read(length, function(err, buffer) {
+      if (err && !self.endCalled) return self.emit('error', err);
+
+      // Stream is closed
+      if (self.endCalled || buffer == null) return self.push(null);
+      // Remove bytes read
+      if (buffer.length <= self.totalBytesToRead) {
+        self.totalBytesToRead = self.totalBytesToRead - buffer.length;
+        self.push(buffer);
+      } else if (buffer.length > self.totalBytesToRead) {
+        self.totalBytesToRead = self.totalBytesToRead - buffer._index;
+        self.push(buffer.slice(0, buffer._index));
+      }
+
+      // Finished reading
+      if (self.totalBytesToRead <= 0) {
+        self.endCalled = true;
+      }
+    });
+  };
+
+  // Set read length
+  var length =
+    self.gs.length < self.gs.chunkSize ? self.gs.length - self.seekPosition : self.gs.chunkSize;
+  if (!self.gs.isOpen) {
+    self.gs.open(function(err) {
+      self.totalBytesToRead = self.gs.length - self.gs.position;
+      if (err) return self.emit('error', err);
+      read();
+    });
+  } else {
+    read();
+  }
+};
+
+GridStoreStream.prototype.destroy = function() {
+  this.pause();
+  this.endCalled = true;
+  this.gs.close();
+  this.emit('end');
+};
+
+GridStoreStream.prototype.write = function(chunk) {
+  var self = this;
+  if (self.endCalled)
+    return self.emit(
+      'error',
+      MongoError.create({ message: 'attempting to write to stream after end called', driver: true })
+    );
+  // Do we have to open the gridstore
+  if (!self.gs.isOpen) {
+    self.gs.open(function() {
+      self.gs.isOpen = true;
+      self.gs.write(chunk, function() {
+        process.nextTick(function() {
+          self.emit('drain');
+        });
+      });
+    });
+    return false;
+  } else {
+    self.gs.write(chunk, function() {
+      self.emit('drain');
+    });
+    return true;
+  }
+};
+
+GridStoreStream.prototype.end = function(chunk, encoding, callback) {
+  var self = this;
+  var args = Array.prototype.slice.call(arguments, 0);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  chunk = args.length ? args.shift() : null;
+  encoding = args.length ? args.shift() : null;
+  self.endCalled = true;
+
+  if (chunk) {
+    self.gs.write(chunk, function() {
+      self.gs.close(function() {
+        if (typeof callback === 'function') callback();
+        self.emit('end');
+      });
+    });
+  }
+
+  self.gs.close(function() {
+    if (typeof callback === 'function') callback();
+    self.emit('end');
+  });
+};
+
+/**
+ * The read() method pulls some data out of the internal buffer and returns it. If there is no data available, then it will return null.
+ * @function external:Duplex#read
+ * @param {number} size Optional argument to specify how much data to read.
+ * @return {(String | Buffer | null)}
+ */
+
+/**
+ * Call this function to cause the stream to return strings of the specified encoding instead of Buffer objects.
+ * @function external:Duplex#setEncoding
+ * @param {string} encoding The encoding to use.
+ * @return {null}
+ */
+
+/**
+ * This method will cause the readable stream to resume emitting data events.
+ * @function external:Duplex#resume
+ * @return {null}
+ */
+
+/**
+ * This method will cause a stream in flowing-mode to stop emitting data events. Any data that becomes available will remain in the internal buffer.
+ * @function external:Duplex#pause
+ * @return {null}
+ */
+
+/**
+ * This method pulls all the data out of a readable stream, and writes it to the supplied destination, automatically managing the flow so that the destination is not overwhelmed by a fast readable stream.
+ * @function external:Duplex#pipe
+ * @param {Writable} destination The destination for writing data
+ * @param {object} [options] Pipe options
+ * @return {null}
+ */
+
+/**
+ * This method will remove the hooks set up for a previous pipe() call.
+ * @function external:Duplex#unpipe
+ * @param {Writable} [destination] The destination for writing data
+ * @return {null}
+ */
+
+/**
+ * This is useful in certain cases where a stream is being consumed by a parser, which needs to "un-consume" some data that it has optimistically pulled out of the source, so that the stream can be passed on to some other party.
+ * @function external:Duplex#unshift
+ * @param {(Buffer|string)} chunk Chunk of data to unshift onto the read queue.
+ * @return {null}
+ */
+
+/**
+ * Versions of Node prior to v0.10 had streams that did not implement the entire Streams API as it is today. (See "Compatibility" below for more information.)
+ * @function external:Duplex#wrap
+ * @param {Stream} stream An "old style" readable stream.
+ * @return {null}
+ */
+
+/**
+ * This method writes some data to the underlying system, and calls the supplied callback once the data has been fully handled.
+ * @function external:Duplex#write
+ * @param {(string|Buffer)} chunk The data to write
+ * @param {string} encoding The encoding, if chunk is a String
+ * @param {function} callback Callback for when this chunk of data is flushed
+ * @return {boolean}
+ */
+
+/**
+ * Call this method when no more data will be written to the stream. If supplied, the callback is attached as a listener on the finish event.
+ * @function external:Duplex#end
+ * @param {(string|Buffer)} chunk The data to write
+ * @param {string} encoding The encoding, if chunk is a String
+ * @param {function} callback Callback for when this chunk of data is flushed
+ * @return {null}
+ */
+
+/**
+ * GridStoreStream stream data event, fired for each document in the cursor.
+ *
+ * @event GridStoreStream#data
+ * @type {object}
+ */
+
+/**
+ * GridStoreStream stream end event
+ *
+ * @event GridStoreStream#end
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream close event
+ *
+ * @event GridStoreStream#close
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream readable event
+ *
+ * @event GridStoreStream#readable
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream drain event
+ *
+ * @event GridStoreStream#drain
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream finish event
+ *
+ * @event GridStoreStream#finish
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream pipe event
+ *
+ * @event GridStoreStream#pipe
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream unpipe event
+ *
+ * @event GridStoreStream#unpipe
+ * @type {null}
+ */
+
+/**
+ * GridStoreStream stream error event
+ *
+ * @event GridStoreStream#error
+ * @type {null}
+ */
+
+/**
+ * @ignore
+ */
+module.exports = GridStore;
diff --git a/NodeAPI/node_modules/mongodb/lib/mongo_client.js b/NodeAPI/node_modules/mongodb/lib/mongo_client.js
new file mode 100644
index 0000000000000000000000000000000000000000..7e11512bf1568897c64fb51caeb85e06a78ba8b1
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/mongo_client.js
@@ -0,0 +1,496 @@
+'use strict';
+
+const ChangeStream = require('./change_stream');
+const Db = require('./db');
+const EventEmitter = require('events').EventEmitter;
+const inherits = require('util').inherits;
+const MongoError = require('./core').MongoError;
+const deprecate = require('util').deprecate;
+const WriteConcern = require('./write_concern');
+const MongoDBNamespace = require('./utils').MongoDBNamespace;
+const ReadPreference = require('./core/topologies/read_preference');
+const maybePromise = require('./utils').maybePromise;
+const NativeTopology = require('./topologies/native_topology');
+const connect = require('./operations/connect').connect;
+const validOptions = require('./operations/connect').validOptions;
+
+/**
+ * @fileOverview The **MongoClient** class is a class that allows for making Connections to MongoDB.
+ *
+ * @example
+ * // Connect using a MongoClient instance
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * const mongoClient = new MongoClient(url);
+ * mongoClient.connect(function(err, client) {
+ *   const db = client.db(dbName);
+ *   client.close();
+ * });
+ *
+ * @example
+ * // Connect using the MongoClient.connect static method
+ * const MongoClient = require('mongodb').MongoClient;
+ * const test = require('assert');
+ * // Connection url
+ * const url = 'mongodb://localhost:27017';
+ * // Database Name
+ * const dbName = 'test';
+ * // Connect using MongoClient
+ * MongoClient.connect(url, function(err, client) {
+ *   const db = client.db(dbName);
+ *   client.close();
+ * });
+ */
+
+/**
+ * A string specifying the level of a ReadConcern
+ * @typedef {'local'|'available'|'majority'|'linearizable'|'snapshot'} ReadConcernLevel
+ * @see https://docs.mongodb.com/manual/reference/read-concern/index.html#read-concern-levels
+ */
+
+/**
+ * Configuration options for drivers wrapping the node driver.
+ *
+ * @typedef {Object} DriverInfoOptions
+ * @property {string} [name] The name of the driver
+ * @property {string} [version] The version of the driver
+ * @property {string} [platform] Optional platform information
+ */
+
+/**
+ * Configuration options for drivers wrapping the node driver.
+ *
+ * @typedef {Object} DriverInfoOptions
+ * @property {string} [name] The name of the driver
+ * @property {string} [version] The version of the driver
+ * @property {string} [platform] Optional platform information
+ */
+
+/**
+ * @public
+ * @typedef AutoEncryptionOptions
+ * @property {MongoClient} [keyVaultClient] A `MongoClient` used to fetch keys from a key vault
+ * @property {string} [keyVaultNamespace] The namespace where keys are stored in the key vault
+ * @property {object} [kmsProviders] Configuration options that are used by specific KMS providers during key generation, encryption, and decryption.
+ * @property {object} [schemaMap] A map of namespaces to a local JSON schema for encryption
+ *
+ * > **NOTE**: Supplying options.schemaMap provides more security than relying on JSON Schemas obtained from the server.
+ * > It protects against a malicious server advertising a false JSON Schema, which could trick the client into sending decrypted data that should be encrypted.
+ * > Schemas supplied in the schemaMap only apply to configuring automatic encryption for client side encryption.
+ * > Other validation rules in the JSON schema will not be enforced by the driver and will result in an error.
+ *
+ * @property {object} [options] An optional hook to catch logging messages from the underlying encryption engine
+ * @property {object} [extraOptions]
+ * @property {boolean} [bypassAutoEncryption]
+ */
+
+/**
+ * @typedef {object} MongoClientOptions
+ * @property {number} [poolSize] (**default**: 5) The maximum size of the individual server pool
+ * @property {boolean} [ssl] (**default**: false) Enable SSL connection. *deprecated* use `tls` variants
+ * @property {boolean} [sslValidate] (**default**: false) Validate mongod server certificate against Certificate Authority
+ * @property {buffer} [sslCA] (**default**: undefined) SSL Certificate store binary buffer *deprecated* use `tls` variants
+ * @property {buffer} [sslCert] (**default**: undefined) SSL Certificate binary buffer *deprecated* use `tls` variants
+ * @property {buffer} [sslKey] (**default**: undefined) SSL Key file binary buffer *deprecated* use `tls` variants
+ * @property {string} [sslPass] (**default**: undefined) SSL Certificate pass phrase *deprecated* use `tls` variants
+ * @property {buffer} [sslCRL] (**default**: undefined) SSL Certificate revocation list binary buffer *deprecated* use `tls` variants
+ * @property {boolean|function} [checkServerIdentity] (**default**: true) Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function. *deprecated* use `tls` variants
+ * @property {boolean} [tls] (**default**: false) Enable TLS connections
+ * @property {boolean} [tlsInsecure] (**default**: false) Relax TLS constraints, disabling validation
+ * @property {string} [tlsCAFile] A path to file with either a single or bundle of certificate authorities to be considered trusted when making a TLS connection
+ * @property {string} [tlsCertificateKeyFile] A path to the client certificate file or the client private key file; in the case that they both are needed, the files should be concatenated
+ * @property {string} [tlsCertificateKeyFilePassword] The password to decrypt the client private key to be used for TLS connections
+ * @property {boolean} [tlsAllowInvalidCertificates] Specifies whether or not the driver should error when the server’s TLS certificate is invalid
+ * @property {boolean} [tlsAllowInvalidHostnames] Specifies whether or not the driver should error when there is a mismatch between the server’s hostname and the hostname specified by the TLS certificate
+ * @property {boolean} [autoReconnect] (**default**: true) Enable autoReconnect for single server instances
+ * @property {boolean} [noDelay] (**default**: true) TCP Connection no delay
+ * @property {boolean} [keepAlive] (**default**: true) TCP Connection keep alive enabled
+ * @property {number} [keepAliveInitialDelay] (**default**: 120000) The number of milliseconds to wait before initiating keepAlive on the TCP socket
+ * @property {number} [connectTimeoutMS] (**default**: 10000) How long to wait for a connection to be established before timing out
+ * @property {number} [socketTimeoutMS] (**default**: 0) How long a send or receive on a socket can take before timing out
+ * @property {number} [family] Version of IP stack. Can be 4, 6 or null (default). If null, will attempt to connect with IPv6, and will fall back to IPv4 on failure
+ * @property {number} [reconnectTries] (**default**: 30) Server attempt to reconnect #times
+ * @property {number} [reconnectInterval] (**default**: 1000) Server will wait # milliseconds between retries
+ * @property {boolean} [ha] (**default**: true) Control if high availability monitoring runs for Replicaset or Mongos proxies
+ * @property {number} [haInterval] (**default**: 10000) The High availability period for replicaset inquiry
+ * @property {string} [replicaSet] (**default**: undefined) The Replicaset set name
+ * @property {number} [secondaryAcceptableLatencyMS] (**default**: 15) Cutoff latency point in MS for Replicaset member selection
+ * @property {number} [acceptableLatencyMS] (**default**: 15) Cutoff latency point in MS for Mongos proxies selection
+ * @property {boolean} [connectWithNoPrimary] (**default**: false) Sets if the driver should connect even if no primary is available
+ * @property {string} [authSource] (**default**: undefined) Define the database to authenticate against
+ * @property {(number|string)} [w] **Deprecated** The write concern. Use writeConcern instead.
+ * @property {number} [wtimeout] **Deprecated** The write concern timeout. Use writeConcern instead.
+ * @property {boolean} [j] (**default**: false) **Deprecated** Specify a journal write concern. Use writeConcern instead.
+ * @property {boolean} [fsync] (**default**: false) **Deprecated** Specify a file sync write concern. Use writeConcern instead.
+ * @property {object|WriteConcern} [writeConcern] Specify write concern settings.
+ * @property {boolean} [forceServerObjectId] (**default**: false) Force server to assign _id values instead of driver
+ * @property {boolean} [serializeFunctions] (**default**: false) Serialize functions on any object
+ * @property {Boolean} [ignoreUndefined] (**default**: false) Specify if the BSON serializer should ignore undefined fields
+ * @property {boolean} [raw] (**default**: false) Return document results as raw BSON buffers
+ * @property {number} [bufferMaxEntries] (**default**: -1) Sets a cap on how many operations the driver will buffer up before giving up on getting a working connection, default is -1 which is unlimited
+ * @property {(ReadPreference|string)} [readPreference] The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST)
+ * @property {object} [pkFactory] A primary key factory object for generation of custom _id keys
+ * @property {object} [promiseLibrary] A Promise library class the application wishes to use such as Bluebird, must be ES6 compatible
+ * @property {object} [readConcern] Specify a read concern for the collection (only MongoDB 3.2 or higher supported)
+ * @property {ReadConcernLevel} [readConcern.level] (**default**: {Level: 'local'}) Specify a read concern level for the collection operations (only MongoDB 3.2 or higher supported)
+ * @property {number} [maxStalenessSeconds] (**default**: undefined) The max staleness to secondary reads (values under 10 seconds cannot be guaranteed)
+ * @property {string} [loggerLevel] (**default**: undefined) The logging level (error/warn/info/debug)
+ * @property {object} [logger] (**default**: undefined) Custom logger object
+ * @property {boolean} [promoteValues] (**default**: true) Promotes BSON values to native types where possible, set to false to only receive wrapper types
+ * @property {boolean} [promoteBuffers] (**default**: false) Promotes Binary BSON values to native Node Buffers
+ * @property {boolean} [promoteLongs] (**default**: true) Promotes long values to number if they fit inside the 53 bits resolution
+ * @property {boolean} [domainsEnabled] (**default**: false) Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit
+ * @property {object} [validateOptions] (**default**: false) Validate MongoClient passed in options for correctness
+ * @property {string} [appname] (**default**: undefined) The name of the application that created this MongoClient instance. MongoDB 3.4 and newer will print this value in the server log upon establishing each connection. It is also recorded in the slow query log and profile collections
+ * @property {string} [options.auth.user] (**default**: undefined) The username for auth
+ * @property {string} [options.auth.password] (**default**: undefined) The password for auth
+ * @property {string} [authMechanism] An authentication mechanism to use for connection authentication, see the {@link https://docs.mongodb.com/manual/reference/connection-string/#urioption.authMechanism|authMechanism} reference for supported options.
+ * @property {object} [compression] Type of compression to use: snappy or zlib
+ * @property {array} [readPreferenceTags] Read preference tags
+ * @property {number} [numberOfRetries] (**default**: 5) The number of retries for a tailable cursor
+ * @property {boolean} [auto_reconnect] (**default**: true) Enable auto reconnecting for single server instances
+ * @property {boolean} [monitorCommands] (**default**: false) Enable command monitoring for this client
+ * @property {number} [minSize] If present, the connection pool will be initialized with minSize connections, and will never dip below minSize connections
+ * @property {boolean} [useNewUrlParser] (**default**: true) Determines whether or not to use the new url parser. Enables the new, spec-compliant, url parser shipped in the core driver. This url parser fixes a number of problems with the original parser, and aims to outright replace that parser in the near future. Defaults to true, and must be explicitly set to false to use the legacy url parser.
+ * @property {boolean} [useUnifiedTopology] Enables the new unified topology layer
+ * @property {number} [localThresholdMS] (**default**: 15) **Only applies to the unified topology** The size of the latency window for selecting among multiple suitable servers
+ * @property {number} [serverSelectionTimeoutMS] (**default**: 30000) **Only applies to the unified topology** How long to block for server selection before throwing an error
+ * @property {number} [heartbeatFrequencyMS] (**default**: 10000) **Only applies to the unified topology** The frequency with which topology updates are scheduled
+ * @property {number} [maxPoolSize] (**default**: 10) **Only applies to the unified topology** The maximum number of connections that may be associated with a pool at a given time. This includes in use and available connections.
+ * @property {number} [minPoolSize] (**default**: 0) **Only applies to the unified topology** The minimum number of connections that MUST exist at any moment in a single connection pool.
+ * @property {number} [maxIdleTimeMS] **Only applies to the unified topology** The maximum amount of time a connection should remain idle in the connection pool before being marked idle. The default is infinity.
+ * @property {number} [waitQueueTimeoutMS] (**default**: 0) **Only applies to the unified topology** The maximum amount of time operation execution should wait for a connection to become available. The default is 0 which means there is no limit.
+ * @property {AutoEncryptionOptions} [autoEncryption] Optionally enable client side auto encryption.
+ *
+ * > Automatic encryption is an enterprise only feature that only applies to operations on a collection. Automatic encryption is not supported for operations on a database or view, and operations that are not bypassed will result in error
+ * > (see [libmongocrypt: Auto Encryption Allow-List](https://github.com/mongodb/specifications/blob/master/source/client-side-encryption/client-side-encryption.rst#libmongocrypt-auto-encryption-allow-list)). To bypass automatic encryption for all operations, set bypassAutoEncryption=true in AutoEncryptionOpts.
+ * >
+ * > Automatic encryption requires the authenticated user to have the [listCollections privilege action](https://docs.mongodb.com/manual/reference/command/listCollections/#dbcmd.listCollections).
+ * >
+ * > If a MongoClient with a limited connection pool size (i.e a non-zero maxPoolSize) is configured with AutoEncryptionOptions, a separate internal MongoClient is created if any of the following are true:
+ * > - AutoEncryptionOptions.keyVaultClient is not passed.
+ * > - AutoEncryptionOptions.bypassAutomaticEncryption is false.
+ * > If an internal MongoClient is created, it is configured with the same options as the parent MongoClient except minPoolSize is set to 0 and AutoEncryptionOptions is omitted.
+ *
+ * @property {DriverInfoOptions} [driverInfo] Allows a wrapping driver to amend the client metadata generated by the driver to include information about the wrapping driver
+ * @property {boolean} [directConnection] (**default**: false) Enable directConnection
+ * @property {function} [callback] The command result callback
+ */
+
+/**
+ * Creates a new MongoClient instance
+ * @constructor
+ * @extends {EventEmitter}
+ * @param {string} url The connection URI string
+ * @param {MongoClientOptions} [options] Optional settings
+ */
+function MongoClient(url, options) {
+  if (!(this instanceof MongoClient)) return new MongoClient(url, options);
+  // Set up event emitter
+  EventEmitter.call(this);
+
+  if (options && options.autoEncryption) require('./encrypter'); // Does CSFLE lib check
+
+  // The internal state
+  this.s = {
+    url: url,
+    options: options || {},
+    promiseLibrary: (options && options.promiseLibrary) || Promise,
+    dbCache: new Map(),
+    sessions: new Set(),
+    writeConcern: WriteConcern.fromOptions(options),
+    readPreference: ReadPreference.fromOptions(options) || ReadPreference.primary,
+    namespace: new MongoDBNamespace('admin')
+  };
+}
+
+/**
+ * @ignore
+ */
+inherits(MongoClient, EventEmitter);
+
+Object.defineProperty(MongoClient.prototype, 'writeConcern', {
+  enumerable: true,
+  get: function() {
+    return this.s.writeConcern;
+  }
+});
+
+Object.defineProperty(MongoClient.prototype, 'readPreference', {
+  enumerable: true,
+  get: function() {
+    return this.s.readPreference;
+  }
+});
+
+/**
+ * The callback format for results
+ * @callback MongoClient~connectCallback
+ * @param {MongoError} error An error instance representing the error during the execution.
+ * @param {MongoClient} client The connected client.
+ */
+
+/**
+ * Connect to MongoDB using a url as documented at
+ *
+ *  docs.mongodb.org/manual/reference/connection-string/
+ *
+ * Note that for replicasets the replicaSet query parameter is required in the 2.0 driver
+ *
+ * @method
+ * @param {MongoClient~connectCallback} [callback] The command result callback
+ * @return {Promise<MongoClient>} returns Promise if no callback passed
+ */
+MongoClient.prototype.connect = function(callback) {
+  if (typeof callback === 'string') {
+    throw new TypeError('`connect` only accepts a callback');
+  }
+
+  const client = this;
+  return maybePromise(this, callback, cb => {
+    const err = validOptions(client.s.options);
+    if (err) return cb(err);
+
+    connect(client, client.s.url, client.s.options, err => {
+      if (err) return cb(err);
+      cb(null, client);
+    });
+  });
+};
+
+MongoClient.prototype.logout = deprecate(function(options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  if (typeof callback === 'function') callback(null, true);
+}, 'Multiple authentication is prohibited on a connected client, please only authenticate once per MongoClient');
+
+/**
+ * Close the db and its underlying connections
+ * @method
+ * @param {boolean} [force=false] Force close, emitting no events
+ * @param {Db~noResultCallback} [callback] The result callback
+ * @return {Promise} returns Promise if no callback passed
+ */
+MongoClient.prototype.close = function(force, callback) {
+  if (typeof force === 'function') {
+    callback = force;
+    force = false;
+  }
+
+  const client = this;
+  return maybePromise(this, callback, cb => {
+    const completeClose = err => {
+      client.emit('close', client);
+
+      if (!(client.topology instanceof NativeTopology)) {
+        for (const item of client.s.dbCache) {
+          item[1].emit('close', client);
+        }
+      }
+
+      client.removeAllListeners('close');
+      cb(err);
+    };
+
+    if (client.topology == null) {
+      completeClose();
+      return;
+    }
+
+    client.topology.close(force, err => {
+      const encrypter = client.topology.s.options.encrypter;
+      if (encrypter) {
+        return encrypter.close(client, force, err2 => {
+          completeClose(err || err2);
+        });
+      }
+      completeClose(err);
+    });
+  });
+};
+
+/**
+ * Create a new Db instance sharing the current socket connections. Be aware that the new db instances are
+ * related in a parent-child relationship to the original instance so that events are correctly emitted on child
+ * db instances. Child db instances are cached so performing db('db1') twice will return the same instance.
+ * You can control these behaviors with the options noListener and returnNonCachedInstance.
+ *
+ * @method
+ * @param {string} [dbName] The name of the database we want to use. If not provided, use database name from connection string.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.noListener=false] Do not make the db an event listener to the original connection.
+ * @param {boolean} [options.returnNonCachedInstance=false] Control if you want to return a cached instance or have a new one created
+ * @return {Db}
+ */
+MongoClient.prototype.db = function(dbName, options) {
+  options = options || {};
+
+  // Default to db from connection string if not provided
+  if (!dbName) {
+    dbName = this.s.options.dbName;
+  }
+
+  // Copy the options and add out internal override of the not shared flag
+  const finalOptions = Object.assign({}, this.s.options, options);
+
+  // Do we have the db in the cache already
+  if (this.s.dbCache.has(dbName) && finalOptions.returnNonCachedInstance !== true) {
+    return this.s.dbCache.get(dbName);
+  }
+
+  // Add promiseLibrary
+  finalOptions.promiseLibrary = this.s.promiseLibrary;
+
+  // If no topology throw an error message
+  if (!this.topology) {
+    throw new MongoError('MongoClient must be connected before calling MongoClient.prototype.db');
+  }
+
+  // Return the db object
+  const db = new Db(dbName, this.topology, finalOptions);
+
+  // Add the db to the cache
+  this.s.dbCache.set(dbName, db);
+  // Return the database
+  return db;
+};
+
+/**
+ * Check if MongoClient is connected
+ *
+ * @method
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.noListener=false] Do not make the db an event listener to the original connection.
+ * @param {boolean} [options.returnNonCachedInstance=false] Control if you want to return a cached instance or have a new one created
+ * @return {boolean}
+ */
+MongoClient.prototype.isConnected = function(options) {
+  options = options || {};
+
+  if (!this.topology) return false;
+  return this.topology.isConnected(options);
+};
+
+/**
+ * Connect to MongoDB using a url as documented at
+ *
+ *  docs.mongodb.org/manual/reference/connection-string/
+ *
+ * Note that for replicasets the replicaSet query parameter is required in the 2.0 driver
+ *
+ * @method
+ * @static
+ * @param {string} url The connection URI string
+ * @param {MongoClientOptions} [options] Optional settings
+ * @return {Promise<MongoClient>} returns Promise if no callback passed
+ */
+MongoClient.connect = function(url, options, callback) {
+  const args = Array.prototype.slice.call(arguments, 1);
+  callback = typeof args[args.length - 1] === 'function' ? args.pop() : undefined;
+  options = args.length ? args.shift() : null;
+  options = options || {};
+
+  // Create client
+  const mongoClient = new MongoClient(url, options);
+  // Execute the connect method
+  return mongoClient.connect(callback);
+};
+
+/**
+ * Starts a new session on the server
+ *
+ * @param {SessionOptions} [options] optional settings for a driver session
+ * @return {ClientSession} the newly established session
+ */
+MongoClient.prototype.startSession = function(options) {
+  options = Object.assign({ explicit: true }, options);
+  if (!this.topology) {
+    throw new MongoError('Must connect to a server before calling this method');
+  }
+
+  return this.topology.startSession(options, this.s.options);
+};
+
+/**
+ * Runs a given operation with an implicitly created session. The lifetime of the session
+ * will be handled without the need for user interaction.
+ *
+ * NOTE: presently the operation MUST return a Promise (either explicit or implicity as an async function)
+ *
+ * @param {Object} [options] Optional settings to be appled to implicitly created session
+ * @param {Function} operation An operation to execute with an implicitly created session. The signature of this MUST be `(session) => {}`
+ * @return {Promise}
+ */
+MongoClient.prototype.withSession = function(options, operation) {
+  if (typeof options === 'function') (operation = options), (options = undefined);
+  const session = this.startSession(options);
+
+  let cleanupHandler = (err, result, opts) => {
+    // prevent multiple calls to cleanupHandler
+    cleanupHandler = () => {
+      throw new ReferenceError('cleanupHandler was called too many times');
+    };
+
+    opts = Object.assign({ throw: true }, opts);
+    session.endSession();
+
+    if (err) {
+      if (opts.throw) throw err;
+      return Promise.reject(err);
+    }
+  };
+
+  try {
+    const result = operation(session);
+    return Promise.resolve(result)
+      .then(result => cleanupHandler(null, result))
+      .catch(err => cleanupHandler(err, null, { throw: true }));
+  } catch (err) {
+    return cleanupHandler(err, null, { throw: false });
+  }
+};
+/**
+ * Create a new Change Stream, watching for new changes (insertions, updates, replacements, deletions, and invalidations) in this cluster. Will ignore all changes to system collections, as well as the local, admin,
+ * and config databases.
+ * @method
+ * @since 3.1.0
+ * @param {Array} [pipeline] An array of {@link https://docs.mongodb.com/manual/reference/operator/aggregation-pipeline/|aggregation pipeline stages} through which to pass change stream documents. This allows for filtering (using $match) and manipulating the change stream documents.
+ * @param {object} [options] Optional settings
+ * @param {string} [options.fullDocument='default'] Allowed values: ‘default’, ‘updateLookup’. When set to ‘updateLookup’, the change stream will include both a delta describing the changes to the document, as well as a copy of the entire document that was changed from some time after the change occurred.
+ * @param {object} [options.resumeAfter] Specifies the logical starting point for the new change stream. This should be the _id field from a previously returned change stream document.
+ * @param {number} [options.maxAwaitTimeMS] The maximum amount of time for the server to wait on new documents to satisfy a change stream query
+ * @param {number} [options.batchSize=1000] The number of documents to return per batch. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {object} [options.collation] Specify collation settings for operation. See {@link https://docs.mongodb.com/manual/reference/command/aggregate|aggregation documentation}.
+ * @param {ReadPreference} [options.readPreference] The read preference. See {@link https://docs.mongodb.com/manual/reference/read-preference|read preference documentation}.
+ * @param {Timestamp} [options.startAtOperationTime] receive change events that occur after the specified timestamp
+ * @param {ClientSession} [options.session] optional session to use for this operation
+ * @return {ChangeStream} a ChangeStream instance.
+ */
+MongoClient.prototype.watch = function(pipeline, options) {
+  pipeline = pipeline || [];
+  options = options || {};
+
+  // Allow optionally not specifying a pipeline
+  if (!Array.isArray(pipeline)) {
+    options = pipeline;
+    pipeline = [];
+  }
+
+  return new ChangeStream(this, pipeline, options);
+};
+
+/**
+ * Return the mongo client logger
+ * @method
+ * @return {Logger} return the mongo client logger
+ * @ignore
+ */
+MongoClient.prototype.getLogger = function() {
+  return this.s.options.logger;
+};
+
+module.exports = MongoClient;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/add_user.js b/NodeAPI/node_modules/mongodb/lib/operations/add_user.js
new file mode 100644
index 0000000000000000000000000000000000000000..62af9d80393b099a0dfe74f5604aa71b55716f4d
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/add_user.js
@@ -0,0 +1,99 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const CommandOperation = require('./command');
+const defineAspects = require('./operation').defineAspects;
+const crypto = require('crypto');
+const handleCallback = require('../utils').handleCallback;
+const toError = require('../utils').toError;
+const emitWarning = require('../utils').emitWarning;
+
+class AddUserOperation extends CommandOperation {
+  constructor(db, username, password, options) {
+    super(db, options);
+
+    this.username = username;
+    this.password = password;
+  }
+
+  _buildCommand() {
+    const db = this.db;
+    const username = this.username;
+    const password = this.password;
+    const options = this.options;
+
+    // Get additional values
+    let roles = [];
+    if (Array.isArray(options.roles)) roles = options.roles;
+    if (typeof options.roles === 'string') roles = [options.roles];
+
+    // If not roles defined print deprecated message
+    // TODO: handle deprecation properly
+    if (roles.length === 0) {
+      emitWarning('Creating a user without roles is deprecated in MongoDB >= 2.6');
+    }
+
+    // Check the db name and add roles if needed
+    if (
+      (db.databaseName.toLowerCase() === 'admin' || options.dbName === 'admin') &&
+      !Array.isArray(options.roles)
+    ) {
+      roles = ['root'];
+    } else if (!Array.isArray(options.roles)) {
+      roles = ['dbOwner'];
+    }
+
+    const digestPassword = db.s.topology.lastIsMaster().maxWireVersion >= 7;
+
+    let userPassword = password;
+
+    if (!digestPassword) {
+      // Use node md5 generator
+      const md5 = crypto.createHash('md5');
+      // Generate keys used for authentication
+      md5.update(username + ':mongo:' + password);
+      userPassword = md5.digest('hex');
+    }
+
+    // Build the command to execute
+    const command = {
+      createUser: username,
+      customData: options.customData || {},
+      roles: roles,
+      digestPassword
+    };
+
+    // No password
+    if (typeof password === 'string') {
+      command.pwd = userPassword;
+    }
+
+    return command;
+  }
+
+  execute(callback) {
+    const options = this.options;
+
+    // Error out if digestPassword set
+    if (options.digestPassword != null) {
+      return callback(
+        toError(
+          "The digestPassword option is not supported via add_user. Please use db.command('createUser', ...) instead for this option."
+        )
+      );
+    }
+
+    // Attempt to execute auth command
+    super.execute((err, r) => {
+      if (!err) {
+        return handleCallback(callback, err, r);
+      }
+
+      return handleCallback(callback, err, null);
+    });
+  }
+}
+
+defineAspects(AddUserOperation, Aspect.WRITE_OPERATION);
+
+module.exports = AddUserOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/admin_ops.js b/NodeAPI/node_modules/mongodb/lib/operations/admin_ops.js
new file mode 100644
index 0000000000000000000000000000000000000000..d5f3516e8ece27a3e10ffed5a3204d5d03392bdd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/admin_ops.js
@@ -0,0 +1,62 @@
+'use strict';
+
+const executeCommand = require('./db_ops').executeCommand;
+const executeDbAdminCommand = require('./db_ops').executeDbAdminCommand;
+
+/**
+ * Get ReplicaSet status
+ *
+ * @param {Admin} a collection instance.
+ * @param {Object} [options] Optional settings. See Admin.prototype.replSetGetStatus for a list of options.
+ * @param {Admin~resultCallback} [callback] The command result callback.
+ */
+function replSetGetStatus(admin, options, callback) {
+  executeDbAdminCommand(admin.s.db, { replSetGetStatus: 1 }, options, callback);
+}
+
+/**
+ * Retrieve this db's server status.
+ *
+ * @param {Admin} a collection instance.
+ * @param {Object} [options] Optional settings. See Admin.prototype.serverStatus for a list of options.
+ * @param {Admin~resultCallback} [callback] The command result callback
+ */
+function serverStatus(admin, options, callback) {
+  executeDbAdminCommand(admin.s.db, { serverStatus: 1 }, options, callback);
+}
+
+/**
+ * Validate an existing collection
+ *
+ * @param {Admin} a collection instance.
+ * @param {string} collectionName The name of the collection to validate.
+ * @param {Object} [options] Optional settings. See Admin.prototype.validateCollection for a list of options.
+ * @param {Admin~resultCallback} [callback] The command result callback.
+ */
+function validateCollection(admin, collectionName, options, callback) {
+  const command = { validate: collectionName };
+  const keys = Object.keys(options);
+
+  // Decorate command with extra options
+  for (let i = 0; i < keys.length; i++) {
+    if (Object.prototype.hasOwnProperty.call(options, keys[i]) && keys[i] !== 'session') {
+      command[keys[i]] = options[keys[i]];
+    }
+  }
+
+  executeCommand(admin.s.db, command, options, (err, doc) => {
+    if (err != null) return callback(err, null);
+
+    if (doc.ok === 0) return callback(new Error('Error with validate command'), null);
+    if (doc.result != null && doc.result.constructor !== String)
+      return callback(new Error('Error with validation data'), null);
+    if (doc.result != null && doc.result.match(/exception|corrupt/) != null)
+      return callback(new Error('Error: invalid collection ' + collectionName), null);
+    if (doc.valid != null && !doc.valid)
+      return callback(new Error('Error: invalid collection ' + collectionName), null);
+
+    return callback(null, doc);
+  });
+}
+
+module.exports = { replSetGetStatus, serverStatus, validateCollection };
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/aggregate.js b/NodeAPI/node_modules/mongodb/lib/operations/aggregate.js
new file mode 100644
index 0000000000000000000000000000000000000000..ca69a52e1985ec1de5fdb2a5976e8f3e827eb371
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/aggregate.js
@@ -0,0 +1,104 @@
+'use strict';
+
+const CommandOperationV2 = require('./command_v2');
+const MongoError = require('../core').MongoError;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const ReadPreference = require('../core').ReadPreference;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+
+const DB_AGGREGATE_COLLECTION = 1;
+const MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT = 8;
+
+class AggregateOperation extends CommandOperationV2 {
+  constructor(parent, pipeline, options) {
+    super(parent, options, { fullResponse: true });
+
+    this.target =
+      parent.s.namespace && parent.s.namespace.collection
+        ? parent.s.namespace.collection
+        : DB_AGGREGATE_COLLECTION;
+
+    this.pipeline = pipeline;
+
+    // determine if we have a write stage, override read preference if so
+    this.hasWriteStage = false;
+    if (typeof options.out === 'string') {
+      this.pipeline = this.pipeline.concat({ $out: options.out });
+      this.hasWriteStage = true;
+    } else if (pipeline.length > 0) {
+      const finalStage = pipeline[pipeline.length - 1];
+      if (finalStage.$out || finalStage.$merge) {
+        this.hasWriteStage = true;
+      }
+    }
+
+    if (this.hasWriteStage) {
+      this.readPreference = ReadPreference.primary;
+    }
+
+    if (this.explain && this.writeConcern) {
+      throw new MongoError('"explain" cannot be used on an aggregate call with writeConcern');
+    }
+
+    if (options.cursor != null && typeof options.cursor !== 'object') {
+      throw new MongoError('cursor options must be an object');
+    }
+  }
+
+  get canRetryRead() {
+    return !this.hasWriteStage;
+  }
+
+  addToPipeline(stage) {
+    this.pipeline.push(stage);
+  }
+
+  execute(server, callback) {
+    const options = this.options;
+    const serverWireVersion = maxWireVersion(server);
+    const command = { aggregate: this.target, pipeline: this.pipeline };
+
+    if (this.hasWriteStage && serverWireVersion < MIN_WIRE_VERSION_$OUT_READ_CONCERN_SUPPORT) {
+      this.readConcern = null;
+    }
+
+    if (serverWireVersion >= 5) {
+      if (this.hasWriteStage && this.writeConcern) {
+        Object.assign(command, { writeConcern: this.writeConcern });
+      }
+    }
+
+    if (options.bypassDocumentValidation === true) {
+      command.bypassDocumentValidation = options.bypassDocumentValidation;
+    }
+
+    if (typeof options.allowDiskUse === 'boolean') {
+      command.allowDiskUse = options.allowDiskUse;
+    }
+
+    if (options.hint) {
+      command.hint = options.hint;
+    }
+
+    if (this.explain) {
+      options.full = false;
+    }
+
+    command.cursor = options.cursor || {};
+    if (options.batchSize && !this.hasWriteStage) {
+      command.cursor.batchSize = options.batchSize;
+    }
+
+    super.executeCommand(server, command, callback);
+  }
+}
+
+defineAspects(AggregateOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION,
+  Aspect.EXPLAINABLE
+]);
+
+module.exports = AggregateOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/bulk_write.js b/NodeAPI/node_modules/mongodb/lib/operations/bulk_write.js
new file mode 100644
index 0000000000000000000000000000000000000000..752b3e7b7f4623972dcb4e6df2917dd8076bb118
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/bulk_write.js
@@ -0,0 +1,96 @@
+'use strict';
+
+const applyRetryableWrites = require('../utils').applyRetryableWrites;
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const MongoError = require('../core').MongoError;
+const OperationBase = require('./operation').OperationBase;
+
+class BulkWriteOperation extends OperationBase {
+  constructor(collection, operations, options) {
+    super(options);
+
+    this.collection = collection;
+    this.operations = operations;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const operations = this.operations;
+    let options = this.options;
+
+    // Add ignoreUndfined
+    if (coll.s.options.ignoreUndefined) {
+      options = Object.assign({}, options);
+      options.ignoreUndefined = coll.s.options.ignoreUndefined;
+    }
+
+    // Create the bulk operation
+    const bulk =
+      options.ordered === true || options.ordered == null
+        ? coll.initializeOrderedBulkOp(options)
+        : coll.initializeUnorderedBulkOp(options);
+
+    // Do we have a collation
+    let collation = false;
+
+    // for each op go through and add to the bulk
+    try {
+      for (let i = 0; i < operations.length; i++) {
+        // Get the operation type
+        const key = Object.keys(operations[i])[0];
+        // Check if we have a collation
+        if (operations[i][key].collation) {
+          collation = true;
+        }
+
+        // Pass to the raw bulk
+        bulk.raw(operations[i]);
+      }
+    } catch (err) {
+      return callback(err, null);
+    }
+
+    // Final options for retryable writes and write concern
+    let finalOptions = Object.assign({}, options);
+    finalOptions = applyRetryableWrites(finalOptions, coll.s.db);
+    finalOptions = applyWriteConcern(finalOptions, { db: coll.s.db, collection: coll }, options);
+
+    const writeCon = finalOptions.writeConcern ? finalOptions.writeConcern : {};
+    const capabilities = coll.s.topology.capabilities();
+
+    // Did the user pass in a collation, check if our write server supports it
+    if (collation && capabilities && !capabilities.commandsTakeCollation) {
+      return callback(new MongoError('server/primary/mongos does not support collation'));
+    }
+
+    // Execute the bulk
+    bulk.execute(writeCon, finalOptions, (err, r) => {
+      // We have connection level error
+      if (!r && err) {
+        return callback(err, null);
+      }
+
+      // Update the n
+      r.n = r.insertedCount;
+
+      // Inserted documents
+      const inserted = r.getInsertedIds();
+      // Map inserted ids
+      for (let i = 0; i < inserted.length; i++) {
+        r.insertedIds[inserted[i].index] = inserted[i]._id;
+      }
+
+      // Upserted documents
+      const upserted = r.getUpsertedIds();
+      // Map upserted ids
+      for (let i = 0; i < upserted.length; i++) {
+        r.upsertedIds[upserted[i].index] = upserted[i]._id;
+      }
+
+      // Return the results
+      callback(null, r);
+    });
+  }
+}
+
+module.exports = BulkWriteOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/collection_ops.js b/NodeAPI/node_modules/mongodb/lib/operations/collection_ops.js
new file mode 100644
index 0000000000000000000000000000000000000000..655bd70c552e4936e3f63616406f8cc23890e9b6
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/collection_ops.js
@@ -0,0 +1,353 @@
+'use strict';
+
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const Code = require('../core').BSON.Code;
+const createIndexDb = require('./db_ops').createIndex;
+const decorateWithCollation = require('../utils').decorateWithCollation;
+const decorateWithReadConcern = require('../utils').decorateWithReadConcern;
+const ensureIndexDb = require('./db_ops').ensureIndex;
+const evaluate = require('./db_ops').evaluate;
+const executeCommand = require('./db_ops').executeCommand;
+const handleCallback = require('../utils').handleCallback;
+const indexInformationDb = require('./db_ops').indexInformation;
+const Long = require('../core').BSON.Long;
+const MongoError = require('../core').MongoError;
+const ReadPreference = require('../core').ReadPreference;
+const insertDocuments = require('./common_functions').insertDocuments;
+const updateDocuments = require('./common_functions').updateDocuments;
+
+/**
+ * Group function helper
+ * @ignore
+ */
+// var groupFunction = function () {
+//   var c = db[ns].find(condition);
+//   var map = new Map();
+//   var reduce_function = reduce;
+//
+//   while (c.hasNext()) {
+//     var obj = c.next();
+//     var key = {};
+//
+//     for (var i = 0, len = keys.length; i < len; ++i) {
+//       var k = keys[i];
+//       key[k] = obj[k];
+//     }
+//
+//     var aggObj = map.get(key);
+//
+//     if (aggObj == null) {
+//       var newObj = Object.extend({}, key);
+//       aggObj = Object.extend(newObj, initial);
+//       map.put(key, aggObj);
+//     }
+//
+//     reduce_function(obj, aggObj);
+//   }
+//
+//   return { "result": map.values() };
+// }.toString();
+const groupFunction =
+  'function () {\nvar c = db[ns].find(condition);\nvar map = new Map();\nvar reduce_function = reduce;\n\nwhile (c.hasNext()) {\nvar obj = c.next();\nvar key = {};\n\nfor (var i = 0, len = keys.length; i < len; ++i) {\nvar k = keys[i];\nkey[k] = obj[k];\n}\n\nvar aggObj = map.get(key);\n\nif (aggObj == null) {\nvar newObj = Object.extend({}, key);\naggObj = Object.extend(newObj, initial);\nmap.put(key, aggObj);\n}\n\nreduce_function(obj, aggObj);\n}\n\nreturn { "result": map.values() };\n}';
+
+/**
+ * Create an index on the db and collection.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings. See Collection.prototype.createIndex for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ */
+function createIndex(coll, fieldOrSpec, options, callback) {
+  createIndexDb(coll.s.db, coll.collectionName, fieldOrSpec, options, callback);
+}
+
+/**
+ * Create multiple indexes in the collection. This method is only supported for
+ * MongoDB 2.6 or higher. Earlier version of MongoDB will throw a command not supported
+ * error. Index specifications are defined at http://docs.mongodb.org/manual/reference/command/createIndexes/.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {array} indexSpecs An array of index specifications to be created
+ * @param {Object} [options] Optional settings. See Collection.prototype.createIndexes for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ */
+function createIndexes(coll, indexSpecs, options, callback) {
+  const capabilities = coll.s.topology.capabilities();
+
+  // Ensure we generate the correct name if the parameter is not set
+  for (let i = 0; i < indexSpecs.length; i++) {
+    if (indexSpecs[i].name == null) {
+      const keys = [];
+
+      // Did the user pass in a collation, check if our write server supports it
+      if (indexSpecs[i].collation && capabilities && !capabilities.commandsTakeCollation) {
+        return callback(new MongoError('server/primary/mongos does not support collation'));
+      }
+
+      for (let name in indexSpecs[i].key) {
+        keys.push(`${name}_${indexSpecs[i].key[name]}`);
+      }
+
+      // Set the name
+      indexSpecs[i].name = keys.join('_');
+    }
+  }
+
+  options = Object.assign({}, options, { readPreference: ReadPreference.PRIMARY });
+
+  // Execute the index
+  executeCommand(
+    coll.s.db,
+    {
+      createIndexes: coll.collectionName,
+      indexes: indexSpecs
+    },
+    options,
+    callback
+  );
+}
+
+/**
+ * Ensure that an index exists. If the index does not exist, this function creates it.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings. See Collection.prototype.ensureIndex for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ */
+function ensureIndex(coll, fieldOrSpec, options, callback) {
+  ensureIndexDb(coll.s.db, coll.collectionName, fieldOrSpec, options, callback);
+}
+
+/**
+ * Run a group command across a collection.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {(object|array|function|code)} keys An object, array or function expressing the keys to group by.
+ * @param {object} condition An optional condition that must be true for a row to be considered.
+ * @param {object} initial Initial value of the aggregation counter object.
+ * @param {(function|Code)} reduce The reduce function aggregates (reduces) the objects iterated
+ * @param {(function|Code)} finalize An optional function to be run on each item in the result set just before the item is returned.
+ * @param {boolean} command Specify if you wish to run using the internal group command or using eval, default is true.
+ * @param {object} [options] Optional settings. See Collection.prototype.group for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ * @deprecated MongoDB 3.6 or higher will no longer support the group command. We recommend rewriting using the aggregation framework.
+ */
+function group(coll, keys, condition, initial, reduce, finalize, command, options, callback) {
+  // Execute using the command
+  if (command) {
+    const reduceFunction = reduce && reduce._bsontype === 'Code' ? reduce : new Code(reduce);
+
+    const selector = {
+      group: {
+        ns: coll.collectionName,
+        $reduce: reduceFunction,
+        cond: condition,
+        initial: initial,
+        out: 'inline'
+      }
+    };
+
+    // if finalize is defined
+    if (finalize != null) selector.group['finalize'] = finalize;
+    // Set up group selector
+    if ('function' === typeof keys || (keys && keys._bsontype === 'Code')) {
+      selector.group.$keyf = keys && keys._bsontype === 'Code' ? keys : new Code(keys);
+    } else {
+      const hash = {};
+      keys.forEach(key => {
+        hash[key] = 1;
+      });
+      selector.group.key = hash;
+    }
+
+    options = Object.assign({}, options);
+    // Ensure we have the right read preference inheritance
+    options.readPreference = ReadPreference.resolve(coll, options);
+
+    // Do we have a readConcern specified
+    decorateWithReadConcern(selector, coll, options);
+
+    // Have we specified collation
+    try {
+      decorateWithCollation(selector, coll, options);
+    } catch (err) {
+      return callback(err, null);
+    }
+
+    // Execute command
+    executeCommand(coll.s.db, selector, options, (err, result) => {
+      if (err) return handleCallback(callback, err, null);
+      handleCallback(callback, null, result.retval);
+    });
+  } else {
+    // Create execution scope
+    const scope = reduce != null && reduce._bsontype === 'Code' ? reduce.scope : {};
+
+    scope.ns = coll.collectionName;
+    scope.keys = keys;
+    scope.condition = condition;
+    scope.initial = initial;
+
+    // Pass in the function text to execute within mongodb.
+    const groupfn = groupFunction.replace(/ reduce;/, reduce.toString() + ';');
+
+    evaluate(coll.s.db, new Code(groupfn, scope), null, options, (err, results) => {
+      if (err) return handleCallback(callback, err, null);
+      handleCallback(callback, null, results.result || results);
+    });
+  }
+}
+
+/**
+ * Retrieve all the indexes on the collection.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {Object} [options] Optional settings. See Collection.prototype.indexes for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ */
+function indexes(coll, options, callback) {
+  options = Object.assign({}, { full: true }, options);
+  indexInformationDb(coll.s.db, coll.collectionName, options, callback);
+}
+
+/**
+ * Check if one or more indexes exist on the collection. This fails on the first index that doesn't exist.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {(string|array)} indexes One or more index names to check.
+ * @param {Object} [options] Optional settings. See Collection.prototype.indexExists for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ */
+function indexExists(coll, indexes, options, callback) {
+  indexInformation(coll, options, (err, indexInformation) => {
+    // If we have an error return
+    if (err != null) return handleCallback(callback, err, null);
+    // Let's check for the index names
+    if (!Array.isArray(indexes))
+      return handleCallback(callback, null, indexInformation[indexes] != null);
+    // Check in list of indexes
+    for (let i = 0; i < indexes.length; i++) {
+      if (indexInformation[indexes[i]] == null) {
+        return handleCallback(callback, null, false);
+      }
+    }
+
+    // All keys found return true
+    return handleCallback(callback, null, true);
+  });
+}
+
+/**
+ * Retrieve this collection's index info.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {object} [options] Optional settings. See Collection.prototype.indexInformation for a list of options.
+ * @param {Collection~resultCallback} [callback] The command result callback
+ */
+function indexInformation(coll, options, callback) {
+  indexInformationDb(coll.s.db, coll.collectionName, options, callback);
+}
+
+/**
+ * Return N parallel cursors for a collection to allow parallel reading of the entire collection. There are
+ * no ordering guarantees for returned results.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {object} [options] Optional settings. See Collection.prototype.parallelCollectionScan for a list of options.
+ * @param {Collection~parallelCollectionScanCallback} [callback] The command result callback
+ */
+function parallelCollectionScan(coll, options, callback) {
+  // Create command object
+  const commandObject = {
+    parallelCollectionScan: coll.collectionName,
+    numCursors: options.numCursors
+  };
+
+  // Do we have a readConcern specified
+  decorateWithReadConcern(commandObject, coll, options);
+
+  // Store the raw value
+  const raw = options.raw;
+  delete options['raw'];
+
+  // Execute the command
+  executeCommand(coll.s.db, commandObject, options, (err, result) => {
+    if (err) return handleCallback(callback, err, null);
+    if (result == null)
+      return handleCallback(
+        callback,
+        new Error('no result returned for parallelCollectionScan'),
+        null
+      );
+
+    options = Object.assign({ explicitlyIgnoreSession: true }, options);
+
+    const cursors = [];
+    // Add the raw back to the option
+    if (raw) options.raw = raw;
+    // Create command cursors for each item
+    for (let i = 0; i < result.cursors.length; i++) {
+      const rawId = result.cursors[i].cursor.id;
+      // Convert cursorId to Long if needed
+      const cursorId = typeof rawId === 'number' ? Long.fromNumber(rawId) : rawId;
+      // Add a command cursor
+      cursors.push(coll.s.topology.cursor(coll.namespace, cursorId, options));
+    }
+
+    handleCallback(callback, null, cursors);
+  });
+}
+
+/**
+ * Save a document.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {object} doc Document to save
+ * @param {object} [options] Optional settings. See Collection.prototype.save for a list of options.
+ * @param {Collection~writeOpCallback} [callback] The command result callback
+ * @deprecated use insertOne, insertMany, updateOne or updateMany
+ */
+function save(coll, doc, options, callback) {
+  // Get the write concern options
+  const finalOptions = applyWriteConcern(
+    Object.assign({}, options),
+    { db: coll.s.db, collection: coll },
+    options
+  );
+  // Establish if we need to perform an insert or update
+  if (doc._id != null) {
+    finalOptions.upsert = true;
+    return updateDocuments(coll, { _id: doc._id }, doc, finalOptions, callback);
+  }
+
+  // Insert the document
+  insertDocuments(coll, [doc], finalOptions, (err, result) => {
+    if (callback == null) return;
+    if (doc == null) return handleCallback(callback, null, null);
+    if (err) return handleCallback(callback, err, null);
+    handleCallback(callback, null, result);
+  });
+}
+
+module.exports = {
+  createIndex,
+  createIndexes,
+  ensureIndex,
+  group,
+  indexes,
+  indexExists,
+  indexInformation,
+  parallelCollectionScan,
+  save
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/collections.js b/NodeAPI/node_modules/mongodb/lib/operations/collections.js
new file mode 100644
index 0000000000000000000000000000000000000000..eac690a2fa681c3d19309fa110dec9b21e484668
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/collections.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const handleCallback = require('../utils').handleCallback;
+
+let collection;
+function loadCollection() {
+  if (!collection) {
+    collection = require('../collection');
+  }
+  return collection;
+}
+
+class CollectionsOperation extends OperationBase {
+  constructor(db, options) {
+    super(options);
+
+    this.db = db;
+  }
+
+  execute(callback) {
+    const db = this.db;
+    let options = this.options;
+
+    let Collection = loadCollection();
+
+    options = Object.assign({}, options, { nameOnly: true });
+    // Let's get the collection names
+    db.listCollections({}, options).toArray((err, documents) => {
+      if (err != null) return handleCallback(callback, err, null);
+      // Filter collections removing any illegal ones
+      documents = documents.filter(doc => {
+        return doc.name.indexOf('$') === -1;
+      });
+
+      // Return the collection objects
+      handleCallback(
+        callback,
+        null,
+        documents.map(d => {
+          return new Collection(
+            db,
+            db.s.topology,
+            db.databaseName,
+            d.name,
+            db.s.pkFactory,
+            db.s.options
+          );
+        })
+      );
+    });
+  }
+}
+
+module.exports = CollectionsOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/command.js b/NodeAPI/node_modules/mongodb/lib/operations/command.js
new file mode 100644
index 0000000000000000000000000000000000000000..fd18a543c51547c0f048d1af995af068383672de
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/command.js
@@ -0,0 +1,119 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const OperationBase = require('./operation').OperationBase;
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const debugOptions = require('../utils').debugOptions;
+const handleCallback = require('../utils').handleCallback;
+const MongoError = require('../core').MongoError;
+const ReadPreference = require('../core').ReadPreference;
+const MongoDBNamespace = require('../utils').MongoDBNamespace;
+
+const debugFields = [
+  'authSource',
+  'w',
+  'wtimeout',
+  'j',
+  'native_parser',
+  'forceServerObjectId',
+  'serializeFunctions',
+  'raw',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'bufferMaxEntries',
+  'numberOfRetries',
+  'retryMiliSeconds',
+  'readPreference',
+  'pkFactory',
+  'parentDb',
+  'promiseLibrary',
+  'noListener'
+];
+
+class CommandOperation extends OperationBase {
+  constructor(db, options, collection, command) {
+    super(options);
+
+    if (!this.hasAspect(Aspect.WRITE_OPERATION)) {
+      if (collection != null) {
+        this.options.readPreference = ReadPreference.resolve(collection, options);
+      } else {
+        this.options.readPreference = ReadPreference.resolve(db, options);
+      }
+    } else {
+      if (collection != null) {
+        applyWriteConcern(this.options, { db, coll: collection }, this.options);
+      } else {
+        applyWriteConcern(this.options, { db }, this.options);
+      }
+      this.options.readPreference = ReadPreference.primary;
+    }
+
+    this.db = db;
+
+    if (command != null) {
+      this.command = command;
+    }
+
+    if (collection != null) {
+      this.collection = collection;
+    }
+  }
+
+  _buildCommand() {
+    if (this.command != null) {
+      return this.command;
+    }
+  }
+
+  execute(callback) {
+    const db = this.db;
+    const options = Object.assign({}, this.options);
+
+    // Did the user destroy the topology
+    if (db.serverConfig && db.serverConfig.isDestroyed()) {
+      return callback(new MongoError('topology was destroyed'));
+    }
+
+    let command;
+    try {
+      command = this._buildCommand();
+    } catch (e) {
+      return callback(e);
+    }
+
+    // Get the db name we are executing against
+    const dbName = options.dbName || options.authdb || db.databaseName;
+
+    // Convert the readPreference if its not a write
+    if (this.hasAspect(Aspect.WRITE_OPERATION)) {
+      if (options.writeConcern && (!options.session || !options.session.inTransaction())) {
+        command.writeConcern = options.writeConcern;
+      }
+    }
+
+    // Debug information
+    if (db.s.logger.isDebug()) {
+      db.s.logger.debug(
+        `executing command ${JSON.stringify(
+          command
+        )} against ${dbName}.$cmd with options [${JSON.stringify(
+          debugOptions(debugFields, options)
+        )}]`
+      );
+    }
+
+    const namespace =
+      this.namespace != null ? this.namespace : new MongoDBNamespace(dbName, '$cmd');
+
+    // Execute command
+    db.s.topology.command(namespace, command, options, (err, result) => {
+      if (err) return handleCallback(callback, err);
+      if (options.full) return handleCallback(callback, null, result);
+      handleCallback(callback, null, result.result);
+    });
+  }
+}
+
+module.exports = CommandOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/command_v2.js b/NodeAPI/node_modules/mongodb/lib/operations/command_v2.js
new file mode 100644
index 0000000000000000000000000000000000000000..52f982b885fc23a08bac006d53d227f0c945da50
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/command_v2.js
@@ -0,0 +1,119 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const OperationBase = require('./operation').OperationBase;
+const ReadPreference = require('../core').ReadPreference;
+const ReadConcern = require('../read_concern');
+const WriteConcern = require('../write_concern');
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const decorateWithExplain = require('../utils').decorateWithExplain;
+const commandSupportsReadConcern = require('../core/sessions').commandSupportsReadConcern;
+const MongoError = require('../core/error').MongoError;
+
+const SUPPORTS_WRITE_CONCERN_AND_COLLATION = 5;
+
+class CommandOperationV2 extends OperationBase {
+  constructor(parent, options, operationOptions) {
+    super(options);
+
+    this.ns = parent.s.namespace.withCollection('$cmd');
+    const propertyProvider = this.hasAspect(Aspect.NO_INHERIT_OPTIONS) ? undefined : parent;
+    this.readPreference = this.hasAspect(Aspect.WRITE_OPERATION)
+      ? ReadPreference.primary
+      : ReadPreference.resolve(propertyProvider, this.options);
+    this.readConcern = resolveReadConcern(propertyProvider, this.options);
+    this.writeConcern = resolveWriteConcern(propertyProvider, this.options);
+
+    if (operationOptions && typeof operationOptions.fullResponse === 'boolean') {
+      this.fullResponse = true;
+    }
+
+    // TODO: A lot of our code depends on having the read preference in the options. This should
+    //       go away, but also requires massive test rewrites.
+    this.options.readPreference = this.readPreference;
+
+    // TODO(NODE-2056): make logger another "inheritable" property
+    if (parent.s.logger) {
+      this.logger = parent.s.logger;
+    } else if (parent.s.db && parent.s.db.logger) {
+      this.logger = parent.s.db.logger;
+    }
+  }
+
+  executeCommand(server, cmd, callback) {
+    // TODO: consider making this a non-enumerable property
+    this.server = server;
+
+    const options = this.options;
+    const serverWireVersion = maxWireVersion(server);
+    const inTransaction = this.session && this.session.inTransaction();
+
+    if (this.readConcern && commandSupportsReadConcern(cmd) && !inTransaction) {
+      Object.assign(cmd, { readConcern: this.readConcern });
+    }
+
+    if (options.collation && serverWireVersion < SUPPORTS_WRITE_CONCERN_AND_COLLATION) {
+      callback(
+        new MongoError(
+          `Server ${server.name}, which reports wire version ${serverWireVersion}, does not support collation`
+        )
+      );
+      return;
+    }
+
+    if (serverWireVersion >= SUPPORTS_WRITE_CONCERN_AND_COLLATION) {
+      if (this.writeConcern && this.hasAspect(Aspect.WRITE_OPERATION)) {
+        Object.assign(cmd, { writeConcern: this.writeConcern });
+      }
+
+      if (options.collation && typeof options.collation === 'object') {
+        Object.assign(cmd, { collation: options.collation });
+      }
+    }
+
+    if (typeof options.maxTimeMS === 'number') {
+      cmd.maxTimeMS = options.maxTimeMS;
+    }
+
+    if (typeof options.comment === 'string') {
+      cmd.comment = options.comment;
+    }
+
+    if (this.hasAspect(Aspect.EXPLAINABLE) && this.explain) {
+      if (serverWireVersion < 6 && cmd.aggregate) {
+        // Prior to 3.6, with aggregate, verbosity is ignored, and we must pass in "explain: true"
+        cmd.explain = true;
+      } else {
+        cmd = decorateWithExplain(cmd, this.explain);
+      }
+    }
+
+    if (this.logger && this.logger.isDebug()) {
+      this.logger.debug(`executing command ${JSON.stringify(cmd)} against ${this.ns}`);
+    }
+
+    server.command(this.ns.toString(), cmd, this.options, (err, result) => {
+      if (err) {
+        callback(err, null);
+        return;
+      }
+
+      if (this.fullResponse) {
+        callback(null, result);
+        return;
+      }
+
+      callback(null, result.result);
+    });
+  }
+}
+
+function resolveWriteConcern(parent, options) {
+  return WriteConcern.fromOptions(options) || (parent && parent.writeConcern);
+}
+
+function resolveReadConcern(parent, options) {
+  return ReadConcern.fromOptions(options) || (parent && parent.readConcern);
+}
+
+module.exports = CommandOperationV2;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/common_functions.js b/NodeAPI/node_modules/mongodb/lib/operations/common_functions.js
new file mode 100644
index 0000000000000000000000000000000000000000..5b9c172f1ec89a3d04cf93e7ca5e0748685e17f8
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/common_functions.js
@@ -0,0 +1,399 @@
+'use strict';
+
+const applyRetryableWrites = require('../utils').applyRetryableWrites;
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const decorateWithCollation = require('../utils').decorateWithCollation;
+const decorateWithReadConcern = require('../utils').decorateWithReadConcern;
+const executeCommand = require('./db_ops').executeCommand;
+const formattedOrderClause = require('../utils').formattedOrderClause;
+const handleCallback = require('../utils').handleCallback;
+const MongoError = require('../core').MongoError;
+const ReadPreference = require('../core').ReadPreference;
+const toError = require('../utils').toError;
+const CursorState = require('../core/cursor').CursorState;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+
+/**
+ * Build the count command.
+ *
+ * @method
+ * @param {collectionOrCursor} an instance of a collection or cursor
+ * @param {object} query The query for the count.
+ * @param {object} [options] Optional settings. See Collection.prototype.count and Cursor.prototype.count for a list of options.
+ */
+function buildCountCommand(collectionOrCursor, query, options) {
+  const skip = options.skip;
+  const limit = options.limit;
+  let hint = options.hint;
+  const maxTimeMS = options.maxTimeMS;
+  query = query || {};
+
+  // Final query
+  const cmd = {
+    count: options.collectionName,
+    query: query
+  };
+
+  if (collectionOrCursor.s.numberOfRetries) {
+    // collectionOrCursor is a cursor
+    if (collectionOrCursor.options.hint) {
+      hint = collectionOrCursor.options.hint;
+    } else if (collectionOrCursor.cmd.hint) {
+      hint = collectionOrCursor.cmd.hint;
+    }
+    decorateWithCollation(cmd, collectionOrCursor, collectionOrCursor.cmd);
+  } else {
+    decorateWithCollation(cmd, collectionOrCursor, options);
+  }
+
+  // Add limit, skip and maxTimeMS if defined
+  if (typeof skip === 'number') cmd.skip = skip;
+  if (typeof limit === 'number') cmd.limit = limit;
+  if (typeof maxTimeMS === 'number') cmd.maxTimeMS = maxTimeMS;
+  if (hint) cmd.hint = hint;
+
+  // Do we have a readConcern specified
+  decorateWithReadConcern(cmd, collectionOrCursor);
+
+  return cmd;
+}
+
+/**
+ * Find and update a document.
+ *
+ * @method
+ * @param {Collection} a Collection instance.
+ * @param {object} query Query object to locate the object to modify.
+ * @param {array} sort If multiple docs match, choose the first one in the specified sort order as the object to manipulate.
+ * @param {object} doc The fields/vals to be updated.
+ * @param {object} [options] Optional settings. See Collection.prototype.findAndModify for a list of options.
+ * @param {Collection~findAndModifyCallback} [callback] The command result callback
+ * @deprecated use findOneAndUpdate, findOneAndReplace or findOneAndDelete instead
+ */
+function findAndModify(coll, query, sort, doc, options, callback) {
+  // Create findAndModify command object
+  const queryObject = {
+    findAndModify: coll.collectionName,
+    query: query
+  };
+
+  sort = formattedOrderClause(sort);
+  if (sort) {
+    queryObject.sort = sort;
+  }
+
+  queryObject.new = options.new ? true : false;
+  queryObject.remove = options.remove ? true : false;
+  queryObject.upsert = options.upsert ? true : false;
+
+  const projection = options.projection || options.fields;
+
+  if (projection) {
+    queryObject.fields = projection;
+  }
+
+  if (options.arrayFilters) {
+    queryObject.arrayFilters = options.arrayFilters;
+    delete options.arrayFilters;
+  }
+
+  if (doc && !options.remove) {
+    queryObject.update = doc;
+  }
+
+  if (options.maxTimeMS) queryObject.maxTimeMS = options.maxTimeMS;
+
+  // Either use override on the function, or go back to default on either the collection
+  // level or db
+  options.serializeFunctions = options.serializeFunctions || coll.s.serializeFunctions;
+
+  // No check on the documents
+  options.checkKeys = false;
+
+  // Final options for retryable writes and write concern
+  let finalOptions = Object.assign({}, options);
+  finalOptions = applyRetryableWrites(finalOptions, coll.s.db);
+  finalOptions = applyWriteConcern(finalOptions, { db: coll.s.db, collection: coll }, options);
+
+  // Decorate the findAndModify command with the write Concern
+  if (finalOptions.writeConcern) {
+    queryObject.writeConcern = finalOptions.writeConcern;
+  }
+
+  // Have we specified bypassDocumentValidation
+  if (finalOptions.bypassDocumentValidation === true) {
+    queryObject.bypassDocumentValidation = finalOptions.bypassDocumentValidation;
+  }
+
+  finalOptions.readPreference = ReadPreference.primary;
+
+  // Have we specified collation
+  try {
+    decorateWithCollation(queryObject, coll, finalOptions);
+  } catch (err) {
+    return callback(err, null);
+  }
+
+  // Execute the command
+  executeCommand(coll.s.db, queryObject, finalOptions, (err, result) => {
+    if (err) return handleCallback(callback, err, null);
+
+    return handleCallback(callback, null, result);
+  });
+}
+
+/**
+ * Retrieves this collections index info.
+ *
+ * @method
+ * @param {Db} db The Db instance on which to retrieve the index info.
+ * @param {string} name The name of the collection.
+ * @param {object} [options] Optional settings. See Db.prototype.indexInformation for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback
+ */
+function indexInformation(db, name, options, callback) {
+  // If we specified full information
+  const full = options['full'] == null ? false : options['full'];
+
+  // Did the user destroy the topology
+  if (db.serverConfig && db.serverConfig.isDestroyed())
+    return callback(new MongoError('topology was destroyed'));
+  // Process all the results from the index command and collection
+  function processResults(indexes) {
+    // Contains all the information
+    let info = {};
+    // Process all the indexes
+    for (let i = 0; i < indexes.length; i++) {
+      const index = indexes[i];
+      // Let's unpack the object
+      info[index.name] = [];
+      for (let name in index.key) {
+        info[index.name].push([name, index.key[name]]);
+      }
+    }
+
+    return info;
+  }
+
+  // Get the list of indexes of the specified collection
+  db.collection(name)
+    .listIndexes(options)
+    .toArray((err, indexes) => {
+      if (err) return callback(toError(err));
+      if (!Array.isArray(indexes)) return handleCallback(callback, null, []);
+      if (full) return handleCallback(callback, null, indexes);
+      handleCallback(callback, null, processResults(indexes));
+    });
+}
+
+function prepareDocs(coll, docs, options) {
+  const forceServerObjectId =
+    typeof options.forceServerObjectId === 'boolean'
+      ? options.forceServerObjectId
+      : coll.s.db.options.forceServerObjectId;
+
+  // no need to modify the docs if server sets the ObjectId
+  if (forceServerObjectId === true) {
+    return docs;
+  }
+
+  return docs.map(doc => {
+    if (forceServerObjectId !== true && doc._id == null) {
+      doc._id = coll.s.pkFactory.createPk();
+    }
+
+    return doc;
+  });
+}
+
+// Get the next available document from the cursor, returns null if no more documents are available.
+function nextObject(cursor, callback) {
+  if (cursor.s.state === CursorState.CLOSED || (cursor.isDead && cursor.isDead())) {
+    return handleCallback(
+      callback,
+      MongoError.create({ message: 'Cursor is closed', driver: true })
+    );
+  }
+
+  if (cursor.s.state === CursorState.INIT && cursor.cmd && cursor.cmd.sort) {
+    try {
+      cursor.cmd.sort = formattedOrderClause(cursor.cmd.sort);
+    } catch (err) {
+      return handleCallback(callback, err);
+    }
+  }
+
+  // Get the next object
+  cursor._next((err, doc) => {
+    cursor.s.state = CursorState.OPEN;
+    if (err) return handleCallback(callback, err);
+    handleCallback(callback, null, doc);
+  });
+}
+
+function insertDocuments(coll, docs, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+  // Ensure we are operating on an array op docs
+  docs = Array.isArray(docs) ? docs : [docs];
+
+  // Final options for retryable writes and write concern
+  let finalOptions = Object.assign({}, options);
+  finalOptions = applyRetryableWrites(finalOptions, coll.s.db);
+  finalOptions = applyWriteConcern(finalOptions, { db: coll.s.db, collection: coll }, options);
+
+  // If keep going set unordered
+  if (finalOptions.keepGoing === true) finalOptions.ordered = false;
+  finalOptions.serializeFunctions = options.serializeFunctions || coll.s.serializeFunctions;
+
+  docs = prepareDocs(coll, docs, options);
+
+  // File inserts
+  coll.s.topology.insert(coll.s.namespace, docs, finalOptions, (err, result) => {
+    if (callback == null) return;
+    if (err) return handleCallback(callback, err);
+    if (result == null) return handleCallback(callback, null, null);
+    if (result.result.code) return handleCallback(callback, toError(result.result));
+    if (result.result.writeErrors)
+      return handleCallback(callback, toError(result.result.writeErrors[0]));
+    // Add docs to the list
+    result.ops = docs;
+    // Return the results
+    handleCallback(callback, null, result);
+  });
+}
+
+function removeDocuments(coll, selector, options, callback) {
+  if (typeof options === 'function') {
+    (callback = options), (options = {});
+  } else if (typeof selector === 'function') {
+    callback = selector;
+    options = {};
+    selector = {};
+  }
+
+  // Create an empty options object if the provided one is null
+  options = options || {};
+
+  // Final options for retryable writes and write concern
+  let finalOptions = Object.assign({}, options);
+  finalOptions = applyRetryableWrites(finalOptions, coll.s.db);
+  finalOptions = applyWriteConcern(finalOptions, { db: coll.s.db, collection: coll }, options);
+
+  // If selector is null set empty
+  if (selector == null) selector = {};
+
+  // Build the op
+  const op = { q: selector, limit: 0 };
+  if (options.single) {
+    op.limit = 1;
+  } else if (finalOptions.retryWrites) {
+    finalOptions.retryWrites = false;
+  }
+  if (options.hint) {
+    op.hint = options.hint;
+  }
+
+  // Have we specified collation
+  try {
+    decorateWithCollation(finalOptions, coll, options);
+  } catch (err) {
+    return callback(err, null);
+  }
+
+  if (options.explain !== undefined && maxWireVersion(coll.s.topology) < 3) {
+    return callback
+      ? callback(new MongoError(`server does not support explain on remove`))
+      : undefined;
+  }
+
+  // Execute the remove
+  coll.s.topology.remove(coll.s.namespace, [op], finalOptions, (err, result) => {
+    if (callback == null) return;
+    if (err) return handleCallback(callback, err, null);
+    if (result == null) return handleCallback(callback, null, null);
+    if (result.result.code) return handleCallback(callback, toError(result.result));
+    if (result.result.writeErrors) {
+      return handleCallback(callback, toError(result.result.writeErrors[0]));
+    }
+
+    // Return the results
+    handleCallback(callback, null, result);
+  });
+}
+
+function updateDocuments(coll, selector, document, options, callback) {
+  if ('function' === typeof options) (callback = options), (options = null);
+  if (options == null) options = {};
+  if (!('function' === typeof callback)) callback = null;
+
+  // If we are not providing a selector or document throw
+  if (selector == null || typeof selector !== 'object')
+    return callback(toError('selector must be a valid JavaScript object'));
+  if (document == null || typeof document !== 'object')
+    return callback(toError('document must be a valid JavaScript object'));
+
+  // Final options for retryable writes and write concern
+  let finalOptions = Object.assign({}, options);
+  finalOptions = applyRetryableWrites(finalOptions, coll.s.db);
+  finalOptions = applyWriteConcern(finalOptions, { db: coll.s.db, collection: coll }, options);
+
+  // Do we return the actual result document
+  // Either use override on the function, or go back to default on either the collection
+  // level or db
+  finalOptions.serializeFunctions = options.serializeFunctions || coll.s.serializeFunctions;
+
+  // Execute the operation
+  const op = { q: selector, u: document };
+  op.upsert = options.upsert !== void 0 ? !!options.upsert : false;
+  op.multi = options.multi !== void 0 ? !!options.multi : false;
+
+  if (options.hint) {
+    op.hint = options.hint;
+  }
+
+  if (finalOptions.arrayFilters) {
+    op.arrayFilters = finalOptions.arrayFilters;
+    delete finalOptions.arrayFilters;
+  }
+
+  if (finalOptions.retryWrites && op.multi) {
+    finalOptions.retryWrites = false;
+  }
+
+  // Have we specified collation
+  try {
+    decorateWithCollation(finalOptions, coll, options);
+  } catch (err) {
+    return callback(err, null);
+  }
+
+  if (options.explain !== undefined && maxWireVersion(coll.s.topology) < 3) {
+    return callback
+      ? callback(new MongoError(`server does not support explain on update`))
+      : undefined;
+  }
+
+  // Update options
+  coll.s.topology.update(coll.s.namespace, [op], finalOptions, (err, result) => {
+    if (callback == null) return;
+    if (err) return handleCallback(callback, err, null);
+    if (result == null) return handleCallback(callback, null, null);
+    if (result.result.code) return handleCallback(callback, toError(result.result));
+    if (result.result.writeErrors)
+      return handleCallback(callback, toError(result.result.writeErrors[0]));
+    // Return the results
+    handleCallback(callback, null, result);
+  });
+}
+
+module.exports = {
+  buildCountCommand,
+  findAndModify,
+  indexInformation,
+  nextObject,
+  prepareDocs,
+  insertDocuments,
+  removeDocuments,
+  updateDocuments
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/connect.js b/NodeAPI/node_modules/mongodb/lib/operations/connect.js
new file mode 100644
index 0000000000000000000000000000000000000000..4533d2847bec3015b14f7c32866f5ec1ddb75630
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/connect.js
@@ -0,0 +1,782 @@
+'use strict';
+
+const deprecate = require('util').deprecate;
+const Logger = require('../core').Logger;
+const MongoCredentials = require('../core').MongoCredentials;
+const MongoError = require('../core').MongoError;
+const Mongos = require('../topologies/mongos');
+const NativeTopology = require('../topologies/native_topology');
+const parse = require('../core').parseConnectionString;
+const ReadConcern = require('../read_concern');
+const ReadPreference = require('../core').ReadPreference;
+const ReplSet = require('../topologies/replset');
+const Server = require('../topologies/server');
+const ServerSessionPool = require('../core').Sessions.ServerSessionPool;
+const emitDeprecationWarning = require('../utils').emitDeprecationWarning;
+const emitWarningOnce = require('../utils').emitWarningOnce;
+const fs = require('fs');
+const WriteConcern = require('../write_concern');
+const CMAP_EVENT_NAMES = require('../cmap/events').CMAP_EVENT_NAMES;
+
+let client;
+function loadClient() {
+  if (!client) {
+    client = require('../mongo_client');
+  }
+  return client;
+}
+
+const legacyParse = deprecate(
+  require('../url_parser'),
+  'current URL string parser is deprecated, and will be removed in a future version. ' +
+    'To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.'
+);
+
+const AUTH_MECHANISM_INTERNAL_MAP = {
+  DEFAULT: 'default',
+  PLAIN: 'plain',
+  GSSAPI: 'gssapi',
+  'MONGODB-CR': 'mongocr',
+  'MONGODB-X509': 'x509',
+  'MONGODB-AWS': 'mongodb-aws',
+  'SCRAM-SHA-1': 'scram-sha-1',
+  'SCRAM-SHA-256': 'scram-sha-256'
+};
+
+const monitoringEvents = [
+  'timeout',
+  'close',
+  'serverOpening',
+  'serverDescriptionChanged',
+  'serverHeartbeatStarted',
+  'serverHeartbeatSucceeded',
+  'serverHeartbeatFailed',
+  'serverClosed',
+  'topologyOpening',
+  'topologyClosed',
+  'topologyDescriptionChanged',
+  'commandStarted',
+  'commandSucceeded',
+  'commandFailed',
+  'joined',
+  'left',
+  'ping',
+  'ha',
+  'all',
+  'fullsetup',
+  'open'
+];
+
+const VALID_AUTH_MECHANISMS = new Set([
+  'DEFAULT',
+  'PLAIN',
+  'GSSAPI',
+  'MONGODB-CR',
+  'MONGODB-X509',
+  'MONGODB-AWS',
+  'SCRAM-SHA-1',
+  'SCRAM-SHA-256'
+]);
+
+const validOptionNames = [
+  'poolSize',
+  'ssl',
+  'sslValidate',
+  'sslCA',
+  'sslCert',
+  'sslKey',
+  'sslPass',
+  'sslCRL',
+  'autoReconnect',
+  'noDelay',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'connectTimeoutMS',
+  'family',
+  'socketTimeoutMS',
+  'reconnectTries',
+  'reconnectInterval',
+  'ha',
+  'haInterval',
+  'replicaSet',
+  'secondaryAcceptableLatencyMS',
+  'acceptableLatencyMS',
+  'connectWithNoPrimary',
+  'authSource',
+  'w',
+  'wtimeout',
+  'j',
+  'writeConcern',
+  'forceServerObjectId',
+  'serializeFunctions',
+  'ignoreUndefined',
+  'raw',
+  'bufferMaxEntries',
+  'readPreference',
+  'pkFactory',
+  'promiseLibrary',
+  'readConcern',
+  'maxStalenessSeconds',
+  'loggerLevel',
+  'logger',
+  'promoteValues',
+  'promoteBuffers',
+  'promoteLongs',
+  'domainsEnabled',
+  'checkServerIdentity',
+  'validateOptions',
+  'appname',
+  'auth',
+  'user',
+  'password',
+  'authMechanism',
+  'compression',
+  'fsync',
+  'readPreferenceTags',
+  'numberOfRetries',
+  'auto_reconnect',
+  'minSize',
+  'monitorCommands',
+  'retryWrites',
+  'retryReads',
+  'useNewUrlParser',
+  'useUnifiedTopology',
+  'serverSelectionTimeoutMS',
+  'useRecoveryToken',
+  'autoEncryption',
+  'driverInfo',
+  'tls',
+  'tlsInsecure',
+  'tlsinsecure',
+  'tlsAllowInvalidCertificates',
+  'tlsAllowInvalidHostnames',
+  'tlsCAFile',
+  'tlsCertificateFile',
+  'tlsCertificateKeyFile',
+  'tlsCertificateKeyFilePassword',
+  'minHeartbeatFrequencyMS',
+  'heartbeatFrequencyMS',
+  'directConnection',
+  'appName',
+
+  // CMAP options
+  'maxPoolSize',
+  'minPoolSize',
+  'maxIdleTimeMS',
+  'waitQueueTimeoutMS'
+];
+
+const ignoreOptionNames = ['native_parser'];
+const legacyOptionNames = ['server', 'replset', 'replSet', 'mongos', 'db'];
+
+// Validate options object
+function validOptions(options) {
+  const _validOptions = validOptionNames.concat(legacyOptionNames);
+
+  for (const name in options) {
+    if (ignoreOptionNames.indexOf(name) !== -1) {
+      continue;
+    }
+
+    if (_validOptions.indexOf(name) === -1) {
+      if (options.validateOptions) {
+        return new MongoError(`option ${name} is not supported`);
+      } else {
+        emitWarningOnce(`the options [${name}] is not supported`);
+      }
+    }
+
+    if (legacyOptionNames.indexOf(name) !== -1) {
+      emitWarningOnce(
+        `the server/replset/mongos/db options are deprecated, ` +
+          `all their options are supported at the top level of the options object [${validOptionNames}]`
+      );
+    }
+  }
+}
+
+const LEGACY_OPTIONS_MAP = validOptionNames.reduce((obj, name) => {
+  obj[name.toLowerCase()] = name;
+  return obj;
+}, {});
+
+function addListeners(mongoClient, topology) {
+  topology.on('authenticated', createListener(mongoClient, 'authenticated'));
+  topology.on('error', createListener(mongoClient, 'error'));
+  topology.on('timeout', createListener(mongoClient, 'timeout'));
+  topology.on('close', createListener(mongoClient, 'close'));
+  topology.on('parseError', createListener(mongoClient, 'parseError'));
+  topology.once('open', createListener(mongoClient, 'open'));
+  topology.once('fullsetup', createListener(mongoClient, 'fullsetup'));
+  topology.once('all', createListener(mongoClient, 'all'));
+  topology.on('reconnect', createListener(mongoClient, 'reconnect'));
+}
+
+function assignTopology(client, topology) {
+  client.topology = topology;
+
+  if (!(topology instanceof NativeTopology)) {
+    topology.s.sessionPool = new ServerSessionPool(topology.s.coreTopology);
+  }
+}
+
+// Clear out all events
+function clearAllEvents(topology) {
+  monitoringEvents.forEach(event => topology.removeAllListeners(event));
+}
+
+// Collect all events in order from SDAM
+function collectEvents(mongoClient, topology) {
+  let MongoClient = loadClient();
+  const collectedEvents = [];
+
+  if (mongoClient instanceof MongoClient) {
+    monitoringEvents.forEach(event => {
+      topology.on(event, (object1, object2) => {
+        if (event === 'open') {
+          collectedEvents.push({ event: event, object1: mongoClient });
+        } else {
+          collectedEvents.push({ event: event, object1: object1, object2: object2 });
+        }
+      });
+    });
+  }
+
+  return collectedEvents;
+}
+
+function resolveTLSOptions(options) {
+  if (options.tls == null) {
+    return;
+  }
+
+  ['sslCA', 'sslKey', 'sslCert'].forEach(optionName => {
+    if (options[optionName]) {
+      options[optionName] = fs.readFileSync(options[optionName]);
+    }
+  });
+}
+
+function connect(mongoClient, url, options, callback) {
+  options = Object.assign({}, options);
+
+  // If callback is null throw an exception
+  if (callback == null) {
+    throw new Error('no callback function provided');
+  }
+
+  let didRequestAuthentication = false;
+  const logger = Logger('MongoClient', options);
+
+  // Did we pass in a Server/ReplSet/Mongos
+  if (url instanceof Server || url instanceof ReplSet || url instanceof Mongos) {
+    return connectWithUrl(mongoClient, url, options, connectCallback);
+  }
+
+  const useNewUrlParser = options.useNewUrlParser !== false;
+
+  const parseFn = useNewUrlParser ? parse : legacyParse;
+  const transform = useNewUrlParser ? transformUrlOptions : legacyTransformUrlOptions;
+
+  parseFn(url, options, (err, _object) => {
+    // Do not attempt to connect if parsing error
+    if (err) return callback(err);
+
+    // Flatten
+    const object = transform(_object);
+
+    // Parse the string
+    const _finalOptions = createUnifiedOptions(object, options);
+
+    // Check if we have connection and socket timeout set
+    if (_finalOptions.socketTimeoutMS == null) _finalOptions.socketTimeoutMS = 0;
+    if (_finalOptions.connectTimeoutMS == null) _finalOptions.connectTimeoutMS = 10000;
+    if (_finalOptions.retryWrites == null) _finalOptions.retryWrites = true;
+    if (_finalOptions.useRecoveryToken == null) _finalOptions.useRecoveryToken = true;
+    if (_finalOptions.readPreference == null) _finalOptions.readPreference = 'primary';
+
+    if (_finalOptions.db_options && _finalOptions.db_options.auth) {
+      delete _finalOptions.db_options.auth;
+    }
+
+    // resolve tls options if needed
+    resolveTLSOptions(_finalOptions);
+
+    // Store the merged options object
+    mongoClient.s.options = _finalOptions;
+
+    // Apply read and write concern from parsed url
+    mongoClient.s.readPreference = ReadPreference.fromOptions(_finalOptions);
+    mongoClient.s.writeConcern = WriteConcern.fromOptions(_finalOptions);
+
+    // Failure modes
+    if (object.servers.length === 0) {
+      return callback(new Error('connection string must contain at least one seed host'));
+    }
+
+    if (_finalOptions.auth && !_finalOptions.credentials) {
+      try {
+        didRequestAuthentication = true;
+        _finalOptions.credentials = generateCredentials(
+          mongoClient,
+          _finalOptions.auth.user,
+          _finalOptions.auth.password,
+          _finalOptions
+        );
+      } catch (err) {
+        return callback(err);
+      }
+    }
+
+    if (_finalOptions.useUnifiedTopology) {
+      return createTopology(mongoClient, 'unified', _finalOptions, connectCallback);
+    }
+
+    emitWarningOnce(
+      'Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.'
+    );
+
+    // Do we have a replicaset then skip discovery and go straight to connectivity
+    if (_finalOptions.replicaSet || _finalOptions.rs_name) {
+      return createTopology(mongoClient, 'replicaset', _finalOptions, connectCallback);
+    } else if (object.servers.length > 1) {
+      return createTopology(mongoClient, 'mongos', _finalOptions, connectCallback);
+    } else {
+      return createServer(mongoClient, _finalOptions, connectCallback);
+    }
+  });
+
+  function connectCallback(err, topology) {
+    const warningMessage = `seed list contains no mongos proxies, replicaset connections requires the parameter replicaSet to be supplied in the URI or options object, mongodb://server:port/db?replicaSet=name`;
+    if (err && err.message === 'no mongos proxies found in seed list') {
+      if (logger.isWarn()) {
+        logger.warn(warningMessage);
+      }
+
+      // Return a more specific error message for MongoClient.connect
+      return callback(new MongoError(warningMessage));
+    }
+
+    if (didRequestAuthentication) {
+      mongoClient.emit('authenticated', null, true);
+    }
+
+    // Return the error and db instance
+    callback(err, topology);
+  }
+}
+
+function connectWithUrl(mongoClient, url, options, connectCallback) {
+  // Set the topology
+  assignTopology(mongoClient, url);
+
+  // Add listeners
+  addListeners(mongoClient, url);
+
+  // Propagate the events to the client
+  relayEvents(mongoClient, url);
+
+  let finalOptions = Object.assign({}, options);
+
+  // If we have a readPreference passed in by the db options, convert it from a string
+  if (typeof options.readPreference === 'string' || typeof options.read_preference === 'string') {
+    finalOptions.readPreference = new ReadPreference(
+      options.readPreference || options.read_preference
+    );
+  }
+
+  const isDoingAuth = finalOptions.user || finalOptions.password || finalOptions.authMechanism;
+  if (isDoingAuth && !finalOptions.credentials) {
+    try {
+      finalOptions.credentials = generateCredentials(
+        mongoClient,
+        finalOptions.user,
+        finalOptions.password,
+        finalOptions
+      );
+    } catch (err) {
+      return connectCallback(err, url);
+    }
+  }
+
+  return url.connect(finalOptions, connectCallback);
+}
+
+function createListener(mongoClient, event) {
+  const eventSet = new Set(['all', 'fullsetup', 'open', 'reconnect']);
+  return (v1, v2) => {
+    if (eventSet.has(event)) {
+      return mongoClient.emit(event, mongoClient);
+    }
+
+    mongoClient.emit(event, v1, v2);
+  };
+}
+
+function createServer(mongoClient, options, callback) {
+  // Pass in the promise library
+  options.promiseLibrary = mongoClient.s.promiseLibrary;
+
+  // Set default options
+  const servers = translateOptions(options);
+
+  const server = servers[0];
+
+  // Propagate the events to the client
+  const collectedEvents = collectEvents(mongoClient, server);
+
+  // Connect to topology
+  server.connect(options, (err, topology) => {
+    if (err) {
+      server.close(true);
+      return callback(err);
+    }
+    // Clear out all the collected event listeners
+    clearAllEvents(server);
+
+    // Relay all the events
+    relayEvents(mongoClient, server);
+    // Add listeners
+    addListeners(mongoClient, server);
+    // Check if we are really speaking to a mongos
+    const ismaster = topology.lastIsMaster();
+
+    // Set the topology
+    assignTopology(mongoClient, topology);
+
+    // Do we actually have a mongos
+    if (ismaster && ismaster.msg === 'isdbgrid') {
+      // Destroy the current connection
+      topology.close();
+      // Create mongos connection instead
+      return createTopology(mongoClient, 'mongos', options, callback);
+    }
+
+    // Fire all the events
+    replayEvents(mongoClient, collectedEvents);
+    // Otherwise callback
+    callback(err, topology);
+  });
+}
+
+const DEPRECATED_UNIFIED_EVENTS = new Set([
+  'reconnect',
+  'reconnectFailed',
+  'attemptReconnect',
+  'joined',
+  'left',
+  'ping',
+  'ha',
+  'all',
+  'fullsetup',
+  'open'
+]);
+
+function registerDeprecatedEventNotifiers(client) {
+  client.on('newListener', eventName => {
+    if (DEPRECATED_UNIFIED_EVENTS.has(eventName)) {
+      emitDeprecationWarning(
+        `The \`${eventName}\` event is no longer supported by the unified topology, please read more by visiting http://bit.ly/2D8WfT6`,
+        'DeprecationWarning'
+      );
+    }
+  });
+}
+
+function createTopology(mongoClient, topologyType, options, callback) {
+  // Pass in the promise library
+  options.promiseLibrary = mongoClient.s.promiseLibrary;
+
+  const translationOptions = {};
+  if (topologyType === 'unified') translationOptions.createServers = false;
+
+  // Set default options
+  const servers = translateOptions(options, translationOptions);
+
+  // determine CSFLE support
+  if (options.autoEncryption != null) {
+    const Encrypter = require('../encrypter').Encrypter;
+    options.encrypter = new Encrypter(mongoClient, options);
+    options.autoEncrypter = options.encrypter.autoEncrypter;
+  }
+
+  // Create the topology
+  let topology;
+  if (topologyType === 'mongos') {
+    topology = new Mongos(servers, options);
+  } else if (topologyType === 'replicaset') {
+    topology = new ReplSet(servers, options);
+  } else if (topologyType === 'unified') {
+    topology = new NativeTopology(options.servers, options);
+    registerDeprecatedEventNotifiers(mongoClient);
+  }
+
+  // Add listeners
+  addListeners(mongoClient, topology);
+
+  // Propagate the events to the client
+  relayEvents(mongoClient, topology);
+
+  // Open the connection
+  assignTopology(mongoClient, topology);
+
+  // initialize CSFLE if requested
+  if (options.autoEncrypter) {
+    options.autoEncrypter.init(err => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      topology.connect(options, err => {
+        if (err) {
+          topology.close(true);
+          callback(err);
+          return;
+        }
+
+        options.encrypter.connectInternalClient(error => {
+          if (error) return callback(error);
+          callback(undefined, topology);
+        });
+      });
+    });
+
+    return;
+  }
+
+  // otherwise connect normally
+  topology.connect(options, err => {
+    if (err) {
+      topology.close(true);
+      return callback(err);
+    }
+
+    callback(undefined, topology);
+    return;
+  });
+}
+
+function createUnifiedOptions(finalOptions, options) {
+  const childOptions = [
+    'mongos',
+    'server',
+    'db',
+    'replset',
+    'db_options',
+    'server_options',
+    'rs_options',
+    'mongos_options'
+  ];
+  const noMerge = ['readconcern', 'compression', 'autoencryption'];
+  const skip = ['w', 'wtimeout', 'j', 'journal', 'fsync', 'writeconcern'];
+
+  for (const name in options) {
+    if (skip.indexOf(name.toLowerCase()) !== -1) {
+      continue;
+    } else if (noMerge.indexOf(name.toLowerCase()) !== -1) {
+      finalOptions[name] = options[name];
+    } else if (childOptions.indexOf(name.toLowerCase()) !== -1) {
+      finalOptions = mergeOptions(finalOptions, options[name], false);
+    } else {
+      if (
+        options[name] &&
+        typeof options[name] === 'object' &&
+        !Buffer.isBuffer(options[name]) &&
+        !Array.isArray(options[name])
+      ) {
+        finalOptions = mergeOptions(finalOptions, options[name], true);
+      } else {
+        finalOptions[name] = options[name];
+      }
+    }
+  }
+
+  // Handle write concern keys separately, since `options` may have the keys at the top level or
+  // under `options.writeConcern`. The final merged keys will be under `finalOptions.writeConcern`.
+  // This way, `fromOptions` will warn once if `options` is using deprecated write concern options
+  const optionsWriteConcern = WriteConcern.fromOptions(options);
+  if (optionsWriteConcern) {
+    finalOptions.writeConcern = Object.assign({}, finalOptions.writeConcern, optionsWriteConcern);
+  }
+
+  return finalOptions;
+}
+
+function generateCredentials(client, username, password, options) {
+  options = Object.assign({}, options);
+
+  // the default db to authenticate against is 'self'
+  // if authententicate is called from a retry context, it may be another one, like admin
+  const source = options.authSource || options.authdb || options.dbName;
+
+  // authMechanism
+  const authMechanismRaw = options.authMechanism || 'DEFAULT';
+  const authMechanism = authMechanismRaw.toUpperCase();
+  const mechanismProperties = options.authMechanismProperties;
+
+  if (!VALID_AUTH_MECHANISMS.has(authMechanism)) {
+    throw MongoError.create({
+      message: `authentication mechanism ${authMechanismRaw} not supported', options.authMechanism`,
+      driver: true
+    });
+  }
+
+  return new MongoCredentials({
+    mechanism: AUTH_MECHANISM_INTERNAL_MAP[authMechanism],
+    mechanismProperties,
+    source,
+    username,
+    password
+  });
+}
+
+function legacyTransformUrlOptions(object) {
+  return mergeOptions(createUnifiedOptions({}, object), object, false);
+}
+
+function mergeOptions(target, source, flatten) {
+  for (const name in source) {
+    if (source[name] && typeof source[name] === 'object' && flatten) {
+      target = mergeOptions(target, source[name], flatten);
+    } else {
+      target[name] = source[name];
+    }
+  }
+
+  return target;
+}
+
+function relayEvents(mongoClient, topology) {
+  const serverOrCommandEvents = [
+    // APM
+    'commandStarted',
+    'commandSucceeded',
+    'commandFailed',
+
+    // SDAM
+    'serverOpening',
+    'serverClosed',
+    'serverDescriptionChanged',
+    'serverHeartbeatStarted',
+    'serverHeartbeatSucceeded',
+    'serverHeartbeatFailed',
+    'topologyOpening',
+    'topologyClosed',
+    'topologyDescriptionChanged',
+
+    // Legacy
+    'joined',
+    'left',
+    'ping',
+    'ha'
+  ].concat(CMAP_EVENT_NAMES);
+
+  serverOrCommandEvents.forEach(event => {
+    topology.on(event, (object1, object2) => {
+      mongoClient.emit(event, object1, object2);
+    });
+  });
+}
+
+//
+// Replay any events due to single server connection switching to Mongos
+//
+function replayEvents(mongoClient, events) {
+  for (let i = 0; i < events.length; i++) {
+    mongoClient.emit(events[i].event, events[i].object1, events[i].object2);
+  }
+}
+
+function transformUrlOptions(_object) {
+  let object = Object.assign({ servers: _object.hosts }, _object.options);
+  for (let name in object) {
+    const camelCaseName = LEGACY_OPTIONS_MAP[name];
+    if (camelCaseName) {
+      object[camelCaseName] = object[name];
+    }
+  }
+
+  const hasUsername = _object.auth && _object.auth.username;
+  const hasAuthMechanism = _object.options && _object.options.authMechanism;
+  if (hasUsername || hasAuthMechanism) {
+    object.auth = Object.assign({}, _object.auth);
+    if (object.auth.db) {
+      object.authSource = object.authSource || object.auth.db;
+    }
+
+    if (object.auth.username) {
+      object.auth.user = object.auth.username;
+    }
+  }
+
+  if (_object.defaultDatabase) {
+    object.dbName = _object.defaultDatabase;
+  }
+
+  if (object.maxPoolSize) {
+    object.poolSize = object.maxPoolSize;
+  }
+
+  if (object.readConcernLevel) {
+    object.readConcern = new ReadConcern(object.readConcernLevel);
+  }
+
+  if (object.wTimeoutMS) {
+    object.wtimeout = object.wTimeoutMS;
+    object.wTimeoutMS = undefined;
+  }
+
+  if (_object.srvHost) {
+    object.srvHost = _object.srvHost;
+  }
+
+  // Any write concern options from the URL will be top-level, so we manually
+  // move them options under `object.writeConcern` to avoid warnings later
+  const wcKeys = ['w', 'wtimeout', 'j', 'journal', 'fsync'];
+  for (const key of wcKeys) {
+    if (object[key] !== undefined) {
+      if (object.writeConcern === undefined) object.writeConcern = {};
+      object.writeConcern[key] = object[key];
+      object[key] = undefined;
+    }
+  }
+
+  return object;
+}
+
+function translateOptions(options, translationOptions) {
+  translationOptions = Object.assign({}, { createServers: true }, translationOptions);
+
+  // If we have a readPreference passed in by the db options
+  if (typeof options.readPreference === 'string' || typeof options.read_preference === 'string') {
+    options.readPreference = new ReadPreference(options.readPreference || options.read_preference);
+  }
+
+  // Do we have readPreference tags, add them
+  if (options.readPreference && (options.readPreferenceTags || options.read_preference_tags)) {
+    options.readPreference.tags = options.readPreferenceTags || options.read_preference_tags;
+  }
+
+  // Do we have maxStalenessSeconds
+  if (options.maxStalenessSeconds) {
+    options.readPreference.maxStalenessSeconds = options.maxStalenessSeconds;
+  }
+
+  // Set the socket and connection timeouts
+  if (options.socketTimeoutMS == null) options.socketTimeoutMS = 0;
+  if (options.connectTimeoutMS == null) options.connectTimeoutMS = 10000;
+
+  if (!translationOptions.createServers) {
+    return;
+  }
+
+  // Create server instances
+  return options.servers.map(serverObj => {
+    return serverObj.domain_socket
+      ? new Server(serverObj.domain_socket, 27017, options)
+      : new Server(serverObj.host, serverObj.port, options);
+  });
+}
+
+module.exports = { validOptions, connect };
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/count.js b/NodeAPI/node_modules/mongodb/lib/operations/count.js
new file mode 100644
index 0000000000000000000000000000000000000000..a7216d6a9e998194213d95bc7e504f619893fecf
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/count.js
@@ -0,0 +1,68 @@
+'use strict';
+
+const buildCountCommand = require('./common_functions').buildCountCommand;
+const OperationBase = require('./operation').OperationBase;
+
+class CountOperation extends OperationBase {
+  constructor(cursor, applySkipLimit, options) {
+    super(options);
+
+    this.cursor = cursor;
+    this.applySkipLimit = applySkipLimit;
+  }
+
+  execute(callback) {
+    const cursor = this.cursor;
+    const applySkipLimit = this.applySkipLimit;
+    const options = this.options;
+
+    if (applySkipLimit) {
+      if (typeof cursor.cursorSkip() === 'number') options.skip = cursor.cursorSkip();
+      if (typeof cursor.cursorLimit() === 'number') options.limit = cursor.cursorLimit();
+    }
+
+    // Ensure we have the right read preference inheritance
+    if (options.readPreference) {
+      cursor.setReadPreference(options.readPreference);
+    }
+
+    if (
+      typeof options.maxTimeMS !== 'number' &&
+      cursor.cmd &&
+      typeof cursor.cmd.maxTimeMS === 'number'
+    ) {
+      options.maxTimeMS = cursor.cmd.maxTimeMS;
+    }
+
+    let finalOptions = {};
+    finalOptions.skip = options.skip;
+    finalOptions.limit = options.limit;
+    finalOptions.hint = options.hint;
+    finalOptions.maxTimeMS = options.maxTimeMS;
+
+    // Command
+    finalOptions.collectionName = cursor.namespace.collection;
+
+    let command;
+    try {
+      command = buildCountCommand(cursor, cursor.cmd.query, finalOptions);
+    } catch (err) {
+      return callback(err);
+    }
+
+    // Set cursor server to the same as the topology
+    cursor.server = cursor.topology.s.coreTopology;
+
+    // Execute the command
+    cursor.topology.command(
+      cursor.namespace.withCollection('$cmd'),
+      command,
+      cursor.options,
+      (err, result) => {
+        callback(err, result ? result.result.n : null);
+      }
+    );
+  }
+}
+
+module.exports = CountOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/count_documents.js b/NodeAPI/node_modules/mongodb/lib/operations/count_documents.js
new file mode 100644
index 0000000000000000000000000000000000000000..d043abfa769b0122d9c4e1e198cb054ebe6cf2e1
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/count_documents.js
@@ -0,0 +1,41 @@
+'use strict';
+
+const AggregateOperation = require('./aggregate');
+
+class CountDocumentsOperation extends AggregateOperation {
+  constructor(collection, query, options) {
+    const pipeline = [{ $match: query }];
+    if (typeof options.skip === 'number') {
+      pipeline.push({ $skip: options.skip });
+    }
+
+    if (typeof options.limit === 'number') {
+      pipeline.push({ $limit: options.limit });
+    }
+
+    pipeline.push({ $group: { _id: 1, n: { $sum: 1 } } });
+
+    super(collection, pipeline, options);
+  }
+
+  execute(server, callback) {
+    super.execute(server, (err, result) => {
+      if (err) {
+        callback(err, null);
+        return;
+      }
+
+      // NOTE: We're avoiding creating a cursor here to reduce the callstack.
+      const response = result.result;
+      if (response.cursor == null || response.cursor.firstBatch == null) {
+        callback(null, 0);
+        return;
+      }
+
+      const docs = response.cursor.firstBatch;
+      callback(null, docs.length ? docs[0].n : 0);
+    });
+  }
+}
+
+module.exports = CountDocumentsOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/create_collection.js b/NodeAPI/node_modules/mongodb/lib/operations/create_collection.js
new file mode 100644
index 0000000000000000000000000000000000000000..c84adb02fff09f48639f91815ac769dee0163adc
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/create_collection.js
@@ -0,0 +1,102 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const CommandOperation = require('./command');
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const loadCollection = require('../dynamic_loaders').loadCollection;
+const MongoError = require('../core').MongoError;
+const ReadPreference = require('../core').ReadPreference;
+
+const ILLEGAL_COMMAND_FIELDS = new Set([
+  'w',
+  'wtimeout',
+  'j',
+  'fsync',
+  'autoIndexId',
+  'strict',
+  'serializeFunctions',
+  'pkFactory',
+  'raw',
+  'readPreference',
+  'session',
+  'readConcern',
+  'writeConcern'
+]);
+
+class CreateCollectionOperation extends CommandOperation {
+  constructor(db, name, options) {
+    super(db, options);
+    this.name = name;
+  }
+
+  _buildCommand() {
+    const name = this.name;
+    const options = this.options;
+
+    const cmd = { create: name };
+    for (let n in options) {
+      if (
+        options[n] != null &&
+        typeof options[n] !== 'function' &&
+        !ILLEGAL_COMMAND_FIELDS.has(n)
+      ) {
+        cmd[n] = options[n];
+      }
+    }
+
+    return cmd;
+  }
+
+  execute(callback) {
+    const db = this.db;
+    const name = this.name;
+    const options = this.options;
+    const Collection = loadCollection();
+
+    let listCollectionOptions = Object.assign({ nameOnly: true, strict: false }, options);
+    listCollectionOptions = applyWriteConcern(listCollectionOptions, { db }, listCollectionOptions);
+
+    function done(err) {
+      if (err) {
+        return callback(err);
+      }
+
+      try {
+        callback(
+          null,
+          new Collection(db, db.s.topology, db.databaseName, name, db.s.pkFactory, options)
+        );
+      } catch (err) {
+        callback(err);
+      }
+    }
+
+    const strictMode = listCollectionOptions.strict;
+    if (strictMode) {
+      db.listCollections({ name }, listCollectionOptions)
+        .setReadPreference(ReadPreference.PRIMARY)
+        .toArray((err, collections) => {
+          if (err) {
+            return callback(err);
+          }
+
+          if (collections.length > 0) {
+            return callback(
+              new MongoError(`Collection ${name} already exists. Currently in strict mode.`)
+            );
+          }
+
+          super.execute(done);
+        });
+
+      return;
+    }
+
+    // otherwise just execute the command
+    super.execute(done);
+  }
+}
+
+defineAspects(CreateCollectionOperation, Aspect.WRITE_OPERATION);
+module.exports = CreateCollectionOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/create_indexes.js b/NodeAPI/node_modules/mongodb/lib/operations/create_indexes.js
new file mode 100644
index 0000000000000000000000000000000000000000..211b43cdcd98bd1c7be51bf92fc5b7f8a25272f9
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/create_indexes.js
@@ -0,0 +1,137 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const CommandOperationV2 = require('./command_v2');
+const MongoError = require('../core').MongoError;
+const parseIndexOptions = require('../utils').parseIndexOptions;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+
+const VALID_INDEX_OPTIONS = new Set([
+  'background',
+  'unique',
+  'name',
+  'partialFilterExpression',
+  'sparse',
+  'expireAfterSeconds',
+  'storageEngine',
+  'collation',
+
+  // text indexes
+  'weights',
+  'default_language',
+  'language_override',
+  'textIndexVersion',
+
+  // 2d-sphere indexes
+  '2dsphereIndexVersion',
+
+  // 2d indexes
+  'bits',
+  'min',
+  'max',
+
+  // geoHaystack Indexes
+  'bucketSize',
+
+  // wildcard indexes
+  'wildcardProjection'
+]);
+
+class CreateIndexesOperation extends CommandOperationV2 {
+  /**
+   * @ignore
+   */
+  constructor(parent, collection, indexes, options) {
+    super(parent, options);
+    this.collection = collection;
+
+    // createIndex can be called with a variety of styles:
+    //   coll.createIndex('a');
+    //   coll.createIndex({ a: 1 });
+    //   coll.createIndex([['a', 1]]);
+    // createIndexes is always called with an array of index spec objects
+    if (!Array.isArray(indexes) || Array.isArray(indexes[0])) {
+      this.onlyReturnNameOfCreatedIndex = true;
+      // TODO: remove in v4 (breaking change); make createIndex return full response as createIndexes does
+
+      const indexParameters = parseIndexOptions(indexes);
+      // Generate the index name
+      const name = typeof options.name === 'string' ? options.name : indexParameters.name;
+      // Set up the index
+      const indexSpec = { name, key: indexParameters.fieldHash };
+      // merge valid index options into the index spec
+      for (let optionName in options) {
+        if (VALID_INDEX_OPTIONS.has(optionName)) {
+          indexSpec[optionName] = options[optionName];
+        }
+      }
+      this.indexes = [indexSpec];
+      return;
+    }
+
+    this.indexes = indexes;
+  }
+
+  /**
+   * @ignore
+   */
+  execute(server, callback) {
+    const options = this.options;
+    const indexes = this.indexes;
+
+    const serverWireVersion = maxWireVersion(server);
+
+    // Ensure we generate the correct name if the parameter is not set
+    for (let i = 0; i < indexes.length; i++) {
+      // Did the user pass in a collation, check if our write server supports it
+      if (indexes[i].collation && serverWireVersion < 5) {
+        callback(
+          new MongoError(
+            `Server ${server.name}, which reports wire version ${serverWireVersion}, does not support collation`
+          )
+        );
+        return;
+      }
+
+      if (indexes[i].name == null) {
+        const keys = [];
+
+        for (let name in indexes[i].key) {
+          keys.push(`${name}_${indexes[i].key[name]}`);
+        }
+
+        // Set the name
+        indexes[i].name = keys.join('_');
+      }
+    }
+
+    const cmd = { createIndexes: this.collection, indexes };
+
+    if (options.commitQuorum != null) {
+      if (serverWireVersion < 9) {
+        callback(
+          new MongoError('`commitQuorum` option for `createIndexes` not supported on servers < 4.4')
+        );
+        return;
+      }
+      cmd.commitQuorum = options.commitQuorum;
+    }
+
+    // collation is set on each index, it should not be defined at the root
+    this.options.collation = undefined;
+
+    super.executeCommand(server, cmd, (err, result) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      callback(null, this.onlyReturnNameOfCreatedIndex ? indexes[0].name : result);
+    });
+  }
+}
+
+defineAspects(CreateIndexesOperation, [Aspect.WRITE_OPERATION, Aspect.EXECUTE_WITH_SELECTION]);
+
+module.exports = CreateIndexesOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/cursor_ops.js b/NodeAPI/node_modules/mongodb/lib/operations/cursor_ops.js
new file mode 100644
index 0000000000000000000000000000000000000000..fda4c91491b85ecff10ba4c46658ce7e25259b8a
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/cursor_ops.js
@@ -0,0 +1,167 @@
+'use strict';
+
+const buildCountCommand = require('./collection_ops').buildCountCommand;
+const handleCallback = require('../utils').handleCallback;
+const MongoError = require('../core').MongoError;
+const push = Array.prototype.push;
+const CursorState = require('../core/cursor').CursorState;
+
+/**
+ * Get the count of documents for this cursor.
+ *
+ * @method
+ * @param {Cursor} cursor The Cursor instance on which to count.
+ * @param {boolean} [applySkipLimit=true] Specifies whether the count command apply limit and skip settings should be applied on the cursor or in the provided options.
+ * @param {object} [options] Optional settings. See Cursor.prototype.count for a list of options.
+ * @param {Cursor~countResultCallback} [callback] The result callback.
+ */
+function count(cursor, applySkipLimit, opts, callback) {
+  if (applySkipLimit) {
+    if (typeof cursor.cursorSkip() === 'number') opts.skip = cursor.cursorSkip();
+    if (typeof cursor.cursorLimit() === 'number') opts.limit = cursor.cursorLimit();
+  }
+
+  // Ensure we have the right read preference inheritance
+  if (opts.readPreference) {
+    cursor.setReadPreference(opts.readPreference);
+  }
+
+  if (
+    typeof opts.maxTimeMS !== 'number' &&
+    cursor.cmd &&
+    typeof cursor.cmd.maxTimeMS === 'number'
+  ) {
+    opts.maxTimeMS = cursor.cmd.maxTimeMS;
+  }
+
+  let options = {};
+  options.skip = opts.skip;
+  options.limit = opts.limit;
+  options.hint = opts.hint;
+  options.maxTimeMS = opts.maxTimeMS;
+
+  // Command
+  options.collectionName = cursor.namespace.collection;
+
+  let command;
+  try {
+    command = buildCountCommand(cursor, cursor.cmd.query, options);
+  } catch (err) {
+    return callback(err);
+  }
+
+  // Set cursor server to the same as the topology
+  cursor.server = cursor.topology.s.coreTopology;
+
+  // Execute the command
+  cursor.topology.command(
+    cursor.namespace.withCollection('$cmd'),
+    command,
+    cursor.options,
+    (err, result) => {
+      callback(err, result ? result.result.n : null);
+    }
+  );
+}
+
+/**
+ * Iterates over all the documents for this cursor. See Cursor.prototype.each for more information.
+ *
+ * @method
+ * @deprecated
+ * @param {Cursor} cursor The Cursor instance on which to run.
+ * @param {Cursor~resultCallback} callback The result callback.
+ */
+function each(cursor, callback) {
+  if (!callback) throw MongoError.create({ message: 'callback is mandatory', driver: true });
+  if (cursor.isNotified()) return;
+  if (cursor.s.state === CursorState.CLOSED || cursor.isDead()) {
+    return handleCallback(
+      callback,
+      MongoError.create({ message: 'Cursor is closed', driver: true })
+    );
+  }
+
+  if (cursor.s.state === CursorState.INIT) {
+    cursor.s.state = CursorState.OPEN;
+  }
+
+  // Define function to avoid global scope escape
+  let fn = null;
+  // Trampoline all the entries
+  if (cursor.bufferedCount() > 0) {
+    while ((fn = loop(cursor, callback))) fn(cursor, callback);
+    each(cursor, callback);
+  } else {
+    cursor.next((err, item) => {
+      if (err) return handleCallback(callback, err);
+      if (item == null) {
+        return cursor.close({ skipKillCursors: true }, () => handleCallback(callback, null, null));
+      }
+
+      if (handleCallback(callback, null, item) === false) return;
+      each(cursor, callback);
+    });
+  }
+}
+
+// Trampoline emptying the number of retrieved items
+// without incurring a nextTick operation
+function loop(cursor, callback) {
+  // No more items we are done
+  if (cursor.bufferedCount() === 0) return;
+  // Get the next document
+  cursor._next(callback);
+  // Loop
+  return loop;
+}
+
+/**
+ * Returns an array of documents. See Cursor.prototype.toArray for more information.
+ *
+ * @method
+ * @param {Cursor} cursor The Cursor instance from which to get the next document.
+ * @param {Cursor~toArrayResultCallback} [callback] The result callback.
+ */
+function toArray(cursor, callback) {
+  const items = [];
+
+  // Reset cursor
+  cursor.rewind();
+  cursor.s.state = CursorState.INIT;
+
+  // Fetch all the documents
+  const fetchDocs = () => {
+    cursor._next((err, doc) => {
+      if (err) {
+        return handleCallback(callback, err);
+      }
+
+      if (doc == null) {
+        return cursor.close({ skipKillCursors: true }, () => handleCallback(callback, null, items));
+      }
+
+      // Add doc to items
+      items.push(doc);
+
+      // Get all buffered objects
+      if (cursor.bufferedCount() > 0) {
+        let docs = cursor.readBufferedDocuments(cursor.bufferedCount());
+
+        // Transform the doc if transform method added
+        if (cursor.s.transforms && typeof cursor.s.transforms.doc === 'function') {
+          docs = docs.map(cursor.s.transforms.doc);
+        }
+
+        push.apply(items, docs);
+      }
+
+      // Attempt a fetch
+      fetchDocs();
+    });
+  };
+
+  fetchDocs();
+}
+
+module.exports = { count, each, toArray };
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/db_ops.js b/NodeAPI/node_modules/mongodb/lib/operations/db_ops.js
new file mode 100644
index 0000000000000000000000000000000000000000..8f9b89046b2f022d7155777add7e2c58e2a3b367
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/db_ops.js
@@ -0,0 +1,467 @@
+'use strict';
+
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const Code = require('../core').BSON.Code;
+const debugOptions = require('../utils').debugOptions;
+const handleCallback = require('../utils').handleCallback;
+const MongoError = require('../core').MongoError;
+const parseIndexOptions = require('../utils').parseIndexOptions;
+const ReadPreference = require('../core').ReadPreference;
+const toError = require('../utils').toError;
+const CONSTANTS = require('../constants');
+const MongoDBNamespace = require('../utils').MongoDBNamespace;
+
+const debugFields = [
+  'authSource',
+  'w',
+  'wtimeout',
+  'j',
+  'native_parser',
+  'forceServerObjectId',
+  'serializeFunctions',
+  'raw',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'bufferMaxEntries',
+  'numberOfRetries',
+  'retryMiliSeconds',
+  'readPreference',
+  'pkFactory',
+  'parentDb',
+  'promiseLibrary',
+  'noListener'
+];
+
+/**
+ * Creates an index on the db and collection.
+ * @method
+ * @param {Db} db The Db instance on which to create an index.
+ * @param {string} name Name of the collection to create the index on.
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings. See Db.prototype.createIndex for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback
+ */
+function createIndex(db, name, fieldOrSpec, options, callback) {
+  // Get the write concern options
+  let finalOptions = Object.assign({}, { readPreference: ReadPreference.PRIMARY }, options);
+  finalOptions = applyWriteConcern(finalOptions, { db }, options);
+
+  // Ensure we have a callback
+  if (finalOptions.writeConcern && typeof callback !== 'function') {
+    throw MongoError.create({
+      message: 'Cannot use a writeConcern without a provided callback',
+      driver: true
+    });
+  }
+
+  // Did the user destroy the topology
+  if (db.serverConfig && db.serverConfig.isDestroyed())
+    return callback(new MongoError('topology was destroyed'));
+
+  // Attempt to run using createIndexes command
+  createIndexUsingCreateIndexes(db, name, fieldOrSpec, finalOptions, (err, result) => {
+    if (err == null) return handleCallback(callback, err, result);
+
+    /**
+     * The following errors mean that the server recognized `createIndex` as a command so we don't need to fallback to an insert:
+     * 67 = 'CannotCreateIndex' (malformed index options)
+     * 85 = 'IndexOptionsConflict' (index already exists with different options)
+     * 86 = 'IndexKeySpecsConflict' (index already exists with the same name)
+     * 11000 = 'DuplicateKey' (couldn't build unique index because of dupes)
+     * 11600 = 'InterruptedAtShutdown' (interrupted at shutdown)
+     * 197 = 'InvalidIndexSpecificationOption' (`_id` with `background: true`)
+     */
+    if (
+      err.code === 67 ||
+      err.code === 11000 ||
+      err.code === 85 ||
+      err.code === 86 ||
+      err.code === 11600 ||
+      err.code === 197
+    ) {
+      return handleCallback(callback, err, result);
+    }
+
+    // Create command
+    const doc = createCreateIndexCommand(db, name, fieldOrSpec, options);
+    // Set no key checking
+    finalOptions.checkKeys = false;
+    // Insert document
+    db.s.topology.insert(
+      db.s.namespace.withCollection(CONSTANTS.SYSTEM_INDEX_COLLECTION),
+      doc,
+      finalOptions,
+      (err, result) => {
+        if (callback == null) return;
+        if (err) return handleCallback(callback, err);
+        if (result == null) return handleCallback(callback, null, null);
+        if (result.result.writeErrors)
+          return handleCallback(callback, MongoError.create(result.result.writeErrors[0]), null);
+        handleCallback(callback, null, doc.name);
+      }
+    );
+  });
+}
+
+// Add listeners to topology
+function createListener(db, e, object) {
+  function listener(err) {
+    if (object.listeners(e).length > 0) {
+      object.emit(e, err, db);
+
+      // Emit on all associated db's if available
+      for (let i = 0; i < db.s.children.length; i++) {
+        db.s.children[i].emit(e, err, db.s.children[i]);
+      }
+    }
+  }
+  return listener;
+}
+
+/**
+ * Ensures that an index exists. If it does not, creates it.
+ *
+ * @method
+ * @param {Db} db The Db instance on which to ensure the index.
+ * @param {string} name The index name
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {object} [options] Optional settings. See Db.prototype.ensureIndex for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback
+ */
+function ensureIndex(db, name, fieldOrSpec, options, callback) {
+  // Get the write concern options
+  const finalOptions = applyWriteConcern({}, { db }, options);
+  // Create command
+  const selector = createCreateIndexCommand(db, name, fieldOrSpec, options);
+  const index_name = selector.name;
+
+  // Did the user destroy the topology
+  if (db.serverConfig && db.serverConfig.isDestroyed())
+    return callback(new MongoError('topology was destroyed'));
+
+  // Merge primary readPreference
+  finalOptions.readPreference = ReadPreference.PRIMARY;
+
+  // Check if the index already exists
+  indexInformation(db, name, finalOptions, (err, indexInformation) => {
+    if (err != null && err.code !== 26) return handleCallback(callback, err, null);
+    // If the index does not exist, create it
+    if (indexInformation == null || !indexInformation[index_name]) {
+      createIndex(db, name, fieldOrSpec, options, callback);
+    } else {
+      if (typeof callback === 'function') return handleCallback(callback, null, index_name);
+    }
+  });
+}
+
+/**
+ * Evaluate JavaScript on the server
+ *
+ * @method
+ * @param {Db} db The Db instance.
+ * @param {Code} code JavaScript to execute on server.
+ * @param {(object|array)} parameters The parameters for the call.
+ * @param {object} [options] Optional settings. See Db.prototype.eval for a list of options.
+ * @param {Db~resultCallback} [callback] The results callback
+ * @deprecated Eval is deprecated on MongoDB 3.2 and forward
+ */
+function evaluate(db, code, parameters, options, callback) {
+  let finalCode = code;
+  let finalParameters = [];
+
+  // Did the user destroy the topology
+  if (db.serverConfig && db.serverConfig.isDestroyed())
+    return callback(new MongoError('topology was destroyed'));
+
+  // If not a code object translate to one
+  if (!(finalCode && finalCode._bsontype === 'Code')) finalCode = new Code(finalCode);
+  // Ensure the parameters are correct
+  if (parameters != null && !Array.isArray(parameters) && typeof parameters !== 'function') {
+    finalParameters = [parameters];
+  } else if (parameters != null && Array.isArray(parameters) && typeof parameters !== 'function') {
+    finalParameters = parameters;
+  }
+
+  // Create execution selector
+  let cmd = { $eval: finalCode, args: finalParameters };
+  // Check if the nolock parameter is passed in
+  if (options['nolock']) {
+    cmd['nolock'] = options['nolock'];
+  }
+
+  // Set primary read preference
+  options.readPreference = new ReadPreference(ReadPreference.PRIMARY);
+
+  // Execute the command
+  executeCommand(db, cmd, options, (err, result) => {
+    if (err) return handleCallback(callback, err, null);
+    if (result && result.ok === 1) return handleCallback(callback, null, result.retval);
+    if (result)
+      return handleCallback(
+        callback,
+        MongoError.create({ message: `eval failed: ${result.errmsg}`, driver: true }),
+        null
+      );
+    handleCallback(callback, err, result);
+  });
+}
+
+/**
+ * Execute a command
+ *
+ * @method
+ * @param {Db} db The Db instance on which to execute the command.
+ * @param {object} command The command hash
+ * @param {object} [options] Optional settings. See Db.prototype.command for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback
+ */
+function executeCommand(db, command, options, callback) {
+  // Did the user destroy the topology
+  if (db.serverConfig && db.serverConfig.isDestroyed())
+    return callback(new MongoError('topology was destroyed'));
+  // Get the db name we are executing against
+  const dbName = options.dbName || options.authdb || db.databaseName;
+
+  // Convert the readPreference if its not a write
+  options.readPreference = ReadPreference.resolve(db, options);
+
+  // Debug information
+  if (db.s.logger.isDebug())
+    db.s.logger.debug(
+      `executing command ${JSON.stringify(
+        command
+      )} against ${dbName}.$cmd with options [${JSON.stringify(
+        debugOptions(debugFields, options)
+      )}]`
+    );
+
+  // Execute command
+  db.s.topology.command(db.s.namespace.withCollection('$cmd'), command, options, (err, result) => {
+    if (err) return handleCallback(callback, err);
+    if (options.full) return handleCallback(callback, null, result);
+    handleCallback(callback, null, result.result);
+  });
+}
+
+/**
+ * Runs a command on the database as admin.
+ *
+ * @method
+ * @param {Db} db The Db instance on which to execute the command.
+ * @param {object} command The command hash
+ * @param {object} [options] Optional settings. See Db.prototype.executeDbAdminCommand for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback
+ */
+function executeDbAdminCommand(db, command, options, callback) {
+  const namespace = new MongoDBNamespace('admin', '$cmd');
+
+  db.s.topology.command(namespace, command, options, (err, result) => {
+    // Did the user destroy the topology
+    if (db.serverConfig && db.serverConfig.isDestroyed()) {
+      return callback(new MongoError('topology was destroyed'));
+    }
+
+    if (err) return handleCallback(callback, err);
+    handleCallback(callback, null, result.result);
+  });
+}
+
+/**
+ * Retrieves this collections index info.
+ *
+ * @method
+ * @param {Db} db The Db instance on which to retrieve the index info.
+ * @param {string} name The name of the collection.
+ * @param {object} [options] Optional settings. See Db.prototype.indexInformation for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback
+ */
+function indexInformation(db, name, options, callback) {
+  // If we specified full information
+  const full = options['full'] == null ? false : options['full'];
+
+  // Did the user destroy the topology
+  if (db.serverConfig && db.serverConfig.isDestroyed())
+    return callback(new MongoError('topology was destroyed'));
+  // Process all the results from the index command and collection
+  function processResults(indexes) {
+    // Contains all the information
+    let info = {};
+    // Process all the indexes
+    for (let i = 0; i < indexes.length; i++) {
+      const index = indexes[i];
+      // Let's unpack the object
+      info[index.name] = [];
+      for (let name in index.key) {
+        info[index.name].push([name, index.key[name]]);
+      }
+    }
+
+    return info;
+  }
+
+  // Get the list of indexes of the specified collection
+  db.collection(name)
+    .listIndexes(options)
+    .toArray((err, indexes) => {
+      if (err) return callback(toError(err));
+      if (!Array.isArray(indexes)) return handleCallback(callback, null, []);
+      if (full) return handleCallback(callback, null, indexes);
+      handleCallback(callback, null, processResults(indexes));
+    });
+}
+
+/**
+ * Retrieve the current profiling information for MongoDB
+ *
+ * @method
+ * @param {Db} db The Db instance on which to retrieve the profiling info.
+ * @param {Object} [options] Optional settings. See Db.protoype.profilingInfo for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback.
+ * @deprecated Query the system.profile collection directly.
+ */
+function profilingInfo(db, options, callback) {
+  try {
+    db.collection('system.profile')
+      .find({}, options)
+      .toArray(callback);
+  } catch (err) {
+    return callback(err, null);
+  }
+}
+
+// Validate the database name
+function validateDatabaseName(databaseName) {
+  if (typeof databaseName !== 'string')
+    throw MongoError.create({ message: 'database name must be a string', driver: true });
+  if (databaseName.length === 0)
+    throw MongoError.create({ message: 'database name cannot be the empty string', driver: true });
+  if (databaseName === '$external') return;
+
+  const invalidChars = [' ', '.', '$', '/', '\\'];
+  for (let i = 0; i < invalidChars.length; i++) {
+    if (databaseName.indexOf(invalidChars[i]) !== -1)
+      throw MongoError.create({
+        message: "database names cannot contain the character '" + invalidChars[i] + "'",
+        driver: true
+      });
+  }
+}
+
+/**
+ * Create the command object for Db.prototype.createIndex.
+ *
+ * @param {Db} db The Db instance on which to create the command.
+ * @param {string} name Name of the collection to create the index on.
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {Object} [options] Optional settings. See Db.prototype.createIndex for a list of options.
+ * @return {Object} The insert command object.
+ */
+function createCreateIndexCommand(db, name, fieldOrSpec, options) {
+  const indexParameters = parseIndexOptions(fieldOrSpec);
+  const fieldHash = indexParameters.fieldHash;
+
+  // Generate the index name
+  const indexName = typeof options.name === 'string' ? options.name : indexParameters.name;
+  const selector = {
+    ns: db.s.namespace.withCollection(name).toString(),
+    key: fieldHash,
+    name: indexName
+  };
+
+  // Ensure we have a correct finalUnique
+  const finalUnique = options == null || 'object' === typeof options ? false : options;
+  // Set up options
+  options = options == null || typeof options === 'boolean' ? {} : options;
+
+  // Add all the options
+  const keysToOmit = Object.keys(selector);
+  for (let optionName in options) {
+    if (keysToOmit.indexOf(optionName) === -1) {
+      selector[optionName] = options[optionName];
+    }
+  }
+
+  if (selector['unique'] == null) selector['unique'] = finalUnique;
+
+  // Remove any write concern operations
+  const removeKeys = ['w', 'wtimeout', 'j', 'fsync', 'readPreference', 'session'];
+  for (let i = 0; i < removeKeys.length; i++) {
+    delete selector[removeKeys[i]];
+  }
+
+  // Return the command creation selector
+  return selector;
+}
+
+/**
+ * Create index using the createIndexes command.
+ *
+ * @param {Db} db The Db instance on which to execute the command.
+ * @param {string} name Name of the collection to create the index on.
+ * @param {(string|object)} fieldOrSpec Defines the index.
+ * @param {Object} [options] Optional settings. See Db.prototype.createIndex for a list of options.
+ * @param {Db~resultCallback} [callback] The command result callback.
+ */
+function createIndexUsingCreateIndexes(db, name, fieldOrSpec, options, callback) {
+  // Build the index
+  const indexParameters = parseIndexOptions(fieldOrSpec);
+  // Generate the index name
+  const indexName = typeof options.name === 'string' ? options.name : indexParameters.name;
+  // Set up the index
+  const indexes = [{ name: indexName, key: indexParameters.fieldHash }];
+  // merge all the options
+  const keysToOmit = Object.keys(indexes[0]).concat([
+    'writeConcern',
+    'w',
+    'wtimeout',
+    'j',
+    'fsync',
+    'readPreference',
+    'session'
+  ]);
+
+  for (let optionName in options) {
+    if (keysToOmit.indexOf(optionName) === -1) {
+      indexes[0][optionName] = options[optionName];
+    }
+  }
+
+  // Get capabilities
+  const capabilities = db.s.topology.capabilities();
+
+  // Did the user pass in a collation, check if our write server supports it
+  if (indexes[0].collation && capabilities && !capabilities.commandsTakeCollation) {
+    // Create a new error
+    const error = new MongoError('server/primary/mongos does not support collation');
+    error.code = 67;
+    // Return the error
+    return callback(error);
+  }
+
+  // Create command, apply write concern to command
+  const cmd = applyWriteConcern({ createIndexes: name, indexes }, { db }, options);
+
+  // ReadPreference primary
+  options.readPreference = ReadPreference.PRIMARY;
+
+  // Build the command
+  executeCommand(db, cmd, options, (err, result) => {
+    if (err) return handleCallback(callback, err, null);
+    if (result.ok === 0) return handleCallback(callback, toError(result), null);
+    // Return the indexName for backward compatibility
+    handleCallback(callback, null, indexName);
+  });
+}
+
+module.exports = {
+  createListener,
+  createIndex,
+  ensureIndex,
+  evaluate,
+  executeCommand,
+  executeDbAdminCommand,
+  indexInformation,
+  profilingInfo,
+  validateDatabaseName
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/delete_many.js b/NodeAPI/node_modules/mongodb/lib/operations/delete_many.js
new file mode 100644
index 0000000000000000000000000000000000000000..32ae500ddabffad469b015ddcc0ae3cd7745ace1
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/delete_many.js
@@ -0,0 +1,38 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const removeDocuments = require('./common_functions').removeDocuments;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+
+class DeleteManyOperation extends OperationBase {
+  constructor(collection, filter, options) {
+    super(options);
+
+    this.collection = collection;
+    this.filter = filter;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const filter = this.filter;
+    const options = this.options;
+
+    options.single = false;
+    removeDocuments(coll, filter, options, (err, r) => {
+      if (callback == null) return;
+      if (err && callback) return callback(err);
+      if (r == null) return callback(null, { result: { ok: 1 } });
+
+      // If an explain operation was executed, don't process the server results
+      if (this.explain) return callback(undefined, r.result);
+
+      r.deletedCount = r.result.n;
+      callback(null, r);
+    });
+  }
+}
+
+defineAspects(DeleteManyOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = DeleteManyOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/delete_one.js b/NodeAPI/node_modules/mongodb/lib/operations/delete_one.js
new file mode 100644
index 0000000000000000000000000000000000000000..9aec05b99ed533498c917dad5ea610c68a6e2f69
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/delete_one.js
@@ -0,0 +1,38 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const removeDocuments = require('./common_functions').removeDocuments;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+
+class DeleteOneOperation extends OperationBase {
+  constructor(collection, filter, options) {
+    super(options);
+
+    this.collection = collection;
+    this.filter = filter;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const filter = this.filter;
+    const options = this.options;
+
+    options.single = true;
+    removeDocuments(coll, filter, options, (err, r) => {
+      if (callback == null) return;
+      if (err && callback) return callback(err);
+      if (r == null) return callback(null, { result: { ok: 1 } });
+
+      // If an explain operation was executed, don't process the server results
+      if (this.explain) return callback(undefined, r.result);
+
+      r.deletedCount = r.result.n;
+      callback(null, r);
+    });
+  }
+}
+
+defineAspects(DeleteOneOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = DeleteOneOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/distinct.js b/NodeAPI/node_modules/mongodb/lib/operations/distinct.js
new file mode 100644
index 0000000000000000000000000000000000000000..fcac930c6f43f70ec777ee9edbf5c39b5a9a2cd3
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/distinct.js
@@ -0,0 +1,93 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const CommandOperationV2 = require('./command_v2');
+const decorateWithCollation = require('../utils').decorateWithCollation;
+const decorateWithReadConcern = require('../utils').decorateWithReadConcern;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const MongoError = require('../error').MongoError;
+
+/**
+ * Return a list of distinct values for the given key across a collection.
+ *
+ * @class
+ * @property {Collection} a Collection instance.
+ * @property {string} key Field of the document to find distinct values for.
+ * @property {object} query The query for filtering the set of documents to which we apply the distinct filter.
+ * @property {object} [options] Optional settings. See Collection.prototype.distinct for a list of options.
+ */
+class DistinctOperation extends CommandOperationV2 {
+  /**
+   * Construct a Distinct operation.
+   *
+   * @param {Collection} a Collection instance.
+   * @param {string} key Field of the document to find distinct values for.
+   * @param {object} query The query for filtering the set of documents to which we apply the distinct filter.
+   * @param {object} [options] Optional settings. See Collection.prototype.distinct for a list of options.
+   */
+  constructor(collection, key, query, options) {
+    super(collection, options);
+
+    this.collection = collection;
+    this.key = key;
+    this.query = query;
+  }
+
+  /**
+   * Execute the operation.
+   *
+   * @param {Collection~resultCallback} [callback] The command result callback
+   */
+  execute(server, callback) {
+    const coll = this.collection;
+    const key = this.key;
+    const query = this.query;
+    const options = this.options;
+
+    // Distinct command
+    const cmd = {
+      distinct: coll.collectionName,
+      key: key,
+      query: query
+    };
+
+    // Add maxTimeMS if defined
+    if (typeof options.maxTimeMS === 'number') {
+      cmd.maxTimeMS = options.maxTimeMS;
+    }
+
+    // Do we have a readConcern specified
+    decorateWithReadConcern(cmd, coll, options);
+
+    // Have we specified collation
+    try {
+      decorateWithCollation(cmd, coll, options);
+    } catch (err) {
+      return callback(err, null);
+    }
+
+    if (this.explain && maxWireVersion(server) < 4) {
+      callback(new MongoError(`server does not support explain on distinct`));
+      return;
+    }
+
+    super.executeCommand(server, cmd, (err, result) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      callback(null, this.options.full || this.explain ? result : result.values);
+    });
+  }
+}
+
+defineAspects(DistinctOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION,
+  Aspect.EXPLAINABLE
+]);
+
+module.exports = DistinctOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/drop.js b/NodeAPI/node_modules/mongodb/lib/operations/drop.js
new file mode 100644
index 0000000000000000000000000000000000000000..be03716fa70c49231a79a31686107f68a37cbe9c
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/drop.js
@@ -0,0 +1,53 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const CommandOperation = require('./command');
+const defineAspects = require('./operation').defineAspects;
+const handleCallback = require('../utils').handleCallback;
+
+class DropOperation extends CommandOperation {
+  constructor(db, options) {
+    const finalOptions = Object.assign({}, options, db.s.options);
+
+    if (options.session) {
+      finalOptions.session = options.session;
+    }
+
+    super(db, finalOptions);
+  }
+
+  execute(callback) {
+    super.execute((err, result) => {
+      if (err) return handleCallback(callback, err);
+      if (result.ok) return handleCallback(callback, null, true);
+      handleCallback(callback, null, false);
+    });
+  }
+}
+
+defineAspects(DropOperation, Aspect.WRITE_OPERATION);
+
+class DropCollectionOperation extends DropOperation {
+  constructor(db, name, options) {
+    super(db, options);
+
+    this.name = name;
+    this.namespace = `${db.namespace}.${name}`;
+  }
+
+  _buildCommand() {
+    return { drop: this.name };
+  }
+}
+
+class DropDatabaseOperation extends DropOperation {
+  _buildCommand() {
+    return { dropDatabase: 1 };
+  }
+}
+
+module.exports = {
+  DropOperation,
+  DropCollectionOperation,
+  DropDatabaseOperation
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/drop_index.js b/NodeAPI/node_modules/mongodb/lib/operations/drop_index.js
new file mode 100644
index 0000000000000000000000000000000000000000..a6ca783dc98ab3f8e6d52cc46ff221c66fd0798a
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/drop_index.js
@@ -0,0 +1,42 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const CommandOperation = require('./command');
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const handleCallback = require('../utils').handleCallback;
+
+class DropIndexOperation extends CommandOperation {
+  constructor(collection, indexName, options) {
+    super(collection.s.db, options, collection);
+
+    this.collection = collection;
+    this.indexName = indexName;
+  }
+
+  _buildCommand() {
+    const collection = this.collection;
+    const indexName = this.indexName;
+    const options = this.options;
+
+    let cmd = { dropIndexes: collection.collectionName, index: indexName };
+
+    // Decorate command with writeConcern if supported
+    cmd = applyWriteConcern(cmd, { db: collection.s.db, collection }, options);
+
+    return cmd;
+  }
+
+  execute(callback) {
+    // Execute command
+    super.execute((err, result) => {
+      if (typeof callback !== 'function') return;
+      if (err) return handleCallback(callback, err, null);
+      handleCallback(callback, null, result);
+    });
+  }
+}
+
+defineAspects(DropIndexOperation, Aspect.WRITE_OPERATION);
+
+module.exports = DropIndexOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/drop_indexes.js b/NodeAPI/node_modules/mongodb/lib/operations/drop_indexes.js
new file mode 100644
index 0000000000000000000000000000000000000000..ed404ee9d1b21172aaa80e436479d16f7dd3eccc
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/drop_indexes.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const DropIndexOperation = require('./drop_index');
+const handleCallback = require('../utils').handleCallback;
+
+class DropIndexesOperation extends DropIndexOperation {
+  constructor(collection, options) {
+    super(collection, '*', options);
+  }
+
+  execute(callback) {
+    super.execute(err => {
+      if (err) return handleCallback(callback, err, false);
+      handleCallback(callback, null, true);
+    });
+  }
+}
+
+defineAspects(DropIndexesOperation, Aspect.WRITE_OPERATION);
+
+module.exports = DropIndexesOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/estimated_document_count.js b/NodeAPI/node_modules/mongodb/lib/operations/estimated_document_count.js
new file mode 100644
index 0000000000000000000000000000000000000000..e2d65563d657258e89f50d67b6986688f01e7b33
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/estimated_document_count.js
@@ -0,0 +1,58 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const CommandOperationV2 = require('./command_v2');
+
+class EstimatedDocumentCountOperation extends CommandOperationV2 {
+  constructor(collection, query, options) {
+    if (typeof options === 'undefined') {
+      options = query;
+      query = undefined;
+    }
+
+    super(collection, options);
+    this.collectionName = collection.s.namespace.collection;
+    if (query) {
+      this.query = query;
+    }
+  }
+
+  execute(server, callback) {
+    const options = this.options;
+    const cmd = { count: this.collectionName };
+
+    if (this.query) {
+      cmd.query = this.query;
+    }
+
+    if (typeof options.skip === 'number') {
+      cmd.skip = options.skip;
+    }
+
+    if (typeof options.limit === 'number') {
+      cmd.limit = options.limit;
+    }
+
+    if (options.hint) {
+      cmd.hint = options.hint;
+    }
+
+    super.executeCommand(server, cmd, (err, response) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+
+      callback(null, response.n);
+    });
+  }
+}
+
+defineAspects(EstimatedDocumentCountOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION
+]);
+
+module.exports = EstimatedDocumentCountOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/execute_db_admin_command.js b/NodeAPI/node_modules/mongodb/lib/operations/execute_db_admin_command.js
new file mode 100644
index 0000000000000000000000000000000000000000..d15fc8e660eda2067f26ca0c321bdd74a874f70d
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/execute_db_admin_command.js
@@ -0,0 +1,34 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const handleCallback = require('../utils').handleCallback;
+const MongoError = require('../core').MongoError;
+const MongoDBNamespace = require('../utils').MongoDBNamespace;
+
+class ExecuteDbAdminCommandOperation extends OperationBase {
+  constructor(db, selector, options) {
+    super(options);
+
+    this.db = db;
+    this.selector = selector;
+  }
+
+  execute(callback) {
+    const db = this.db;
+    const selector = this.selector;
+    const options = this.options;
+
+    const namespace = new MongoDBNamespace('admin', '$cmd');
+    db.s.topology.command(namespace, selector, options, (err, result) => {
+      // Did the user destroy the topology
+      if (db.serverConfig && db.serverConfig.isDestroyed()) {
+        return callback(new MongoError('topology was destroyed'));
+      }
+
+      if (err) return handleCallback(callback, err);
+      handleCallback(callback, null, result.result);
+    });
+  }
+}
+
+module.exports = ExecuteDbAdminCommandOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/execute_operation.js b/NodeAPI/node_modules/mongodb/lib/operations/execute_operation.js
new file mode 100644
index 0000000000000000000000000000000000000000..c2255980d155ecb459c79f9ea56e1bf8dae13940
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/execute_operation.js
@@ -0,0 +1,164 @@
+'use strict';
+
+const maybePromise = require('../utils').maybePromise;
+const MongoError = require('../core/error').MongoError;
+const Aspect = require('./operation').Aspect;
+const OperationBase = require('./operation').OperationBase;
+const ReadPreference = require('../core/topologies/read_preference');
+const isRetryableError = require('../core/error').isRetryableError;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const isUnifiedTopology = require('../core/utils').isUnifiedTopology;
+
+/**
+ * Executes the given operation with provided arguments.
+ *
+ * This method reduces large amounts of duplication in the entire codebase by providing
+ * a single point for determining whether callbacks or promises should be used. Additionally
+ * it allows for a single point of entry to provide features such as implicit sessions, which
+ * are required by the Driver Sessions specification in the event that a ClientSession is
+ * not provided
+ *
+ * @param {object} topology The topology to execute this operation on
+ * @param {Operation} operation The operation to execute
+ * @param {function} callback The command result callback
+ */
+function executeOperation(topology, operation, cb) {
+  if (topology == null) {
+    throw new TypeError('This method requires a valid topology instance');
+  }
+
+  if (!(operation instanceof OperationBase)) {
+    throw new TypeError('This method requires a valid operation instance');
+  }
+
+  return maybePromise(topology, cb, callback => {
+    if (isUnifiedTopology(topology) && topology.shouldCheckForSessionSupport()) {
+      // Recursive call to executeOperation after a server selection
+      return selectServerForSessionSupport(topology, operation, callback);
+    }
+
+    // The driver sessions spec mandates that we implicitly create sessions for operations
+    // that are not explicitly provided with a session.
+    let session, owner;
+    if (topology.hasSessionSupport()) {
+      if (operation.session == null) {
+        owner = Symbol();
+        session = topology.startSession({ owner });
+        operation.session = session;
+      } else if (operation.session.hasEnded) {
+        return callback(new MongoError('Use of expired sessions is not permitted'));
+      }
+    } else if (operation.session) {
+      // If the user passed an explicit session and we are still, after server selection,
+      // trying to run against a topology that doesn't support sessions we error out.
+      return callback(new MongoError('Current topology does not support sessions'));
+    }
+
+    function executeCallback(err, result) {
+      if (session && session.owner === owner) {
+        session.endSession();
+        if (operation.session === session) {
+          operation.clearSession();
+        }
+      }
+
+      callback(err, result);
+    }
+
+    try {
+      if (operation.hasAspect(Aspect.EXECUTE_WITH_SELECTION)) {
+        executeWithServerSelection(topology, operation, executeCallback);
+      } else {
+        operation.execute(executeCallback);
+      }
+    } catch (error) {
+      if (session && session.owner === owner) {
+        session.endSession();
+        if (operation.session === session) {
+          operation.clearSession();
+        }
+      }
+
+      callback(error);
+    }
+  });
+}
+
+function supportsRetryableReads(server) {
+  return maxWireVersion(server) >= 6;
+}
+
+function executeWithServerSelection(topology, operation, callback) {
+  const readPreference = operation.readPreference || ReadPreference.primary;
+  const inTransaction = operation.session && operation.session.inTransaction();
+
+  if (inTransaction && !readPreference.equals(ReadPreference.primary)) {
+    callback(
+      new MongoError(
+        `Read preference in a transaction must be primary, not: ${readPreference.mode}`
+      )
+    );
+
+    return;
+  }
+
+  const serverSelectionOptions = {
+    readPreference,
+    session: operation.session
+  };
+
+  function callbackWithRetry(err, result) {
+    if (err == null) {
+      return callback(null, result);
+    }
+
+    if (!isRetryableError(err)) {
+      return callback(err);
+    }
+
+    // select a new server, and attempt to retry the operation
+    topology.selectServer(serverSelectionOptions, (err, server) => {
+      if (err || !supportsRetryableReads(server)) {
+        callback(err, null);
+        return;
+      }
+
+      operation.execute(server, callback);
+    });
+  }
+
+  // select a server, and execute the operation against it
+  topology.selectServer(serverSelectionOptions, (err, server) => {
+    if (err) {
+      callback(err, null);
+      return;
+    }
+    const shouldRetryReads =
+      topology.s.options.retryReads !== false &&
+      operation.session &&
+      !inTransaction &&
+      supportsRetryableReads(server) &&
+      operation.canRetryRead;
+
+    if (operation.hasAspect(Aspect.RETRYABLE) && shouldRetryReads) {
+      operation.execute(server, callbackWithRetry);
+      return;
+    }
+
+    operation.execute(server, callback);
+  });
+}
+
+// The Unified Topology runs serverSelection before executing every operation
+// Session support is determined by the result of a monitoring check triggered by this selection
+function selectServerForSessionSupport(topology, operation, callback) {
+  topology.selectServer(ReadPreference.primaryPreferred, err => {
+    if (err) {
+      return callback(err);
+    }
+
+    executeOperation(topology, operation, callback);
+  });
+}
+
+module.exports = executeOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/find.js b/NodeAPI/node_modules/mongodb/lib/operations/find.js
new file mode 100644
index 0000000000000000000000000000000000000000..97ecdb8d2ba82e68256d3ef1fa9e648aa2262c57
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/find.js
@@ -0,0 +1,49 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const ReadPreference = require('../core').ReadPreference;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const MongoError = require('../core/error').MongoError;
+
+class FindOperation extends OperationBase {
+  constructor(collection, ns, command, options) {
+    super(options);
+
+    this.ns = ns;
+    this.cmd = command;
+    this.readPreference = ReadPreference.resolve(collection, this.options);
+  }
+
+  execute(server, callback) {
+    // copied from `CommandOperationV2`, to be subclassed in the future
+    this.server = server;
+
+    // updates readPreference if setReadPreference was called on the cursor
+    this.readPreference = ReadPreference.resolve(this, this.options);
+
+    if (typeof this.cmd.allowDiskUse !== 'undefined' && maxWireVersion(server) < 4) {
+      callback(new MongoError('The `allowDiskUse` option is not supported on MongoDB < 3.2'));
+      return;
+    }
+
+    if (this.explain) {
+      // We need to manually ensure explain is in the options.
+      this.options.explain = this.explain.verbosity;
+    }
+
+    // TOOD: use `MongoDBNamespace` through and through
+    const cursorState = this.cursorState || {};
+    server.query(this.ns.toString(), this.cmd, cursorState, this.options, callback);
+  }
+}
+
+defineAspects(FindOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION,
+  Aspect.EXPLAINABLE
+]);
+
+module.exports = FindOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/find_and_modify.js b/NodeAPI/node_modules/mongodb/lib/operations/find_and_modify.js
new file mode 100644
index 0000000000000000000000000000000000000000..3886688e977b49134f44e2122823a57873a57824
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/find_and_modify.js
@@ -0,0 +1,128 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const applyRetryableWrites = require('../utils').applyRetryableWrites;
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const decorateWithCollation = require('../utils').decorateWithCollation;
+const executeCommand = require('./db_ops').executeCommand;
+const formattedOrderClause = require('../utils').formattedOrderClause;
+const handleCallback = require('../utils').handleCallback;
+const ReadPreference = require('../core').ReadPreference;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const MongoError = require('../error').MongoError;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const decorateWithExplain = require('../utils').decorateWithExplain;
+
+class FindAndModifyOperation extends OperationBase {
+  constructor(collection, query, sort, doc, options) {
+    super(options);
+
+    this.collection = collection;
+    this.query = query;
+    this.sort = sort;
+    this.doc = doc;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const query = this.query;
+    const sort = formattedOrderClause(this.sort);
+    const doc = this.doc;
+    let options = this.options;
+
+    // Create findAndModify command object
+    let queryObject = {
+      findAndModify: coll.collectionName,
+      query: query
+    };
+
+    if (sort) {
+      queryObject.sort = sort;
+    }
+
+    queryObject.new = options.new ? true : false;
+    queryObject.remove = options.remove ? true : false;
+    queryObject.upsert = options.upsert ? true : false;
+
+    const projection = options.projection || options.fields;
+
+    if (projection) {
+      queryObject.fields = projection;
+    }
+
+    if (options.arrayFilters) {
+      queryObject.arrayFilters = options.arrayFilters;
+    }
+
+    if (doc && !options.remove) {
+      queryObject.update = doc;
+    }
+
+    if (options.maxTimeMS) queryObject.maxTimeMS = options.maxTimeMS;
+
+    // Either use override on the function, or go back to default on either the collection
+    // level or db
+    options.serializeFunctions = options.serializeFunctions || coll.s.serializeFunctions;
+
+    // No check on the documents
+    options.checkKeys = false;
+
+    // Final options for retryable writes and write concern
+    options = applyRetryableWrites(options, coll.s.db);
+    options = applyWriteConcern(options, { db: coll.s.db, collection: coll }, options);
+
+    // Decorate the findAndModify command with the write Concern
+    if (options.writeConcern) {
+      queryObject.writeConcern = options.writeConcern;
+    }
+
+    // Have we specified bypassDocumentValidation
+    if (options.bypassDocumentValidation === true) {
+      queryObject.bypassDocumentValidation = options.bypassDocumentValidation;
+    }
+
+    options.readPreference = ReadPreference.primary;
+
+    // Have we specified collation
+    try {
+      decorateWithCollation(queryObject, coll, options);
+    } catch (err) {
+      return callback(err, null);
+    }
+
+    if (options.hint) {
+      // TODO: once this method becomes a CommandOperationV2 we will have the server
+      // in place to check.
+      const unacknowledgedWrite = options.writeConcern && options.writeConcern.w === 0;
+      if (unacknowledgedWrite || maxWireVersion(coll.s.topology) < 8) {
+        callback(
+          new MongoError('The current topology does not support a hint on findAndModify commands')
+        );
+
+        return;
+      }
+
+      queryObject.hint = options.hint;
+    }
+
+    if (this.explain) {
+      if (maxWireVersion(coll.s.topology) < 4) {
+        callback(new MongoError(`server does not support explain on findAndModify`));
+        return;
+      }
+      queryObject = decorateWithExplain(queryObject, this.explain);
+    }
+
+    // Execute the command
+    executeCommand(coll.s.db, queryObject, options, (err, result) => {
+      if (err) return handleCallback(callback, err, null);
+
+      return handleCallback(callback, null, result);
+    });
+  }
+}
+
+defineAspects(FindAndModifyOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = FindAndModifyOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/find_one.js b/NodeAPI/node_modules/mongodb/lib/operations/find_one.js
new file mode 100644
index 0000000000000000000000000000000000000000..3e4b3cf8500a8cdb29b12223053ce97a6a0f291f
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/find_one.js
@@ -0,0 +1,41 @@
+'use strict';
+
+const handleCallback = require('../utils').handleCallback;
+const OperationBase = require('./operation').OperationBase;
+const toError = require('../utils').toError;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+
+class FindOneOperation extends OperationBase {
+  constructor(collection, query, options) {
+    super(options);
+
+    this.collection = collection;
+    this.query = query;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const query = this.query;
+    const options = this.options;
+
+    try {
+      const cursor = coll
+        .find(query, options)
+        .limit(-1)
+        .batchSize(1);
+
+      // Return the item
+      cursor.next((err, item) => {
+        if (err != null) return handleCallback(callback, toError(err), null);
+        handleCallback(callback, null, item);
+      });
+    } catch (e) {
+      callback(e);
+    }
+  }
+}
+
+defineAspects(FindOneOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = FindOneOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_delete.js b/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_delete.js
new file mode 100644
index 0000000000000000000000000000000000000000..eaf32877cbc94eb7a5019b5cc7d80ae71f262628
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_delete.js
@@ -0,0 +1,21 @@
+'use strict';
+
+const FindAndModifyOperation = require('./find_and_modify');
+
+class FindOneAndDeleteOperation extends FindAndModifyOperation {
+  constructor(collection, filter, options) {
+    // Final options
+    const finalOptions = Object.assign({}, options);
+    finalOptions.fields = options.projection;
+    finalOptions.remove = true;
+
+    // Basic validation
+    if (filter == null || typeof filter !== 'object') {
+      throw new TypeError('Filter parameter must be an object');
+    }
+
+    super(collection, filter, finalOptions.sort, null, finalOptions);
+  }
+}
+
+module.exports = FindOneAndDeleteOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_replace.js b/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_replace.js
new file mode 100644
index 0000000000000000000000000000000000000000..3720baea4ee7fdba192b2aedb96a82b89081e6c8
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_replace.js
@@ -0,0 +1,37 @@
+'use strict';
+
+const MongoError = require('../core').MongoError;
+const FindAndModifyOperation = require('./find_and_modify');
+const hasAtomicOperators = require('../utils').hasAtomicOperators;
+
+class FindOneAndReplaceOperation extends FindAndModifyOperation {
+  constructor(collection, filter, replacement, options) {
+    if ('returnDocument' in options && 'returnOriginal' in options) {
+      throw new MongoError(
+        'findOneAndReplace option returnOriginal is deprecated in favor of returnDocument and cannot be combined'
+      );
+    }
+    // Final options
+    const finalOptions = Object.assign({}, options);
+    finalOptions.fields = options.projection;
+    finalOptions.update = true;
+    finalOptions.new = options.returnDocument === 'after' || options.returnOriginal === false;
+    finalOptions.upsert = options.upsert === true;
+
+    if (filter == null || typeof filter !== 'object') {
+      throw new TypeError('Filter parameter must be an object');
+    }
+
+    if (replacement == null || typeof replacement !== 'object') {
+      throw new TypeError('Replacement parameter must be an object');
+    }
+
+    if (hasAtomicOperators(replacement)) {
+      throw new TypeError('Replacement document must not contain atomic operators');
+    }
+
+    super(collection, filter, finalOptions.sort, replacement, finalOptions);
+  }
+}
+
+module.exports = FindOneAndReplaceOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_update.js b/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_update.js
new file mode 100644
index 0000000000000000000000000000000000000000..9408aca7bfe0621922d9548e990c97cccbb7a2fd
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/find_one_and_update.js
@@ -0,0 +1,37 @@
+'use strict';
+
+const MongoError = require('../core').MongoError;
+const FindAndModifyOperation = require('./find_and_modify');
+const hasAtomicOperators = require('../utils').hasAtomicOperators;
+
+class FindOneAndUpdateOperation extends FindAndModifyOperation {
+  constructor(collection, filter, update, options) {
+    if ('returnDocument' in options && 'returnOriginal' in options) {
+      throw new MongoError(
+        'findOneAndUpdate option returnOriginal is deprecated in favor of returnDocument and cannot be combined'
+      );
+    }
+    // Final options
+    const finalOptions = Object.assign({}, options);
+    finalOptions.fields = options.projection;
+    finalOptions.update = true;
+    finalOptions.new = options.returnDocument === 'after' || options.returnOriginal === false;
+    finalOptions.upsert = options.upsert === true;
+
+    if (filter == null || typeof filter !== 'object') {
+      throw new TypeError('Filter parameter must be an object');
+    }
+
+    if (update == null || typeof update !== 'object') {
+      throw new TypeError('Update parameter must be an object');
+    }
+
+    if (!hasAtomicOperators(update)) {
+      throw new TypeError('Update document requires atomic operators');
+    }
+
+    super(collection, filter, finalOptions.sort, update, finalOptions);
+  }
+}
+
+module.exports = FindOneAndUpdateOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/geo_haystack_search.js b/NodeAPI/node_modules/mongodb/lib/operations/geo_haystack_search.js
new file mode 100644
index 0000000000000000000000000000000000000000..7c8654d2cd80dc9deb85e66f6852fef3ab164441
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/geo_haystack_search.js
@@ -0,0 +1,79 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const OperationBase = require('./operation').OperationBase;
+const decorateCommand = require('../utils').decorateCommand;
+const decorateWithReadConcern = require('../utils').decorateWithReadConcern;
+const executeCommand = require('./db_ops').executeCommand;
+const handleCallback = require('../utils').handleCallback;
+const ReadPreference = require('../core').ReadPreference;
+const toError = require('../utils').toError;
+
+/**
+ * Execute a geo search using a geo haystack index on a collection.
+ *
+ * @class
+ * @property {Collection} a Collection instance.
+ * @property {number} x Point to search on the x axis, ensure the indexes are ordered in the same order.
+ * @property {number} y Point to search on the y axis, ensure the indexes are ordered in the same order.
+ * @property {object} [options] Optional settings. See Collection.prototype.geoHaystackSearch for a list of options.
+ */
+class GeoHaystackSearchOperation extends OperationBase {
+  /**
+   * Construct a GeoHaystackSearch operation.
+   *
+   * @param {Collection} a Collection instance.
+   * @param {number} x Point to search on the x axis, ensure the indexes are ordered in the same order.
+   * @param {number} y Point to search on the y axis, ensure the indexes are ordered in the same order.
+   * @param {object} [options] Optional settings. See Collection.prototype.geoHaystackSearch for a list of options.
+   */
+  constructor(collection, x, y, options) {
+    super(options);
+
+    this.collection = collection;
+    this.x = x;
+    this.y = y;
+  }
+
+  /**
+   * Execute the operation.
+   *
+   * @param {Collection~resultCallback} [callback] The command result callback
+   */
+  execute(callback) {
+    const coll = this.collection;
+    const x = this.x;
+    const y = this.y;
+    let options = this.options;
+
+    // Build command object
+    let commandObject = {
+      geoSearch: coll.collectionName,
+      near: [x, y]
+    };
+
+    // Remove read preference from hash if it exists
+    commandObject = decorateCommand(commandObject, options, ['readPreference', 'session']);
+
+    options = Object.assign({}, options);
+    // Ensure we have the right read preference inheritance
+    options.readPreference = ReadPreference.resolve(coll, options);
+
+    // Do we have a readConcern specified
+    decorateWithReadConcern(commandObject, coll, options);
+
+    // Execute the command
+    executeCommand(coll.s.db, commandObject, options, (err, res) => {
+      if (err) return handleCallback(callback, err);
+      if (res.err || res.errmsg) handleCallback(callback, toError(res));
+      // should we only be returning res.results here? Not sure if the user
+      // should see the other return information
+      handleCallback(callback, null, res);
+    });
+  }
+}
+
+defineAspects(GeoHaystackSearchOperation, Aspect.READ_OPERATION);
+
+module.exports = GeoHaystackSearchOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/index_exists.js b/NodeAPI/node_modules/mongodb/lib/operations/index_exists.js
new file mode 100644
index 0000000000000000000000000000000000000000..bd9dc0e92c4b74ab90c0a963a538ad20b2d1d16e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/index_exists.js
@@ -0,0 +1,39 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const handleCallback = require('../utils').handleCallback;
+const indexInformationDb = require('./db_ops').indexInformation;
+
+class IndexExistsOperation extends OperationBase {
+  constructor(collection, indexes, options) {
+    super(options);
+
+    this.collection = collection;
+    this.indexes = indexes;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const indexes = this.indexes;
+    const options = this.options;
+
+    indexInformationDb(coll.s.db, coll.collectionName, options, (err, indexInformation) => {
+      // If we have an error return
+      if (err != null) return handleCallback(callback, err, null);
+      // Let's check for the index names
+      if (!Array.isArray(indexes))
+        return handleCallback(callback, null, indexInformation[indexes] != null);
+      // Check in list of indexes
+      for (let i = 0; i < indexes.length; i++) {
+        if (indexInformation[indexes[i]] == null) {
+          return handleCallback(callback, null, false);
+        }
+      }
+
+      // All keys found return true
+      return handleCallback(callback, null, true);
+    });
+  }
+}
+
+module.exports = IndexExistsOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/index_information.js b/NodeAPI/node_modules/mongodb/lib/operations/index_information.js
new file mode 100644
index 0000000000000000000000000000000000000000..b18a603f25caf9683395c8c9648f90b8b4e39438
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/index_information.js
@@ -0,0 +1,23 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const indexInformation = require('./common_functions').indexInformation;
+
+class IndexInformationOperation extends OperationBase {
+  constructor(db, name, options) {
+    super(options);
+
+    this.db = db;
+    this.name = name;
+  }
+
+  execute(callback) {
+    const db = this.db;
+    const name = this.name;
+    const options = this.options;
+
+    indexInformation(db, name, options, callback);
+  }
+}
+
+module.exports = IndexInformationOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/indexes.js b/NodeAPI/node_modules/mongodb/lib/operations/indexes.js
new file mode 100644
index 0000000000000000000000000000000000000000..e29a88aa16694e7e74fcc4d9fbe43f16195169ad
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/indexes.js
@@ -0,0 +1,22 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const indexInformation = require('./common_functions').indexInformation;
+
+class IndexesOperation extends OperationBase {
+  constructor(collection, options) {
+    super(options);
+
+    this.collection = collection;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    let options = this.options;
+
+    options = Object.assign({}, { full: true }, options);
+    indexInformation(coll.s.db, coll.collectionName, options, callback);
+  }
+}
+
+module.exports = IndexesOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/insert_many.js b/NodeAPI/node_modules/mongodb/lib/operations/insert_many.js
new file mode 100644
index 0000000000000000000000000000000000000000..fdfc0d46bb08ec32534880874ac431b0489247ce
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/insert_many.js
@@ -0,0 +1,59 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const BulkWriteOperation = require('./bulk_write');
+const MongoError = require('../core').MongoError;
+const prepareDocs = require('./common_functions').prepareDocs;
+
+class InsertManyOperation extends OperationBase {
+  constructor(collection, docs, options) {
+    super(options);
+
+    this.collection = collection;
+    this.docs = docs;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    let docs = this.docs;
+    const options = this.options;
+
+    if (!Array.isArray(docs)) {
+      return callback(
+        MongoError.create({ message: 'docs parameter must be an array of documents', driver: true })
+      );
+    }
+
+    // If keep going set unordered
+    options['serializeFunctions'] = options['serializeFunctions'] || coll.s.serializeFunctions;
+
+    docs = prepareDocs(coll, docs, options);
+
+    // Generate the bulk write operations
+    const operations = docs.map(document => ({ insertOne: { document } }));
+
+    const bulkWriteOperation = new BulkWriteOperation(coll, operations, options);
+
+    bulkWriteOperation.execute((err, result) => {
+      if (err) return callback(err, null);
+      callback(null, mapInsertManyResults(docs, result));
+    });
+  }
+}
+
+function mapInsertManyResults(docs, r) {
+  const finalResult = {
+    result: { ok: 1, n: r.insertedCount },
+    ops: docs,
+    insertedCount: r.insertedCount,
+    insertedIds: r.insertedIds
+  };
+
+  if (r.getLastOp()) {
+    finalResult.result.opTime = r.getLastOp();
+  }
+
+  return finalResult;
+}
+
+module.exports = InsertManyOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/insert_one.js b/NodeAPI/node_modules/mongodb/lib/operations/insert_one.js
new file mode 100644
index 0000000000000000000000000000000000000000..5e708801d53dc4f0ffdf2f023ad57712ebd7e1cc
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/insert_one.js
@@ -0,0 +1,39 @@
+'use strict';
+
+const MongoError = require('../core').MongoError;
+const OperationBase = require('./operation').OperationBase;
+const insertDocuments = require('./common_functions').insertDocuments;
+
+class InsertOneOperation extends OperationBase {
+  constructor(collection, doc, options) {
+    super(options);
+
+    this.collection = collection;
+    this.doc = doc;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const doc = this.doc;
+    const options = this.options;
+
+    if (Array.isArray(doc)) {
+      return callback(
+        MongoError.create({ message: 'doc parameter must be an object', driver: true })
+      );
+    }
+
+    insertDocuments(coll, [doc], options, (err, r) => {
+      if (callback == null) return;
+      if (err && callback) return callback(err);
+      // Workaround for pre 2.6 servers
+      if (r == null) return callback(null, { result: { ok: 1 } });
+      // Add values to top level to ensure crud spec compatibility
+      r.insertedCount = r.result.n;
+      r.insertedId = doc._id;
+      if (callback) callback(null, r);
+    });
+  }
+}
+
+module.exports = InsertOneOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/is_capped.js b/NodeAPI/node_modules/mongodb/lib/operations/is_capped.js
new file mode 100644
index 0000000000000000000000000000000000000000..3bfd9ffa04b1dcc606c6bfb3d8316c688934f7af
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/is_capped.js
@@ -0,0 +1,19 @@
+'use strict';
+
+const OptionsOperation = require('./options_operation');
+const handleCallback = require('../utils').handleCallback;
+
+class IsCappedOperation extends OptionsOperation {
+  constructor(collection, options) {
+    super(collection, options);
+  }
+
+  execute(callback) {
+    super.execute((err, document) => {
+      if (err) return handleCallback(callback, err);
+      handleCallback(callback, null, !!(document && document.capped));
+    });
+  }
+}
+
+module.exports = IsCappedOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/list_collections.js b/NodeAPI/node_modules/mongodb/lib/operations/list_collections.js
new file mode 100644
index 0000000000000000000000000000000000000000..ee01d31e85c3addb2de5095558165a69e19ec43b
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/list_collections.js
@@ -0,0 +1,106 @@
+'use strict';
+
+const CommandOperationV2 = require('./command_v2');
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const CONSTANTS = require('../constants');
+
+const LIST_COLLECTIONS_WIRE_VERSION = 3;
+
+function listCollectionsTransforms(databaseName) {
+  const matching = `${databaseName}.`;
+
+  return {
+    doc: doc => {
+      const index = doc.name.indexOf(matching);
+      // Remove database name if available
+      if (doc.name && index === 0) {
+        doc.name = doc.name.substr(index + matching.length);
+      }
+
+      return doc;
+    }
+  };
+}
+
+class ListCollectionsOperation extends CommandOperationV2 {
+  constructor(db, filter, options) {
+    super(db, options, { fullResponse: true });
+
+    this.db = db;
+    this.filter = filter;
+    this.nameOnly = !!this.options.nameOnly;
+
+    if (typeof this.options.batchSize === 'number') {
+      this.batchSize = this.options.batchSize;
+    }
+  }
+
+  execute(server, callback) {
+    if (maxWireVersion(server) < LIST_COLLECTIONS_WIRE_VERSION) {
+      let filter = this.filter;
+      const databaseName = this.db.s.namespace.db;
+
+      // If we have legacy mode and have not provided a full db name filter it
+      if (
+        typeof filter.name === 'string' &&
+        !new RegExp('^' + databaseName + '\\.').test(filter.name)
+      ) {
+        filter = Object.assign({}, filter);
+        filter.name = this.db.s.namespace.withCollection(filter.name).toString();
+      }
+
+      // No filter, filter by current database
+      if (filter == null) {
+        filter.name = `/${databaseName}/`;
+      }
+
+      // Rewrite the filter to use $and to filter out indexes
+      if (filter.name) {
+        filter = { $and: [{ name: filter.name }, { name: /^((?!\$).)*$/ }] };
+      } else {
+        filter = { name: /^((?!\$).)*$/ };
+      }
+
+      const transforms = listCollectionsTransforms(databaseName);
+      server.query(
+        `${databaseName}.${CONSTANTS.SYSTEM_NAMESPACE_COLLECTION}`,
+        { query: filter },
+        { batchSize: this.batchSize || 1000 },
+        {},
+        (err, result) => {
+          if (
+            result &&
+            result.message &&
+            result.message.documents &&
+            Array.isArray(result.message.documents)
+          ) {
+            result.message.documents = result.message.documents.map(transforms.doc);
+          }
+
+          callback(err, result);
+        }
+      );
+
+      return;
+    }
+
+    const command = {
+      listCollections: 1,
+      filter: this.filter,
+      cursor: this.batchSize ? { batchSize: this.batchSize } : {},
+      nameOnly: this.nameOnly
+    };
+
+    return super.executeCommand(server, command, callback);
+  }
+}
+
+defineAspects(ListCollectionsOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION
+]);
+
+module.exports = ListCollectionsOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/list_databases.js b/NodeAPI/node_modules/mongodb/lib/operations/list_databases.js
new file mode 100644
index 0000000000000000000000000000000000000000..62b2606f899c10231bcee644c6bc8c9bea8ebaca
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/list_databases.js
@@ -0,0 +1,38 @@
+'use strict';
+
+const CommandOperationV2 = require('./command_v2');
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const MongoDBNamespace = require('../utils').MongoDBNamespace;
+
+class ListDatabasesOperation extends CommandOperationV2 {
+  constructor(db, options) {
+    super(db, options);
+    this.ns = new MongoDBNamespace('admin', '$cmd');
+  }
+
+  execute(server, callback) {
+    const cmd = { listDatabases: 1 };
+    if (this.options.nameOnly) {
+      cmd.nameOnly = Number(cmd.nameOnly);
+    }
+
+    if (this.options.filter) {
+      cmd.filter = this.options.filter;
+    }
+
+    if (typeof this.options.authorizedDatabases === 'boolean') {
+      cmd.authorizedDatabases = this.options.authorizedDatabases;
+    }
+
+    super.executeCommand(server, cmd, callback);
+  }
+}
+
+defineAspects(ListDatabasesOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION
+]);
+
+module.exports = ListDatabasesOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/list_indexes.js b/NodeAPI/node_modules/mongodb/lib/operations/list_indexes.js
new file mode 100644
index 0000000000000000000000000000000000000000..302a31b7c8caeff2682da2ca9621396b635f0a94
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/list_indexes.js
@@ -0,0 +1,42 @@
+'use strict';
+
+const CommandOperationV2 = require('./command_v2');
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+
+const LIST_INDEXES_WIRE_VERSION = 3;
+
+class ListIndexesOperation extends CommandOperationV2 {
+  constructor(collection, options) {
+    super(collection, options, { fullResponse: true });
+
+    this.collectionNamespace = collection.s.namespace;
+  }
+
+  execute(server, callback) {
+    const serverWireVersion = maxWireVersion(server);
+    if (serverWireVersion < LIST_INDEXES_WIRE_VERSION) {
+      const systemIndexesNS = this.collectionNamespace.withCollection('system.indexes').toString();
+      const collectionNS = this.collectionNamespace.toString();
+
+      server.query(systemIndexesNS, { query: { ns: collectionNS } }, {}, this.options, callback);
+      return;
+    }
+
+    const cursor = this.options.batchSize ? { batchSize: this.options.batchSize } : {};
+    super.executeCommand(
+      server,
+      { listIndexes: this.collectionNamespace.collection, cursor },
+      callback
+    );
+  }
+}
+
+defineAspects(ListIndexesOperation, [
+  Aspect.READ_OPERATION,
+  Aspect.RETRYABLE,
+  Aspect.EXECUTE_WITH_SELECTION
+]);
+
+module.exports = ListIndexesOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/map_reduce.js b/NodeAPI/node_modules/mongodb/lib/operations/map_reduce.js
new file mode 100644
index 0000000000000000000000000000000000000000..3a2cf261866705f89fce878bb9abe97bff2898d2
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/map_reduce.js
@@ -0,0 +1,209 @@
+'use strict';
+
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const Code = require('../core').BSON.Code;
+const decorateWithCollation = require('../utils').decorateWithCollation;
+const decorateWithReadConcern = require('../utils').decorateWithReadConcern;
+const executeCommand = require('./db_ops').executeCommand;
+const handleCallback = require('../utils').handleCallback;
+const isObject = require('../utils').isObject;
+const loadDb = require('../dynamic_loaders').loadDb;
+const OperationBase = require('./operation').OperationBase;
+const ReadPreference = require('../core').ReadPreference;
+const toError = require('../utils').toError;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const decorateWithExplain = require('../utils').decorateWithExplain;
+const maxWireVersion = require('../core/utils').maxWireVersion;
+const MongoError = require('../error').MongoError;
+
+const exclusionList = [
+  'explain',
+  'readPreference',
+  'session',
+  'bypassDocumentValidation',
+  'w',
+  'wtimeout',
+  'j',
+  'writeConcern'
+];
+
+/**
+ * Run Map Reduce across a collection. Be aware that the inline option for out will return an array of results not a collection.
+ *
+ * @class
+ * @property {Collection} a Collection instance.
+ * @property {(function|string)} map The mapping function.
+ * @property {(function|string)} reduce The reduce function.
+ * @property {object} [options] Optional settings. See Collection.prototype.mapReduce for a list of options.
+ */
+class MapReduceOperation extends OperationBase {
+  /**
+   * Constructs a MapReduce operation.
+   *
+   * @param {Collection} a Collection instance.
+   * @param {(function|string)} map The mapping function.
+   * @param {(function|string)} reduce The reduce function.
+   * @param {object} [options] Optional settings. See Collection.prototype.mapReduce for a list of options.
+   */
+  constructor(collection, map, reduce, options) {
+    super(options);
+
+    this.collection = collection;
+    this.map = map;
+    this.reduce = reduce;
+  }
+
+  /**
+   * Execute the operation.
+   *
+   * @param {Collection~resultCallback} [callback] The command result callback
+   */
+  execute(callback) {
+    const coll = this.collection;
+    const map = this.map;
+    const reduce = this.reduce;
+    let options = this.options;
+
+    let mapCommandHash = {
+      mapReduce: coll.collectionName,
+      map: map,
+      reduce: reduce
+    };
+
+    // Add any other options passed in
+    for (let n in options) {
+      if ('scope' === n) {
+        mapCommandHash[n] = processScope(options[n]);
+      } else {
+        // Only include if not in exclusion list
+        if (exclusionList.indexOf(n) === -1) {
+          mapCommandHash[n] = options[n];
+        }
+      }
+    }
+
+    options = Object.assign({}, options);
+
+    // Ensure we have the right read preference inheritance
+    options.readPreference = ReadPreference.resolve(coll, options);
+
+    // If we have a read preference and inline is not set as output fail hard
+    if (
+      options.readPreference !== false &&
+      options.readPreference !== 'primary' &&
+      options['out'] &&
+      options['out'].inline !== 1 &&
+      options['out'] !== 'inline'
+    ) {
+      // Force readPreference to primary
+      options.readPreference = 'primary';
+      // Decorate command with writeConcern if supported
+      applyWriteConcern(mapCommandHash, { db: coll.s.db, collection: coll }, options);
+    } else {
+      decorateWithReadConcern(mapCommandHash, coll, options);
+    }
+
+    // Is bypassDocumentValidation specified
+    if (options.bypassDocumentValidation === true) {
+      mapCommandHash.bypassDocumentValidation = options.bypassDocumentValidation;
+    }
+
+    // Have we specified collation
+    try {
+      decorateWithCollation(mapCommandHash, coll, options);
+    } catch (err) {
+      return callback(err, null);
+    }
+
+    if (this.explain) {
+      if (maxWireVersion(coll.s.topology) < 9) {
+        callback(new MongoError(`server does not support explain on mapReduce`));
+        return;
+      }
+      mapCommandHash = decorateWithExplain(mapCommandHash, this.explain);
+    }
+
+    // Execute command
+    executeCommand(coll.s.db, mapCommandHash, options, (err, result) => {
+      if (err) return handleCallback(callback, err);
+      // Check if we have an error
+      if (1 !== result.ok || result.err || result.errmsg) {
+        return handleCallback(callback, toError(result));
+      }
+
+      // If an explain operation was executed, don't process the server results
+      if (this.explain) return callback(undefined, result);
+
+      // Create statistics value
+      const stats = {};
+      if (result.timeMillis) stats['processtime'] = result.timeMillis;
+      if (result.counts) stats['counts'] = result.counts;
+      if (result.timing) stats['timing'] = result.timing;
+
+      // invoked with inline?
+      if (result.results) {
+        // If we wish for no verbosity
+        if (options['verbose'] == null || !options['verbose']) {
+          return handleCallback(callback, null, result.results);
+        }
+
+        return handleCallback(callback, null, { results: result.results, stats: stats });
+      }
+
+      // The returned collection
+      let collection = null;
+
+      // If we have an object it's a different db
+      if (result.result != null && typeof result.result === 'object') {
+        const doc = result.result;
+        // Return a collection from another db
+        let Db = loadDb();
+        collection = new Db(doc.db, coll.s.db.s.topology, coll.s.db.s.options).collection(
+          doc.collection
+        );
+      } else {
+        // Create a collection object that wraps the result collection
+        collection = coll.s.db.collection(result.result);
+      }
+
+      // If we wish for no verbosity
+      if (options['verbose'] == null || !options['verbose']) {
+        return handleCallback(callback, err, collection);
+      }
+
+      // Return stats as third set of values
+      handleCallback(callback, err, { collection: collection, stats: stats });
+    });
+  }
+}
+
+/**
+ * Functions that are passed as scope args must
+ * be converted to Code instances.
+ * @ignore
+ */
+function processScope(scope) {
+  if (!isObject(scope) || scope._bsontype === 'ObjectID') {
+    return scope;
+  }
+
+  const keys = Object.keys(scope);
+  let key;
+  const new_scope = {};
+
+  for (let i = keys.length - 1; i >= 0; i--) {
+    key = keys[i];
+    if ('function' === typeof scope[key]) {
+      new_scope[key] = new Code(String(scope[key]));
+    } else {
+      new_scope[key] = processScope(scope[key]);
+    }
+  }
+
+  return new_scope;
+}
+
+defineAspects(MapReduceOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = MapReduceOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/operation.js b/NodeAPI/node_modules/mongodb/lib/operations/operation.js
new file mode 100644
index 0000000000000000000000000000000000000000..94ccd814940b3a50696d5db745b1dd7654eb82f9
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/operation.js
@@ -0,0 +1,76 @@
+'use strict';
+
+const Explain = require('../explain').Explain;
+const MongoError = require('../core/error').MongoError;
+
+const Aspect = {
+  READ_OPERATION: Symbol('READ_OPERATION'),
+  WRITE_OPERATION: Symbol('WRITE_OPERATION'),
+  RETRYABLE: Symbol('RETRYABLE'),
+  EXECUTE_WITH_SELECTION: Symbol('EXECUTE_WITH_SELECTION'),
+  NO_INHERIT_OPTIONS: Symbol('NO_INHERIT_OPTIONS'),
+  EXPLAINABLE: Symbol('EXPLAINABLE')
+};
+
+/**
+ * This class acts as a parent class for any operation and is responsible for setting this.options,
+ * as well as setting and getting a session.
+ * Additionally, this class implements `hasAspect`, which determines whether an operation has
+ * a specific aspect.
+ */
+class OperationBase {
+  constructor(options) {
+    this.options = Object.assign({}, options);
+
+    if (this.hasAspect(Aspect.EXPLAINABLE)) {
+      this.explain = Explain.fromOptions(options);
+    } else if (this.options.explain !== undefined) {
+      throw new MongoError(`explain is not supported on this command`);
+    }
+  }
+
+  hasAspect(aspect) {
+    if (this.constructor.aspects == null) {
+      return false;
+    }
+    return this.constructor.aspects.has(aspect);
+  }
+
+  set session(session) {
+    Object.assign(this.options, { session });
+  }
+
+  get session() {
+    return this.options.session;
+  }
+
+  clearSession() {
+    delete this.options.session;
+  }
+
+  get canRetryRead() {
+    return true;
+  }
+
+  execute() {
+    throw new TypeError('`execute` must be implemented for OperationBase subclasses');
+  }
+}
+
+function defineAspects(operation, aspects) {
+  if (!Array.isArray(aspects) && !(aspects instanceof Set)) {
+    aspects = [aspects];
+  }
+  aspects = new Set(aspects);
+  Object.defineProperty(operation, 'aspects', {
+    value: aspects,
+    writable: false
+  });
+  return aspects;
+}
+
+module.exports = {
+  Aspect,
+  defineAspects,
+  OperationBase
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/options_operation.js b/NodeAPI/node_modules/mongodb/lib/operations/options_operation.js
new file mode 100644
index 0000000000000000000000000000000000000000..9a739a519327a947d63a4eb63f75f2922f4271e9
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/options_operation.js
@@ -0,0 +1,32 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const handleCallback = require('../utils').handleCallback;
+const MongoError = require('../core').MongoError;
+
+class OptionsOperation extends OperationBase {
+  constructor(collection, options) {
+    super(options);
+
+    this.collection = collection;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const opts = this.options;
+
+    coll.s.db.listCollections({ name: coll.collectionName }, opts).toArray((err, collections) => {
+      if (err) return handleCallback(callback, err);
+      if (collections.length === 0) {
+        return handleCallback(
+          callback,
+          MongoError.create({ message: `collection ${coll.namespace} not found`, driver: true })
+        );
+      }
+
+      handleCallback(callback, err, collections[0].options || null);
+    });
+  }
+}
+
+module.exports = OptionsOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/profiling_level.js b/NodeAPI/node_modules/mongodb/lib/operations/profiling_level.js
new file mode 100644
index 0000000000000000000000000000000000000000..3f7639b43c2e8f843d68b8b9c6269690cadbe3ac
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/profiling_level.js
@@ -0,0 +1,31 @@
+'use strict';
+
+const CommandOperation = require('./command');
+
+class ProfilingLevelOperation extends CommandOperation {
+  constructor(db, command, options) {
+    super(db, options);
+  }
+
+  _buildCommand() {
+    const command = { profile: -1 };
+
+    return command;
+  }
+
+  execute(callback) {
+    super.execute((err, doc) => {
+      if (err == null && doc.ok === 1) {
+        const was = doc.was;
+        if (was === 0) return callback(null, 'off');
+        if (was === 1) return callback(null, 'slow_only');
+        if (was === 2) return callback(null, 'all');
+        return callback(new Error('Error: illegal profiling level value ' + was), null);
+      } else {
+        err != null ? callback(err, null) : callback(new Error('Error with profile command'), null);
+      }
+    });
+  }
+}
+
+module.exports = ProfilingLevelOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/re_index.js b/NodeAPI/node_modules/mongodb/lib/operations/re_index.js
new file mode 100644
index 0000000000000000000000000000000000000000..dc445222c3c810fbdf9331a8e02827f36c41a1db
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/re_index.js
@@ -0,0 +1,33 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+const CommandOperationV2 = require('./command_v2');
+const serverType = require('../core/sdam/common').serverType;
+const ServerType = require('../core/sdam/common').ServerType;
+const MongoError = require('../core').MongoError;
+
+class ReIndexOperation extends CommandOperationV2 {
+  constructor(collection, options) {
+    super(collection, options);
+    this.collectionName = collection.collectionName;
+  }
+
+  execute(server, callback) {
+    if (serverType(server) !== ServerType.Standalone) {
+      callback(new MongoError(`reIndex can only be executed on standalone servers.`));
+      return;
+    }
+    super.executeCommand(server, { reIndex: this.collectionName }, (err, result) => {
+      if (err) {
+        callback(err);
+        return;
+      }
+      callback(null, !!result.ok);
+    });
+  }
+}
+
+defineAspects(ReIndexOperation, [Aspect.EXECUTE_WITH_SELECTION]);
+
+module.exports = ReIndexOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/remove_user.js b/NodeAPI/node_modules/mongodb/lib/operations/remove_user.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e8376b1a229b8869f97dbb97cdb9f947f0148dc
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/remove_user.js
@@ -0,0 +1,52 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const CommandOperation = require('./command');
+const defineAspects = require('./operation').defineAspects;
+const handleCallback = require('../utils').handleCallback;
+const WriteConcern = require('../write_concern');
+
+class RemoveUserOperation extends CommandOperation {
+  constructor(db, username, options) {
+    const commandOptions = {};
+
+    const writeConcern = WriteConcern.fromOptions(options);
+    if (writeConcern != null) {
+      commandOptions.writeConcern = writeConcern;
+    }
+
+    if (options.dbName) {
+      commandOptions.dbName = options.dbName;
+    }
+
+    // Add maxTimeMS to options if set
+    if (typeof options.maxTimeMS === 'number') {
+      commandOptions.maxTimeMS = options.maxTimeMS;
+    }
+
+    super(db, commandOptions);
+
+    this.username = username;
+  }
+
+  _buildCommand() {
+    const username = this.username;
+
+    // Build the command to execute
+    const command = { dropUser: username };
+
+    return command;
+  }
+
+  execute(callback) {
+    // Attempt to execute command
+    super.execute((err, result) => {
+      if (err) return handleCallback(callback, err, null);
+      handleCallback(callback, err, result.ok ? true : false);
+    });
+  }
+}
+
+defineAspects(RemoveUserOperation, Aspect.WRITE_OPERATION);
+
+module.exports = RemoveUserOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/rename.js b/NodeAPI/node_modules/mongodb/lib/operations/rename.js
new file mode 100644
index 0000000000000000000000000000000000000000..8098fe6be5f2a787da3db42bd656f72ab8b8814a
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/rename.js
@@ -0,0 +1,61 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const applyWriteConcern = require('../utils').applyWriteConcern;
+const checkCollectionName = require('../utils').checkCollectionName;
+const executeDbAdminCommand = require('./db_ops').executeDbAdminCommand;
+const handleCallback = require('../utils').handleCallback;
+const loadCollection = require('../dynamic_loaders').loadCollection;
+const toError = require('../utils').toError;
+
+class RenameOperation extends OperationBase {
+  constructor(collection, newName, options) {
+    super(options);
+
+    this.collection = collection;
+    this.newName = newName;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const newName = this.newName;
+    const options = this.options;
+
+    let Collection = loadCollection();
+    // Check the collection name
+    checkCollectionName(newName);
+    // Build the command
+    const renameCollection = coll.namespace;
+    const toCollection = coll.s.namespace.withCollection(newName).toString();
+    const dropTarget = typeof options.dropTarget === 'boolean' ? options.dropTarget : false;
+    const cmd = { renameCollection: renameCollection, to: toCollection, dropTarget: dropTarget };
+
+    // Decorate command with writeConcern if supported
+    applyWriteConcern(cmd, { db: coll.s.db, collection: coll }, options);
+
+    // Execute against admin
+    executeDbAdminCommand(coll.s.db.admin().s.db, cmd, options, (err, doc) => {
+      if (err) return handleCallback(callback, err, null);
+      // We have an error
+      if (doc.errmsg) return handleCallback(callback, toError(doc), null);
+      try {
+        return handleCallback(
+          callback,
+          null,
+          new Collection(
+            coll.s.db,
+            coll.s.topology,
+            coll.s.namespace.db,
+            newName,
+            coll.s.pkFactory,
+            coll.s.options
+          )
+        );
+      } catch (err) {
+        return handleCallback(callback, toError(err), null);
+      }
+    });
+  }
+}
+
+module.exports = RenameOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/replace_one.js b/NodeAPI/node_modules/mongodb/lib/operations/replace_one.js
new file mode 100644
index 0000000000000000000000000000000000000000..93ec0ef3eedcd641cd3bc3bfcac91a9297bf9629
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/replace_one.js
@@ -0,0 +1,54 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const updateDocuments = require('./common_functions').updateDocuments;
+const hasAtomicOperators = require('../utils').hasAtomicOperators;
+
+class ReplaceOneOperation extends OperationBase {
+  constructor(collection, filter, replacement, options) {
+    super(options);
+
+    if (hasAtomicOperators(replacement)) {
+      throw new TypeError('Replacement document must not contain atomic operators');
+    }
+
+    this.collection = collection;
+    this.filter = filter;
+    this.replacement = replacement;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const filter = this.filter;
+    const replacement = this.replacement;
+    const options = this.options;
+
+    // Set single document update
+    options.multi = false;
+
+    // Execute update
+    updateDocuments(coll, filter, replacement, options, (err, r) =>
+      replaceCallback(err, r, replacement, callback)
+    );
+  }
+}
+
+function replaceCallback(err, r, doc, callback) {
+  if (callback == null) return;
+  if (err && callback) return callback(err);
+  if (r == null) return callback(null, { result: { ok: 1 } });
+
+  r.modifiedCount = r.result.nModified != null ? r.result.nModified : r.result.n;
+  r.upsertedId =
+    Array.isArray(r.result.upserted) && r.result.upserted.length > 0
+      ? r.result.upserted[0] // FIXME(major): should be `r.result.upserted[0]._id`
+      : null;
+  r.upsertedCount =
+    Array.isArray(r.result.upserted) && r.result.upserted.length ? r.result.upserted.length : 0;
+  r.matchedCount =
+    Array.isArray(r.result.upserted) && r.result.upserted.length > 0 ? 0 : r.result.n;
+  r.ops = [doc]; // TODO: Should we still have this?
+  if (callback) callback(null, r);
+}
+
+module.exports = ReplaceOneOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/run_command.js b/NodeAPI/node_modules/mongodb/lib/operations/run_command.js
new file mode 100644
index 0000000000000000000000000000000000000000..5525ba2a1b540ac54c0c59b6fce121ff2902adee
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/run_command.js
@@ -0,0 +1,19 @@
+'use strict';
+
+const CommandOperationV2 = require('./command_v2');
+const defineAspects = require('./operation').defineAspects;
+const Aspect = require('./operation').Aspect;
+
+class RunCommandOperation extends CommandOperationV2 {
+  constructor(parent, command, options) {
+    super(parent, options);
+    this.command = command;
+  }
+  execute(server, callback) {
+    const command = this.command;
+    this.executeCommand(server, command, callback);
+  }
+}
+defineAspects(RunCommandOperation, [Aspect.EXECUTE_WITH_SELECTION, Aspect.NO_INHERIT_OPTIONS]);
+
+module.exports = RunCommandOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/set_profiling_level.js b/NodeAPI/node_modules/mongodb/lib/operations/set_profiling_level.js
new file mode 100644
index 0000000000000000000000000000000000000000..b31cc130c0fb13bedeff8b79ddb4155dc806868e
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/set_profiling_level.js
@@ -0,0 +1,48 @@
+'use strict';
+
+const CommandOperation = require('./command');
+const levelValues = new Set(['off', 'slow_only', 'all']);
+
+class SetProfilingLevelOperation extends CommandOperation {
+  constructor(db, level, options) {
+    let profile = 0;
+
+    if (level === 'off') {
+      profile = 0;
+    } else if (level === 'slow_only') {
+      profile = 1;
+    } else if (level === 'all') {
+      profile = 2;
+    }
+
+    super(db, options);
+    this.level = level;
+    this.profile = profile;
+  }
+
+  _buildCommand() {
+    const profile = this.profile;
+
+    // Set up the profile number
+    const command = { profile };
+
+    return command;
+  }
+
+  execute(callback) {
+    const level = this.level;
+
+    if (!levelValues.has(level)) {
+      return callback(new Error('Error: illegal profiling level value ' + level));
+    }
+
+    super.execute((err, doc) => {
+      if (err == null && doc.ok === 1) return callback(null, level);
+      return err != null
+        ? callback(err, null)
+        : callback(new Error('Error with profile command'), null);
+    });
+  }
+}
+
+module.exports = SetProfilingLevelOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/stats.js b/NodeAPI/node_modules/mongodb/lib/operations/stats.js
new file mode 100644
index 0000000000000000000000000000000000000000..ff79126e1f09cf78433739843bb124914e0cd615
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/stats.js
@@ -0,0 +1,45 @@
+'use strict';
+
+const Aspect = require('./operation').Aspect;
+const CommandOperation = require('./command');
+const defineAspects = require('./operation').defineAspects;
+
+/**
+ * Get all the collection statistics.
+ *
+ * @class
+ * @property {Collection} a Collection instance.
+ * @property {object} [options] Optional settings. See Collection.prototype.stats for a list of options.
+ */
+class StatsOperation extends CommandOperation {
+  /**
+   * Construct a Stats operation.
+   *
+   * @param {Collection} a Collection instance.
+   * @param {object} [options] Optional settings. See Collection.prototype.stats for a list of options.
+   */
+  constructor(collection, options) {
+    super(collection.s.db, options, collection);
+  }
+
+  _buildCommand() {
+    const collection = this.collection;
+    const options = this.options;
+
+    // Build command object
+    const command = {
+      collStats: collection.collectionName
+    };
+
+    // Check if we have the scale value
+    if (options['scale'] != null) {
+      command['scale'] = options['scale'];
+    }
+
+    return command;
+  }
+}
+
+defineAspects(StatsOperation, Aspect.READ_OPERATION);
+
+module.exports = StatsOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/update_many.js b/NodeAPI/node_modules/mongodb/lib/operations/update_many.js
new file mode 100644
index 0000000000000000000000000000000000000000..6d2252d34be81c40938c683e277142e60b8d5bf6
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/update_many.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const updateDocuments = require('./common_functions').updateDocuments;
+const hasAtomicOperators = require('../utils').hasAtomicOperators;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+
+class UpdateManyOperation extends OperationBase {
+  constructor(collection, filter, update, options) {
+    super(options);
+
+    if (!hasAtomicOperators(update)) {
+      throw new TypeError('Update document requires atomic operators');
+    }
+
+    this.collection = collection;
+    this.filter = filter;
+    this.update = update;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const filter = this.filter;
+    const update = this.update;
+    const options = this.options;
+
+    // Set single document update
+    options.multi = true;
+    // Execute update
+    updateDocuments(coll, filter, update, options, (err, r) => {
+      if (callback == null) return;
+      if (err) return callback(err);
+      if (r == null) return callback(null, { result: { ok: 1 } });
+
+      // If an explain operation was executed, don't process the server results
+      if (this.explain) return callback(undefined, r.result);
+
+      r.modifiedCount = r.result.nModified != null ? r.result.nModified : r.result.n;
+      r.upsertedId =
+        Array.isArray(r.result.upserted) && r.result.upserted.length > 0
+          ? r.result.upserted[0] // FIXME(major): should be `r.result.upserted[0]._id`
+          : null;
+      r.upsertedCount =
+        Array.isArray(r.result.upserted) && r.result.upserted.length ? r.result.upserted.length : 0;
+      r.matchedCount =
+        Array.isArray(r.result.upserted) && r.result.upserted.length > 0 ? 0 : r.result.n;
+      callback(null, r);
+    });
+  }
+}
+
+defineAspects(UpdateManyOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = UpdateManyOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/update_one.js b/NodeAPI/node_modules/mongodb/lib/operations/update_one.js
new file mode 100644
index 0000000000000000000000000000000000000000..e05cb93a818c5cefb77cfe24c6f3c09b5f8d81a0
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/update_one.js
@@ -0,0 +1,55 @@
+'use strict';
+
+const OperationBase = require('./operation').OperationBase;
+const updateDocuments = require('./common_functions').updateDocuments;
+const hasAtomicOperators = require('../utils').hasAtomicOperators;
+const Aspect = require('./operation').Aspect;
+const defineAspects = require('./operation').defineAspects;
+
+class UpdateOneOperation extends OperationBase {
+  constructor(collection, filter, update, options) {
+    super(options);
+
+    if (!hasAtomicOperators(update)) {
+      throw new TypeError('Update document requires atomic operators');
+    }
+
+    this.collection = collection;
+    this.filter = filter;
+    this.update = update;
+  }
+
+  execute(callback) {
+    const coll = this.collection;
+    const filter = this.filter;
+    const update = this.update;
+    const options = this.options;
+
+    // Set single document update
+    options.multi = false;
+    // Execute update
+    updateDocuments(coll, filter, update, options, (err, r) => {
+      if (callback == null) return;
+      if (err) return callback(err);
+      if (r == null) return callback(null, { result: { ok: 1 } });
+
+      // If an explain operation was executed, don't process the server results
+      if (this.explain) return callback(undefined, r.result);
+
+      r.modifiedCount = r.result.nModified != null ? r.result.nModified : r.result.n;
+      r.upsertedId =
+        Array.isArray(r.result.upserted) && r.result.upserted.length > 0
+          ? r.result.upserted[0] // FIXME(major): should be `r.result.upserted[0]._id`
+          : null;
+      r.upsertedCount =
+        Array.isArray(r.result.upserted) && r.result.upserted.length ? r.result.upserted.length : 0;
+      r.matchedCount =
+        Array.isArray(r.result.upserted) && r.result.upserted.length > 0 ? 0 : r.result.n;
+      callback(null, r);
+    });
+  }
+}
+
+defineAspects(UpdateOneOperation, [Aspect.EXPLAINABLE]);
+
+module.exports = UpdateOneOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/operations/validate_collection.js b/NodeAPI/node_modules/mongodb/lib/operations/validate_collection.js
new file mode 100644
index 0000000000000000000000000000000000000000..bc16cd225322298b95aff0ba19235de213bb3a92
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/operations/validate_collection.js
@@ -0,0 +1,39 @@
+'use strict';
+
+const CommandOperation = require('./command');
+
+class ValidateCollectionOperation extends CommandOperation {
+  constructor(admin, collectionName, options) {
+    // Decorate command with extra options
+    let command = { validate: collectionName };
+    const keys = Object.keys(options);
+    for (let i = 0; i < keys.length; i++) {
+      if (Object.prototype.hasOwnProperty.call(options, keys[i]) && keys[i] !== 'session') {
+        command[keys[i]] = options[keys[i]];
+      }
+    }
+
+    super(admin.s.db, options, null, command);
+    this.collectionName = collectionName;
+  }
+
+  execute(callback) {
+    const collectionName = this.collectionName;
+
+    super.execute((err, doc) => {
+      if (err != null) return callback(err, null);
+
+      if (doc.ok === 0) return callback(new Error('Error with validate command'), null);
+      if (doc.result != null && doc.result.constructor !== String)
+        return callback(new Error('Error with validation data'), null);
+      if (doc.result != null && doc.result.match(/exception|corrupt/) != null)
+        return callback(new Error('Error: invalid collection ' + collectionName), null);
+      if (doc.valid != null && !doc.valid)
+        return callback(new Error('Error: invalid collection ' + collectionName), null);
+
+      return callback(null, doc);
+    });
+  }
+}
+
+module.exports = ValidateCollectionOperation;
diff --git a/NodeAPI/node_modules/mongodb/lib/read_concern.js b/NodeAPI/node_modules/mongodb/lib/read_concern.js
new file mode 100644
index 0000000000000000000000000000000000000000..b48b8e0ee080574d6afb3d66599ee6385cd26ea5
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/read_concern.js
@@ -0,0 +1,61 @@
+'use strict';
+
+/**
+ * The **ReadConcern** class is a class that represents a MongoDB ReadConcern.
+ * @class
+ * @property {string} level The read concern level
+ * @see https://docs.mongodb.com/manual/reference/read-concern/index.html
+ */
+class ReadConcern {
+  /**
+   * Constructs a ReadConcern from the read concern properties.
+   * @param {string} [level] The read concern level ({'local'|'available'|'majority'|'linearizable'|'snapshot'})
+   */
+  constructor(level) {
+    if (level != null) {
+      this.level = level;
+    }
+  }
+
+  /**
+   * Construct a ReadConcern given an options object.
+   *
+   * @param {object} options The options object from which to extract the write concern.
+   * @return {ReadConcern}
+   */
+  static fromOptions(options) {
+    if (options == null) {
+      return;
+    }
+
+    if (options.readConcern) {
+      if (options.readConcern instanceof ReadConcern) {
+        return options.readConcern;
+      }
+
+      return new ReadConcern(options.readConcern.level);
+    }
+
+    if (options.level) {
+      return new ReadConcern(options.level);
+    }
+  }
+
+  static get MAJORITY() {
+    return 'majority';
+  }
+
+  static get AVAILABLE() {
+    return 'available';
+  }
+
+  static get LINEARIZABLE() {
+    return 'linearizable';
+  }
+
+  static get SNAPSHOT() {
+    return 'snapshot';
+  }
+}
+
+module.exports = ReadConcern;
diff --git a/NodeAPI/node_modules/mongodb/lib/topologies/mongos.js b/NodeAPI/node_modules/mongodb/lib/topologies/mongos.js
new file mode 100644
index 0000000000000000000000000000000000000000..bf30d20ebefeb1f35a4b7ff19728bc51b28c6212
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/topologies/mongos.js
@@ -0,0 +1,445 @@
+'use strict';
+
+const TopologyBase = require('./topology_base').TopologyBase;
+const MongoError = require('../core').MongoError;
+const CMongos = require('../core').Mongos;
+const Cursor = require('../cursor');
+const Server = require('./server');
+const Store = require('./topology_base').Store;
+const MAX_JS_INT = require('../utils').MAX_JS_INT;
+const translateOptions = require('../utils').translateOptions;
+const filterOptions = require('../utils').filterOptions;
+const mergeOptions = require('../utils').mergeOptions;
+
+/**
+ * @fileOverview The **Mongos** class is a class that represents a Mongos Proxy topology and is
+ * used to construct connections.
+ *
+ * **Mongos Should not be used, use MongoClient.connect**
+ */
+
+// Allowed parameters
+var legalOptionNames = [
+  'ha',
+  'haInterval',
+  'acceptableLatencyMS',
+  'poolSize',
+  'ssl',
+  'checkServerIdentity',
+  'sslValidate',
+  'sslCA',
+  'sslCRL',
+  'sslCert',
+  'ciphers',
+  'ecdhCurve',
+  'sslKey',
+  'sslPass',
+  'socketOptions',
+  'bufferMaxEntries',
+  'store',
+  'auto_reconnect',
+  'autoReconnect',
+  'emitError',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'noDelay',
+  'connectTimeoutMS',
+  'socketTimeoutMS',
+  'loggerLevel',
+  'logger',
+  'reconnectTries',
+  'appname',
+  'domainsEnabled',
+  'servername',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'promiseLibrary',
+  'monitorCommands'
+];
+
+/**
+ * Creates a new Mongos instance
+ * @class
+ * @deprecated
+ * @param {Server[]} servers A seedlist of servers participating in the replicaset.
+ * @param {object} [options] Optional settings.
+ * @param {booelan} [options.ha=true] Turn on high availability monitoring.
+ * @param {number} [options.haInterval=5000] Time between each replicaset status check.
+ * @param {number} [options.poolSize=5] Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons.
+ * @param {number} [options.acceptableLatencyMS=15] Cutoff latency point in MS for MongoS proxy selection
+ * @param {boolean} [options.ssl=false] Use ssl connection (needs to have a mongod server with ssl support)
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {boolean} [options.sslValidate=false] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {array} [options.sslCA] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {array} [options.sslCRL] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {string} [options.ciphers] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
+ * @param {string} [options.ecdhCurve] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
+ * @param {(Buffer|string)} [options.sslCert] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {(Buffer|string)} [options.sslKey] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {(Buffer|string)} [options.sslPass] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {string} [options.servername] String containing the server name requested via TLS SNI.
+ * @param {object} [options.socketOptions] Socket options
+ * @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option.
+ * @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.socketOptions.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
+ * @param {number} [options.socketOptions.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
+ * @param {number} [options.socketOptions.socketTimeoutMS=0] How long a send or receive on a socket can take before timing out
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
+ * @fires Mongos#connect
+ * @fires Mongos#ha
+ * @fires Mongos#joined
+ * @fires Mongos#left
+ * @fires Mongos#fullsetup
+ * @fires Mongos#open
+ * @fires Mongos#close
+ * @fires Mongos#error
+ * @fires Mongos#timeout
+ * @fires Mongos#parseError
+ * @fires Mongos#commandStarted
+ * @fires Mongos#commandSucceeded
+ * @fires Mongos#commandFailed
+ * @property {string} parserType the parser type used (c++ or js).
+ * @return {Mongos} a Mongos instance.
+ */
+class Mongos extends TopologyBase {
+  constructor(servers, options) {
+    super();
+
+    options = options || {};
+    var self = this;
+
+    // Filter the options
+    options = filterOptions(options, legalOptionNames);
+
+    // Ensure all the instances are Server
+    for (var i = 0; i < servers.length; i++) {
+      if (!(servers[i] instanceof Server)) {
+        throw MongoError.create({
+          message: 'all seed list instances must be of the Server type',
+          driver: true
+        });
+      }
+    }
+
+    // Stored options
+    var storeOptions = {
+      force: false,
+      bufferMaxEntries:
+        typeof options.bufferMaxEntries === 'number' ? options.bufferMaxEntries : MAX_JS_INT
+    };
+
+    // Shared global store
+    var store = options.store || new Store(self, storeOptions);
+
+    // Build seed list
+    var seedlist = servers.map(function(x) {
+      return { host: x.host, port: x.port };
+    });
+
+    // Get the reconnect option
+    var reconnect = typeof options.auto_reconnect === 'boolean' ? options.auto_reconnect : true;
+    reconnect = typeof options.autoReconnect === 'boolean' ? options.autoReconnect : reconnect;
+
+    // Clone options
+    var clonedOptions = mergeOptions(
+      {},
+      {
+        disconnectHandler: store,
+        cursorFactory: Cursor,
+        reconnect: reconnect,
+        emitError: typeof options.emitError === 'boolean' ? options.emitError : true,
+        size: typeof options.poolSize === 'number' ? options.poolSize : 5,
+        monitorCommands:
+          typeof options.monitorCommands === 'boolean' ? options.monitorCommands : false
+      }
+    );
+
+    // Translate any SSL options and other connectivity options
+    clonedOptions = translateOptions(clonedOptions, options);
+
+    // Socket options
+    var socketOptions =
+      options.socketOptions && Object.keys(options.socketOptions).length > 0
+        ? options.socketOptions
+        : options;
+
+    // Translate all the options to the core types
+    clonedOptions = translateOptions(clonedOptions, socketOptions);
+
+    // Internal state
+    this.s = {
+      // Create the Mongos
+      coreTopology: new CMongos(seedlist, clonedOptions),
+      // Server capabilities
+      sCapabilities: null,
+      // Debug turned on
+      debug: clonedOptions.debug,
+      // Store option defaults
+      storeOptions: storeOptions,
+      // Cloned options
+      clonedOptions: clonedOptions,
+      // Actual store of callbacks
+      store: store,
+      // Options
+      options: options,
+      // Server Session Pool
+      sessionPool: null,
+      // Active client sessions
+      sessions: new Set(),
+      // Promise library
+      promiseLibrary: options.promiseLibrary || Promise
+    };
+  }
+
+  // Connect
+  connect(_options, callback) {
+    var self = this;
+    if ('function' === typeof _options) (callback = _options), (_options = {});
+    if (_options == null) _options = {};
+    if (!('function' === typeof callback)) callback = null;
+    _options = Object.assign({}, this.s.clonedOptions, _options);
+    self.s.options = _options;
+
+    // Update bufferMaxEntries
+    self.s.storeOptions.bufferMaxEntries =
+      typeof _options.bufferMaxEntries === 'number' ? _options.bufferMaxEntries : -1;
+
+    // Error handler
+    var connectErrorHandler = function() {
+      return function(err) {
+        // Remove all event handlers
+        var events = ['timeout', 'error', 'close'];
+        events.forEach(function(e) {
+          self.removeListener(e, connectErrorHandler);
+        });
+
+        self.s.coreTopology.removeListener('connect', connectErrorHandler);
+        // Force close the topology
+        self.close(true);
+
+        // Try to callback
+        try {
+          callback(err);
+        } catch (err) {
+          process.nextTick(function() {
+            throw err;
+          });
+        }
+      };
+    };
+
+    // Actual handler
+    var errorHandler = function(event) {
+      return function(err) {
+        if (event !== 'error') {
+          self.emit(event, err);
+        }
+      };
+    };
+
+    // Error handler
+    var reconnectHandler = function() {
+      self.emit('reconnect');
+      self.s.store.execute();
+    };
+
+    // relay the event
+    var relay = function(event) {
+      return function(t, server) {
+        self.emit(event, t, server);
+      };
+    };
+
+    // Connect handler
+    var connectHandler = function() {
+      // Clear out all the current handlers left over
+      var events = ['timeout', 'error', 'close', 'fullsetup'];
+      events.forEach(function(e) {
+        self.s.coreTopology.removeAllListeners(e);
+      });
+
+      // Set up listeners
+      self.s.coreTopology.on('timeout', errorHandler('timeout'));
+      self.s.coreTopology.on('error', errorHandler('error'));
+      self.s.coreTopology.on('close', errorHandler('close'));
+
+      // Set up serverConfig listeners
+      self.s.coreTopology.on('fullsetup', function() {
+        self.emit('fullsetup', self);
+      });
+
+      // Emit open event
+      self.emit('open', null, self);
+
+      // Return correctly
+      try {
+        callback(null, self);
+      } catch (err) {
+        process.nextTick(function() {
+          throw err;
+        });
+      }
+    };
+
+    // Clear out all the current handlers left over
+    var events = [
+      'timeout',
+      'error',
+      'close',
+      'serverOpening',
+      'serverDescriptionChanged',
+      'serverHeartbeatStarted',
+      'serverHeartbeatSucceeded',
+      'serverHeartbeatFailed',
+      'serverClosed',
+      'topologyOpening',
+      'topologyClosed',
+      'topologyDescriptionChanged',
+      'commandStarted',
+      'commandSucceeded',
+      'commandFailed'
+    ];
+    events.forEach(function(e) {
+      self.s.coreTopology.removeAllListeners(e);
+    });
+
+    // Set up SDAM listeners
+    self.s.coreTopology.on('serverDescriptionChanged', relay('serverDescriptionChanged'));
+    self.s.coreTopology.on('serverHeartbeatStarted', relay('serverHeartbeatStarted'));
+    self.s.coreTopology.on('serverHeartbeatSucceeded', relay('serverHeartbeatSucceeded'));
+    self.s.coreTopology.on('serverHeartbeatFailed', relay('serverHeartbeatFailed'));
+    self.s.coreTopology.on('serverOpening', relay('serverOpening'));
+    self.s.coreTopology.on('serverClosed', relay('serverClosed'));
+    self.s.coreTopology.on('topologyOpening', relay('topologyOpening'));
+    self.s.coreTopology.on('topologyClosed', relay('topologyClosed'));
+    self.s.coreTopology.on('topologyDescriptionChanged', relay('topologyDescriptionChanged'));
+    self.s.coreTopology.on('commandStarted', relay('commandStarted'));
+    self.s.coreTopology.on('commandSucceeded', relay('commandSucceeded'));
+    self.s.coreTopology.on('commandFailed', relay('commandFailed'));
+
+    // Set up listeners
+    self.s.coreTopology.once('timeout', connectErrorHandler('timeout'));
+    self.s.coreTopology.once('error', connectErrorHandler('error'));
+    self.s.coreTopology.once('close', connectErrorHandler('close'));
+    self.s.coreTopology.once('connect', connectHandler);
+    // Join and leave events
+    self.s.coreTopology.on('joined', relay('joined'));
+    self.s.coreTopology.on('left', relay('left'));
+
+    // Reconnect server
+    self.s.coreTopology.on('reconnect', reconnectHandler);
+
+    // Start connection
+    self.s.coreTopology.connect(_options);
+  }
+}
+
+Object.defineProperty(Mongos.prototype, 'haInterval', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.s.haInterval;
+  }
+});
+
+/**
+ * A mongos connect event, used to verify that the connection is up and running
+ *
+ * @event Mongos#connect
+ * @type {Mongos}
+ */
+
+/**
+ * The mongos high availability event
+ *
+ * @event Mongos#ha
+ * @type {function}
+ * @param {string} type The stage in the high availability event (start|end)
+ * @param {boolean} data.norepeat This is a repeating high availability process or a single execution only
+ * @param {number} data.id The id for this high availability request
+ * @param {object} data.state An object containing the information about the current replicaset
+ */
+
+/**
+ * A server member left the mongos set
+ *
+ * @event Mongos#left
+ * @type {function}
+ * @param {string} type The type of member that left (primary|secondary|arbiter)
+ * @param {Server} server The server object that left
+ */
+
+/**
+ * A server member joined the mongos set
+ *
+ * @event Mongos#joined
+ * @type {function}
+ * @param {string} type The type of member that joined (primary|secondary|arbiter)
+ * @param {Server} server The server object that joined
+ */
+
+/**
+ * Mongos fullsetup event, emitted when all proxies in the topology have been connected to.
+ *
+ * @event Mongos#fullsetup
+ * @type {Mongos}
+ */
+
+/**
+ * Mongos open event, emitted when mongos can start processing commands.
+ *
+ * @event Mongos#open
+ * @type {Mongos}
+ */
+
+/**
+ * Mongos close event
+ *
+ * @event Mongos#close
+ * @type {object}
+ */
+
+/**
+ * Mongos error event, emitted if there is an error listener.
+ *
+ * @event Mongos#error
+ * @type {MongoError}
+ */
+
+/**
+ * Mongos timeout event
+ *
+ * @event Mongos#timeout
+ * @type {object}
+ */
+
+/**
+ * Mongos parseError event
+ *
+ * @event Mongos#parseError
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command was started, if command monitoring is enabled
+ *
+ * @event Mongos#commandStarted
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command succeeded, if command monitoring is enabled
+ *
+ * @event Mongos#commandSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command failed, if command monitoring is enabled
+ *
+ * @event Mongos#commandFailed
+ * @type {object}
+ */
+
+module.exports = Mongos;
diff --git a/NodeAPI/node_modules/mongodb/lib/topologies/native_topology.js b/NodeAPI/node_modules/mongodb/lib/topologies/native_topology.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb7d91dcdea90da0089d44132b45073b980717d0
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/topologies/native_topology.js
@@ -0,0 +1,78 @@
+'use strict';
+
+const Topology = require('../core').Topology;
+const ServerCapabilities = require('./topology_base').ServerCapabilities;
+const Cursor = require('../cursor');
+const translateOptions = require('../utils').translateOptions;
+
+class NativeTopology extends Topology {
+  constructor(servers, options) {
+    options = options || {};
+
+    let clonedOptions = Object.assign(
+      {},
+      {
+        cursorFactory: Cursor,
+        reconnect: false,
+        emitError: typeof options.emitError === 'boolean' ? options.emitError : true,
+        maxPoolSize:
+          typeof options.maxPoolSize === 'number'
+            ? options.maxPoolSize
+            : typeof options.poolSize === 'number'
+            ? options.poolSize
+            : 10,
+        minPoolSize:
+          typeof options.minPoolSize === 'number'
+            ? options.minPoolSize
+            : typeof options.minSize === 'number'
+            ? options.minSize
+            : 0,
+        monitorCommands:
+          typeof options.monitorCommands === 'boolean' ? options.monitorCommands : false
+      }
+    );
+
+    // Translate any SSL options and other connectivity options
+    clonedOptions = translateOptions(clonedOptions, options);
+
+    // Socket options
+    var socketOptions =
+      options.socketOptions && Object.keys(options.socketOptions).length > 0
+        ? options.socketOptions
+        : options;
+
+    // Translate all the options to the core types
+    clonedOptions = translateOptions(clonedOptions, socketOptions);
+
+    super(servers, clonedOptions);
+  }
+
+  capabilities() {
+    if (this.s.sCapabilities) return this.s.sCapabilities;
+    if (this.lastIsMaster() == null) return null;
+    this.s.sCapabilities = new ServerCapabilities(this.lastIsMaster());
+    return this.s.sCapabilities;
+  }
+
+  // Command
+  command(ns, cmd, options, callback) {
+    super.command(ns.toString(), cmd, options, callback);
+  }
+
+  // Insert
+  insert(ns, ops, options, callback) {
+    super.insert(ns.toString(), ops, options, callback);
+  }
+
+  // Update
+  update(ns, ops, options, callback) {
+    super.update(ns.toString(), ops, options, callback);
+  }
+
+  // Remove
+  remove(ns, ops, options, callback) {
+    super.remove(ns.toString(), ops, options, callback);
+  }
+}
+
+module.exports = NativeTopology;
diff --git a/NodeAPI/node_modules/mongodb/lib/topologies/replset.js b/NodeAPI/node_modules/mongodb/lib/topologies/replset.js
new file mode 100644
index 0000000000000000000000000000000000000000..80701f5d3e32db1a9eb4eb7b44bfbe1178286cfe
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/topologies/replset.js
@@ -0,0 +1,489 @@
+'use strict';
+
+const Server = require('./server');
+const Cursor = require('../cursor');
+const MongoError = require('../core').MongoError;
+const TopologyBase = require('./topology_base').TopologyBase;
+const Store = require('./topology_base').Store;
+const CReplSet = require('../core').ReplSet;
+const MAX_JS_INT = require('../utils').MAX_JS_INT;
+const translateOptions = require('../utils').translateOptions;
+const filterOptions = require('../utils').filterOptions;
+const mergeOptions = require('../utils').mergeOptions;
+
+/**
+ * @fileOverview The **ReplSet** class is a class that represents a Replicaset topology and is
+ * used to construct connections.
+ *
+ * **ReplSet Should not be used, use MongoClient.connect**
+ */
+
+// Allowed parameters
+var legalOptionNames = [
+  'ha',
+  'haInterval',
+  'replicaSet',
+  'rs_name',
+  'secondaryAcceptableLatencyMS',
+  'connectWithNoPrimary',
+  'poolSize',
+  'ssl',
+  'checkServerIdentity',
+  'sslValidate',
+  'sslCA',
+  'sslCert',
+  'ciphers',
+  'ecdhCurve',
+  'sslCRL',
+  'sslKey',
+  'sslPass',
+  'socketOptions',
+  'bufferMaxEntries',
+  'store',
+  'auto_reconnect',
+  'autoReconnect',
+  'emitError',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'noDelay',
+  'connectTimeoutMS',
+  'socketTimeoutMS',
+  'strategy',
+  'debug',
+  'family',
+  'loggerLevel',
+  'logger',
+  'reconnectTries',
+  'appname',
+  'domainsEnabled',
+  'servername',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'maxStalenessSeconds',
+  'promiseLibrary',
+  'minSize',
+  'monitorCommands'
+];
+
+/**
+ * Creates a new ReplSet instance
+ * @class
+ * @deprecated
+ * @param {Server[]} servers A seedlist of servers participating in the replicaset.
+ * @param {object} [options] Optional settings.
+ * @param {boolean} [options.ha=true] Turn on high availability monitoring.
+ * @param {number} [options.haInterval=10000] Time between each replicaset status check.
+ * @param {string} [options.replicaSet] The name of the replicaset to connect to.
+ * @param {number} [options.secondaryAcceptableLatencyMS=15] Sets the range of servers to pick when using NEAREST (lowest ping ms + the latency fence, ex: range of 1 to (1 + 15) ms)
+ * @param {boolean} [options.connectWithNoPrimary=false] Sets if the driver should connect even if no primary is available
+ * @param {number} [options.poolSize=5] Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons.
+ * @param {boolean} [options.ssl=false] Use ssl connection (needs to have a mongod server with ssl support)
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {boolean} [options.sslValidate=false] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {array} [options.sslCA] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {array} [options.sslCRL] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {(Buffer|string)} [options.sslCert] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher.
+ * @param {string} [options.ciphers] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
+ * @param {string} [options.ecdhCurve] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
+ * @param {(Buffer|string)} [options.sslKey] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {(Buffer|string)} [options.sslPass] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {string} [options.servername] String containing the server name requested via TLS SNI.
+ * @param {object} [options.socketOptions] Socket options
+ * @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option.
+ * @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.socketOptions.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
+ * @param {number} [options.socketOptions.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
+ * @param {number} [options.socketOptions.socketTimeoutMS=360000] How long a send or receive on a socket can take before timing out
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @param {number} [options.maxStalenessSeconds=undefined] The max staleness to secondary reads (values under 10 seconds cannot be guaranteed);
+ * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
+ * @fires ReplSet#connect
+ * @fires ReplSet#ha
+ * @fires ReplSet#joined
+ * @fires ReplSet#left
+ * @fires ReplSet#fullsetup
+ * @fires ReplSet#open
+ * @fires ReplSet#close
+ * @fires ReplSet#error
+ * @fires ReplSet#timeout
+ * @fires ReplSet#parseError
+ * @fires ReplSet#commandStarted
+ * @fires ReplSet#commandSucceeded
+ * @fires ReplSet#commandFailed
+ * @property {string} parserType the parser type used (c++ or js).
+ * @return {ReplSet} a ReplSet instance.
+ */
+class ReplSet extends TopologyBase {
+  constructor(servers, options) {
+    super();
+
+    options = options || {};
+    var self = this;
+
+    // Filter the options
+    options = filterOptions(options, legalOptionNames);
+
+    // Ensure all the instances are Server
+    for (var i = 0; i < servers.length; i++) {
+      if (!(servers[i] instanceof Server)) {
+        throw MongoError.create({
+          message: 'all seed list instances must be of the Server type',
+          driver: true
+        });
+      }
+    }
+
+    // Stored options
+    var storeOptions = {
+      force: false,
+      bufferMaxEntries:
+        typeof options.bufferMaxEntries === 'number' ? options.bufferMaxEntries : MAX_JS_INT
+    };
+
+    // Shared global store
+    var store = options.store || new Store(self, storeOptions);
+
+    // Build seed list
+    var seedlist = servers.map(function(x) {
+      return { host: x.host, port: x.port };
+    });
+
+    // Clone options
+    var clonedOptions = mergeOptions(
+      {},
+      {
+        disconnectHandler: store,
+        cursorFactory: Cursor,
+        reconnect: false,
+        emitError: typeof options.emitError === 'boolean' ? options.emitError : true,
+        size: typeof options.poolSize === 'number' ? options.poolSize : 5,
+        monitorCommands:
+          typeof options.monitorCommands === 'boolean' ? options.monitorCommands : false
+      }
+    );
+
+    // Translate any SSL options and other connectivity options
+    clonedOptions = translateOptions(clonedOptions, options);
+
+    // Socket options
+    var socketOptions =
+      options.socketOptions && Object.keys(options.socketOptions).length > 0
+        ? options.socketOptions
+        : options;
+
+    // Translate all the options to the core types
+    clonedOptions = translateOptions(clonedOptions, socketOptions);
+
+    // Create the ReplSet
+    var coreTopology = new CReplSet(seedlist, clonedOptions);
+
+    // Listen to reconnect event
+    coreTopology.on('reconnect', function() {
+      self.emit('reconnect');
+      store.execute();
+    });
+
+    // Internal state
+    this.s = {
+      // Replicaset
+      coreTopology: coreTopology,
+      // Server capabilities
+      sCapabilities: null,
+      // Debug tag
+      tag: options.tag,
+      // Store options
+      storeOptions: storeOptions,
+      // Cloned options
+      clonedOptions: clonedOptions,
+      // Store
+      store: store,
+      // Options
+      options: options,
+      // Server Session Pool
+      sessionPool: null,
+      // Active client sessions
+      sessions: new Set(),
+      // Promise library
+      promiseLibrary: options.promiseLibrary || Promise
+    };
+
+    // Debug
+    if (clonedOptions.debug) {
+      // Last ismaster
+      Object.defineProperty(this, 'replset', {
+        enumerable: true,
+        get: function() {
+          return coreTopology;
+        }
+      });
+    }
+  }
+
+  // Connect method
+  connect(_options, callback) {
+    var self = this;
+    if ('function' === typeof _options) (callback = _options), (_options = {});
+    if (_options == null) _options = {};
+    if (!('function' === typeof callback)) callback = null;
+    _options = Object.assign({}, this.s.clonedOptions, _options);
+    self.s.options = _options;
+
+    // Update bufferMaxEntries
+    self.s.storeOptions.bufferMaxEntries =
+      typeof _options.bufferMaxEntries === 'number' ? _options.bufferMaxEntries : -1;
+
+    // Actual handler
+    var errorHandler = function(event) {
+      return function(err) {
+        if (event !== 'error') {
+          self.emit(event, err);
+        }
+      };
+    };
+
+    // Clear out all the current handlers left over
+    var events = [
+      'timeout',
+      'error',
+      'close',
+      'serverOpening',
+      'serverDescriptionChanged',
+      'serverHeartbeatStarted',
+      'serverHeartbeatSucceeded',
+      'serverHeartbeatFailed',
+      'serverClosed',
+      'topologyOpening',
+      'topologyClosed',
+      'topologyDescriptionChanged',
+      'commandStarted',
+      'commandSucceeded',
+      'commandFailed',
+      'joined',
+      'left',
+      'ping',
+      'ha'
+    ];
+    events.forEach(function(e) {
+      self.s.coreTopology.removeAllListeners(e);
+    });
+
+    // relay the event
+    var relay = function(event) {
+      return function(t, server) {
+        self.emit(event, t, server);
+      };
+    };
+
+    // Replset events relay
+    var replsetRelay = function(event) {
+      return function(t, server) {
+        self.emit(event, t, server.lastIsMaster(), server);
+      };
+    };
+
+    // Relay ha
+    var relayHa = function(t, state) {
+      self.emit('ha', t, state);
+
+      if (t === 'start') {
+        self.emit('ha_connect', t, state);
+      } else if (t === 'end') {
+        self.emit('ha_ismaster', t, state);
+      }
+    };
+
+    // Set up serverConfig listeners
+    self.s.coreTopology.on('joined', replsetRelay('joined'));
+    self.s.coreTopology.on('left', relay('left'));
+    self.s.coreTopology.on('ping', relay('ping'));
+    self.s.coreTopology.on('ha', relayHa);
+
+    // Set up SDAM listeners
+    self.s.coreTopology.on('serverDescriptionChanged', relay('serverDescriptionChanged'));
+    self.s.coreTopology.on('serverHeartbeatStarted', relay('serverHeartbeatStarted'));
+    self.s.coreTopology.on('serverHeartbeatSucceeded', relay('serverHeartbeatSucceeded'));
+    self.s.coreTopology.on('serverHeartbeatFailed', relay('serverHeartbeatFailed'));
+    self.s.coreTopology.on('serverOpening', relay('serverOpening'));
+    self.s.coreTopology.on('serverClosed', relay('serverClosed'));
+    self.s.coreTopology.on('topologyOpening', relay('topologyOpening'));
+    self.s.coreTopology.on('topologyClosed', relay('topologyClosed'));
+    self.s.coreTopology.on('topologyDescriptionChanged', relay('topologyDescriptionChanged'));
+    self.s.coreTopology.on('commandStarted', relay('commandStarted'));
+    self.s.coreTopology.on('commandSucceeded', relay('commandSucceeded'));
+    self.s.coreTopology.on('commandFailed', relay('commandFailed'));
+
+    self.s.coreTopology.on('fullsetup', function() {
+      self.emit('fullsetup', self, self);
+    });
+
+    self.s.coreTopology.on('all', function() {
+      self.emit('all', null, self);
+    });
+
+    // Connect handler
+    var connectHandler = function() {
+      // Set up listeners
+      self.s.coreTopology.once('timeout', errorHandler('timeout'));
+      self.s.coreTopology.once('error', errorHandler('error'));
+      self.s.coreTopology.once('close', errorHandler('close'));
+
+      // Emit open event
+      self.emit('open', null, self);
+
+      // Return correctly
+      try {
+        callback(null, self);
+      } catch (err) {
+        process.nextTick(function() {
+          throw err;
+        });
+      }
+    };
+
+    // Error handler
+    var connectErrorHandler = function() {
+      return function(err) {
+        ['timeout', 'error', 'close'].forEach(function(e) {
+          self.s.coreTopology.removeListener(e, connectErrorHandler);
+        });
+
+        self.s.coreTopology.removeListener('connect', connectErrorHandler);
+        // Destroy the replset
+        self.s.coreTopology.destroy();
+
+        // Try to callback
+        try {
+          callback(err);
+        } catch (err) {
+          if (!self.s.coreTopology.isConnected())
+            process.nextTick(function() {
+              throw err;
+            });
+        }
+      };
+    };
+
+    // Set up listeners
+    self.s.coreTopology.once('timeout', connectErrorHandler('timeout'));
+    self.s.coreTopology.once('error', connectErrorHandler('error'));
+    self.s.coreTopology.once('close', connectErrorHandler('close'));
+    self.s.coreTopology.once('connect', connectHandler);
+
+    // Start connection
+    self.s.coreTopology.connect(_options);
+  }
+
+  close(forceClosed, callback) {
+    ['timeout', 'error', 'close', 'joined', 'left'].forEach(e => this.removeAllListeners(e));
+    super.close(forceClosed, callback);
+  }
+}
+
+Object.defineProperty(ReplSet.prototype, 'haInterval', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.s.haInterval;
+  }
+});
+
+/**
+ * A replset connect event, used to verify that the connection is up and running
+ *
+ * @event ReplSet#connect
+ * @type {ReplSet}
+ */
+
+/**
+ * The replset high availability event
+ *
+ * @event ReplSet#ha
+ * @type {function}
+ * @param {string} type The stage in the high availability event (start|end)
+ * @param {boolean} data.norepeat This is a repeating high availability process or a single execution only
+ * @param {number} data.id The id for this high availability request
+ * @param {object} data.state An object containing the information about the current replicaset
+ */
+
+/**
+ * A server member left the replicaset
+ *
+ * @event ReplSet#left
+ * @type {function}
+ * @param {string} type The type of member that left (primary|secondary|arbiter)
+ * @param {Server} server The server object that left
+ */
+
+/**
+ * A server member joined the replicaset
+ *
+ * @event ReplSet#joined
+ * @type {function}
+ * @param {string} type The type of member that joined (primary|secondary|arbiter)
+ * @param {Server} server The server object that joined
+ */
+
+/**
+ * ReplSet open event, emitted when replicaset can start processing commands.
+ *
+ * @event ReplSet#open
+ * @type {Replset}
+ */
+
+/**
+ * ReplSet fullsetup event, emitted when all servers in the topology have been connected to.
+ *
+ * @event ReplSet#fullsetup
+ * @type {Replset}
+ */
+
+/**
+ * ReplSet close event
+ *
+ * @event ReplSet#close
+ * @type {object}
+ */
+
+/**
+ * ReplSet error event, emitted if there is an error listener.
+ *
+ * @event ReplSet#error
+ * @type {MongoError}
+ */
+
+/**
+ * ReplSet timeout event
+ *
+ * @event ReplSet#timeout
+ * @type {object}
+ */
+
+/**
+ * ReplSet parseError event
+ *
+ * @event ReplSet#parseError
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command was started, if command monitoring is enabled
+ *
+ * @event ReplSet#commandStarted
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command succeeded, if command monitoring is enabled
+ *
+ * @event ReplSet#commandSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command failed, if command monitoring is enabled
+ *
+ * @event ReplSet#commandFailed
+ * @type {object}
+ */
+
+module.exports = ReplSet;
diff --git a/NodeAPI/node_modules/mongodb/lib/topologies/server.js b/NodeAPI/node_modules/mongodb/lib/topologies/server.js
new file mode 100644
index 0000000000000000000000000000000000000000..0abaad3dba6cc0c6788848c753c864e5bcc41ead
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/topologies/server.js
@@ -0,0 +1,448 @@
+'use strict';
+
+const CServer = require('../core').Server;
+const Cursor = require('../cursor');
+const TopologyBase = require('./topology_base').TopologyBase;
+const Store = require('./topology_base').Store;
+const MongoError = require('../core').MongoError;
+const MAX_JS_INT = require('../utils').MAX_JS_INT;
+const translateOptions = require('../utils').translateOptions;
+const filterOptions = require('../utils').filterOptions;
+const mergeOptions = require('../utils').mergeOptions;
+
+/**
+ * @fileOverview The **Server** class is a class that represents a single server topology and is
+ * used to construct connections.
+ *
+ * **Server Should not be used, use MongoClient.connect**
+ */
+
+// Allowed parameters
+var legalOptionNames = [
+  'ha',
+  'haInterval',
+  'acceptableLatencyMS',
+  'poolSize',
+  'ssl',
+  'checkServerIdentity',
+  'sslValidate',
+  'sslCA',
+  'sslCRL',
+  'sslCert',
+  'ciphers',
+  'ecdhCurve',
+  'sslKey',
+  'sslPass',
+  'socketOptions',
+  'bufferMaxEntries',
+  'store',
+  'auto_reconnect',
+  'autoReconnect',
+  'emitError',
+  'keepAlive',
+  'keepAliveInitialDelay',
+  'noDelay',
+  'connectTimeoutMS',
+  'socketTimeoutMS',
+  'family',
+  'loggerLevel',
+  'logger',
+  'reconnectTries',
+  'reconnectInterval',
+  'monitoring',
+  'appname',
+  'domainsEnabled',
+  'servername',
+  'promoteLongs',
+  'promoteValues',
+  'promoteBuffers',
+  'compression',
+  'promiseLibrary',
+  'monitorCommands'
+];
+
+/**
+ * Creates a new Server instance
+ * @class
+ * @deprecated
+ * @param {string} host The host for the server, can be either an IP4, IP6 or domain socket style host.
+ * @param {number} [port] The server port if IP4.
+ * @param {object} [options] Optional settings.
+ * @param {number} [options.poolSize=5] Number of connections in the connection pool for each server instance, set to 5 as default for legacy reasons.
+ * @param {boolean} [options.ssl=false] Use ssl connection (needs to have a mongod server with ssl support)
+ * @param {boolean} [options.sslValidate=false] Validate mongod server certificate against ca (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {boolean|function} [options.checkServerIdentity=true] Ensure we check server identify during SSL, set to false to disable checking. Only works for Node 0.12.x or higher. You can pass in a boolean or your own checkServerIdentity override function.
+ * @param {array} [options.sslCA] Array of valid certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {array} [options.sslCRL] Array of revocation certificates either as Buffers or Strings (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {(Buffer|string)} [options.sslCert] String or buffer containing the certificate we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {string} [options.ciphers] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
+ * @param {string} [options.ecdhCurve] Passed directly through to tls.createSecureContext. See https://nodejs.org/dist/latest-v9.x/docs/api/tls.html#tls_tls_createsecurecontext_options for more info.
+ * @param {(Buffer|string)} [options.sslKey] String or buffer containing the certificate private key we wish to present (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {(Buffer|string)} [options.sslPass] String or buffer containing the certificate password (needs to have a mongod server with ssl support, 2.4 or higher)
+ * @param {string} [options.servername] String containing the server name requested via TLS SNI.
+ * @param {object} [options.socketOptions] Socket options
+ * @param {boolean} [options.socketOptions.autoReconnect=true] Reconnect on error.
+ * @param {boolean} [options.socketOptions.noDelay=true] TCP Socket NoDelay option.
+ * @param {boolean} [options.socketOptions.keepAlive=true] TCP Connection keep alive enabled
+ * @param {number} [options.socketOptions.keepAliveInitialDelay=120000] The number of milliseconds to wait before initiating keepAlive on the TCP socket
+ * @param {number} [options.socketOptions.connectTimeoutMS=10000] How long to wait for a connection to be established before timing out
+ * @param {number} [options.socketOptions.socketTimeoutMS=0] How long a send or receive on a socket can take before timing out
+ * @param {number} [options.reconnectTries=30] Server attempt to reconnect #times
+ * @param {number} [options.reconnectInterval=1000] Server will wait # milliseconds between retries
+ * @param {boolean} [options.monitoring=true] Triggers the server instance to call ismaster
+ * @param {number} [options.haInterval=10000] The interval of calling ismaster when monitoring is enabled.
+ * @param {boolean} [options.domainsEnabled=false] Enable the wrapping of the callback in the current domain, disabled by default to avoid perf hit.
+ * @param {boolean} [options.monitorCommands=false] Enable command monitoring for this topology
+ * @fires Server#connect
+ * @fires Server#close
+ * @fires Server#error
+ * @fires Server#timeout
+ * @fires Server#parseError
+ * @fires Server#reconnect
+ * @fires Server#commandStarted
+ * @fires Server#commandSucceeded
+ * @fires Server#commandFailed
+ * @property {string} parserType the parser type used (c++ or js).
+ * @return {Server} a Server instance.
+ */
+class Server extends TopologyBase {
+  constructor(host, port, options) {
+    super();
+    var self = this;
+
+    // Filter the options
+    options = filterOptions(options, legalOptionNames);
+
+    // Promise library
+    const promiseLibrary = options.promiseLibrary;
+
+    // Stored options
+    var storeOptions = {
+      force: false,
+      bufferMaxEntries:
+        typeof options.bufferMaxEntries === 'number' ? options.bufferMaxEntries : MAX_JS_INT
+    };
+
+    // Shared global store
+    var store = options.store || new Store(self, storeOptions);
+
+    // Detect if we have a socket connection
+    if (host.indexOf('/') !== -1) {
+      if (port != null && typeof port === 'object') {
+        options = port;
+        port = null;
+      }
+    } else if (port == null) {
+      throw MongoError.create({ message: 'port must be specified', driver: true });
+    }
+
+    // Get the reconnect option
+    var reconnect = typeof options.auto_reconnect === 'boolean' ? options.auto_reconnect : true;
+    reconnect = typeof options.autoReconnect === 'boolean' ? options.autoReconnect : reconnect;
+
+    // Clone options
+    var clonedOptions = mergeOptions(
+      {},
+      {
+        host: host,
+        port: port,
+        disconnectHandler: store,
+        cursorFactory: Cursor,
+        reconnect: reconnect,
+        emitError: typeof options.emitError === 'boolean' ? options.emitError : true,
+        size: typeof options.poolSize === 'number' ? options.poolSize : 5,
+        monitorCommands:
+          typeof options.monitorCommands === 'boolean' ? options.monitorCommands : false
+      }
+    );
+
+    // Translate any SSL options and other connectivity options
+    clonedOptions = translateOptions(clonedOptions, options);
+
+    // Socket options
+    var socketOptions =
+      options.socketOptions && Object.keys(options.socketOptions).length > 0
+        ? options.socketOptions
+        : options;
+
+    // Translate all the options to the core types
+    clonedOptions = translateOptions(clonedOptions, socketOptions);
+
+    // Define the internal properties
+    this.s = {
+      // Create an instance of a server instance from core module
+      coreTopology: new CServer(clonedOptions),
+      // Server capabilities
+      sCapabilities: null,
+      // Cloned options
+      clonedOptions: clonedOptions,
+      // Reconnect
+      reconnect: clonedOptions.reconnect,
+      // Emit error
+      emitError: clonedOptions.emitError,
+      // Pool size
+      poolSize: clonedOptions.size,
+      // Store Options
+      storeOptions: storeOptions,
+      // Store
+      store: store,
+      // Host
+      host: host,
+      // Port
+      port: port,
+      // Options
+      options: options,
+      // Server Session Pool
+      sessionPool: null,
+      // Active client sessions
+      sessions: new Set(),
+      // Promise library
+      promiseLibrary: promiseLibrary || Promise
+    };
+  }
+
+  // Connect
+  connect(_options, callback) {
+    var self = this;
+    if ('function' === typeof _options) (callback = _options), (_options = {});
+    if (_options == null) _options = this.s.clonedOptions;
+    if (!('function' === typeof callback)) callback = null;
+    _options = Object.assign({}, this.s.clonedOptions, _options);
+    self.s.options = _options;
+
+    // Update bufferMaxEntries
+    self.s.storeOptions.bufferMaxEntries =
+      typeof _options.bufferMaxEntries === 'number' ? _options.bufferMaxEntries : -1;
+
+    // Error handler
+    var connectErrorHandler = function() {
+      return function(err) {
+        // Remove all event handlers
+        var events = ['timeout', 'error', 'close'];
+        events.forEach(function(e) {
+          self.s.coreTopology.removeListener(e, connectHandlers[e]);
+        });
+
+        self.s.coreTopology.removeListener('connect', connectErrorHandler);
+
+        // Try to callback
+        try {
+          callback(err);
+        } catch (err) {
+          process.nextTick(function() {
+            throw err;
+          });
+        }
+      };
+    };
+
+    // Actual handler
+    var errorHandler = function(event) {
+      return function(err) {
+        if (event !== 'error') {
+          self.emit(event, err);
+        }
+      };
+    };
+
+    // Error handler
+    var reconnectHandler = function() {
+      self.emit('reconnect', self);
+      self.s.store.execute();
+    };
+
+    // Reconnect failed
+    var reconnectFailedHandler = function(err) {
+      self.emit('reconnectFailed', err);
+      self.s.store.flush(err);
+    };
+
+    // Destroy called on topology, perform cleanup
+    var destroyHandler = function() {
+      self.s.store.flush();
+    };
+
+    // relay the event
+    var relay = function(event) {
+      return function(t, server) {
+        self.emit(event, t, server);
+      };
+    };
+
+    // Connect handler
+    var connectHandler = function() {
+      // Clear out all the current handlers left over
+      ['timeout', 'error', 'close', 'destroy'].forEach(function(e) {
+        self.s.coreTopology.removeAllListeners(e);
+      });
+
+      // Set up listeners
+      self.s.coreTopology.on('timeout', errorHandler('timeout'));
+      self.s.coreTopology.once('error', errorHandler('error'));
+      self.s.coreTopology.on('close', errorHandler('close'));
+      // Only called on destroy
+      self.s.coreTopology.on('destroy', destroyHandler);
+
+      // Emit open event
+      self.emit('open', null, self);
+
+      // Return correctly
+      try {
+        callback(null, self);
+      } catch (err) {
+        process.nextTick(function() {
+          throw err;
+        });
+      }
+    };
+
+    // Set up listeners
+    var connectHandlers = {
+      timeout: connectErrorHandler('timeout'),
+      error: connectErrorHandler('error'),
+      close: connectErrorHandler('close')
+    };
+
+    // Clear out all the current handlers left over
+    [
+      'timeout',
+      'error',
+      'close',
+      'serverOpening',
+      'serverDescriptionChanged',
+      'serverHeartbeatStarted',
+      'serverHeartbeatSucceeded',
+      'serverHeartbeatFailed',
+      'serverClosed',
+      'topologyOpening',
+      'topologyClosed',
+      'topologyDescriptionChanged',
+      'commandStarted',
+      'commandSucceeded',
+      'commandFailed'
+    ].forEach(function(e) {
+      self.s.coreTopology.removeAllListeners(e);
+    });
+
+    // Add the event handlers
+    self.s.coreTopology.once('timeout', connectHandlers.timeout);
+    self.s.coreTopology.once('error', connectHandlers.error);
+    self.s.coreTopology.once('close', connectHandlers.close);
+    self.s.coreTopology.once('connect', connectHandler);
+    // Reconnect server
+    self.s.coreTopology.on('reconnect', reconnectHandler);
+    self.s.coreTopology.on('reconnectFailed', reconnectFailedHandler);
+
+    // Set up SDAM listeners
+    self.s.coreTopology.on('serverDescriptionChanged', relay('serverDescriptionChanged'));
+    self.s.coreTopology.on('serverHeartbeatStarted', relay('serverHeartbeatStarted'));
+    self.s.coreTopology.on('serverHeartbeatSucceeded', relay('serverHeartbeatSucceeded'));
+    self.s.coreTopology.on('serverHeartbeatFailed', relay('serverHeartbeatFailed'));
+    self.s.coreTopology.on('serverOpening', relay('serverOpening'));
+    self.s.coreTopology.on('serverClosed', relay('serverClosed'));
+    self.s.coreTopology.on('topologyOpening', relay('topologyOpening'));
+    self.s.coreTopology.on('topologyClosed', relay('topologyClosed'));
+    self.s.coreTopology.on('topologyDescriptionChanged', relay('topologyDescriptionChanged'));
+    self.s.coreTopology.on('commandStarted', relay('commandStarted'));
+    self.s.coreTopology.on('commandSucceeded', relay('commandSucceeded'));
+    self.s.coreTopology.on('commandFailed', relay('commandFailed'));
+    self.s.coreTopology.on('attemptReconnect', relay('attemptReconnect'));
+    self.s.coreTopology.on('monitoring', relay('monitoring'));
+
+    // Start connection
+    self.s.coreTopology.connect(_options);
+  }
+}
+
+Object.defineProperty(Server.prototype, 'poolSize', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.connections().length;
+  }
+});
+
+Object.defineProperty(Server.prototype, 'autoReconnect', {
+  enumerable: true,
+  get: function() {
+    return this.s.reconnect;
+  }
+});
+
+Object.defineProperty(Server.prototype, 'host', {
+  enumerable: true,
+  get: function() {
+    return this.s.host;
+  }
+});
+
+Object.defineProperty(Server.prototype, 'port', {
+  enumerable: true,
+  get: function() {
+    return this.s.port;
+  }
+});
+
+/**
+ * Server connect event
+ *
+ * @event Server#connect
+ * @type {object}
+ */
+
+/**
+ * Server close event
+ *
+ * @event Server#close
+ * @type {object}
+ */
+
+/**
+ * Server reconnect event
+ *
+ * @event Server#reconnect
+ * @type {object}
+ */
+
+/**
+ * Server error event
+ *
+ * @event Server#error
+ * @type {MongoError}
+ */
+
+/**
+ * Server timeout event
+ *
+ * @event Server#timeout
+ * @type {object}
+ */
+
+/**
+ * Server parseError event
+ *
+ * @event Server#parseError
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command was started, if command monitoring is enabled
+ *
+ * @event Server#commandStarted
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command succeeded, if command monitoring is enabled
+ *
+ * @event Server#commandSucceeded
+ * @type {object}
+ */
+
+/**
+ * An event emitted indicating a command failed, if command monitoring is enabled
+ *
+ * @event Server#commandFailed
+ * @type {object}
+ */
+
+module.exports = Server;
diff --git a/NodeAPI/node_modules/mongodb/lib/topologies/topology_base.js b/NodeAPI/node_modules/mongodb/lib/topologies/topology_base.js
new file mode 100644
index 0000000000000000000000000000000000000000..938f1a22076c4fef85268520872191742ec65ef3
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/topologies/topology_base.js
@@ -0,0 +1,417 @@
+'use strict';
+
+const EventEmitter = require('events'),
+  MongoError = require('../core').MongoError,
+  f = require('util').format,
+  ReadPreference = require('../core').ReadPreference,
+  ClientSession = require('../core').Sessions.ClientSession;
+
+// The store of ops
+var Store = function(topology, storeOptions) {
+  var self = this;
+  var storedOps = [];
+  storeOptions = storeOptions || { force: false, bufferMaxEntries: -1 };
+
+  // Internal state
+  this.s = {
+    storedOps: storedOps,
+    storeOptions: storeOptions,
+    topology: topology
+  };
+
+  Object.defineProperty(this, 'length', {
+    enumerable: true,
+    get: function() {
+      return self.s.storedOps.length;
+    }
+  });
+};
+
+Store.prototype.add = function(opType, ns, ops, options, callback) {
+  if (this.s.storeOptions.force) {
+    return callback(MongoError.create({ message: 'db closed by application', driver: true }));
+  }
+
+  if (this.s.storeOptions.bufferMaxEntries === 0) {
+    return callback(
+      MongoError.create({
+        message: f(
+          'no connection available for operation and number of stored operation > %s',
+          this.s.storeOptions.bufferMaxEntries
+        ),
+        driver: true
+      })
+    );
+  }
+
+  if (
+    this.s.storeOptions.bufferMaxEntries > 0 &&
+    this.s.storedOps.length > this.s.storeOptions.bufferMaxEntries
+  ) {
+    while (this.s.storedOps.length > 0) {
+      var op = this.s.storedOps.shift();
+      op.c(
+        MongoError.create({
+          message: f(
+            'no connection available for operation and number of stored operation > %s',
+            this.s.storeOptions.bufferMaxEntries
+          ),
+          driver: true
+        })
+      );
+    }
+
+    return;
+  }
+
+  this.s.storedOps.push({ t: opType, n: ns, o: ops, op: options, c: callback });
+};
+
+Store.prototype.addObjectAndMethod = function(opType, object, method, params, callback) {
+  if (this.s.storeOptions.force) {
+    return callback(MongoError.create({ message: 'db closed by application', driver: true }));
+  }
+
+  if (this.s.storeOptions.bufferMaxEntries === 0) {
+    return callback(
+      MongoError.create({
+        message: f(
+          'no connection available for operation and number of stored operation > %s',
+          this.s.storeOptions.bufferMaxEntries
+        ),
+        driver: true
+      })
+    );
+  }
+
+  if (
+    this.s.storeOptions.bufferMaxEntries > 0 &&
+    this.s.storedOps.length > this.s.storeOptions.bufferMaxEntries
+  ) {
+    while (this.s.storedOps.length > 0) {
+      var op = this.s.storedOps.shift();
+      op.c(
+        MongoError.create({
+          message: f(
+            'no connection available for operation and number of stored operation > %s',
+            this.s.storeOptions.bufferMaxEntries
+          ),
+          driver: true
+        })
+      );
+    }
+
+    return;
+  }
+
+  this.s.storedOps.push({ t: opType, m: method, o: object, p: params, c: callback });
+};
+
+Store.prototype.flush = function(err) {
+  while (this.s.storedOps.length > 0) {
+    this.s.storedOps
+      .shift()
+      .c(
+        err ||
+          MongoError.create({ message: f('no connection available for operation'), driver: true })
+      );
+  }
+};
+
+var primaryOptions = ['primary', 'primaryPreferred', 'nearest', 'secondaryPreferred'];
+var secondaryOptions = ['secondary', 'secondaryPreferred'];
+
+Store.prototype.execute = function(options) {
+  options = options || {};
+  // Get current ops
+  var ops = this.s.storedOps;
+  // Reset the ops
+  this.s.storedOps = [];
+
+  // Unpack options
+  var executePrimary = typeof options.executePrimary === 'boolean' ? options.executePrimary : true;
+  var executeSecondary =
+    typeof options.executeSecondary === 'boolean' ? options.executeSecondary : true;
+
+  // Execute all the stored ops
+  while (ops.length > 0) {
+    var op = ops.shift();
+
+    if (op.t === 'cursor') {
+      if (executePrimary && executeSecondary) {
+        op.o[op.m].apply(op.o, op.p);
+      } else if (
+        executePrimary &&
+        op.o.options &&
+        op.o.options.readPreference &&
+        primaryOptions.indexOf(op.o.options.readPreference.mode) !== -1
+      ) {
+        op.o[op.m].apply(op.o, op.p);
+      } else if (
+        !executePrimary &&
+        executeSecondary &&
+        op.o.options &&
+        op.o.options.readPreference &&
+        secondaryOptions.indexOf(op.o.options.readPreference.mode) !== -1
+      ) {
+        op.o[op.m].apply(op.o, op.p);
+      }
+    } else if (op.t === 'auth') {
+      this.s.topology[op.t].apply(this.s.topology, op.o);
+    } else {
+      if (executePrimary && executeSecondary) {
+        this.s.topology[op.t](op.n, op.o, op.op, op.c);
+      } else if (
+        executePrimary &&
+        op.op &&
+        op.op.readPreference &&
+        primaryOptions.indexOf(op.op.readPreference.mode) !== -1
+      ) {
+        this.s.topology[op.t](op.n, op.o, op.op, op.c);
+      } else if (
+        !executePrimary &&
+        executeSecondary &&
+        op.op &&
+        op.op.readPreference &&
+        secondaryOptions.indexOf(op.op.readPreference.mode) !== -1
+      ) {
+        this.s.topology[op.t](op.n, op.o, op.op, op.c);
+      }
+    }
+  }
+};
+
+Store.prototype.all = function() {
+  return this.s.storedOps;
+};
+
+// Server capabilities
+var ServerCapabilities = function(ismaster) {
+  var setup_get_property = function(object, name, value) {
+    Object.defineProperty(object, name, {
+      enumerable: true,
+      get: function() {
+        return value;
+      }
+    });
+  };
+
+  // Capabilities
+  var aggregationCursor = false;
+  var writeCommands = false;
+  var textSearch = false;
+  var authCommands = false;
+  var listCollections = false;
+  var listIndexes = false;
+  var maxNumberOfDocsInBatch = ismaster.maxWriteBatchSize || 1000;
+  var commandsTakeWriteConcern = false;
+  var commandsTakeCollation = false;
+
+  if (ismaster.minWireVersion >= 0) {
+    textSearch = true;
+  }
+
+  if (ismaster.maxWireVersion >= 1) {
+    aggregationCursor = true;
+    authCommands = true;
+  }
+
+  if (ismaster.maxWireVersion >= 2) {
+    writeCommands = true;
+  }
+
+  if (ismaster.maxWireVersion >= 3) {
+    listCollections = true;
+    listIndexes = true;
+  }
+
+  if (ismaster.maxWireVersion >= 5) {
+    commandsTakeWriteConcern = true;
+    commandsTakeCollation = true;
+  }
+
+  // If no min or max wire version set to 0
+  if (ismaster.minWireVersion == null) {
+    ismaster.minWireVersion = 0;
+  }
+
+  if (ismaster.maxWireVersion == null) {
+    ismaster.maxWireVersion = 0;
+  }
+
+  // Map up read only parameters
+  setup_get_property(this, 'hasAggregationCursor', aggregationCursor);
+  setup_get_property(this, 'hasWriteCommands', writeCommands);
+  setup_get_property(this, 'hasTextSearch', textSearch);
+  setup_get_property(this, 'hasAuthCommands', authCommands);
+  setup_get_property(this, 'hasListCollectionsCommand', listCollections);
+  setup_get_property(this, 'hasListIndexesCommand', listIndexes);
+  setup_get_property(this, 'minWireVersion', ismaster.minWireVersion);
+  setup_get_property(this, 'maxWireVersion', ismaster.maxWireVersion);
+  setup_get_property(this, 'maxNumberOfDocsInBatch', maxNumberOfDocsInBatch);
+  setup_get_property(this, 'commandsTakeWriteConcern', commandsTakeWriteConcern);
+  setup_get_property(this, 'commandsTakeCollation', commandsTakeCollation);
+};
+
+class TopologyBase extends EventEmitter {
+  constructor() {
+    super();
+    this.setMaxListeners(Infinity);
+  }
+
+  // Sessions related methods
+  hasSessionSupport() {
+    return this.logicalSessionTimeoutMinutes != null;
+  }
+
+  startSession(options, clientOptions) {
+    const session = new ClientSession(this, this.s.sessionPool, options, clientOptions);
+
+    session.once('ended', () => {
+      this.s.sessions.delete(session);
+    });
+
+    this.s.sessions.add(session);
+    return session;
+  }
+
+  endSessions(sessions, callback) {
+    return this.s.coreTopology.endSessions(sessions, callback);
+  }
+
+  get clientMetadata() {
+    return this.s.coreTopology.s.options.metadata;
+  }
+
+  // Server capabilities
+  capabilities() {
+    if (this.s.sCapabilities) return this.s.sCapabilities;
+    if (this.s.coreTopology.lastIsMaster() == null) return null;
+    this.s.sCapabilities = new ServerCapabilities(this.s.coreTopology.lastIsMaster());
+    return this.s.sCapabilities;
+  }
+
+  // Command
+  command(ns, cmd, options, callback) {
+    this.s.coreTopology.command(ns.toString(), cmd, ReadPreference.translate(options), callback);
+  }
+
+  // Insert
+  insert(ns, ops, options, callback) {
+    this.s.coreTopology.insert(ns.toString(), ops, options, callback);
+  }
+
+  // Update
+  update(ns, ops, options, callback) {
+    this.s.coreTopology.update(ns.toString(), ops, options, callback);
+  }
+
+  // Remove
+  remove(ns, ops, options, callback) {
+    this.s.coreTopology.remove(ns.toString(), ops, options, callback);
+  }
+
+  // IsConnected
+  isConnected(options) {
+    options = options || {};
+    options = ReadPreference.translate(options);
+
+    return this.s.coreTopology.isConnected(options);
+  }
+
+  // IsDestroyed
+  isDestroyed() {
+    return this.s.coreTopology.isDestroyed();
+  }
+
+  // Cursor
+  cursor(ns, cmd, options) {
+    options = options || {};
+    options = ReadPreference.translate(options);
+    options.disconnectHandler = this.s.store;
+    options.topology = this;
+
+    return this.s.coreTopology.cursor(ns, cmd, options);
+  }
+
+  lastIsMaster() {
+    return this.s.coreTopology.lastIsMaster();
+  }
+
+  selectServer(selector, options, callback) {
+    return this.s.coreTopology.selectServer(selector, options, callback);
+  }
+
+  /**
+   * Unref all sockets
+   * @method
+   */
+  unref() {
+    return this.s.coreTopology.unref();
+  }
+
+  /**
+   * All raw connections
+   * @method
+   * @return {array}
+   */
+  connections() {
+    return this.s.coreTopology.connections();
+  }
+
+  close(forceClosed, callback) {
+    // If we have sessions, we want to individually move them to the session pool,
+    // and then send a single endSessions call.
+    this.s.sessions.forEach(session => session.endSession());
+
+    if (this.s.sessionPool) {
+      this.s.sessionPool.endAllPooledSessions();
+    }
+
+    // We need to wash out all stored processes
+    if (forceClosed === true) {
+      this.s.storeOptions.force = forceClosed;
+      this.s.store.flush();
+    }
+
+    this.s.coreTopology.destroy(
+      {
+        force: typeof forceClosed === 'boolean' ? forceClosed : false
+      },
+      callback
+    );
+  }
+}
+
+// Properties
+Object.defineProperty(TopologyBase.prototype, 'bson', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.s.bson;
+  }
+});
+
+Object.defineProperty(TopologyBase.prototype, 'parserType', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.parserType;
+  }
+});
+
+Object.defineProperty(TopologyBase.prototype, 'logicalSessionTimeoutMinutes', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.logicalSessionTimeoutMinutes;
+  }
+});
+
+Object.defineProperty(TopologyBase.prototype, 'type', {
+  enumerable: true,
+  get: function() {
+    return this.s.coreTopology.type;
+  }
+});
+
+exports.Store = Store;
+exports.ServerCapabilities = ServerCapabilities;
+exports.TopologyBase = TopologyBase;
diff --git a/NodeAPI/node_modules/mongodb/lib/url_parser.js b/NodeAPI/node_modules/mongodb/lib/url_parser.js
new file mode 100644
index 0000000000000000000000000000000000000000..3f17a1cf367373187cc7c10def998b41779590d3
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/url_parser.js
@@ -0,0 +1,628 @@
+'use strict';
+
+const ReadPreference = require('./core').ReadPreference;
+const parser = require('url');
+const f = require('util').format;
+const Logger = require('./core').Logger;
+const dns = require('dns');
+const ReadConcern = require('./read_concern');
+const qs = require('querystring');
+const MongoParseError = require('./core/error').MongoParseError;
+
+module.exports = function(url, options, callback) {
+  if (typeof options === 'function') (callback = options), (options = {});
+  options = options || {};
+
+  let result;
+  try {
+    result = parser.parse(url, true);
+  } catch (e) {
+    return callback(new Error('URL malformed, cannot be parsed'));
+  }
+
+  if (result.protocol !== 'mongodb:' && result.protocol !== 'mongodb+srv:') {
+    return callback(new Error('Invalid schema, expected `mongodb` or `mongodb+srv`'));
+  }
+
+  if (result.protocol === 'mongodb:') {
+    return parseHandler(url, options, callback);
+  }
+
+  // Otherwise parse this as an SRV record
+  if (result.hostname.split('.').length < 3) {
+    return callback(new Error('URI does not have hostname, domain name and tld'));
+  }
+
+  result.domainLength = result.hostname.split('.').length;
+
+  if (result.pathname && result.pathname.match(',')) {
+    return callback(new Error('Invalid URI, cannot contain multiple hostnames'));
+  }
+
+  if (result.port) {
+    return callback(new Error('Ports not accepted with `mongodb+srv` URIs'));
+  }
+
+  let srvAddress = `_mongodb._tcp.${result.host}`;
+  dns.resolveSrv(srvAddress, function(err, addresses) {
+    if (err) return callback(err);
+
+    if (addresses.length === 0) {
+      return callback(new Error('No addresses found at host'));
+    }
+
+    for (let i = 0; i < addresses.length; i++) {
+      if (!matchesParentDomain(addresses[i].name, result.hostname, result.domainLength)) {
+        return callback(new Error('Server record does not share hostname with parent URI'));
+      }
+    }
+
+    let base = result.auth ? `mongodb://${result.auth}@` : `mongodb://`;
+    let connectionStrings = addresses.map(function(address, i) {
+      if (i === 0) return `${base}${address.name}:${address.port}`;
+      else return `${address.name}:${address.port}`;
+    });
+
+    let connectionString = connectionStrings.join(',') + '/';
+    let connectionStringOptions = [];
+
+    // Add the default database if needed
+    if (result.path) {
+      let defaultDb = result.path.slice(1);
+      if (defaultDb.indexOf('?') !== -1) {
+        defaultDb = defaultDb.slice(0, defaultDb.indexOf('?'));
+      }
+
+      connectionString += defaultDb;
+    }
+
+    // Default to SSL true
+    if (!options.ssl && !result.search) {
+      connectionStringOptions.push('ssl=true');
+    } else if (!options.ssl && result.search && !result.search.match('ssl')) {
+      connectionStringOptions.push('ssl=true');
+    }
+
+    // Keep original uri options
+    if (result.search) {
+      connectionStringOptions.push(result.search.replace('?', ''));
+    }
+
+    dns.resolveTxt(result.host, function(err, record) {
+      if (err && err.code !== 'ENODATA' && err.code !== 'ENOTFOUND') return callback(err);
+      if (err && err.code === 'ENODATA') record = null;
+
+      if (record) {
+        if (record.length > 1) {
+          return callback(new MongoParseError('Multiple text records not allowed'));
+        }
+
+        record = record[0].join('');
+        const parsedRecord = qs.parse(record);
+        const items = Object.keys(parsedRecord);
+        if (items.some(item => item !== 'authSource' && item !== 'replicaSet')) {
+          return callback(
+            new MongoParseError('Text record must only set `authSource` or `replicaSet`')
+          );
+        }
+
+        if (items.length > 0) {
+          connectionStringOptions.push(record);
+        }
+      }
+
+      // Add any options to the connection string
+      if (connectionStringOptions.length) {
+        connectionString += `?${connectionStringOptions.join('&')}`;
+      }
+
+      parseHandler(connectionString, options, callback);
+    });
+  });
+};
+
+function matchesParentDomain(srvAddress, parentDomain) {
+  let regex = /^.*?\./;
+  let srv = `.${srvAddress.replace(regex, '')}`;
+  let parent = `.${parentDomain.replace(regex, '')}`;
+  if (srv.endsWith(parent)) return true;
+  else return false;
+}
+
+function parseHandler(address, options, callback) {
+  let result, err;
+  try {
+    result = parseConnectionString(address, options);
+  } catch (e) {
+    err = e;
+  }
+
+  return err ? callback(err, null) : callback(null, result);
+}
+
+function parseConnectionString(url, options) {
+  // Variables
+  let connection_part = '';
+  let auth_part = '';
+  let query_string_part = '';
+  let dbName = 'admin';
+
+  // Url parser result
+  let result = parser.parse(url, true);
+  if ((result.hostname == null || result.hostname === '') && url.indexOf('.sock') === -1) {
+    throw new Error('No hostname or hostnames provided in connection string');
+  }
+
+  if (result.port === '0') {
+    throw new Error('Invalid port (zero) with hostname');
+  }
+
+  if (!isNaN(parseInt(result.port, 10)) && parseInt(result.port, 10) > 65535) {
+    throw new Error('Invalid port (larger than 65535) with hostname');
+  }
+
+  if (
+    result.path &&
+    result.path.length > 0 &&
+    result.path[0] !== '/' &&
+    url.indexOf('.sock') === -1
+  ) {
+    throw new Error('Missing delimiting slash between hosts and options');
+  }
+
+  if (result.query) {
+    for (let name in result.query) {
+      if (name.indexOf('::') !== -1) {
+        throw new Error('Double colon in host identifier');
+      }
+
+      if (result.query[name] === '') {
+        throw new Error('Query parameter ' + name + ' is an incomplete value pair');
+      }
+    }
+  }
+
+  if (result.auth) {
+    let parts = result.auth.split(':');
+    if (url.indexOf(result.auth) !== -1 && parts.length > 2) {
+      throw new Error('Username with password containing an unescaped colon');
+    }
+
+    if (url.indexOf(result.auth) !== -1 && result.auth.indexOf('@') !== -1) {
+      throw new Error('Username containing an unescaped at-sign');
+    }
+  }
+
+  // Remove query
+  let clean = url.split('?').shift();
+
+  // Extract the list of hosts
+  let strings = clean.split(',');
+  let hosts = [];
+
+  for (let i = 0; i < strings.length; i++) {
+    let hostString = strings[i];
+
+    if (hostString.indexOf('mongodb') !== -1) {
+      if (hostString.indexOf('@') !== -1) {
+        hosts.push(hostString.split('@').pop());
+      } else {
+        hosts.push(hostString.substr('mongodb://'.length));
+      }
+    } else if (hostString.indexOf('/') !== -1) {
+      hosts.push(hostString.split('/').shift());
+    } else if (hostString.indexOf('/') === -1) {
+      hosts.push(hostString.trim());
+    }
+  }
+
+  for (let i = 0; i < hosts.length; i++) {
+    let r = parser.parse(f('mongodb://%s', hosts[i].trim()));
+    if (r.path && r.path.indexOf('.sock') !== -1) continue;
+    if (r.path && r.path.indexOf(':') !== -1) {
+      // Not connecting to a socket so check for an extra slash in the hostname.
+      // Using String#split as perf is better than match.
+      if (r.path.split('/').length > 1 && r.path.indexOf('::') === -1) {
+        throw new Error('Slash in host identifier');
+      } else {
+        throw new Error('Double colon in host identifier');
+      }
+    }
+  }
+
+  // If we have a ? mark cut the query elements off
+  if (url.indexOf('?') !== -1) {
+    query_string_part = url.substr(url.indexOf('?') + 1);
+    connection_part = url.substring('mongodb://'.length, url.indexOf('?'));
+  } else {
+    connection_part = url.substring('mongodb://'.length);
+  }
+
+  // Check if we have auth params
+  if (connection_part.indexOf('@') !== -1) {
+    auth_part = connection_part.split('@')[0];
+    connection_part = connection_part.split('@')[1];
+  }
+
+  // Check there is not more than one unescaped slash
+  if (connection_part.split('/').length > 2) {
+    throw new Error(
+      "Unsupported host '" +
+        connection_part.split('?')[0] +
+        "', hosts must be URL encoded and contain at most one unencoded slash"
+    );
+  }
+
+  // Check if the connection string has a db
+  if (connection_part.indexOf('.sock') !== -1) {
+    if (connection_part.indexOf('.sock/') !== -1) {
+      dbName = connection_part.split('.sock/')[1];
+      // Check if multiple database names provided, or just an illegal trailing backslash
+      if (dbName.indexOf('/') !== -1) {
+        if (dbName.split('/').length === 2 && dbName.split('/')[1].length === 0) {
+          throw new Error('Illegal trailing backslash after database name');
+        }
+        throw new Error('More than 1 database name in URL');
+      }
+      connection_part = connection_part.split(
+        '/',
+        connection_part.indexOf('.sock') + '.sock'.length
+      );
+    }
+  } else if (connection_part.indexOf('/') !== -1) {
+    // Check if multiple database names provided, or just an illegal trailing backslash
+    if (connection_part.split('/').length > 2) {
+      if (connection_part.split('/')[2].length === 0) {
+        throw new Error('Illegal trailing backslash after database name');
+      }
+      throw new Error('More than 1 database name in URL');
+    }
+    dbName = connection_part.split('/')[1];
+    connection_part = connection_part.split('/')[0];
+  }
+
+  // URI decode the host information
+  connection_part = decodeURIComponent(connection_part);
+
+  // Result object
+  let object = {};
+
+  // Pick apart the authentication part of the string
+  let authPart = auth_part || '';
+  let auth = authPart.split(':', 2);
+
+  // Decode the authentication URI components and verify integrity
+  let user = decodeURIComponent(auth[0]);
+  if (auth[0] !== encodeURIComponent(user)) {
+    throw new Error('Username contains an illegal unescaped character');
+  }
+  auth[0] = user;
+
+  if (auth[1]) {
+    let pass = decodeURIComponent(auth[1]);
+    if (auth[1] !== encodeURIComponent(pass)) {
+      throw new Error('Password contains an illegal unescaped character');
+    }
+    auth[1] = pass;
+  }
+
+  // Add auth to final object if we have 2 elements
+  if (auth.length === 2) object.auth = { user: auth[0], password: auth[1] };
+  // if user provided auth options, use that
+  if (options && options.auth != null) object.auth = options.auth;
+
+  // Variables used for temporary storage
+  let hostPart;
+  let urlOptions;
+  let servers;
+  let compression;
+  let serverOptions = { socketOptions: {} };
+  let dbOptions = { read_preference_tags: [] };
+  let replSetServersOptions = { socketOptions: {} };
+  let mongosOptions = { socketOptions: {} };
+  // Add server options to final object
+  object.server_options = serverOptions;
+  object.db_options = dbOptions;
+  object.rs_options = replSetServersOptions;
+  object.mongos_options = mongosOptions;
+
+  // Let's check if we are using a domain socket
+  if (url.match(/\.sock/)) {
+    // Split out the socket part
+    let domainSocket = url.substring(
+      url.indexOf('mongodb://') + 'mongodb://'.length,
+      url.lastIndexOf('.sock') + '.sock'.length
+    );
+    // Clean out any auth stuff if any
+    if (domainSocket.indexOf('@') !== -1) domainSocket = domainSocket.split('@')[1];
+    domainSocket = decodeURIComponent(domainSocket);
+    servers = [{ domain_socket: domainSocket }];
+  } else {
+    // Split up the db
+    hostPart = connection_part;
+    // Deduplicate servers
+    let deduplicatedServers = {};
+
+    // Parse all server results
+    servers = hostPart
+      .split(',')
+      .map(function(h) {
+        let _host, _port, ipv6match;
+        //check if it matches [IPv6]:port, where the port number is optional
+        if ((ipv6match = /\[([^\]]+)\](?::(.+))?/.exec(h))) {
+          _host = ipv6match[1];
+          _port = parseInt(ipv6match[2], 10) || 27017;
+        } else {
+          //otherwise assume it's IPv4, or plain hostname
+          let hostPort = h.split(':', 2);
+          _host = hostPort[0] || 'localhost';
+          _port = hostPort[1] != null ? parseInt(hostPort[1], 10) : 27017;
+          // Check for localhost?safe=true style case
+          if (_host.indexOf('?') !== -1) _host = _host.split(/\?/)[0];
+        }
+
+        // No entry returned for duplicate server
+        if (deduplicatedServers[_host + '_' + _port]) return null;
+        deduplicatedServers[_host + '_' + _port] = 1;
+
+        // Return the mapped object
+        return { host: _host, port: _port };
+      })
+      .filter(function(x) {
+        return x != null;
+      });
+  }
+
+  // Get the db name
+  object.dbName = dbName || 'admin';
+  // Split up all the options
+  urlOptions = (query_string_part || '').split(/[&;]/);
+  // Ugh, we have to figure out which options go to which constructor manually.
+  urlOptions.forEach(function(opt) {
+    if (!opt) return;
+    var splitOpt = opt.split('='),
+      name = splitOpt[0],
+      value = splitOpt[1];
+
+    // Options implementations
+    switch (name) {
+      case 'slaveOk':
+      case 'slave_ok':
+        serverOptions.slave_ok = value === 'true';
+        dbOptions.slaveOk = value === 'true';
+        break;
+      case 'maxPoolSize':
+      case 'poolSize':
+        serverOptions.poolSize = parseInt(value, 10);
+        replSetServersOptions.poolSize = parseInt(value, 10);
+        break;
+      case 'appname':
+        object.appname = decodeURIComponent(value);
+        break;
+      case 'autoReconnect':
+      case 'auto_reconnect':
+        serverOptions.auto_reconnect = value === 'true';
+        break;
+      case 'ssl':
+        if (value === 'prefer') {
+          serverOptions.ssl = value;
+          replSetServersOptions.ssl = value;
+          mongosOptions.ssl = value;
+          break;
+        }
+        serverOptions.ssl = value === 'true';
+        replSetServersOptions.ssl = value === 'true';
+        mongosOptions.ssl = value === 'true';
+        break;
+      case 'sslValidate':
+        serverOptions.sslValidate = value === 'true';
+        replSetServersOptions.sslValidate = value === 'true';
+        mongosOptions.sslValidate = value === 'true';
+        break;
+      case 'replicaSet':
+      case 'rs_name':
+        replSetServersOptions.rs_name = value;
+        break;
+      case 'reconnectWait':
+        replSetServersOptions.reconnectWait = parseInt(value, 10);
+        break;
+      case 'retries':
+        replSetServersOptions.retries = parseInt(value, 10);
+        break;
+      case 'readSecondary':
+      case 'read_secondary':
+        replSetServersOptions.read_secondary = value === 'true';
+        break;
+      case 'fsync':
+        dbOptions.fsync = value === 'true';
+        break;
+      case 'journal':
+        dbOptions.j = value === 'true';
+        break;
+      case 'safe':
+        dbOptions.safe = value === 'true';
+        break;
+      case 'nativeParser':
+      case 'native_parser':
+        dbOptions.native_parser = value === 'true';
+        break;
+      case 'readConcernLevel':
+        dbOptions.readConcern = new ReadConcern(value);
+        break;
+      case 'connectTimeoutMS':
+        serverOptions.socketOptions.connectTimeoutMS = parseInt(value, 10);
+        replSetServersOptions.socketOptions.connectTimeoutMS = parseInt(value, 10);
+        mongosOptions.socketOptions.connectTimeoutMS = parseInt(value, 10);
+        break;
+      case 'socketTimeoutMS':
+        serverOptions.socketOptions.socketTimeoutMS = parseInt(value, 10);
+        replSetServersOptions.socketOptions.socketTimeoutMS = parseInt(value, 10);
+        mongosOptions.socketOptions.socketTimeoutMS = parseInt(value, 10);
+        break;
+      case 'w':
+        dbOptions.w = parseInt(value, 10);
+        if (isNaN(dbOptions.w)) dbOptions.w = value;
+        break;
+      case 'authSource':
+        dbOptions.authSource = value;
+        break;
+      case 'gssapiServiceName':
+        dbOptions.gssapiServiceName = value;
+        break;
+      case 'authMechanism':
+        if (value === 'GSSAPI') {
+          // If no password provided decode only the principal
+          if (object.auth == null) {
+            let urlDecodeAuthPart = decodeURIComponent(authPart);
+            if (urlDecodeAuthPart.indexOf('@') === -1)
+              throw new Error('GSSAPI requires a provided principal');
+            object.auth = { user: urlDecodeAuthPart, password: null };
+          } else {
+            object.auth.user = decodeURIComponent(object.auth.user);
+          }
+        } else if (value === 'MONGODB-X509') {
+          object.auth = { user: decodeURIComponent(authPart) };
+        }
+
+        // Only support GSSAPI or MONGODB-CR for now
+        if (
+          value !== 'GSSAPI' &&
+          value !== 'MONGODB-X509' &&
+          value !== 'MONGODB-CR' &&
+          value !== 'DEFAULT' &&
+          value !== 'SCRAM-SHA-1' &&
+          value !== 'SCRAM-SHA-256' &&
+          value !== 'PLAIN'
+        )
+          throw new Error(
+            'Only DEFAULT, GSSAPI, PLAIN, MONGODB-X509, or SCRAM-SHA-1 is supported by authMechanism'
+          );
+
+        // Authentication mechanism
+        dbOptions.authMechanism = value;
+        break;
+      case 'authMechanismProperties':
+        {
+          // Split up into key, value pairs
+          let values = value.split(',');
+          let o = {};
+          // For each value split into key, value
+          values.forEach(function(x) {
+            let v = x.split(':');
+            o[v[0]] = v[1];
+          });
+
+          // Set all authMechanismProperties
+          dbOptions.authMechanismProperties = o;
+          // Set the service name value
+          if (typeof o.SERVICE_NAME === 'string') dbOptions.gssapiServiceName = o.SERVICE_NAME;
+          if (typeof o.SERVICE_REALM === 'string') dbOptions.gssapiServiceRealm = o.SERVICE_REALM;
+          if (typeof o.CANONICALIZE_HOST_NAME === 'string')
+            dbOptions.gssapiCanonicalizeHostName =
+              o.CANONICALIZE_HOST_NAME === 'true' ? true : false;
+        }
+        break;
+      case 'wtimeoutMS':
+        dbOptions.wtimeout = parseInt(value, 10);
+        break;
+      case 'readPreference':
+        if (!ReadPreference.isValid(value))
+          throw new Error(
+            'readPreference must be either primary/primaryPreferred/secondary/secondaryPreferred/nearest'
+          );
+        dbOptions.readPreference = value;
+        break;
+      case 'maxStalenessSeconds':
+        dbOptions.maxStalenessSeconds = parseInt(value, 10);
+        break;
+      case 'readPreferenceTags':
+        {
+          // Decode the value
+          value = decodeURIComponent(value);
+          // Contains the tag object
+          let tagObject = {};
+          if (value == null || value === '') {
+            dbOptions.read_preference_tags.push(tagObject);
+            break;
+          }
+
+          // Split up the tags
+          let tags = value.split(/,/);
+          for (let i = 0; i < tags.length; i++) {
+            let parts = tags[i].trim().split(/:/);
+            tagObject[parts[0]] = parts[1];
+          }
+
+          // Set the preferences tags
+          dbOptions.read_preference_tags.push(tagObject);
+        }
+        break;
+      case 'compressors':
+        {
+          compression = serverOptions.compression || {};
+          let compressors = value.split(',');
+          if (
+            !compressors.every(function(compressor) {
+              return compressor === 'snappy' || compressor === 'zlib';
+            })
+          ) {
+            throw new Error('Compressors must be at least one of snappy or zlib');
+          }
+
+          compression.compressors = compressors;
+          serverOptions.compression = compression;
+        }
+        break;
+      case 'zlibCompressionLevel':
+        {
+          compression = serverOptions.compression || {};
+          let zlibCompressionLevel = parseInt(value, 10);
+          if (zlibCompressionLevel < -1 || zlibCompressionLevel > 9) {
+            throw new Error('zlibCompressionLevel must be an integer between -1 and 9');
+          }
+
+          compression.zlibCompressionLevel = zlibCompressionLevel;
+          serverOptions.compression = compression;
+        }
+        break;
+      case 'retryWrites':
+        dbOptions.retryWrites = value === 'true';
+        break;
+      case 'minSize':
+        dbOptions.minSize = parseInt(value, 10);
+        break;
+      default:
+        {
+          let logger = Logger('URL Parser');
+          logger.warn(`${name} is not supported as a connection string option`);
+        }
+        break;
+    }
+  });
+
+  // No tags: should be null (not [])
+  if (dbOptions.read_preference_tags.length === 0) {
+    dbOptions.read_preference_tags = null;
+  }
+
+  // Validate if there are an invalid write concern combinations
+  if (
+    (dbOptions.w === -1 || dbOptions.w === 0) &&
+    (dbOptions.journal === true || dbOptions.fsync === true || dbOptions.safe === true)
+  )
+    throw new Error('w set to -1 or 0 cannot be combined with safe/w/journal/fsync');
+
+  // If no read preference set it to primary
+  if (!dbOptions.readPreference) {
+    dbOptions.readPreference = 'primary';
+  }
+
+  // make sure that user-provided options are applied with priority
+  dbOptions = Object.assign(dbOptions, options);
+
+  // Add servers to result
+  object.servers = servers;
+
+  // Returned parsed object
+  return object;
+}
diff --git a/NodeAPI/node_modules/mongodb/lib/utils.js b/NodeAPI/node_modules/mongodb/lib/utils.js
new file mode 100644
index 0000000000000000000000000000000000000000..b0d8776dda36bfebb6b3bc68f5b7f07b3cd21d12
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/utils.js
@@ -0,0 +1,911 @@
+'use strict';
+const MongoError = require('./core/error').MongoError;
+const WriteConcern = require('./write_concern');
+
+var shallowClone = function(obj) {
+  var copy = {};
+  for (var name in obj) copy[name] = obj[name];
+  return copy;
+};
+
+// Set simple property
+var getSingleProperty = function(obj, name, value) {
+  Object.defineProperty(obj, name, {
+    enumerable: true,
+    get: function() {
+      return value;
+    }
+  });
+};
+
+var formatSortValue = (exports.formatSortValue = function(sortDirection) {
+  var value = ('' + sortDirection).toLowerCase();
+
+  switch (value) {
+    case 'ascending':
+    case 'asc':
+    case '1':
+      return 1;
+    case 'descending':
+    case 'desc':
+    case '-1':
+      return -1;
+    default:
+      throw new Error(
+        'Illegal sort clause, must be of the form ' +
+          "[['field1', '(ascending|descending)'], " +
+          "['field2', '(ascending|descending)']]"
+      );
+  }
+});
+
+var formattedOrderClause = (exports.formattedOrderClause = function(sortValue) {
+  var orderBy = new Map();
+  if (sortValue == null) return null;
+  if (Array.isArray(sortValue)) {
+    if (sortValue.length === 0) {
+      return null;
+    }
+
+    for (var i = 0; i < sortValue.length; i++) {
+      if (sortValue[i].constructor === String) {
+        orderBy.set(`${sortValue[i]}`, 1);
+      } else {
+        orderBy.set(`${sortValue[i][0]}`, formatSortValue(sortValue[i][1]));
+      }
+    }
+  } else if (sortValue != null && typeof sortValue === 'object') {
+    if (sortValue instanceof Map) {
+      orderBy = sortValue;
+    } else {
+      var sortKeys = Object.keys(sortValue);
+      for (var k of sortKeys) {
+        orderBy.set(k, sortValue[k]);
+      }
+    }
+  } else if (typeof sortValue === 'string') {
+    orderBy.set(`${sortValue}`, 1);
+  } else {
+    throw new Error(
+      'Illegal sort clause, must be of the form ' +
+        "[['field1', '(ascending|descending)'], ['field2', '(ascending|descending)']]"
+    );
+  }
+
+  return orderBy;
+});
+
+var checkCollectionName = function checkCollectionName(collectionName) {
+  if ('string' !== typeof collectionName) {
+    throw new MongoError('collection name must be a String');
+  }
+
+  if (!collectionName || collectionName.indexOf('..') !== -1) {
+    throw new MongoError('collection names cannot be empty');
+  }
+
+  if (
+    collectionName.indexOf('$') !== -1 &&
+    collectionName.match(/((^\$cmd)|(oplog\.\$main))/) == null
+  ) {
+    throw new MongoError("collection names must not contain '$'");
+  }
+
+  if (collectionName.match(/^\.|\.$/) != null) {
+    throw new MongoError("collection names must not start or end with '.'");
+  }
+
+  // Validate that we are not passing 0x00 in the collection name
+  if (collectionName.indexOf('\x00') !== -1) {
+    throw new MongoError('collection names cannot contain a null character');
+  }
+};
+
+var handleCallback = function(callback, err, value1, value2) {
+  try {
+    if (callback == null) return;
+
+    if (callback) {
+      return value2 ? callback(err, value1, value2) : callback(err, value1);
+    }
+  } catch (err) {
+    process.nextTick(function() {
+      throw err;
+    });
+    return false;
+  }
+
+  return true;
+};
+
+/**
+ * Wrap a Mongo error document in an Error instance
+ * @ignore
+ * @api private
+ */
+var toError = function(error) {
+  if (error instanceof Error) return error;
+
+  var msg = error.err || error.errmsg || error.errMessage || error;
+  var e = MongoError.create({ message: msg, driver: true });
+
+  // Get all object keys
+  var keys = typeof error === 'object' ? Object.keys(error) : [];
+
+  for (var i = 0; i < keys.length; i++) {
+    try {
+      e[keys[i]] = error[keys[i]];
+    } catch (err) {
+      // continue
+    }
+  }
+
+  return e;
+};
+
+/**
+ * @ignore
+ */
+var normalizeHintField = function normalizeHintField(hint) {
+  var finalHint = null;
+
+  if (typeof hint === 'string') {
+    finalHint = hint;
+  } else if (Array.isArray(hint)) {
+    finalHint = {};
+
+    hint.forEach(function(param) {
+      finalHint[param] = 1;
+    });
+  } else if (hint != null && typeof hint === 'object') {
+    finalHint = {};
+    for (var name in hint) {
+      finalHint[name] = hint[name];
+    }
+  }
+
+  return finalHint;
+};
+
+/**
+ * Create index name based on field spec
+ *
+ * @ignore
+ * @api private
+ */
+var parseIndexOptions = function(fieldOrSpec) {
+  var fieldHash = {};
+  var indexes = [];
+  var keys;
+
+  // Get all the fields accordingly
+  if ('string' === typeof fieldOrSpec) {
+    // 'type'
+    indexes.push(fieldOrSpec + '_' + 1);
+    fieldHash[fieldOrSpec] = 1;
+  } else if (Array.isArray(fieldOrSpec)) {
+    fieldOrSpec.forEach(function(f) {
+      if ('string' === typeof f) {
+        // [{location:'2d'}, 'type']
+        indexes.push(f + '_' + 1);
+        fieldHash[f] = 1;
+      } else if (Array.isArray(f)) {
+        // [['location', '2d'],['type', 1]]
+        indexes.push(f[0] + '_' + (f[1] || 1));
+        fieldHash[f[0]] = f[1] || 1;
+      } else if (isObject(f)) {
+        // [{location:'2d'}, {type:1}]
+        keys = Object.keys(f);
+        keys.forEach(function(k) {
+          indexes.push(k + '_' + f[k]);
+          fieldHash[k] = f[k];
+        });
+      } else {
+        // undefined (ignore)
+      }
+    });
+  } else if (isObject(fieldOrSpec)) {
+    // {location:'2d', type:1}
+    keys = Object.keys(fieldOrSpec);
+    keys.forEach(function(key) {
+      indexes.push(key + '_' + fieldOrSpec[key]);
+      fieldHash[key] = fieldOrSpec[key];
+    });
+  }
+
+  return {
+    name: indexes.join('_'),
+    keys: keys,
+    fieldHash: fieldHash
+  };
+};
+
+var isObject = (exports.isObject = function(arg) {
+  return '[object Object]' === Object.prototype.toString.call(arg);
+});
+
+var debugOptions = function(debugFields, options) {
+  var finaloptions = {};
+  debugFields.forEach(function(n) {
+    finaloptions[n] = options[n];
+  });
+
+  return finaloptions;
+};
+
+var decorateCommand = function(command, options, exclude) {
+  for (var name in options) {
+    if (exclude.indexOf(name) === -1) command[name] = options[name];
+  }
+
+  return command;
+};
+
+var mergeOptions = function(target, source) {
+  for (var name in source) {
+    target[name] = source[name];
+  }
+
+  return target;
+};
+
+// Merge options with translation
+var translateOptions = function(target, source) {
+  var translations = {
+    // SSL translation options
+    sslCA: 'ca',
+    sslCRL: 'crl',
+    sslValidate: 'rejectUnauthorized',
+    sslKey: 'key',
+    sslCert: 'cert',
+    sslPass: 'passphrase',
+    // SocketTimeout translation options
+    socketTimeoutMS: 'socketTimeout',
+    connectTimeoutMS: 'connectionTimeout',
+    // Replicaset options
+    replicaSet: 'setName',
+    rs_name: 'setName',
+    secondaryAcceptableLatencyMS: 'acceptableLatency',
+    connectWithNoPrimary: 'secondaryOnlyConnectionAllowed',
+    // Mongos options
+    acceptableLatencyMS: 'localThresholdMS'
+  };
+
+  for (var name in source) {
+    if (translations[name]) {
+      target[translations[name]] = source[name];
+    } else {
+      target[name] = source[name];
+    }
+  }
+
+  return target;
+};
+
+var filterOptions = function(options, names) {
+  var filterOptions = {};
+
+  for (var name in options) {
+    if (names.indexOf(name) !== -1) filterOptions[name] = options[name];
+  }
+
+  // Filtered options
+  return filterOptions;
+};
+
+// Write concern keys
+const WRITE_CONCERN_KEYS = ['w', 'j', 'wtimeout', 'fsync', 'writeConcern'];
+
+/**
+ * If there is no WriteConcern related options defined on target then inherit from source.
+ * Otherwise, do not inherit **any** options from source.
+ * @internal
+ * @param {object} target - options object conditionally receiving the writeConcern options
+ * @param {object} source - options object containing the potentially inherited writeConcern options
+ */
+function conditionallyMergeWriteConcern(target, source) {
+  let found = false;
+  for (const wcKey of WRITE_CONCERN_KEYS) {
+    if (wcKey in target) {
+      // Found a writeConcern option
+      found = true;
+      break;
+    }
+  }
+
+  if (!found) {
+    for (const wcKey of WRITE_CONCERN_KEYS) {
+      if (source[wcKey]) {
+        if (!('writeConcern' in target)) {
+          target.writeConcern = {};
+        }
+        target.writeConcern[wcKey] = source[wcKey];
+      }
+    }
+  }
+
+  return target;
+}
+
+/**
+ * Executes the given operation with provided arguments.
+ *
+ * This method reduces large amounts of duplication in the entire codebase by providing
+ * a single point for determining whether callbacks or promises should be used. Additionally
+ * it allows for a single point of entry to provide features such as implicit sessions, which
+ * are required by the Driver Sessions specification in the event that a ClientSession is
+ * not provided
+ *
+ * @param {object} topology The topology to execute this operation on
+ * @param {function} operation The operation to execute
+ * @param {array} args Arguments to apply the provided operation
+ * @param {object} [options] Options that modify the behavior of the method
+ */
+const executeLegacyOperation = (topology, operation, args, options) => {
+  if (topology == null) {
+    throw new TypeError('This method requires a valid topology instance');
+  }
+
+  if (!Array.isArray(args)) {
+    throw new TypeError('This method requires an array of arguments to apply');
+  }
+
+  options = options || {};
+  const Promise = topology.s.promiseLibrary;
+  let callback = args[args.length - 1];
+
+  // The driver sessions spec mandates that we implicitly create sessions for operations
+  // that are not explicitly provided with a session.
+  let session, opOptions, owner;
+  if (!options.skipSessions && topology.hasSessionSupport()) {
+    opOptions = args[args.length - 2];
+    if (opOptions == null || opOptions.session == null) {
+      owner = Symbol();
+      session = topology.startSession({ owner });
+      const optionsIndex = args.length - 2;
+      args[optionsIndex] = Object.assign({}, args[optionsIndex], { session: session });
+    } else if (opOptions.session && opOptions.session.hasEnded) {
+      throw new MongoError('Use of expired sessions is not permitted');
+    }
+  }
+
+  const makeExecuteCallback = (resolve, reject) =>
+    function executeCallback(err, result) {
+      if (session && session.owner === owner && !options.returnsCursor) {
+        session.endSession(() => {
+          delete opOptions.session;
+          if (err) return reject(err);
+          resolve(result);
+        });
+      } else {
+        if (err) return reject(err);
+        resolve(result);
+      }
+    };
+
+  // Execute using callback
+  if (typeof callback === 'function') {
+    callback = args.pop();
+    const handler = makeExecuteCallback(
+      result => callback(null, result),
+      err => callback(err, null)
+    );
+    args.push(handler);
+
+    try {
+      return operation.apply(null, args);
+    } catch (e) {
+      handler(e);
+      throw e;
+    }
+  }
+
+  // Return a Promise
+  if (args[args.length - 1] != null) {
+    throw new TypeError('final argument to `executeLegacyOperation` must be a callback');
+  }
+
+  return new Promise(function(resolve, reject) {
+    const handler = makeExecuteCallback(resolve, reject);
+    args[args.length - 1] = handler;
+
+    try {
+      return operation.apply(null, args);
+    } catch (e) {
+      handler(e);
+    }
+  });
+};
+
+/**
+ * Applies retryWrites: true to a command if retryWrites is set on the command's database.
+ *
+ * @param {object} target The target command to which we will apply retryWrites.
+ * @param {object} db The database from which we can inherit a retryWrites value.
+ */
+function applyRetryableWrites(target, db) {
+  if (db && db.s.options.retryWrites) {
+    target.retryWrites = true;
+  }
+
+  return target;
+}
+
+/**
+ * Applies a write concern to a command based on well defined inheritance rules, optionally
+ * detecting support for the write concern in the first place.
+ *
+ * @param {Object} target the target command we will be applying the write concern to
+ * @param {Object} sources sources where we can inherit default write concerns from
+ * @param {Object} [options] optional settings passed into a command for write concern overrides
+ * @returns {Object} the (now) decorated target
+ */
+function applyWriteConcern(target, sources, options) {
+  options = options || {};
+  const db = sources.db;
+  const coll = sources.collection;
+
+  if (options.session && options.session.inTransaction()) {
+    // writeConcern is not allowed within a multi-statement transaction
+    if (target.writeConcern) {
+      delete target.writeConcern;
+    }
+
+    return target;
+  }
+
+  const writeConcern = WriteConcern.fromOptions(options);
+  if (writeConcern) {
+    return Object.assign(target, { writeConcern });
+  }
+
+  if (coll && coll.writeConcern) {
+    return Object.assign(target, { writeConcern: Object.assign({}, coll.writeConcern) });
+  }
+
+  if (db && db.writeConcern) {
+    return Object.assign(target, { writeConcern: Object.assign({}, db.writeConcern) });
+  }
+
+  return target;
+}
+
+/**
+ * Checks if a given value is a Promise
+ *
+ * @param {*} maybePromise
+ * @return true if the provided value is a Promise
+ */
+function isPromiseLike(maybePromise) {
+  return maybePromise && typeof maybePromise.then === 'function';
+}
+
+/**
+ * Applies collation to a given command.
+ *
+ * @param {object} [command] the command on which to apply collation
+ * @param {(Cursor|Collection)} [target] target of command
+ * @param {object} [options] options containing collation settings
+ */
+function decorateWithCollation(command, target, options) {
+  const topology = (target.s && target.s.topology) || target.topology;
+
+  if (!topology) {
+    throw new TypeError('parameter "target" is missing a topology');
+  }
+
+  const capabilities = topology.capabilities();
+  if (options.collation && typeof options.collation === 'object') {
+    if (capabilities && capabilities.commandsTakeCollation) {
+      command.collation = options.collation;
+    } else {
+      throw new MongoError(`Current topology does not support collation`);
+    }
+  }
+}
+
+/**
+ * Applies a read concern to a given command.
+ *
+ * @param {object} command the command on which to apply the read concern
+ * @param {Collection} coll the parent collection of the operation calling this method
+ */
+function decorateWithReadConcern(command, coll, options) {
+  if (options && options.session && options.session.inTransaction()) {
+    return;
+  }
+  let readConcern = Object.assign({}, command.readConcern || {});
+  if (coll.s.readConcern) {
+    Object.assign(readConcern, coll.s.readConcern);
+  }
+
+  if (Object.keys(readConcern).length > 0) {
+    Object.assign(command, { readConcern: readConcern });
+  }
+}
+
+/**
+ * Applies an explain to a given command.
+ * @internal
+ *
+ * @param {object} command - the command on which to apply the explain
+ * @param {Explain} explain - the options containing the explain verbosity
+ * @return the new command
+ */
+function decorateWithExplain(command, explain) {
+  if (command.explain) {
+    return command;
+  }
+
+  return { explain: command, verbosity: explain.verbosity };
+}
+
+const nodejsMajorVersion = +process.version.split('.')[0].substring(1);
+const emitProcessWarning = msg =>
+  nodejsMajorVersion <= 6
+    ? process.emitWarning(msg, 'DeprecationWarning', MONGODB_WARNING_CODE)
+    : process.emitWarning(msg, { type: 'DeprecationWarning', code: MONGODB_WARNING_CODE });
+// eslint-disable-next-line no-console
+const emitConsoleWarning = msg => console.error(msg);
+const emitDeprecationWarning = process.emitWarning ? emitProcessWarning : emitConsoleWarning;
+
+/**
+ * Default message handler for generating deprecation warnings.
+ *
+ * @param {string} name function name
+ * @param {string} option option name
+ * @return {string} warning message
+ * @ignore
+ * @api private
+ */
+function defaultMsgHandler(name, option) {
+  return `${name} option [${option}] is deprecated and will be removed in a later version.`;
+}
+
+/**
+ * Deprecates a given function's options.
+ *
+ * @param {object} config configuration for deprecation
+ * @param {string} config.name function name
+ * @param {Array} config.deprecatedOptions options to deprecate
+ * @param {number} config.optionsIndex index of options object in function arguments array
+ * @param {function} [config.msgHandler] optional custom message handler to generate warnings
+ * @param {function} fn the target function of deprecation
+ * @return {function} modified function that warns once per deprecated option, and executes original function
+ * @ignore
+ * @api private
+ */
+function deprecateOptions(config, fn) {
+  if (process.noDeprecation === true) {
+    return fn;
+  }
+
+  const msgHandler = config.msgHandler ? config.msgHandler : defaultMsgHandler;
+
+  const optionsWarned = new Set();
+  function deprecated() {
+    const options = arguments[config.optionsIndex];
+
+    // ensure options is a valid, non-empty object, otherwise short-circuit
+    if (!isObject(options) || Object.keys(options).length === 0) {
+      return fn.apply(this, arguments);
+    }
+
+    config.deprecatedOptions.forEach(deprecatedOption => {
+      if (
+        Object.prototype.hasOwnProperty.call(options, deprecatedOption) &&
+        !optionsWarned.has(deprecatedOption)
+      ) {
+        optionsWarned.add(deprecatedOption);
+        const msg = msgHandler(config.name, deprecatedOption);
+        emitDeprecationWarning(msg);
+        if (this && this.getLogger) {
+          const logger = this.getLogger();
+          if (logger) {
+            logger.warn(msg);
+          }
+        }
+      }
+    });
+
+    return fn.apply(this, arguments);
+  }
+
+  // These lines copied from https://github.com/nodejs/node/blob/25e5ae41688676a5fd29b2e2e7602168eee4ceb5/lib/internal/util.js#L73-L80
+  // The wrapper will keep the same prototype as fn to maintain prototype chain
+  Object.setPrototypeOf(deprecated, fn);
+  if (fn.prototype) {
+    // Setting this (rather than using Object.setPrototype, as above) ensures
+    // that calling the unwrapped constructor gives an instanceof the wrapped
+    // constructor.
+    deprecated.prototype = fn.prototype;
+  }
+
+  return deprecated;
+}
+
+const SUPPORTS = {};
+// Test asyncIterator support
+try {
+  require('./async/async_iterator');
+  SUPPORTS.ASYNC_ITERATOR = true;
+} catch (e) {
+  SUPPORTS.ASYNC_ITERATOR = false;
+}
+
+class MongoDBNamespace {
+  constructor(db, collection) {
+    this.db = db;
+    this.collection = collection;
+  }
+
+  toString() {
+    return this.collection ? `${this.db}.${this.collection}` : this.db;
+  }
+
+  withCollection(collection) {
+    return new MongoDBNamespace(this.db, collection);
+  }
+
+  static fromString(namespace) {
+    if (!namespace) {
+      throw new Error(`Cannot parse namespace from "${namespace}"`);
+    }
+
+    const index = namespace.indexOf('.');
+    return new MongoDBNamespace(namespace.substring(0, index), namespace.substring(index + 1));
+  }
+}
+
+function* makeCounter(seed) {
+  let count = seed || 0;
+  while (true) {
+    const newCount = count;
+    count += 1;
+    yield newCount;
+  }
+}
+
+/**
+ * Helper function for either accepting a callback, or returning a promise
+ *
+ * @param {Object} parent an instance of parent with promiseLibrary.
+ * @param {object} parent.s an object containing promiseLibrary.
+ * @param {function} parent.s.promiseLibrary an object containing promiseLibrary.
+ * @param {[Function]} callback an optional callback.
+ * @param {Function} fn A function that takes a callback
+ * @returns {Promise|void} Returns nothing if a callback is supplied, else returns a Promise.
+ */
+function maybePromise(parent, callback, fn) {
+  const PromiseLibrary = (parent && parent.s && parent.s.promiseLibrary) || Promise;
+
+  let result;
+  if (typeof callback !== 'function') {
+    result = new PromiseLibrary((resolve, reject) => {
+      callback = (err, res) => {
+        if (err) return reject(err);
+        resolve(res);
+      };
+    });
+  }
+
+  fn(function(err, res) {
+    if (err != null) {
+      try {
+        callback(err);
+      } catch (error) {
+        return process.nextTick(() => {
+          throw error;
+        });
+      }
+      return;
+    }
+
+    callback(err, res);
+  });
+
+  return result;
+}
+
+function now() {
+  const hrtime = process.hrtime();
+  return Math.floor(hrtime[0] * 1000 + hrtime[1] / 1000000);
+}
+
+function calculateDurationInMs(started) {
+  if (typeof started !== 'number') {
+    throw TypeError('numeric value required to calculate duration');
+  }
+
+  const elapsed = now() - started;
+  return elapsed < 0 ? 0 : elapsed;
+}
+
+/**
+ * Creates an interval timer which is able to be woken up sooner than
+ * the interval. The timer will also debounce multiple calls to wake
+ * ensuring that the function is only ever called once within a minimum
+ * interval window.
+ *
+ * @param {function} fn An async function to run on an interval, must accept a `callback` as its only parameter
+ * @param {object} [options] Optional settings
+ * @param {number} [options.interval] The interval at which to run the provided function
+ * @param {number} [options.minInterval] The minimum time which must pass between invocations of the provided function
+ * @param {boolean} [options.immediate] Execute the function immediately when the interval is started
+ */
+function makeInterruptableAsyncInterval(fn, options) {
+  let timerId;
+  let lastCallTime;
+  let lastWakeTime;
+  let stopped = false;
+
+  options = options || {};
+  const interval = options.interval || 1000;
+  const minInterval = options.minInterval || 500;
+  const immediate = typeof options.immediate === 'boolean' ? options.immediate : false;
+  const clock = typeof options.clock === 'function' ? options.clock : now;
+
+  function wake() {
+    const currentTime = clock();
+    const timeSinceLastWake = currentTime - lastWakeTime;
+    const timeSinceLastCall = currentTime - lastCallTime;
+    const timeUntilNextCall = interval - timeSinceLastCall;
+    lastWakeTime = currentTime;
+
+    // For the streaming protocol: there is nothing obviously stopping this
+    // interval from being woken up again while we are waiting "infinitely"
+    // for `fn` to be called again`. Since the function effectively
+    // never completes, the `timeUntilNextCall` will continue to grow
+    // negatively unbounded, so it will never trigger a reschedule here.
+
+    // debounce multiple calls to wake within the `minInterval`
+    if (timeSinceLastWake < minInterval) {
+      return;
+    }
+
+    // reschedule a call as soon as possible, ensuring the call never happens
+    // faster than the `minInterval`
+    if (timeUntilNextCall > minInterval) {
+      reschedule(minInterval);
+    }
+
+    // This is possible in virtualized environments like AWS Lambda where our
+    // clock is unreliable. In these cases the timer is "running" but never
+    // actually completes, so we want to execute immediately and then attempt
+    // to reschedule.
+    if (timeUntilNextCall < 0) {
+      executeAndReschedule();
+    }
+  }
+
+  function stop() {
+    stopped = true;
+    if (timerId) {
+      clearTimeout(timerId);
+      timerId = null;
+    }
+
+    lastCallTime = 0;
+    lastWakeTime = 0;
+  }
+
+  function reschedule(ms) {
+    if (stopped) return;
+    clearTimeout(timerId);
+    timerId = setTimeout(executeAndReschedule, ms || interval);
+  }
+
+  function executeAndReschedule() {
+    lastWakeTime = 0;
+    lastCallTime = clock();
+
+    fn(err => {
+      if (err) throw err;
+      reschedule(interval);
+    });
+  }
+
+  if (immediate) {
+    executeAndReschedule();
+  } else {
+    lastCallTime = clock();
+    reschedule();
+  }
+
+  return { wake, stop };
+}
+
+function hasAtomicOperators(doc) {
+  if (Array.isArray(doc)) {
+    return doc.reduce((err, u) => err || hasAtomicOperators(u), null);
+  }
+
+  return (
+    Object.keys(typeof doc.toBSON !== 'function' ? doc : doc.toBSON())
+      .map(k => k[0])
+      .indexOf('$') >= 0
+  );
+}
+
+/**
+ * When the driver used emitWarning the code will be equal to this.
+ * @public
+ *
+ * @example
+ * ```js
+ * process.on('warning', (warning) => {
+ *  if (warning.code === MONGODB_WARNING_CODE) console.error('Ah an important warning! :)')
+ * })
+ * ```
+ */
+const MONGODB_WARNING_CODE = 'MONGODB DRIVER';
+
+/**
+ * @internal
+ * @param {string} message - message to warn about
+ */
+function emitWarning(message) {
+  if (process.emitWarning) {
+    return nodejsMajorVersion <= 6
+      ? process.emitWarning(message, undefined, MONGODB_WARNING_CODE)
+      : process.emitWarning(message, { code: MONGODB_WARNING_CODE });
+  } else {
+    // Approximate the style of print out on node versions pre 8.x
+    // eslint-disable-next-line no-console
+    return console.error(`[${MONGODB_WARNING_CODE}] Warning:`, message);
+  }
+}
+
+const emittedWarnings = new Set();
+/**
+ * Will emit a warning once for the duration of the application.
+ * Uses the message to identify if it has already been emitted
+ * so using string interpolation can cause multiple emits
+ * @internal
+ * @param {string} message - message to warn about
+ */
+function emitWarningOnce(message) {
+  if (!emittedWarnings.has(message)) {
+    emittedWarnings.add(message);
+    return emitWarning(message);
+  }
+}
+
+module.exports = {
+  filterOptions,
+  mergeOptions,
+  translateOptions,
+  shallowClone,
+  getSingleProperty,
+  checkCollectionName,
+  toError,
+  formattedOrderClause,
+  parseIndexOptions,
+  normalizeHintField,
+  handleCallback,
+  decorateCommand,
+  isObject,
+  debugOptions,
+  MAX_JS_INT: Number.MAX_SAFE_INTEGER + 1,
+  conditionallyMergeWriteConcern,
+  executeLegacyOperation,
+  applyRetryableWrites,
+  applyWriteConcern,
+  isPromiseLike,
+  decorateWithCollation,
+  decorateWithReadConcern,
+  decorateWithExplain,
+  deprecateOptions,
+  SUPPORTS,
+  MongoDBNamespace,
+  emitDeprecationWarning,
+  makeCounter,
+  maybePromise,
+  now,
+  calculateDurationInMs,
+  makeInterruptableAsyncInterval,
+  hasAtomicOperators,
+  MONGODB_WARNING_CODE,
+  emitWarning,
+  emitWarningOnce
+};
diff --git a/NodeAPI/node_modules/mongodb/lib/write_concern.js b/NodeAPI/node_modules/mongodb/lib/write_concern.js
new file mode 100644
index 0000000000000000000000000000000000000000..8fa487403b84e907071fe478392336e96a0e644b
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/lib/write_concern.js
@@ -0,0 +1,94 @@
+'use strict';
+
+const kWriteConcernKeys = new Set(['w', 'wtimeout', 'j', 'journal', 'fsync']);
+let utils;
+
+/**
+ * The **WriteConcern** class is a class that represents a MongoDB WriteConcern.
+ * @class
+ * @property {(number|string)} w The write concern
+ * @property {number} wtimeout The write concern timeout
+ * @property {boolean} j The journal write concern
+ * @property {boolean} fsync The file sync write concern
+ * @see https://docs.mongodb.com/manual/reference/write-concern/index.html
+ */
+class WriteConcern {
+  /**
+   * Constructs a WriteConcern from the write concern properties.
+   * @param {(number|string)} [w] The write concern
+   * @param {number} [wtimeout] The write concern timeout
+   * @param {boolean} [j] The journal write concern
+   * @param {boolean} [fsync] The file sync write concern
+   */
+  constructor(w, wtimeout, j, fsync) {
+    if (w != null) {
+      this.w = w;
+    }
+    if (wtimeout != null) {
+      this.wtimeout = wtimeout;
+    }
+    if (j != null) {
+      this.j = j;
+    }
+    if (fsync != null) {
+      this.fsync = fsync;
+    }
+  }
+
+  /**
+   * Construct a WriteConcern given an options object.
+   *
+   * @param {object} [options] The options object from which to extract the write concern.
+   * @param {(number|string)} [options.w] **Deprecated** Use `options.writeConcern` instead
+   * @param {number} [options.wtimeout] **Deprecated** Use `options.writeConcern` instead
+   * @param {boolean} [options.j] **Deprecated** Use `options.writeConcern` instead
+   * @param {boolean} [options.fsync] **Deprecated** Use `options.writeConcern` instead
+   * @param {object|WriteConcern} [options.writeConcern] Specify write concern settings.
+   * @return {WriteConcern}
+   */
+  static fromOptions(options) {
+    if (
+      options == null ||
+      (options.writeConcern == null &&
+        options.w == null &&
+        options.wtimeout == null &&
+        options.j == null &&
+        options.journal == null &&
+        options.fsync == null)
+    ) {
+      return;
+    }
+
+    if (options.writeConcern) {
+      if (typeof options.writeConcern === 'string') {
+        return new WriteConcern(options.writeConcern);
+      }
+
+      if (!Object.keys(options.writeConcern).some(key => kWriteConcernKeys.has(key))) {
+        return;
+      }
+
+      return new WriteConcern(
+        options.writeConcern.w,
+        options.writeConcern.wtimeout,
+        options.writeConcern.j || options.writeConcern.journal,
+        options.writeConcern.fsync
+      );
+    }
+
+    // this is down here to prevent circular dependency
+    if (!utils) utils = require('./utils');
+
+    utils.emitWarningOnce(
+      `Top-level use of w, wtimeout, j, and fsync is deprecated. Use writeConcern instead.`
+    );
+    return new WriteConcern(
+      options.w,
+      options.wtimeout,
+      options.j || options.journal,
+      options.fsync
+    );
+  }
+}
+
+module.exports = WriteConcern;
diff --git a/NodeAPI/node_modules/mongodb/package.json b/NodeAPI/node_modules/mongodb/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..b7d9cd3f4fbfa90a927fb9939fd0a4f08235c7b4
--- /dev/null
+++ b/NodeAPI/node_modules/mongodb/package.json
@@ -0,0 +1,107 @@
+{
+  "name": "mongodb",
+  "version": "3.6.8",
+  "description": "The official MongoDB driver for Node.js",
+  "main": "index.js",
+  "files": [
+    "index.js",
+    "lib"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git@github.com:mongodb/node-mongodb-native.git"
+  },
+  "keywords": [
+    "mongodb",
+    "driver",
+    "official"
+  ],
+  "peerDependenciesMeta": {
+    "kerberos": {
+      "optional": true
+    },
+    "mongodb-client-encryption": {
+      "optional": true
+    },
+    "mongodb-extjson": {
+      "optional": true
+    },
+    "snappy": {
+      "optional": true
+    },
+    "bson-ext": {
+      "optional": true
+    },
+    "aws4": {
+      "optional": true
+    }
+  },
+  "dependencies": {
+    "bl": "^2.2.1",
+    "bson": "^1.1.4",
+    "denque": "^1.4.1",
+    "optional-require": "^1.0.3",
+    "safe-buffer": "^5.1.2"
+  },
+  "devDependencies": {
+    "@types/chai": "^4.2.16",
+    "@types/mocha": "^8.2.2",
+    "@types/node": "^14.14.37",
+    "array-includes": "^3.1.3",
+    "chai": "^4.1.1",
+    "chai-subset": "^1.6.0",
+    "chalk": "^2.4.2",
+    "co": "4.6.0",
+    "eslint": "^7.10.0",
+    "eslint-config-prettier": "^6.11.0",
+    "eslint-plugin-es": "^3.0.1",
+    "eslint-plugin-prettier": "^3.1.3",
+    "jsdoc": "^3.5.5",
+    "lodash.camelcase": "^4.3.0",
+    "mocha": "5.2.0",
+    "mocha-sinon": "^2.1.0",
+    "mongodb-extjson": "^2.1.1",
+    "mongodb-mock-server": "^1.0.1",
+    "nyc": "^15.1.0",
+    "object.entries": "^1.1.3",
+    "prettier": "^1.19.1",
+    "semver": "^5.5.0",
+    "sinon": "^4.3.0",
+    "sinon-chai": "^3.2.0",
+    "snappy": "^6.3.4",
+    "spec-xunit-file": "0.0.1-3",
+    "standard-version": "^9.2.0",
+    "tslib": "^2.2.0",
+    "typescript": "^4.2.4",
+    "util.promisify": "^1.0.1",
+    "worker-farm": "^1.5.0",
+    "wtfnode": "^0.8.0",
+    "yargs": "^14.2.0"
+  },
+  "license": "Apache-2.0",
+  "engines": {
+    "node": ">=4"
+  },
+  "bugs": {
+    "url": "https://github.com/mongodb/node-mongodb-native/issues"
+  },
+  "scripts": {
+    "build:evergreen": "node .evergreen/generate_evergreen_tasks.js",
+    "build:unified": "tsc -p test/functional/unified-spec-runner/tsconfig.unified.json",
+    "check:atlas": "mocha --opts '{}' ./test/manual/atlas_connectivity.test.js",
+    "check:bench": "node test/benchmarks/driverBench/",
+    "check:coverage": "nyc npm run check:test",
+    "check:kerberos": "mocha --opts '{}' -t 60000 test/manual/kerberos.test.js",
+    "check:ldap": "mocha --opts '{}' test/manual/ldap.test.js",
+    "check:lint": "eslint -v && eslint lib test",
+    "check:test": "mocha --recursive test/functional test/unit",
+    "check:tls": "mocha --opts '{}' test/manual/tls_support.test.js",
+    "format": "npm run check:lint -- --fix",
+    "release": "standard-version -i HISTORY.md",
+    "test": "npm run lint && mocha --recursive test/functional test/unit"
+  },
+  "homepage": "https://github.com/mongodb/node-mongodb-native",
+  "optionalDependencies": {
+    "saslprep": "^1.0.0"
+  }
+}
diff --git a/NodeAPI/node_modules/optional-require/README.md b/NodeAPI/node_modules/optional-require/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..db36522cc4e17268a7faf6561117a2ebac1e50d3
--- /dev/null
+++ b/NodeAPI/node_modules/optional-require/README.md
@@ -0,0 +1,92 @@
+[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
+[![Dependency Status][daviddm-image]][daviddm-url] [![devDependency Status][daviddm-dev-image]][daviddm-dev-url]
+
+# Optional Require
+
+NodeJS Require that let you handle module not found error without try/catch.  Allows you to gracefully require a module only if it exists and contains no error.
+
+# Usage
+
+```js
+const optionalRequire = require("optional-require")(require);
+
+const foo = optionalRequire("foo") || {};
+const bar = optionalRequire("bar", true); // true enables console.log a message when not found
+const xyz = optionalRequire("xyz", "test"); // "test" enables console.log a message with "test" added.
+const fbPath = optionalRequire.resolve("foo", "foo doesn't exist");
+const rel = optionalRequire("../foo/bar"); // relative module path works
+```
+
+# Install
+
+```bash
+$ npm i optional-require --save
+```
+
+# API
+
+#### [optionalRequire(require)](#optionalrequirerequire)
+
+The single function this module exports.  Call it with `require` to get a custom function for you to do optional require from your file's require context.  See [Usage](#usage) above.
+
+#### [customOptionalRequire(path, \[message|options\])](#customoptionalrequirepath-messageoptions)
+
+The function [optionalRequire](#optionalrequirerequire) returns for you to do optional require from your file's require context.
+
+##### Params
+
+-   `path` - name/path to the module your want to optionally require
+-   `message` - optional flag/message to enable `console.log` a message when module is not found
+-   `options` - an optional object with the following fields
+    -   `message` - see above
+    -   `fail` - callback for when an error that's _not_ `MODULE_NOT_FOUND` for `path` occurred
+    -   `notFound` - callback for when `path` was not found
+        -   The value from this is returned
+    -   `default` - default value to returned when not found - not allowed with `notFound` together
+
+##### Returns
+
+-   module required or one of the following if not found
+    -   `undefined` or
+    -   return value from `options.notFound` if it's specified
+    -   `options.default` if it's specified
+
+##### Throws
+
+-   rethrows any error that's not `MODULE_NOT_FOUND` for the module `path`
+
+#### [customOptionalRequire.resolve(path, \[message\])](#customoptionalrequireresolvepath-message)
+
+Same as [customOptionalRequire](#customoptionalrequirepath-messageoptions) but acts like `require.resolve`
+
+#### [optionalRequire.log(message, path)](#optionalrequirelogmessage-path)
+
+The function that will be called to log the message when optional module is not found.  You can override this with your own function.
+
+#### [optionalRequire.try(require, path, \[message|options\])](#optionalrequiretryrequire-path-messageoptions)
+
+Same as [customOptionalRequire](#customoptionalrequirepath-messageoptions) but you have to pass in `require` from your file's context.
+
+#### [optionalRequire.resolve(require, path, \[message|options\])](#optionalrequireresolverequire-path-messageoptions)
+
+Same as [customOptionalRequire.resolve](#customoptionalrequirepath-messageoptions) but you have to pass in `require` from your file's context.
+
+# LICENSE
+
+Apache-2.0 © [Joel Chen](https://github.com/jchip)
+
+[travis-image]: https://travis-ci.org/jchip/optional-require.svg?branch=master
+
+[travis-url]: https://travis-ci.org/jchip/optional-require
+
+[npm-image]: https://badge.fury.io/js/optional-require.svg
+
+[npm-url]: https://npmjs.org/package/optional-require
+
+[daviddm-image]: https://david-dm.org/jchip/optional-require/status.svg
+
+[daviddm-url]: https://david-dm.org/jchip/optional-require
+
+[daviddm-dev-image]: https://david-dm.org/jchip/optional-require/dev-status.svg
+
+[daviddm-dev-url]: https://david-dm.org/jchip/optional-require?type=dev
diff --git a/NodeAPI/node_modules/optional-require/index.js b/NodeAPI/node_modules/optional-require/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..62c9ae927c1571a51170b13ff670ff12951aab7f
--- /dev/null
+++ b/NodeAPI/node_modules/optional-require/index.js
@@ -0,0 +1,75 @@
+"use strict";
+
+const assert = require("assert");
+
+function findModuleNotFound(err, name) {
+  // Check the first line of the error message
+  const msg = err.message.split("\n")[0];
+  return msg && (
+    // Check for "Cannot find module 'foo'"
+    msg.includes(`'${name}'`)
+    // Check for "Your application tried to access foo (a peer dependency) ..." (Yarn v2 PnP)
+    // https://github.com/yarnpkg/berry/blob/e81dc0d29bb2f41818d9c5c1c74bab1406fb979b/packages/yarnpkg-pnp/sources/loader/makeApi.ts#L680
+    || msg.includes(` ${name} `)
+    // Check for "Your application tried to access foo. While ..." (Yarn v2 PnP)
+    // https://github.com/yarnpkg/berry/blob/e81dc0d29bb2f41818d9c5c1c74bab1406fb979b/packages/yarnpkg-pnp/sources/loader/makeApi.ts#L704
+    || msg.includes(` ${name}. `)
+    // Check for "Your application tried to access foo, but ..." (Yarn v2 PnP)
+    // https://github.com/yarnpkg/berry/blob/e81dc0d29bb2f41818d9c5c1c74bab1406fb979b/packages/yarnpkg-pnp/sources/loader/makeApi.ts#L718
+    || msg.includes(` ${name}, `)
+  );
+}
+
+function _optionalRequire(callerRequire, resolve, path, message) {
+  let opts;
+
+  if (typeof message === "object") {
+    opts = message;
+    assert(
+      !(opts.hasOwnProperty("notFound") && opts.hasOwnProperty("default")),
+      "optionalRequire: options set with both `notFound` and `default`"
+    );
+  } else {
+    opts = { message };
+  }
+
+  try {
+    return resolve ? callerRequire.resolve(path) : callerRequire(path);
+  } catch (e) {
+    if (e.code !== "MODULE_NOT_FOUND" || !findModuleNotFound(e, path)) {
+      // if the module we are requiring fail because it try to require a
+      // module that's not found, then we have to report this as failed.
+      if (typeof opts.fail === "function") {
+        return opts.fail(e);
+      }
+      throw e;
+    }
+
+    if (opts.message) {
+      const message = typeof opts.message === "string" ? `${opts.message} - ` : "";
+      const r = resolve ? "resolved" : "found";
+      optionalRequire.log(`${message}optional module not ${r}`, path);
+    }
+
+    if (typeof opts.notFound === "function") {
+      return opts.notFound(e);
+    }
+
+    return opts.default;
+  }
+}
+
+const tryRequire = (callerRequire, path, message) => _optionalRequire(callerRequire, false, path, message);
+const tryResolve = (callerRequire, path, message) => _optionalRequire(callerRequire, true, path, message);
+
+function optionalRequire(callerRequire) {
+  const x = (path, message) => tryRequire(callerRequire, path, message);
+  x.resolve = (path, message) => tryResolve(callerRequire, path, message);
+  return x;
+}
+
+optionalRequire.try = tryRequire;
+optionalRequire.tryResolve = tryResolve;
+optionalRequire.resolve = tryResolve;
+optionalRequire.log = (message, path) => console.log(`Just FYI: ${message}; Path "${path}"`);
+module.exports = optionalRequire;
diff --git a/NodeAPI/node_modules/optional-require/package.json b/NodeAPI/node_modules/optional-require/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..eff8e9a83d94929560011b3538e4c35fca950da7
--- /dev/null
+++ b/NodeAPI/node_modules/optional-require/package.json
@@ -0,0 +1,38 @@
+{
+  "name": "optional-require",
+  "version": "1.0.3",
+  "description": "NodeJS Require that let you handle module not found error without try/catch",
+  "main": "index.js",
+  "scripts": {
+    "test": "mocha test/spec",
+    "coverage": "istanbul cover _mocha -- test/spec/*.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/jchip/optional-require.git"
+  },
+  "keywords": [
+    "optional require",
+    "optional",
+    "require"
+  ],
+  "files": [
+    "index.js"
+  ],
+  "engines": {
+    "node": ">=4"
+  },
+  "author": "Joel Chen",
+  "license": "Apache-2.0",
+  "devDependencies": {
+    "chai": "^3.5.0",
+    "istanbul": "^0.4.5",
+    "mocha": "^3.2.0",
+    "prettier": "1.19.1",
+    "require-at": "^1.0.0"
+  },
+  "dependencies": {},
+  "prettier": {
+    "printWidth": 120
+  }
+}
diff --git a/NodeAPI/node_modules/process-nextick-args/index.js b/NodeAPI/node_modules/process-nextick-args/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..3eecf11488531cd40aed422f0a68bdf0e6a8611a
--- /dev/null
+++ b/NodeAPI/node_modules/process-nextick-args/index.js
@@ -0,0 +1,45 @@
+'use strict';
+
+if (typeof process === 'undefined' ||
+    !process.version ||
+    process.version.indexOf('v0.') === 0 ||
+    process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
+  module.exports = { nextTick: nextTick };
+} else {
+  module.exports = process
+}
+
+function nextTick(fn, arg1, arg2, arg3) {
+  if (typeof fn !== 'function') {
+    throw new TypeError('"callback" argument must be a function');
+  }
+  var len = arguments.length;
+  var args, i;
+  switch (len) {
+  case 0:
+  case 1:
+    return process.nextTick(fn);
+  case 2:
+    return process.nextTick(function afterTickOne() {
+      fn.call(null, arg1);
+    });
+  case 3:
+    return process.nextTick(function afterTickTwo() {
+      fn.call(null, arg1, arg2);
+    });
+  case 4:
+    return process.nextTick(function afterTickThree() {
+      fn.call(null, arg1, arg2, arg3);
+    });
+  default:
+    args = new Array(len - 1);
+    i = 0;
+    while (i < args.length) {
+      args[i++] = arguments[i];
+    }
+    return process.nextTick(function afterTick() {
+      fn.apply(null, args);
+    });
+  }
+}
+
diff --git a/NodeAPI/node_modules/process-nextick-args/license.md b/NodeAPI/node_modules/process-nextick-args/license.md
new file mode 100644
index 0000000000000000000000000000000000000000..c67e3532b542455fad8c4004ef297534d7f480b2
--- /dev/null
+++ b/NodeAPI/node_modules/process-nextick-args/license.md
@@ -0,0 +1,19 @@
+# Copyright (c) 2015 Calvin Metcalf
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.**
diff --git a/NodeAPI/node_modules/process-nextick-args/package.json b/NodeAPI/node_modules/process-nextick-args/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..6070b723fcd3476052a28040412e61d7df2511f4
--- /dev/null
+++ b/NodeAPI/node_modules/process-nextick-args/package.json
@@ -0,0 +1,25 @@
+{
+  "name": "process-nextick-args",
+  "version": "2.0.1",
+  "description": "process.nextTick but always with args",
+  "main": "index.js",
+  "files": [
+    "index.js"
+  ],
+  "scripts": {
+    "test": "node test.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/calvinmetcalf/process-nextick-args.git"
+  },
+  "author": "",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/calvinmetcalf/process-nextick-args/issues"
+  },
+  "homepage": "https://github.com/calvinmetcalf/process-nextick-args",
+  "devDependencies": {
+    "tap": "~0.2.6"
+  }
+}
diff --git a/NodeAPI/node_modules/process-nextick-args/readme.md b/NodeAPI/node_modules/process-nextick-args/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..ecb432c9b21ffd44bded842812586d3dab132c69
--- /dev/null
+++ b/NodeAPI/node_modules/process-nextick-args/readme.md
@@ -0,0 +1,18 @@
+process-nextick-args
+=====
+
+[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args)
+
+```bash
+npm install --save process-nextick-args
+```
+
+Always be able to pass arguments to process.nextTick, no matter the platform
+
+```js
+var pna = require('process-nextick-args');
+
+pna.nextTick(function (a, b, c) {
+  console.log(a, b, c);
+}, 'step', 3,  'profit');
+```
diff --git a/NodeAPI/node_modules/readable-stream/.travis.yml b/NodeAPI/node_modules/readable-stream/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..f62cdac0686da613ecdbf214fb2b43a828cb6ce9
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/.travis.yml
@@ -0,0 +1,34 @@
+sudo: false
+language: node_js
+before_install:
+  - (test $NPM_LEGACY && npm install -g npm@2 && npm install -g npm@3) || true
+notifications:
+  email: false
+matrix:
+  fast_finish: true
+  include:
+  - node_js: '0.8'
+    env: NPM_LEGACY=true
+  - node_js: '0.10'
+    env: NPM_LEGACY=true
+  - node_js: '0.11'
+    env: NPM_LEGACY=true
+  - node_js: '0.12'
+    env: NPM_LEGACY=true
+  - node_js: 1
+    env: NPM_LEGACY=true
+  - node_js: 2
+    env: NPM_LEGACY=true
+  - node_js: 3
+    env: NPM_LEGACY=true
+  - node_js: 4
+  - node_js: 5
+  - node_js: 6
+  - node_js: 7
+  - node_js: 8
+  - node_js: 9
+script: "npm run test"
+env:
+  global:
+  - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc=
+  - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI=
diff --git a/NodeAPI/node_modules/readable-stream/CONTRIBUTING.md b/NodeAPI/node_modules/readable-stream/CONTRIBUTING.md
new file mode 100644
index 0000000000000000000000000000000000000000..f478d58dca85b2c396e2da8a2251be0071c4e9e0
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/CONTRIBUTING.md
@@ -0,0 +1,38 @@
+# Developer's Certificate of Origin 1.1
+
+By making a contribution to this project, I certify that:
+
+* (a) The contribution was created in whole or in part by me and I
+  have the right to submit it under the open source license
+  indicated in the file; or
+
+* (b) The contribution is based upon previous work that, to the best
+  of my knowledge, is covered under an appropriate open source
+  license and I have the right under that license to submit that
+  work with modifications, whether created in whole or in part
+  by me, under the same open source license (unless I am
+  permitted to submit under a different license), as indicated
+  in the file; or
+
+* (c) The contribution was provided directly to me by some other
+  person who certified (a), (b) or (c) and I have not modified
+  it.
+
+* (d) I understand and agree that this project and the contribution
+  are public and that a record of the contribution (including all
+  personal information I submit with it, including my sign-off) is
+  maintained indefinitely and may be redistributed consistent with
+  this project or the open source license(s) involved.
+
+## Moderation Policy
+
+The [Node.js Moderation Policy] applies to this WG.
+
+## Code of Conduct
+
+The [Node.js Code of Conduct][] applies to this WG.
+
+[Node.js Code of Conduct]:
+https://github.com/nodejs/node/blob/master/CODE_OF_CONDUCT.md
+[Node.js Moderation Policy]:
+https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md
diff --git a/NodeAPI/node_modules/readable-stream/GOVERNANCE.md b/NodeAPI/node_modules/readable-stream/GOVERNANCE.md
new file mode 100644
index 0000000000000000000000000000000000000000..16ffb93f24bece9519cc4a220a0c1d3c91481453
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/GOVERNANCE.md
@@ -0,0 +1,136 @@
+### Streams Working Group
+
+The Node.js Streams is jointly governed by a Working Group
+(WG)
+that is responsible for high-level guidance of the project.
+
+The WG has final authority over this project including:
+
+* Technical direction
+* Project governance and process (including this policy)
+* Contribution policy
+* GitHub repository hosting
+* Conduct guidelines
+* Maintaining the list of additional Collaborators
+
+For the current list of WG members, see the project
+[README.md](./README.md#current-project-team-members).
+
+### Collaborators
+
+The readable-stream GitHub repository is
+maintained by the WG and additional Collaborators who are added by the
+WG on an ongoing basis.
+
+Individuals making significant and valuable contributions are made
+Collaborators and given commit-access to the project. These
+individuals are identified by the WG and their addition as
+Collaborators is discussed during the WG meeting.
+
+_Note:_ If you make a significant contribution and are not considered
+for commit-access log an issue or contact a WG member directly and it
+will be brought up in the next WG meeting.
+
+Modifications of the contents of the readable-stream repository are
+made on
+a collaborative basis. Anybody with a GitHub account may propose a
+modification via pull request and it will be considered by the project
+Collaborators. All pull requests must be reviewed and accepted by a
+Collaborator with sufficient expertise who is able to take full
+responsibility for the change. In the case of pull requests proposed
+by an existing Collaborator, an additional Collaborator is required
+for sign-off. Consensus should be sought if additional Collaborators
+participate and there is disagreement around a particular
+modification. See _Consensus Seeking Process_ below for further detail
+on the consensus model used for governance.
+
+Collaborators may opt to elevate significant or controversial
+modifications, or modifications that have not found consensus to the
+WG for discussion by assigning the ***WG-agenda*** tag to a pull
+request or issue. The WG should serve as the final arbiter where
+required.
+
+For the current list of Collaborators, see the project
+[README.md](./README.md#members).
+
+### WG Membership
+
+WG seats are not time-limited.  There is no fixed size of the WG.
+However, the expected target is between 6 and 12, to ensure adequate
+coverage of important areas of expertise, balanced with the ability to
+make decisions efficiently.
+
+There is no specific set of requirements or qualifications for WG
+membership beyond these rules.
+
+The WG may add additional members to the WG by unanimous consensus.
+
+A WG member may be removed from the WG by voluntary resignation, or by
+unanimous consensus of all other WG members.
+
+Changes to WG membership should be posted in the agenda, and may be
+suggested as any other agenda item (see "WG Meetings" below).
+
+If an addition or removal is proposed during a meeting, and the full
+WG is not in attendance to participate, then the addition or removal
+is added to the agenda for the subsequent meeting.  This is to ensure
+that all members are given the opportunity to participate in all
+membership decisions.  If a WG member is unable to attend a meeting
+where a planned membership decision is being made, then their consent
+is assumed.
+
+No more than 1/3 of the WG members may be affiliated with the same
+employer.  If removal or resignation of a WG member, or a change of
+employment by a WG member, creates a situation where more than 1/3 of
+the WG membership shares an employer, then the situation must be
+immediately remedied by the resignation or removal of one or more WG
+members affiliated with the over-represented employer(s).
+
+### WG Meetings
+
+The WG meets occasionally on a Google Hangout On Air. A designated moderator
+approved by the WG runs the meeting. Each meeting should be
+published to YouTube.
+
+Items are added to the WG agenda that are considered contentious or
+are modifications of governance, contribution policy, WG membership,
+or release process.
+
+The intention of the agenda is not to approve or review all patches;
+that should happen continuously on GitHub and be handled by the larger
+group of Collaborators.
+
+Any community member or contributor can ask that something be added to
+the next meeting's agenda by logging a GitHub Issue. Any Collaborator,
+WG member or the moderator can add the item to the agenda by adding
+the ***WG-agenda*** tag to the issue.
+
+Prior to each WG meeting the moderator will share the Agenda with
+members of the WG. WG members can add any items they like to the
+agenda at the beginning of each meeting. The moderator and the WG
+cannot veto or remove items.
+
+The WG may invite persons or representatives from certain projects to
+participate in a non-voting capacity.
+
+The moderator is responsible for summarizing the discussion of each
+agenda item and sends it as a pull request after the meeting.
+
+### Consensus Seeking Process
+
+The WG follows a
+[Consensus
+Seeking](http://en.wikipedia.org/wiki/Consensus-seeking_decision-making)
+decision-making model.
+
+When an agenda item has appeared to reach a consensus the moderator
+will ask "Does anyone object?" as a final call for dissent from the
+consensus.
+
+If an agenda item cannot reach a consensus a WG member can call for
+either a closing vote or a vote to table the issue to the next
+meeting. The call for a vote must be seconded by a majority of the WG
+or else the discussion will continue. Simple majority wins.
+
+Note that changes to WG membership require a majority consensus.  See
+"WG Membership" above.
diff --git a/NodeAPI/node_modules/readable-stream/LICENSE b/NodeAPI/node_modules/readable-stream/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..2873b3b2e595072e66330369d83e8af46655970c
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/LICENSE
@@ -0,0 +1,47 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
diff --git a/NodeAPI/node_modules/readable-stream/README.md b/NodeAPI/node_modules/readable-stream/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..23fe3f3e3009a2c63c3791738299504d40ebbca9
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/README.md
@@ -0,0 +1,58 @@
+# readable-stream
+
+***Node-core v8.11.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)
+
+
+[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)
+[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)
+
+
+[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)
+
+```bash
+npm install --save readable-stream
+```
+
+***Node-core streams for userland***
+
+This package is a mirror of the Streams2 and Streams3 implementations in
+Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.11.1/docs/api/stream.html).
+
+If you want to guarantee a stable streams base, regardless of what version of
+Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).
+
+As of version 2.0.0 **readable-stream** uses semantic versioning.
+
+# Streams Working Group
+
+`readable-stream` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+  project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+  notice of changes.
+
+<a name="members"></a>
+## Team Members
+
+* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;
+  - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B
+* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;
+  - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242
+* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;
+  - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D
+* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;
+* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;
+* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;
+* **Matteo Collina** ([@mcollina](https://github.com/mcollina)) &lt;matteo.collina@gmail.com&gt;
+  - Release GPG key: 3ABC01543F22DD2239285CDD818674489FBC127E
+* **Irina Shestak** ([@lrlna](https://github.com/lrlna)) &lt;shestak.irina@gmail.com&gt;
diff --git a/NodeAPI/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/NodeAPI/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
new file mode 100644
index 0000000000000000000000000000000000000000..83275f192e4077d32942525aaf510fa449a7c417
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md
@@ -0,0 +1,60 @@
+# streams WG Meeting 2015-01-30
+
+## Links
+
+* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg
+* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106
+* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/
+
+## Agenda
+
+Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting.
+
+* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105)
+* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101)
+* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102)
+* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99)
+
+## Minutes
+
+### adopt a charter
+
+* group: +1's all around
+
+### What versioning scheme should be adopted?
+* group: +1’s 3.0.0
+* domenic+group: pulling in patches from other sources where appropriate
+* mikeal: version independently, suggesting versions for io.js
+* mikeal+domenic: work with TC to notify in advance of changes
+simpler stream creation
+
+### streamline creation of streams
+* sam: streamline creation of streams
+* domenic: nice simple solution posted
+  but, we lose the opportunity to change the model
+  may not be backwards incompatible (double check keys)
+
+  **action item:** domenic will check
+
+### remove implicit flowing of streams on(‘data’)
+* add isFlowing / isPaused
+* mikeal: worrying that we’re documenting polyfill methods – confuses users
+* domenic: more reflective API is probably good, with warning labels for users
+* new section for mad scientists (reflective stream access)
+* calvin: name the “third state”
+* mikeal: maybe borrow the name from whatwg?
+* domenic: we’re missing the “third state”
+* consensus: kind of difficult to name the third state
+* mikeal: figure out differences in states / compat
+* mathias: always flow on data – eliminates third state
+  * explore what it breaks
+
+**action items:**
+* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream)
+* ask rod/build for infrastructure
+* **chris**: explore the “flow on data” approach
+* add isPaused/isFlowing
+* add new docs section
+* move isPaused to that section
+
+
diff --git a/NodeAPI/node_modules/readable-stream/duplex-browser.js b/NodeAPI/node_modules/readable-stream/duplex-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..f8b2db83dbe733d7720264a9840202e29ebeffbd
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/duplex-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_duplex.js');
diff --git a/NodeAPI/node_modules/readable-stream/duplex.js b/NodeAPI/node_modules/readable-stream/duplex.js
new file mode 100644
index 0000000000000000000000000000000000000000..46924cbfdf53871b574d3f6f5b4bc6064b824aaa
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/duplex.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Duplex
diff --git a/NodeAPI/node_modules/readable-stream/lib/_stream_duplex.js b/NodeAPI/node_modules/readable-stream/lib/_stream_duplex.js
new file mode 100644
index 0000000000000000000000000000000000000000..57003c32d256c0a1fe20dadd279abef2d463074f
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/_stream_duplex.js
@@ -0,0 +1,131 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a duplex stream is just a stream that is both readable and writable.
+// Since JS doesn't have multiple prototypal inheritance, this class
+// prototypally inherits from Readable, and then parasitically from
+// Writable.
+
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+/*<replacement>*/
+var objectKeys = Object.keys || function (obj) {
+  var keys = [];
+  for (var key in obj) {
+    keys.push(key);
+  }return keys;
+};
+/*</replacement>*/
+
+module.exports = Duplex;
+
+/*<replacement>*/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/*</replacement>*/
+
+var Readable = require('./_stream_readable');
+var Writable = require('./_stream_writable');
+
+util.inherits(Duplex, Readable);
+
+{
+  // avoid scope creep, the keys array can then be collected
+  var keys = objectKeys(Writable.prototype);
+  for (var v = 0; v < keys.length; v++) {
+    var method = keys[v];
+    if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
+  }
+}
+
+function Duplex(options) {
+  if (!(this instanceof Duplex)) return new Duplex(options);
+
+  Readable.call(this, options);
+  Writable.call(this, options);
+
+  if (options && options.readable === false) this.readable = false;
+
+  if (options && options.writable === false) this.writable = false;
+
+  this.allowHalfOpen = true;
+  if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
+
+  this.once('end', onend);
+}
+
+Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
+  // making it explicit this property is not enumerable
+  // because otherwise some prototype manipulation in
+  // userland will fail
+  enumerable: false,
+  get: function () {
+    return this._writableState.highWaterMark;
+  }
+});
+
+// the no-half-open enforcer
+function onend() {
+  // if we allow half-open state, or if the writable side ended,
+  // then we're ok.
+  if (this.allowHalfOpen || this._writableState.ended) return;
+
+  // no more data can be written.
+  // But allow more writes to happen in this tick.
+  pna.nextTick(onEndNT, this);
+}
+
+function onEndNT(self) {
+  self.end();
+}
+
+Object.defineProperty(Duplex.prototype, 'destroyed', {
+  get: function () {
+    if (this._readableState === undefined || this._writableState === undefined) {
+      return false;
+    }
+    return this._readableState.destroyed && this._writableState.destroyed;
+  },
+  set: function (value) {
+    // we ignore the value if the stream
+    // has not been initialized yet
+    if (this._readableState === undefined || this._writableState === undefined) {
+      return;
+    }
+
+    // backward compatibility, the user is explicitly
+    // managing destroyed
+    this._readableState.destroyed = value;
+    this._writableState.destroyed = value;
+  }
+});
+
+Duplex.prototype._destroy = function (err, cb) {
+  this.push(null);
+  this.end();
+
+  pna.nextTick(cb, err);
+};
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/_stream_passthrough.js b/NodeAPI/node_modules/readable-stream/lib/_stream_passthrough.js
new file mode 100644
index 0000000000000000000000000000000000000000..612edb4d8b443fabc4ddac619da420bad62fc5b0
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/_stream_passthrough.js
@@ -0,0 +1,47 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a passthrough stream.
+// basically just the most minimal sort of Transform stream.
+// Every written chunk gets output as-is.
+
+'use strict';
+
+module.exports = PassThrough;
+
+var Transform = require('./_stream_transform');
+
+/*<replacement>*/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(PassThrough, Transform);
+
+function PassThrough(options) {
+  if (!(this instanceof PassThrough)) return new PassThrough(options);
+
+  Transform.call(this, options);
+}
+
+PassThrough.prototype._transform = function (chunk, encoding, cb) {
+  cb(null, chunk);
+};
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/_stream_readable.js b/NodeAPI/node_modules/readable-stream/lib/_stream_readable.js
new file mode 100644
index 0000000000000000000000000000000000000000..0f807646b0f67d8ab98c46ca516478c2684b70b1
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/_stream_readable.js
@@ -0,0 +1,1019 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+module.exports = Readable;
+
+/*<replacement>*/
+var isArray = require('isarray');
+/*</replacement>*/
+
+/*<replacement>*/
+var Duplex;
+/*</replacement>*/
+
+Readable.ReadableState = ReadableState;
+
+/*<replacement>*/
+var EE = require('events').EventEmitter;
+
+var EElistenerCount = function (emitter, type) {
+  return emitter.listeners(type).length;
+};
+/*</replacement>*/
+
+/*<replacement>*/
+var Stream = require('./internal/streams/stream');
+/*</replacement>*/
+
+/*<replacement>*/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+  return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/*</replacement>*/
+
+/*<replacement>*/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/*</replacement>*/
+
+/*<replacement>*/
+var debugUtil = require('util');
+var debug = void 0;
+if (debugUtil && debugUtil.debuglog) {
+  debug = debugUtil.debuglog('stream');
+} else {
+  debug = function () {};
+}
+/*</replacement>*/
+
+var BufferList = require('./internal/streams/BufferList');
+var destroyImpl = require('./internal/streams/destroy');
+var StringDecoder;
+
+util.inherits(Readable, Stream);
+
+var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
+
+function prependListener(emitter, event, fn) {
+  // Sadly this is not cacheable as some libraries bundle their own
+  // event emitter implementation with them.
+  if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
+
+  // This is a hack to make sure that our error handler is attached before any
+  // userland ones.  NEVER DO THIS. This is here only because this code needs
+  // to continue to work with older versions of Node.js that do not include
+  // the prependListener() method. The goal is to eventually remove this hack.
+  if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
+}
+
+function ReadableState(options, stream) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  options = options || {};
+
+  // Duplex streams are both readable and writable, but share
+  // the same options object.
+  // However, some cases require setting options to different
+  // values for the readable and the writable sides of the duplex stream.
+  // These options can be provided separately as readableXXX and writableXXX.
+  var isDuplex = stream instanceof Duplex;
+
+  // object stream flag. Used to make read(n) ignore n and to
+  // make all the buffer merging and length checks go away
+  this.objectMode = !!options.objectMode;
+
+  if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
+
+  // the point at which it stops calling _read() to fill the buffer
+  // Note: 0 is a valid value, means "don't call _read preemptively ever"
+  var hwm = options.highWaterMark;
+  var readableHwm = options.readableHighWaterMark;
+  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
+
+  // cast to ints.
+  this.highWaterMark = Math.floor(this.highWaterMark);
+
+  // A linked list is used to store data chunks instead of an array because the
+  // linked list can remove elements from the beginning faster than
+  // array.shift()
+  this.buffer = new BufferList();
+  this.length = 0;
+  this.pipes = null;
+  this.pipesCount = 0;
+  this.flowing = null;
+  this.ended = false;
+  this.endEmitted = false;
+  this.reading = false;
+
+  // a flag to be able to tell if the event 'readable'/'data' is emitted
+  // immediately, or on a later tick.  We set this to true at first, because
+  // any actions that shouldn't happen until "later" should generally also
+  // not happen before the first read call.
+  this.sync = true;
+
+  // whenever we return null, then we set a flag to say
+  // that we're awaiting a 'readable' event emission.
+  this.needReadable = false;
+  this.emittedReadable = false;
+  this.readableListening = false;
+  this.resumeScheduled = false;
+
+  // has it been destroyed
+  this.destroyed = false;
+
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // the number of writers that are awaiting a drain event in .pipe()s
+  this.awaitDrain = 0;
+
+  // if true, a maybeReadMore has been scheduled
+  this.readingMore = false;
+
+  this.decoder = null;
+  this.encoding = null;
+  if (options.encoding) {
+    if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+    this.decoder = new StringDecoder(options.encoding);
+    this.encoding = options.encoding;
+  }
+}
+
+function Readable(options) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  if (!(this instanceof Readable)) return new Readable(options);
+
+  this._readableState = new ReadableState(options, this);
+
+  // legacy
+  this.readable = true;
+
+  if (options) {
+    if (typeof options.read === 'function') this._read = options.read;
+
+    if (typeof options.destroy === 'function') this._destroy = options.destroy;
+  }
+
+  Stream.call(this);
+}
+
+Object.defineProperty(Readable.prototype, 'destroyed', {
+  get: function () {
+    if (this._readableState === undefined) {
+      return false;
+    }
+    return this._readableState.destroyed;
+  },
+  set: function (value) {
+    // we ignore the value if the stream
+    // has not been initialized yet
+    if (!this._readableState) {
+      return;
+    }
+
+    // backward compatibility, the user is explicitly
+    // managing destroyed
+    this._readableState.destroyed = value;
+  }
+});
+
+Readable.prototype.destroy = destroyImpl.destroy;
+Readable.prototype._undestroy = destroyImpl.undestroy;
+Readable.prototype._destroy = function (err, cb) {
+  this.push(null);
+  cb(err);
+};
+
+// Manually shove something into the read() buffer.
+// This returns true if the highWaterMark has not been hit yet,
+// similar to how Writable.write() returns true if you should
+// write() some more.
+Readable.prototype.push = function (chunk, encoding) {
+  var state = this._readableState;
+  var skipChunkCheck;
+
+  if (!state.objectMode) {
+    if (typeof chunk === 'string') {
+      encoding = encoding || state.defaultEncoding;
+      if (encoding !== state.encoding) {
+        chunk = Buffer.from(chunk, encoding);
+        encoding = '';
+      }
+      skipChunkCheck = true;
+    }
+  } else {
+    skipChunkCheck = true;
+  }
+
+  return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
+};
+
+// Unshift should *always* be something directly out of read()
+Readable.prototype.unshift = function (chunk) {
+  return readableAddChunk(this, chunk, null, true, false);
+};
+
+function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
+  var state = stream._readableState;
+  if (chunk === null) {
+    state.reading = false;
+    onEofChunk(stream, state);
+  } else {
+    var er;
+    if (!skipChunkCheck) er = chunkInvalid(state, chunk);
+    if (er) {
+      stream.emit('error', er);
+    } else if (state.objectMode || chunk && chunk.length > 0) {
+      if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
+        chunk = _uint8ArrayToBuffer(chunk);
+      }
+
+      if (addToFront) {
+        if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
+      } else if (state.ended) {
+        stream.emit('error', new Error('stream.push() after EOF'));
+      } else {
+        state.reading = false;
+        if (state.decoder && !encoding) {
+          chunk = state.decoder.write(chunk);
+          if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
+        } else {
+          addChunk(stream, state, chunk, false);
+        }
+      }
+    } else if (!addToFront) {
+      state.reading = false;
+    }
+  }
+
+  return needMoreData(state);
+}
+
+function addChunk(stream, state, chunk, addToFront) {
+  if (state.flowing && state.length === 0 && !state.sync) {
+    stream.emit('data', chunk);
+    stream.read(0);
+  } else {
+    // update the buffer info.
+    state.length += state.objectMode ? 1 : chunk.length;
+    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
+
+    if (state.needReadable) emitReadable(stream);
+  }
+  maybeReadMore(stream, state);
+}
+
+function chunkInvalid(state, chunk) {
+  var er;
+  if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+    er = new TypeError('Invalid non-string/buffer chunk');
+  }
+  return er;
+}
+
+// if it's past the high water mark, we can push in some more.
+// Also, if we have no data yet, we can stand some
+// more bytes.  This is to work around cases where hwm=0,
+// such as the repl.  Also, if the push() triggered a
+// readable event, and the user called read(largeNumber) such that
+// needReadable was set, then we ought to push more, so that another
+// 'readable' event will be triggered.
+function needMoreData(state) {
+  return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
+}
+
+Readable.prototype.isPaused = function () {
+  return this._readableState.flowing === false;
+};
+
+// backwards compatibility.
+Readable.prototype.setEncoding = function (enc) {
+  if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
+  this._readableState.decoder = new StringDecoder(enc);
+  this._readableState.encoding = enc;
+  return this;
+};
+
+// Don't raise the hwm > 8MB
+var MAX_HWM = 0x800000;
+function computeNewHighWaterMark(n) {
+  if (n >= MAX_HWM) {
+    n = MAX_HWM;
+  } else {
+    // Get the next highest power of 2 to prevent increasing hwm excessively in
+    // tiny amounts
+    n--;
+    n |= n >>> 1;
+    n |= n >>> 2;
+    n |= n >>> 4;
+    n |= n >>> 8;
+    n |= n >>> 16;
+    n++;
+  }
+  return n;
+}
+
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function howMuchToRead(n, state) {
+  if (n <= 0 || state.length === 0 && state.ended) return 0;
+  if (state.objectMode) return 1;
+  if (n !== n) {
+    // Only flow one buffer at a time
+    if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
+  }
+  // If we're asking for more than the current hwm, then raise the hwm.
+  if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
+  if (n <= state.length) return n;
+  // Don't have enough
+  if (!state.ended) {
+    state.needReadable = true;
+    return 0;
+  }
+  return state.length;
+}
+
+// you can override either this method, or the async _read(n) below.
+Readable.prototype.read = function (n) {
+  debug('read', n);
+  n = parseInt(n, 10);
+  var state = this._readableState;
+  var nOrig = n;
+
+  if (n !== 0) state.emittedReadable = false;
+
+  // if we're doing read(0) to trigger a readable event, but we
+  // already have a bunch of data in the buffer, then just trigger
+  // the 'readable' event and move on.
+  if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
+    debug('read: emitReadable', state.length, state.ended);
+    if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
+    return null;
+  }
+
+  n = howMuchToRead(n, state);
+
+  // if we've ended, and we're now clear, then finish it up.
+  if (n === 0 && state.ended) {
+    if (state.length === 0) endReadable(this);
+    return null;
+  }
+
+  // All the actual chunk generation logic needs to be
+  // *below* the call to _read.  The reason is that in certain
+  // synthetic stream cases, such as passthrough streams, _read
+  // may be a completely synchronous operation which may change
+  // the state of the read buffer, providing enough data when
+  // before there was *not* enough.
+  //
+  // So, the steps are:
+  // 1. Figure out what the state of things will be after we do
+  // a read from the buffer.
+  //
+  // 2. If that resulting state will trigger a _read, then call _read.
+  // Note that this may be asynchronous, or synchronous.  Yes, it is
+  // deeply ugly to write APIs this way, but that still doesn't mean
+  // that the Readable class should behave improperly, as streams are
+  // designed to be sync/async agnostic.
+  // Take note if the _read call is sync or async (ie, if the read call
+  // has returned yet), so that we know whether or not it's safe to emit
+  // 'readable' etc.
+  //
+  // 3. Actually pull the requested chunks out of the buffer and return.
+
+  // if we need a readable event, then we need to do some reading.
+  var doRead = state.needReadable;
+  debug('need readable', doRead);
+
+  // if we currently have less than the highWaterMark, then also read some
+  if (state.length === 0 || state.length - n < state.highWaterMark) {
+    doRead = true;
+    debug('length less than watermark', doRead);
+  }
+
+  // however, if we've ended, then there's no point, and if we're already
+  // reading, then it's unnecessary.
+  if (state.ended || state.reading) {
+    doRead = false;
+    debug('reading or ended', doRead);
+  } else if (doRead) {
+    debug('do read');
+    state.reading = true;
+    state.sync = true;
+    // if the length is currently zero, then we *need* a readable event.
+    if (state.length === 0) state.needReadable = true;
+    // call internal read method
+    this._read(state.highWaterMark);
+    state.sync = false;
+    // If _read pushed data synchronously, then `reading` will be false,
+    // and we need to re-evaluate how much data we can return to the user.
+    if (!state.reading) n = howMuchToRead(nOrig, state);
+  }
+
+  var ret;
+  if (n > 0) ret = fromList(n, state);else ret = null;
+
+  if (ret === null) {
+    state.needReadable = true;
+    n = 0;
+  } else {
+    state.length -= n;
+  }
+
+  if (state.length === 0) {
+    // If we have nothing in the buffer, then we want to know
+    // as soon as we *do* get something into the buffer.
+    if (!state.ended) state.needReadable = true;
+
+    // If we tried to read() past the EOF, then emit end on the next tick.
+    if (nOrig !== n && state.ended) endReadable(this);
+  }
+
+  if (ret !== null) this.emit('data', ret);
+
+  return ret;
+};
+
+function onEofChunk(stream, state) {
+  if (state.ended) return;
+  if (state.decoder) {
+    var chunk = state.decoder.end();
+    if (chunk && chunk.length) {
+      state.buffer.push(chunk);
+      state.length += state.objectMode ? 1 : chunk.length;
+    }
+  }
+  state.ended = true;
+
+  // emit 'readable' now to make sure it gets picked up.
+  emitReadable(stream);
+}
+
+// Don't emit readable right away in sync mode, because this can trigger
+// another read() call => stack overflow.  This way, it might trigger
+// a nextTick recursion warning, but that's not so bad.
+function emitReadable(stream) {
+  var state = stream._readableState;
+  state.needReadable = false;
+  if (!state.emittedReadable) {
+    debug('emitReadable', state.flowing);
+    state.emittedReadable = true;
+    if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
+  }
+}
+
+function emitReadable_(stream) {
+  debug('emit readable');
+  stream.emit('readable');
+  flow(stream);
+}
+
+// at this point, the user has presumably seen the 'readable' event,
+// and called read() to consume some data.  that may have triggered
+// in turn another _read(n) call, in which case reading = true if
+// it's in progress.
+// However, if we're not ended, or reading, and the length < hwm,
+// then go ahead and try to read some more preemptively.
+function maybeReadMore(stream, state) {
+  if (!state.readingMore) {
+    state.readingMore = true;
+    pna.nextTick(maybeReadMore_, stream, state);
+  }
+}
+
+function maybeReadMore_(stream, state) {
+  var len = state.length;
+  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
+    debug('maybeReadMore read 0');
+    stream.read(0);
+    if (len === state.length)
+      // didn't get any data, stop spinning.
+      break;else len = state.length;
+  }
+  state.readingMore = false;
+}
+
+// abstract method.  to be overridden in specific implementation classes.
+// call cb(er, data) where data is <= n in length.
+// for virtual (non-string, non-buffer) streams, "length" is somewhat
+// arbitrary, and perhaps not very meaningful.
+Readable.prototype._read = function (n) {
+  this.emit('error', new Error('_read() is not implemented'));
+};
+
+Readable.prototype.pipe = function (dest, pipeOpts) {
+  var src = this;
+  var state = this._readableState;
+
+  switch (state.pipesCount) {
+    case 0:
+      state.pipes = dest;
+      break;
+    case 1:
+      state.pipes = [state.pipes, dest];
+      break;
+    default:
+      state.pipes.push(dest);
+      break;
+  }
+  state.pipesCount += 1;
+  debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
+
+  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
+
+  var endFn = doEnd ? onend : unpipe;
+  if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
+
+  dest.on('unpipe', onunpipe);
+  function onunpipe(readable, unpipeInfo) {
+    debug('onunpipe');
+    if (readable === src) {
+      if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
+        unpipeInfo.hasUnpiped = true;
+        cleanup();
+      }
+    }
+  }
+
+  function onend() {
+    debug('onend');
+    dest.end();
+  }
+
+  // when the dest drains, it reduces the awaitDrain counter
+  // on the source.  This would be more elegant with a .once()
+  // handler in flow(), but adding and removing repeatedly is
+  // too slow.
+  var ondrain = pipeOnDrain(src);
+  dest.on('drain', ondrain);
+
+  var cleanedUp = false;
+  function cleanup() {
+    debug('cleanup');
+    // cleanup event handlers once the pipe is broken
+    dest.removeListener('close', onclose);
+    dest.removeListener('finish', onfinish);
+    dest.removeListener('drain', ondrain);
+    dest.removeListener('error', onerror);
+    dest.removeListener('unpipe', onunpipe);
+    src.removeListener('end', onend);
+    src.removeListener('end', unpipe);
+    src.removeListener('data', ondata);
+
+    cleanedUp = true;
+
+    // if the reader is waiting for a drain event from this
+    // specific writer, then it would cause it to never start
+    // flowing again.
+    // So, if this is awaiting a drain, then we just call it now.
+    // If we don't know, then assume that we are waiting for one.
+    if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
+  }
+
+  // If the user pushes more data while we're writing to dest then we'll end up
+  // in ondata again. However, we only want to increase awaitDrain once because
+  // dest will only emit one 'drain' event for the multiple writes.
+  // => Introduce a guard on increasing awaitDrain.
+  var increasedAwaitDrain = false;
+  src.on('data', ondata);
+  function ondata(chunk) {
+    debug('ondata');
+    increasedAwaitDrain = false;
+    var ret = dest.write(chunk);
+    if (false === ret && !increasedAwaitDrain) {
+      // If the user unpiped during `dest.write()`, it is possible
+      // to get stuck in a permanently paused state if that write
+      // also returned false.
+      // => Check whether `dest` is still a piping destination.
+      if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
+        debug('false write response, pause', src._readableState.awaitDrain);
+        src._readableState.awaitDrain++;
+        increasedAwaitDrain = true;
+      }
+      src.pause();
+    }
+  }
+
+  // if the dest has an error, then stop piping into it.
+  // however, don't suppress the throwing behavior for this.
+  function onerror(er) {
+    debug('onerror', er);
+    unpipe();
+    dest.removeListener('error', onerror);
+    if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
+  }
+
+  // Make sure our error handler is attached before userland ones.
+  prependListener(dest, 'error', onerror);
+
+  // Both close and finish should trigger unpipe, but only once.
+  function onclose() {
+    dest.removeListener('finish', onfinish);
+    unpipe();
+  }
+  dest.once('close', onclose);
+  function onfinish() {
+    debug('onfinish');
+    dest.removeListener('close', onclose);
+    unpipe();
+  }
+  dest.once('finish', onfinish);
+
+  function unpipe() {
+    debug('unpipe');
+    src.unpipe(dest);
+  }
+
+  // tell the dest that it's being piped to
+  dest.emit('pipe', src);
+
+  // start the flow if it hasn't been started already.
+  if (!state.flowing) {
+    debug('pipe resume');
+    src.resume();
+  }
+
+  return dest;
+};
+
+function pipeOnDrain(src) {
+  return function () {
+    var state = src._readableState;
+    debug('pipeOnDrain', state.awaitDrain);
+    if (state.awaitDrain) state.awaitDrain--;
+    if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
+      state.flowing = true;
+      flow(src);
+    }
+  };
+}
+
+Readable.prototype.unpipe = function (dest) {
+  var state = this._readableState;
+  var unpipeInfo = { hasUnpiped: false };
+
+  // if we're not piping anywhere, then do nothing.
+  if (state.pipesCount === 0) return this;
+
+  // just one destination.  most common case.
+  if (state.pipesCount === 1) {
+    // passed in one, but it's not the right one.
+    if (dest && dest !== state.pipes) return this;
+
+    if (!dest) dest = state.pipes;
+
+    // got a match.
+    state.pipes = null;
+    state.pipesCount = 0;
+    state.flowing = false;
+    if (dest) dest.emit('unpipe', this, unpipeInfo);
+    return this;
+  }
+
+  // slow case. multiple pipe destinations.
+
+  if (!dest) {
+    // remove all.
+    var dests = state.pipes;
+    var len = state.pipesCount;
+    state.pipes = null;
+    state.pipesCount = 0;
+    state.flowing = false;
+
+    for (var i = 0; i < len; i++) {
+      dests[i].emit('unpipe', this, unpipeInfo);
+    }return this;
+  }
+
+  // try to find the right one.
+  var index = indexOf(state.pipes, dest);
+  if (index === -1) return this;
+
+  state.pipes.splice(index, 1);
+  state.pipesCount -= 1;
+  if (state.pipesCount === 1) state.pipes = state.pipes[0];
+
+  dest.emit('unpipe', this, unpipeInfo);
+
+  return this;
+};
+
+// set up data events if they are asked for
+// Ensure readable listeners eventually get something
+Readable.prototype.on = function (ev, fn) {
+  var res = Stream.prototype.on.call(this, ev, fn);
+
+  if (ev === 'data') {
+    // Start flowing on next tick if stream isn't explicitly paused
+    if (this._readableState.flowing !== false) this.resume();
+  } else if (ev === 'readable') {
+    var state = this._readableState;
+    if (!state.endEmitted && !state.readableListening) {
+      state.readableListening = state.needReadable = true;
+      state.emittedReadable = false;
+      if (!state.reading) {
+        pna.nextTick(nReadingNextTick, this);
+      } else if (state.length) {
+        emitReadable(this);
+      }
+    }
+  }
+
+  return res;
+};
+Readable.prototype.addListener = Readable.prototype.on;
+
+function nReadingNextTick(self) {
+  debug('readable nexttick read 0');
+  self.read(0);
+}
+
+// pause() and resume() are remnants of the legacy readable stream API
+// If the user uses them, then switch into old mode.
+Readable.prototype.resume = function () {
+  var state = this._readableState;
+  if (!state.flowing) {
+    debug('resume');
+    state.flowing = true;
+    resume(this, state);
+  }
+  return this;
+};
+
+function resume(stream, state) {
+  if (!state.resumeScheduled) {
+    state.resumeScheduled = true;
+    pna.nextTick(resume_, stream, state);
+  }
+}
+
+function resume_(stream, state) {
+  if (!state.reading) {
+    debug('resume read 0');
+    stream.read(0);
+  }
+
+  state.resumeScheduled = false;
+  state.awaitDrain = 0;
+  stream.emit('resume');
+  flow(stream);
+  if (state.flowing && !state.reading) stream.read(0);
+}
+
+Readable.prototype.pause = function () {
+  debug('call pause flowing=%j', this._readableState.flowing);
+  if (false !== this._readableState.flowing) {
+    debug('pause');
+    this._readableState.flowing = false;
+    this.emit('pause');
+  }
+  return this;
+};
+
+function flow(stream) {
+  var state = stream._readableState;
+  debug('flow', state.flowing);
+  while (state.flowing && stream.read() !== null) {}
+}
+
+// wrap an old-style stream as the async data source.
+// This is *not* part of the readable stream interface.
+// It is an ugly unfortunate mess of history.
+Readable.prototype.wrap = function (stream) {
+  var _this = this;
+
+  var state = this._readableState;
+  var paused = false;
+
+  stream.on('end', function () {
+    debug('wrapped end');
+    if (state.decoder && !state.ended) {
+      var chunk = state.decoder.end();
+      if (chunk && chunk.length) _this.push(chunk);
+    }
+
+    _this.push(null);
+  });
+
+  stream.on('data', function (chunk) {
+    debug('wrapped data');
+    if (state.decoder) chunk = state.decoder.write(chunk);
+
+    // don't skip over falsy values in objectMode
+    if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
+
+    var ret = _this.push(chunk);
+    if (!ret) {
+      paused = true;
+      stream.pause();
+    }
+  });
+
+  // proxy all the other methods.
+  // important when wrapping filters and duplexes.
+  for (var i in stream) {
+    if (this[i] === undefined && typeof stream[i] === 'function') {
+      this[i] = function (method) {
+        return function () {
+          return stream[method].apply(stream, arguments);
+        };
+      }(i);
+    }
+  }
+
+  // proxy certain important events.
+  for (var n = 0; n < kProxyEvents.length; n++) {
+    stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
+  }
+
+  // when we try to consume some more bytes, simply unpause the
+  // underlying stream.
+  this._read = function (n) {
+    debug('wrapped _read', n);
+    if (paused) {
+      paused = false;
+      stream.resume();
+    }
+  };
+
+  return this;
+};
+
+Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
+  // making it explicit this property is not enumerable
+  // because otherwise some prototype manipulation in
+  // userland will fail
+  enumerable: false,
+  get: function () {
+    return this._readableState.highWaterMark;
+  }
+});
+
+// exposed for testing purposes only.
+Readable._fromList = fromList;
+
+// Pluck off n bytes from an array of buffers.
+// Length is the combined lengths of all the buffers in the list.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromList(n, state) {
+  // nothing buffered
+  if (state.length === 0) return null;
+
+  var ret;
+  if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
+    // read it all, truncate the list
+    if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
+    state.buffer.clear();
+  } else {
+    // read part of list
+    ret = fromListPartial(n, state.buffer, state.decoder);
+  }
+
+  return ret;
+}
+
+// Extracts only enough buffered data to satisfy the amount requested.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function fromListPartial(n, list, hasStrings) {
+  var ret;
+  if (n < list.head.data.length) {
+    // slice is the same for buffers and strings
+    ret = list.head.data.slice(0, n);
+    list.head.data = list.head.data.slice(n);
+  } else if (n === list.head.data.length) {
+    // first chunk is a perfect match
+    ret = list.shift();
+  } else {
+    // result spans more than one buffer
+    ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
+  }
+  return ret;
+}
+
+// Copies a specified amount of characters from the list of buffered data
+// chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBufferString(n, list) {
+  var p = list.head;
+  var c = 1;
+  var ret = p.data;
+  n -= ret.length;
+  while (p = p.next) {
+    var str = p.data;
+    var nb = n > str.length ? str.length : n;
+    if (nb === str.length) ret += str;else ret += str.slice(0, n);
+    n -= nb;
+    if (n === 0) {
+      if (nb === str.length) {
+        ++c;
+        if (p.next) list.head = p.next;else list.head = list.tail = null;
+      } else {
+        list.head = p;
+        p.data = str.slice(nb);
+      }
+      break;
+    }
+    ++c;
+  }
+  list.length -= c;
+  return ret;
+}
+
+// Copies a specified amount of bytes from the list of buffered data chunks.
+// This function is designed to be inlinable, so please take care when making
+// changes to the function body.
+function copyFromBuffer(n, list) {
+  var ret = Buffer.allocUnsafe(n);
+  var p = list.head;
+  var c = 1;
+  p.data.copy(ret);
+  n -= p.data.length;
+  while (p = p.next) {
+    var buf = p.data;
+    var nb = n > buf.length ? buf.length : n;
+    buf.copy(ret, ret.length - n, 0, nb);
+    n -= nb;
+    if (n === 0) {
+      if (nb === buf.length) {
+        ++c;
+        if (p.next) list.head = p.next;else list.head = list.tail = null;
+      } else {
+        list.head = p;
+        p.data = buf.slice(nb);
+      }
+      break;
+    }
+    ++c;
+  }
+  list.length -= c;
+  return ret;
+}
+
+function endReadable(stream) {
+  var state = stream._readableState;
+
+  // If we get here before consuming all the bytes, then that is a
+  // bug in node.  Should never happen.
+  if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
+
+  if (!state.endEmitted) {
+    state.ended = true;
+    pna.nextTick(endReadableNT, state, stream);
+  }
+}
+
+function endReadableNT(state, stream) {
+  // Check that we didn't get one last unshift.
+  if (!state.endEmitted && state.length === 0) {
+    state.endEmitted = true;
+    stream.readable = false;
+    stream.emit('end');
+  }
+}
+
+function indexOf(xs, x) {
+  for (var i = 0, l = xs.length; i < l; i++) {
+    if (xs[i] === x) return i;
+  }
+  return -1;
+}
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/_stream_transform.js b/NodeAPI/node_modules/readable-stream/lib/_stream_transform.js
new file mode 100644
index 0000000000000000000000000000000000000000..fcfc105af8e9a124bea4b82011f6cb7d6d2a7158
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/_stream_transform.js
@@ -0,0 +1,214 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// a transform stream is a readable/writable stream where you do
+// something with the data.  Sometimes it's called a "filter",
+// but that's not a great name for it, since that implies a thing where
+// some bits pass through, and others are simply ignored.  (That would
+// be a valid example of a transform, of course.)
+//
+// While the output is causally related to the input, it's not a
+// necessarily symmetric or synchronous transformation.  For example,
+// a zlib stream might take multiple plain-text writes(), and then
+// emit a single compressed chunk some time in the future.
+//
+// Here's how this works:
+//
+// The Transform stream has all the aspects of the readable and writable
+// stream classes.  When you write(chunk), that calls _write(chunk,cb)
+// internally, and returns false if there's a lot of pending writes
+// buffered up.  When you call read(), that calls _read(n) until
+// there's enough pending readable data buffered up.
+//
+// In a transform stream, the written data is placed in a buffer.  When
+// _read(n) is called, it transforms the queued up data, calling the
+// buffered _write cb's as it consumes chunks.  If consuming a single
+// written chunk would result in multiple output chunks, then the first
+// outputted bit calls the readcb, and subsequent chunks just go into
+// the read buffer, and will cause it to emit 'readable' if necessary.
+//
+// This way, back-pressure is actually determined by the reading side,
+// since _read has to be called to start processing a new chunk.  However,
+// a pathological inflate type of transform can cause excessive buffering
+// here.  For example, imagine a stream where every byte of input is
+// interpreted as an integer from 0-255, and then results in that many
+// bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
+// 1kb of data being output.  In this case, you could write a very small
+// amount of input, and end up with a very large amount of output.  In
+// such a pathological inflating mechanism, there'd be no way to tell
+// the system to stop doing the transform.  A single 4MB write could
+// cause the system to run out of memory.
+//
+// However, even in such a pathological case, only a single written chunk
+// would be consumed, and then the rest would wait (un-transformed) until
+// the results of the previous transformed chunk were consumed.
+
+'use strict';
+
+module.exports = Transform;
+
+var Duplex = require('./_stream_duplex');
+
+/*<replacement>*/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/*</replacement>*/
+
+util.inherits(Transform, Duplex);
+
+function afterTransform(er, data) {
+  var ts = this._transformState;
+  ts.transforming = false;
+
+  var cb = ts.writecb;
+
+  if (!cb) {
+    return this.emit('error', new Error('write callback called multiple times'));
+  }
+
+  ts.writechunk = null;
+  ts.writecb = null;
+
+  if (data != null) // single equals check for both `null` and `undefined`
+    this.push(data);
+
+  cb(er);
+
+  var rs = this._readableState;
+  rs.reading = false;
+  if (rs.needReadable || rs.length < rs.highWaterMark) {
+    this._read(rs.highWaterMark);
+  }
+}
+
+function Transform(options) {
+  if (!(this instanceof Transform)) return new Transform(options);
+
+  Duplex.call(this, options);
+
+  this._transformState = {
+    afterTransform: afterTransform.bind(this),
+    needTransform: false,
+    transforming: false,
+    writecb: null,
+    writechunk: null,
+    writeencoding: null
+  };
+
+  // start out asking for a readable event once data is transformed.
+  this._readableState.needReadable = true;
+
+  // we have implemented the _read method, and done the other things
+  // that Readable wants before the first _read call, so unset the
+  // sync guard flag.
+  this._readableState.sync = false;
+
+  if (options) {
+    if (typeof options.transform === 'function') this._transform = options.transform;
+
+    if (typeof options.flush === 'function') this._flush = options.flush;
+  }
+
+  // When the writable side finishes, then flush out anything remaining.
+  this.on('prefinish', prefinish);
+}
+
+function prefinish() {
+  var _this = this;
+
+  if (typeof this._flush === 'function') {
+    this._flush(function (er, data) {
+      done(_this, er, data);
+    });
+  } else {
+    done(this, null, null);
+  }
+}
+
+Transform.prototype.push = function (chunk, encoding) {
+  this._transformState.needTransform = false;
+  return Duplex.prototype.push.call(this, chunk, encoding);
+};
+
+// This is the part where you do stuff!
+// override this function in implementation classes.
+// 'chunk' is an input chunk.
+//
+// Call `push(newChunk)` to pass along transformed output
+// to the readable side.  You may call 'push' zero or more times.
+//
+// Call `cb(err)` when you are done with this chunk.  If you pass
+// an error, then that'll put the hurt on the whole operation.  If you
+// never call cb(), then you'll never get another chunk.
+Transform.prototype._transform = function (chunk, encoding, cb) {
+  throw new Error('_transform() is not implemented');
+};
+
+Transform.prototype._write = function (chunk, encoding, cb) {
+  var ts = this._transformState;
+  ts.writecb = cb;
+  ts.writechunk = chunk;
+  ts.writeencoding = encoding;
+  if (!ts.transforming) {
+    var rs = this._readableState;
+    if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
+  }
+};
+
+// Doesn't matter what the args are here.
+// _transform does all the work.
+// That we got here means that the readable side wants more data.
+Transform.prototype._read = function (n) {
+  var ts = this._transformState;
+
+  if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
+    ts.transforming = true;
+    this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
+  } else {
+    // mark that we need a transform, so that any data that comes in
+    // will get processed, now that we've asked for it.
+    ts.needTransform = true;
+  }
+};
+
+Transform.prototype._destroy = function (err, cb) {
+  var _this2 = this;
+
+  Duplex.prototype._destroy.call(this, err, function (err2) {
+    cb(err2);
+    _this2.emit('close');
+  });
+};
+
+function done(stream, er, data) {
+  if (er) return stream.emit('error', er);
+
+  if (data != null) // single equals check for both `null` and `undefined`
+    stream.push(data);
+
+  // if there's nothing in the write buffer, then that means
+  // that nothing more will ever be provided
+  if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
+
+  if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
+
+  return stream.push(null);
+}
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/_stream_writable.js b/NodeAPI/node_modules/readable-stream/lib/_stream_writable.js
new file mode 100644
index 0000000000000000000000000000000000000000..b0b02200cd72336c17fe871bb7f3ec3872dd802d
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/_stream_writable.js
@@ -0,0 +1,687 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+// A bit simpler than readable streams.
+// Implement an async ._write(chunk, encoding, cb), and it'll handle all
+// the drain event emission and buffering.
+
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+module.exports = Writable;
+
+/* <replacement> */
+function WriteReq(chunk, encoding, cb) {
+  this.chunk = chunk;
+  this.encoding = encoding;
+  this.callback = cb;
+  this.next = null;
+}
+
+// It seems a linked list but it is not
+// there will be only 2 of these for each stream
+function CorkedRequest(state) {
+  var _this = this;
+
+  this.next = null;
+  this.entry = null;
+  this.finish = function () {
+    onCorkedFinish(_this, state);
+  };
+}
+/* </replacement> */
+
+/*<replacement>*/
+var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
+/*</replacement>*/
+
+/*<replacement>*/
+var Duplex;
+/*</replacement>*/
+
+Writable.WritableState = WritableState;
+
+/*<replacement>*/
+var util = Object.create(require('core-util-is'));
+util.inherits = require('inherits');
+/*</replacement>*/
+
+/*<replacement>*/
+var internalUtil = {
+  deprecate: require('util-deprecate')
+};
+/*</replacement>*/
+
+/*<replacement>*/
+var Stream = require('./internal/streams/stream');
+/*</replacement>*/
+
+/*<replacement>*/
+
+var Buffer = require('safe-buffer').Buffer;
+var OurUint8Array = global.Uint8Array || function () {};
+function _uint8ArrayToBuffer(chunk) {
+  return Buffer.from(chunk);
+}
+function _isUint8Array(obj) {
+  return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
+}
+
+/*</replacement>*/
+
+var destroyImpl = require('./internal/streams/destroy');
+
+util.inherits(Writable, Stream);
+
+function nop() {}
+
+function WritableState(options, stream) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  options = options || {};
+
+  // Duplex streams are both readable and writable, but share
+  // the same options object.
+  // However, some cases require setting options to different
+  // values for the readable and the writable sides of the duplex stream.
+  // These options can be provided separately as readableXXX and writableXXX.
+  var isDuplex = stream instanceof Duplex;
+
+  // object stream flag to indicate whether or not this stream
+  // contains buffers or objects.
+  this.objectMode = !!options.objectMode;
+
+  if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
+
+  // the point at which write() starts returning false
+  // Note: 0 is a valid value, means that we always return false if
+  // the entire buffer is not flushed immediately on write()
+  var hwm = options.highWaterMark;
+  var writableHwm = options.writableHighWaterMark;
+  var defaultHwm = this.objectMode ? 16 : 16 * 1024;
+
+  if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
+
+  // cast to ints.
+  this.highWaterMark = Math.floor(this.highWaterMark);
+
+  // if _final has been called
+  this.finalCalled = false;
+
+  // drain event flag.
+  this.needDrain = false;
+  // at the start of calling end()
+  this.ending = false;
+  // when end() has been called, and returned
+  this.ended = false;
+  // when 'finish' is emitted
+  this.finished = false;
+
+  // has it been destroyed
+  this.destroyed = false;
+
+  // should we decode strings into buffers before passing to _write?
+  // this is here so that some node-core streams can optimize string
+  // handling at a lower level.
+  var noDecode = options.decodeStrings === false;
+  this.decodeStrings = !noDecode;
+
+  // Crypto is kind of old and crusty.  Historically, its default string
+  // encoding is 'binary' so we have to make this configurable.
+  // Everything else in the universe uses 'utf8', though.
+  this.defaultEncoding = options.defaultEncoding || 'utf8';
+
+  // not an actual buffer we keep track of, but a measurement
+  // of how much we're waiting to get pushed to some underlying
+  // socket or file.
+  this.length = 0;
+
+  // a flag to see when we're in the middle of a write.
+  this.writing = false;
+
+  // when true all writes will be buffered until .uncork() call
+  this.corked = 0;
+
+  // a flag to be able to tell if the onwrite cb is called immediately,
+  // or on a later tick.  We set this to true at first, because any
+  // actions that shouldn't happen until "later" should generally also
+  // not happen before the first write call.
+  this.sync = true;
+
+  // a flag to know if we're processing previously buffered items, which
+  // may call the _write() callback in the same tick, so that we don't
+  // end up in an overlapped onwrite situation.
+  this.bufferProcessing = false;
+
+  // the callback that's passed to _write(chunk,cb)
+  this.onwrite = function (er) {
+    onwrite(stream, er);
+  };
+
+  // the callback that the user supplies to write(chunk,encoding,cb)
+  this.writecb = null;
+
+  // the amount that is being written when _write is called.
+  this.writelen = 0;
+
+  this.bufferedRequest = null;
+  this.lastBufferedRequest = null;
+
+  // number of pending user-supplied write callbacks
+  // this must be 0 before 'finish' can be emitted
+  this.pendingcb = 0;
+
+  // emit prefinish if the only thing we're waiting for is _write cbs
+  // This is relevant for synchronous Transform streams
+  this.prefinished = false;
+
+  // True if the error was already emitted and should not be thrown again
+  this.errorEmitted = false;
+
+  // count buffered requests
+  this.bufferedRequestCount = 0;
+
+  // allocate the first CorkedRequest, there is always
+  // one allocated and free to use, and we maintain at most two
+  this.corkedRequestsFree = new CorkedRequest(this);
+}
+
+WritableState.prototype.getBuffer = function getBuffer() {
+  var current = this.bufferedRequest;
+  var out = [];
+  while (current) {
+    out.push(current);
+    current = current.next;
+  }
+  return out;
+};
+
+(function () {
+  try {
+    Object.defineProperty(WritableState.prototype, 'buffer', {
+      get: internalUtil.deprecate(function () {
+        return this.getBuffer();
+      }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
+    });
+  } catch (_) {}
+})();
+
+// Test _writableState for inheritance to account for Duplex streams,
+// whose prototype chain only points to Readable.
+var realHasInstance;
+if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
+  realHasInstance = Function.prototype[Symbol.hasInstance];
+  Object.defineProperty(Writable, Symbol.hasInstance, {
+    value: function (object) {
+      if (realHasInstance.call(this, object)) return true;
+      if (this !== Writable) return false;
+
+      return object && object._writableState instanceof WritableState;
+    }
+  });
+} else {
+  realHasInstance = function (object) {
+    return object instanceof this;
+  };
+}
+
+function Writable(options) {
+  Duplex = Duplex || require('./_stream_duplex');
+
+  // Writable ctor is applied to Duplexes, too.
+  // `realHasInstance` is necessary because using plain `instanceof`
+  // would return false, as no `_writableState` property is attached.
+
+  // Trying to use the custom `instanceof` for Writable here will also break the
+  // Node.js LazyTransform implementation, which has a non-trivial getter for
+  // `_writableState` that would lead to infinite recursion.
+  if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
+    return new Writable(options);
+  }
+
+  this._writableState = new WritableState(options, this);
+
+  // legacy.
+  this.writable = true;
+
+  if (options) {
+    if (typeof options.write === 'function') this._write = options.write;
+
+    if (typeof options.writev === 'function') this._writev = options.writev;
+
+    if (typeof options.destroy === 'function') this._destroy = options.destroy;
+
+    if (typeof options.final === 'function') this._final = options.final;
+  }
+
+  Stream.call(this);
+}
+
+// Otherwise people can pipe Writable streams, which is just wrong.
+Writable.prototype.pipe = function () {
+  this.emit('error', new Error('Cannot pipe, not readable'));
+};
+
+function writeAfterEnd(stream, cb) {
+  var er = new Error('write after end');
+  // TODO: defer error events consistently everywhere, not just the cb
+  stream.emit('error', er);
+  pna.nextTick(cb, er);
+}
+
+// Checks that a user-supplied chunk is valid, especially for the particular
+// mode the stream is in. Currently this means that `null` is never accepted
+// and undefined/non-string values are only allowed in object mode.
+function validChunk(stream, state, chunk, cb) {
+  var valid = true;
+  var er = false;
+
+  if (chunk === null) {
+    er = new TypeError('May not write null values to stream');
+  } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
+    er = new TypeError('Invalid non-string/buffer chunk');
+  }
+  if (er) {
+    stream.emit('error', er);
+    pna.nextTick(cb, er);
+    valid = false;
+  }
+  return valid;
+}
+
+Writable.prototype.write = function (chunk, encoding, cb) {
+  var state = this._writableState;
+  var ret = false;
+  var isBuf = !state.objectMode && _isUint8Array(chunk);
+
+  if (isBuf && !Buffer.isBuffer(chunk)) {
+    chunk = _uint8ArrayToBuffer(chunk);
+  }
+
+  if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+
+  if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
+
+  if (typeof cb !== 'function') cb = nop;
+
+  if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
+    state.pendingcb++;
+    ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
+  }
+
+  return ret;
+};
+
+Writable.prototype.cork = function () {
+  var state = this._writableState;
+
+  state.corked++;
+};
+
+Writable.prototype.uncork = function () {
+  var state = this._writableState;
+
+  if (state.corked) {
+    state.corked--;
+
+    if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
+  }
+};
+
+Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
+  // node::ParseEncoding() requires lower case.
+  if (typeof encoding === 'string') encoding = encoding.toLowerCase();
+  if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
+  this._writableState.defaultEncoding = encoding;
+  return this;
+};
+
+function decodeChunk(state, chunk, encoding) {
+  if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
+    chunk = Buffer.from(chunk, encoding);
+  }
+  return chunk;
+}
+
+Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
+  // making it explicit this property is not enumerable
+  // because otherwise some prototype manipulation in
+  // userland will fail
+  enumerable: false,
+  get: function () {
+    return this._writableState.highWaterMark;
+  }
+});
+
+// if we're already writing something, then just put this
+// in the queue, and wait our turn.  Otherwise, call _write
+// If we return false, then we need a drain event, so set that flag.
+function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
+  if (!isBuf) {
+    var newChunk = decodeChunk(state, chunk, encoding);
+    if (chunk !== newChunk) {
+      isBuf = true;
+      encoding = 'buffer';
+      chunk = newChunk;
+    }
+  }
+  var len = state.objectMode ? 1 : chunk.length;
+
+  state.length += len;
+
+  var ret = state.length < state.highWaterMark;
+  // we must ensure that previous needDrain will not be reset to false.
+  if (!ret) state.needDrain = true;
+
+  if (state.writing || state.corked) {
+    var last = state.lastBufferedRequest;
+    state.lastBufferedRequest = {
+      chunk: chunk,
+      encoding: encoding,
+      isBuf: isBuf,
+      callback: cb,
+      next: null
+    };
+    if (last) {
+      last.next = state.lastBufferedRequest;
+    } else {
+      state.bufferedRequest = state.lastBufferedRequest;
+    }
+    state.bufferedRequestCount += 1;
+  } else {
+    doWrite(stream, state, false, len, chunk, encoding, cb);
+  }
+
+  return ret;
+}
+
+function doWrite(stream, state, writev, len, chunk, encoding, cb) {
+  state.writelen = len;
+  state.writecb = cb;
+  state.writing = true;
+  state.sync = true;
+  if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
+  state.sync = false;
+}
+
+function onwriteError(stream, state, sync, er, cb) {
+  --state.pendingcb;
+
+  if (sync) {
+    // defer the callback if we are being called synchronously
+    // to avoid piling up things on the stack
+    pna.nextTick(cb, er);
+    // this can emit finish, and it will always happen
+    // after error
+    pna.nextTick(finishMaybe, stream, state);
+    stream._writableState.errorEmitted = true;
+    stream.emit('error', er);
+  } else {
+    // the caller expect this to happen before if
+    // it is async
+    cb(er);
+    stream._writableState.errorEmitted = true;
+    stream.emit('error', er);
+    // this can emit finish, but finish must
+    // always follow error
+    finishMaybe(stream, state);
+  }
+}
+
+function onwriteStateUpdate(state) {
+  state.writing = false;
+  state.writecb = null;
+  state.length -= state.writelen;
+  state.writelen = 0;
+}
+
+function onwrite(stream, er) {
+  var state = stream._writableState;
+  var sync = state.sync;
+  var cb = state.writecb;
+
+  onwriteStateUpdate(state);
+
+  if (er) onwriteError(stream, state, sync, er, cb);else {
+    // Check if we're actually ready to finish, but don't emit yet
+    var finished = needFinish(state);
+
+    if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
+      clearBuffer(stream, state);
+    }
+
+    if (sync) {
+      /*<replacement>*/
+      asyncWrite(afterWrite, stream, state, finished, cb);
+      /*</replacement>*/
+    } else {
+      afterWrite(stream, state, finished, cb);
+    }
+  }
+}
+
+function afterWrite(stream, state, finished, cb) {
+  if (!finished) onwriteDrain(stream, state);
+  state.pendingcb--;
+  cb();
+  finishMaybe(stream, state);
+}
+
+// Must force callback to be called on nextTick, so that we don't
+// emit 'drain' before the write() consumer gets the 'false' return
+// value, and has a chance to attach a 'drain' listener.
+function onwriteDrain(stream, state) {
+  if (state.length === 0 && state.needDrain) {
+    state.needDrain = false;
+    stream.emit('drain');
+  }
+}
+
+// if there's something in the buffer waiting, then process it
+function clearBuffer(stream, state) {
+  state.bufferProcessing = true;
+  var entry = state.bufferedRequest;
+
+  if (stream._writev && entry && entry.next) {
+    // Fast case, write everything using _writev()
+    var l = state.bufferedRequestCount;
+    var buffer = new Array(l);
+    var holder = state.corkedRequestsFree;
+    holder.entry = entry;
+
+    var count = 0;
+    var allBuffers = true;
+    while (entry) {
+      buffer[count] = entry;
+      if (!entry.isBuf) allBuffers = false;
+      entry = entry.next;
+      count += 1;
+    }
+    buffer.allBuffers = allBuffers;
+
+    doWrite(stream, state, true, state.length, buffer, '', holder.finish);
+
+    // doWrite is almost always async, defer these to save a bit of time
+    // as the hot path ends with doWrite
+    state.pendingcb++;
+    state.lastBufferedRequest = null;
+    if (holder.next) {
+      state.corkedRequestsFree = holder.next;
+      holder.next = null;
+    } else {
+      state.corkedRequestsFree = new CorkedRequest(state);
+    }
+    state.bufferedRequestCount = 0;
+  } else {
+    // Slow case, write chunks one-by-one
+    while (entry) {
+      var chunk = entry.chunk;
+      var encoding = entry.encoding;
+      var cb = entry.callback;
+      var len = state.objectMode ? 1 : chunk.length;
+
+      doWrite(stream, state, false, len, chunk, encoding, cb);
+      entry = entry.next;
+      state.bufferedRequestCount--;
+      // if we didn't call the onwrite immediately, then
+      // it means that we need to wait until it does.
+      // also, that means that the chunk and cb are currently
+      // being processed, so move the buffer counter past them.
+      if (state.writing) {
+        break;
+      }
+    }
+
+    if (entry === null) state.lastBufferedRequest = null;
+  }
+
+  state.bufferedRequest = entry;
+  state.bufferProcessing = false;
+}
+
+Writable.prototype._write = function (chunk, encoding, cb) {
+  cb(new Error('_write() is not implemented'));
+};
+
+Writable.prototype._writev = null;
+
+Writable.prototype.end = function (chunk, encoding, cb) {
+  var state = this._writableState;
+
+  if (typeof chunk === 'function') {
+    cb = chunk;
+    chunk = null;
+    encoding = null;
+  } else if (typeof encoding === 'function') {
+    cb = encoding;
+    encoding = null;
+  }
+
+  if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
+
+  // .end() fully uncorks
+  if (state.corked) {
+    state.corked = 1;
+    this.uncork();
+  }
+
+  // ignore unnecessary end() calls.
+  if (!state.ending && !state.finished) endWritable(this, state, cb);
+};
+
+function needFinish(state) {
+  return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
+}
+function callFinal(stream, state) {
+  stream._final(function (err) {
+    state.pendingcb--;
+    if (err) {
+      stream.emit('error', err);
+    }
+    state.prefinished = true;
+    stream.emit('prefinish');
+    finishMaybe(stream, state);
+  });
+}
+function prefinish(stream, state) {
+  if (!state.prefinished && !state.finalCalled) {
+    if (typeof stream._final === 'function') {
+      state.pendingcb++;
+      state.finalCalled = true;
+      pna.nextTick(callFinal, stream, state);
+    } else {
+      state.prefinished = true;
+      stream.emit('prefinish');
+    }
+  }
+}
+
+function finishMaybe(stream, state) {
+  var need = needFinish(state);
+  if (need) {
+    prefinish(stream, state);
+    if (state.pendingcb === 0) {
+      state.finished = true;
+      stream.emit('finish');
+    }
+  }
+  return need;
+}
+
+function endWritable(stream, state, cb) {
+  state.ending = true;
+  finishMaybe(stream, state);
+  if (cb) {
+    if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
+  }
+  state.ended = true;
+  stream.writable = false;
+}
+
+function onCorkedFinish(corkReq, state, err) {
+  var entry = corkReq.entry;
+  corkReq.entry = null;
+  while (entry) {
+    var cb = entry.callback;
+    state.pendingcb--;
+    cb(err);
+    entry = entry.next;
+  }
+  if (state.corkedRequestsFree) {
+    state.corkedRequestsFree.next = corkReq;
+  } else {
+    state.corkedRequestsFree = corkReq;
+  }
+}
+
+Object.defineProperty(Writable.prototype, 'destroyed', {
+  get: function () {
+    if (this._writableState === undefined) {
+      return false;
+    }
+    return this._writableState.destroyed;
+  },
+  set: function (value) {
+    // we ignore the value if the stream
+    // has not been initialized yet
+    if (!this._writableState) {
+      return;
+    }
+
+    // backward compatibility, the user is explicitly
+    // managing destroyed
+    this._writableState.destroyed = value;
+  }
+});
+
+Writable.prototype.destroy = destroyImpl.destroy;
+Writable.prototype._undestroy = destroyImpl.undestroy;
+Writable.prototype._destroy = function (err, cb) {
+  this.end();
+  cb(err);
+};
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/internal/streams/BufferList.js b/NodeAPI/node_modules/readable-stream/lib/internal/streams/BufferList.js
new file mode 100644
index 0000000000000000000000000000000000000000..aefc68bd90b9c2bd7da278323bcd42a7aad8b853
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/internal/streams/BufferList.js
@@ -0,0 +1,79 @@
+'use strict';
+
+function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
+
+var Buffer = require('safe-buffer').Buffer;
+var util = require('util');
+
+function copyBuffer(src, target, offset) {
+  src.copy(target, offset);
+}
+
+module.exports = function () {
+  function BufferList() {
+    _classCallCheck(this, BufferList);
+
+    this.head = null;
+    this.tail = null;
+    this.length = 0;
+  }
+
+  BufferList.prototype.push = function push(v) {
+    var entry = { data: v, next: null };
+    if (this.length > 0) this.tail.next = entry;else this.head = entry;
+    this.tail = entry;
+    ++this.length;
+  };
+
+  BufferList.prototype.unshift = function unshift(v) {
+    var entry = { data: v, next: this.head };
+    if (this.length === 0) this.tail = entry;
+    this.head = entry;
+    ++this.length;
+  };
+
+  BufferList.prototype.shift = function shift() {
+    if (this.length === 0) return;
+    var ret = this.head.data;
+    if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
+    --this.length;
+    return ret;
+  };
+
+  BufferList.prototype.clear = function clear() {
+    this.head = this.tail = null;
+    this.length = 0;
+  };
+
+  BufferList.prototype.join = function join(s) {
+    if (this.length === 0) return '';
+    var p = this.head;
+    var ret = '' + p.data;
+    while (p = p.next) {
+      ret += s + p.data;
+    }return ret;
+  };
+
+  BufferList.prototype.concat = function concat(n) {
+    if (this.length === 0) return Buffer.alloc(0);
+    if (this.length === 1) return this.head.data;
+    var ret = Buffer.allocUnsafe(n >>> 0);
+    var p = this.head;
+    var i = 0;
+    while (p) {
+      copyBuffer(p.data, ret, i);
+      i += p.data.length;
+      p = p.next;
+    }
+    return ret;
+  };
+
+  return BufferList;
+}();
+
+if (util && util.inspect && util.inspect.custom) {
+  module.exports.prototype[util.inspect.custom] = function () {
+    var obj = util.inspect({ length: this.length });
+    return this.constructor.name + ' ' + obj;
+  };
+}
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/internal/streams/destroy.js b/NodeAPI/node_modules/readable-stream/lib/internal/streams/destroy.js
new file mode 100644
index 0000000000000000000000000000000000000000..5a0a0d88cec6f30f054f14ba6253d4359d86c434
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/internal/streams/destroy.js
@@ -0,0 +1,74 @@
+'use strict';
+
+/*<replacement>*/
+
+var pna = require('process-nextick-args');
+/*</replacement>*/
+
+// undocumented cb() API, needed for core, not for public API
+function destroy(err, cb) {
+  var _this = this;
+
+  var readableDestroyed = this._readableState && this._readableState.destroyed;
+  var writableDestroyed = this._writableState && this._writableState.destroyed;
+
+  if (readableDestroyed || writableDestroyed) {
+    if (cb) {
+      cb(err);
+    } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
+      pna.nextTick(emitErrorNT, this, err);
+    }
+    return this;
+  }
+
+  // we set destroyed to true before firing error callbacks in order
+  // to make it re-entrance safe in case destroy() is called within callbacks
+
+  if (this._readableState) {
+    this._readableState.destroyed = true;
+  }
+
+  // if this is a duplex stream mark the writable part as destroyed as well
+  if (this._writableState) {
+    this._writableState.destroyed = true;
+  }
+
+  this._destroy(err || null, function (err) {
+    if (!cb && err) {
+      pna.nextTick(emitErrorNT, _this, err);
+      if (_this._writableState) {
+        _this._writableState.errorEmitted = true;
+      }
+    } else if (cb) {
+      cb(err);
+    }
+  });
+
+  return this;
+}
+
+function undestroy() {
+  if (this._readableState) {
+    this._readableState.destroyed = false;
+    this._readableState.reading = false;
+    this._readableState.ended = false;
+    this._readableState.endEmitted = false;
+  }
+
+  if (this._writableState) {
+    this._writableState.destroyed = false;
+    this._writableState.ended = false;
+    this._writableState.ending = false;
+    this._writableState.finished = false;
+    this._writableState.errorEmitted = false;
+  }
+}
+
+function emitErrorNT(self, err) {
+  self.emit('error', err);
+}
+
+module.exports = {
+  destroy: destroy,
+  undestroy: undestroy
+};
\ No newline at end of file
diff --git a/NodeAPI/node_modules/readable-stream/lib/internal/streams/stream-browser.js b/NodeAPI/node_modules/readable-stream/lib/internal/streams/stream-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..9332a3fdae7060505c0a081614e697fa6cb56dc0
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/internal/streams/stream-browser.js
@@ -0,0 +1 @@
+module.exports = require('events').EventEmitter;
diff --git a/NodeAPI/node_modules/readable-stream/lib/internal/streams/stream.js b/NodeAPI/node_modules/readable-stream/lib/internal/streams/stream.js
new file mode 100644
index 0000000000000000000000000000000000000000..ce2ad5b6ee57f4778a1f4838f7970093c7941c1c
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/lib/internal/streams/stream.js
@@ -0,0 +1 @@
+module.exports = require('stream');
diff --git a/NodeAPI/node_modules/readable-stream/package.json b/NodeAPI/node_modules/readable-stream/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..2afa6fbd81e225f6869291bc9b37dbfdd7d5f8bb
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/package.json
@@ -0,0 +1,52 @@
+{
+  "name": "readable-stream",
+  "version": "2.3.7",
+  "description": "Streams3, a user-land copy of the stream library from Node.js",
+  "main": "readable.js",
+  "dependencies": {
+    "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"
+  },
+  "devDependencies": {
+    "assert": "^1.4.0",
+    "babel-polyfill": "^6.9.1",
+    "buffer": "^4.9.0",
+    "lolex": "^2.3.2",
+    "nyc": "^6.4.0",
+    "tap": "^0.7.0",
+    "tape": "^4.8.0"
+  },
+  "scripts": {
+    "test": "tap test/parallel/*.js test/ours/*.js && node test/verify-dependencies.js",
+    "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js",
+    "cover": "nyc npm test",
+    "report": "nyc report --reporter=lcov"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nodejs/readable-stream"
+  },
+  "keywords": [
+    "readable",
+    "stream",
+    "pipe"
+  ],
+  "browser": {
+    "util": false,
+    "./readable.js": "./readable-browser.js",
+    "./writable.js": "./writable-browser.js",
+    "./duplex.js": "./duplex-browser.js",
+    "./lib/internal/streams/stream.js": "./lib/internal/streams/stream-browser.js"
+  },
+  "nyc": {
+    "include": [
+      "lib/**.js"
+    ]
+  },
+  "license": "MIT"
+}
diff --git a/NodeAPI/node_modules/readable-stream/passthrough.js b/NodeAPI/node_modules/readable-stream/passthrough.js
new file mode 100644
index 0000000000000000000000000000000000000000..ffd791d7ff275a58d537ea89153175a23edee5fb
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/passthrough.js
@@ -0,0 +1 @@
+module.exports = require('./readable').PassThrough
diff --git a/NodeAPI/node_modules/readable-stream/readable-browser.js b/NodeAPI/node_modules/readable-stream/readable-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..e50372592ee6c63a7fc43cb912dd9639e3fa7eb1
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/readable-browser.js
@@ -0,0 +1,7 @@
+exports = module.exports = require('./lib/_stream_readable.js');
+exports.Stream = exports;
+exports.Readable = exports;
+exports.Writable = require('./lib/_stream_writable.js');
+exports.Duplex = require('./lib/_stream_duplex.js');
+exports.Transform = require('./lib/_stream_transform.js');
+exports.PassThrough = require('./lib/_stream_passthrough.js');
diff --git a/NodeAPI/node_modules/readable-stream/readable.js b/NodeAPI/node_modules/readable-stream/readable.js
new file mode 100644
index 0000000000000000000000000000000000000000..ec89ec53306497adae0014c4a8aba6d51d1aff6c
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/readable.js
@@ -0,0 +1,19 @@
+var Stream = require('stream');
+if (process.env.READABLE_STREAM === 'disable' && Stream) {
+  module.exports = Stream;
+  exports = module.exports = Stream.Readable;
+  exports.Readable = Stream.Readable;
+  exports.Writable = Stream.Writable;
+  exports.Duplex = Stream.Duplex;
+  exports.Transform = Stream.Transform;
+  exports.PassThrough = Stream.PassThrough;
+  exports.Stream = Stream;
+} else {
+  exports = module.exports = require('./lib/_stream_readable.js');
+  exports.Stream = Stream || exports;
+  exports.Readable = exports;
+  exports.Writable = require('./lib/_stream_writable.js');
+  exports.Duplex = require('./lib/_stream_duplex.js');
+  exports.Transform = require('./lib/_stream_transform.js');
+  exports.PassThrough = require('./lib/_stream_passthrough.js');
+}
diff --git a/NodeAPI/node_modules/readable-stream/transform.js b/NodeAPI/node_modules/readable-stream/transform.js
new file mode 100644
index 0000000000000000000000000000000000000000..b1baba26da03dc8bbc5d9da33cd55f3f88c99115
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/transform.js
@@ -0,0 +1 @@
+module.exports = require('./readable').Transform
diff --git a/NodeAPI/node_modules/readable-stream/writable-browser.js b/NodeAPI/node_modules/readable-stream/writable-browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..ebdde6a85dcb19bfdbfc2ec2e34b13a54c0e5bf0
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/writable-browser.js
@@ -0,0 +1 @@
+module.exports = require('./lib/_stream_writable.js');
diff --git a/NodeAPI/node_modules/readable-stream/writable.js b/NodeAPI/node_modules/readable-stream/writable.js
new file mode 100644
index 0000000000000000000000000000000000000000..3211a6f80d1abc9db7099cd1e8fa200ad2ccfdbe
--- /dev/null
+++ b/NodeAPI/node_modules/readable-stream/writable.js
@@ -0,0 +1,8 @@
+var Stream = require("stream")
+var Writable = require("./lib/_stream_writable.js")
+
+if (process.env.READABLE_STREAM === 'disable') {
+  module.exports = Stream && Stream.Writable || Writable
+} else {
+  module.exports = Writable
+}
diff --git a/NodeAPI/node_modules/saslprep/.editorconfig b/NodeAPI/node_modules/saslprep/.editorconfig
new file mode 100644
index 0000000000000000000000000000000000000000..d1d8a4176a416daffcfbfecdd3f35f24bd79fc7d
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/.editorconfig
@@ -0,0 +1,10 @@
+# http://editorconfig.org
+root = true
+
+[*]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
diff --git a/NodeAPI/node_modules/saslprep/.gitattributes b/NodeAPI/node_modules/saslprep/.gitattributes
new file mode 100644
index 0000000000000000000000000000000000000000..3ba45360c5e16ac15e53d12e07063bb5d84375fc
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/.gitattributes
@@ -0,0 +1 @@
+*.mem binary
diff --git a/NodeAPI/node_modules/saslprep/.travis.yml b/NodeAPI/node_modules/saslprep/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..0bca8265327037a4022506288a61c00b89e05251
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/.travis.yml
@@ -0,0 +1,10 @@
+sudo: false
+language: node_js
+node_js:
+  - "6"
+  - "8"
+  - "10"
+  - "12"
+
+before_install:
+- npm install -g npm@6
diff --git a/NodeAPI/node_modules/saslprep/CHANGELOG.md b/NodeAPI/node_modules/saslprep/CHANGELOG.md
new file mode 100644
index 0000000000000000000000000000000000000000..779807877b82fd1a15e3c839f374b2e8aabb8cfc
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/CHANGELOG.md
@@ -0,0 +1,19 @@
+# Change Log
+All notable changes to the "saslprep" package will be documented in this file.
+
+## [1.0.3] - 2019-05-01
+
+- Correctly get code points >U+FFFF ([#5](https://github.com/reklatsmasters/saslprep/pull/5))
+- Fix perfomance downgrades from [#5](https://github.com/reklatsmasters/saslprep/pull/5).
+
+## [1.0.2] - 2018-09-13
+
+- Reduced initialization time ([#3](https://github.com/reklatsmasters/saslprep/issues/3))
+
+## [1.0.1] - 2018-06-20
+
+- Reduced stack overhead of range creation ([#2](https://github.com/reklatsmasters/saslprep/pull/2))
+
+## [1.0.0] - 2017-06-21
+
+- First release
diff --git a/NodeAPI/node_modules/saslprep/LICENSE b/NodeAPI/node_modules/saslprep/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..481c7a50f96cf594ff078ba43267185b9c5cccc7
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2014 Dmitry Tsvettsikh
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/NodeAPI/node_modules/saslprep/code-points.mem b/NodeAPI/node_modules/saslprep/code-points.mem
new file mode 100644
index 0000000000000000000000000000000000000000..4781b066802688bdf954d2e89bcfac967db29c09
Binary files /dev/null and b/NodeAPI/node_modules/saslprep/code-points.mem differ
diff --git a/NodeAPI/node_modules/saslprep/generate-code-points.js b/NodeAPI/node_modules/saslprep/generate-code-points.js
new file mode 100644
index 0000000000000000000000000000000000000000..c5162ca7a47f60113b109c5709f4f5cbf3abc2ff
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/generate-code-points.js
@@ -0,0 +1,51 @@
+'use strict';
+
+const bitfield = require('sparse-bitfield');
+const codePoints = require('./lib/code-points');
+
+const unassigned_code_points = bitfield();
+const commonly_mapped_to_nothing = bitfield();
+const non_ascii_space_characters = bitfield();
+const prohibited_characters = bitfield();
+const bidirectional_r_al = bitfield();
+const bidirectional_l = bitfield();
+
+/**
+ * Iterare over code points and
+ * convert it into an buffer.
+ * @param {bitfield} bits
+ * @param {Array} src
+ * @returns {Buffer}
+ */
+function traverse(bits, src) {
+  for (const code of src.keys()) {
+    bits.set(code, true);
+  }
+
+  const buffer = bits.toBuffer();
+  return Buffer.concat([createSize(buffer), buffer]);
+}
+
+/**
+ * @param {Buffer} buffer
+ * @returns {Buffer}
+ */
+function createSize(buffer) {
+  const buf = Buffer.alloc(4);
+  buf.writeUInt32BE(buffer.length);
+
+  return buf;
+}
+
+const memory = [];
+
+memory.push(
+  traverse(unassigned_code_points, codePoints.unassigned_code_points),
+  traverse(commonly_mapped_to_nothing, codePoints.commonly_mapped_to_nothing),
+  traverse(non_ascii_space_characters, codePoints.non_ASCII_space_characters),
+  traverse(prohibited_characters, codePoints.prohibited_characters),
+  traverse(bidirectional_r_al, codePoints.bidirectional_r_al),
+  traverse(bidirectional_l, codePoints.bidirectional_l)
+);
+
+process.stdout.write(Buffer.concat(memory));
diff --git a/NodeAPI/node_modules/saslprep/index.js b/NodeAPI/node_modules/saslprep/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..21bb0fed3eef0864ae747c4f1781f1fa75e1d43d
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/index.js
@@ -0,0 +1,157 @@
+'use strict';
+
+const {
+  unassigned_code_points,
+  commonly_mapped_to_nothing,
+  non_ASCII_space_characters,
+  prohibited_characters,
+  bidirectional_r_al,
+  bidirectional_l,
+} = require('./lib/memory-code-points');
+
+module.exports = saslprep;
+
+// 2.1.  Mapping
+
+/**
+ * non-ASCII space characters [StringPrep, C.1.2] that can be
+ * mapped to SPACE (U+0020)
+ */
+const mapping2space = non_ASCII_space_characters;
+
+/**
+ * the "commonly mapped to nothing" characters [StringPrep, B.1]
+ * that can be mapped to nothing.
+ */
+const mapping2nothing = commonly_mapped_to_nothing;
+
+// utils
+const getCodePoint = character => character.codePointAt(0);
+const first = x => x[0];
+const last = x => x[x.length - 1];
+
+/**
+ * Convert provided string into an array of Unicode Code Points.
+ * Based on https://stackoverflow.com/a/21409165/1556249
+ * and https://www.npmjs.com/package/code-point-at.
+ * @param {string} input
+ * @returns {number[]}
+ */
+function toCodePoints(input) {
+  const codepoints = [];
+  const size = input.length;
+
+  for (let i = 0; i < size; i += 1) {
+    const before = input.charCodeAt(i);
+
+    if (before >= 0xd800 && before <= 0xdbff && size > i + 1) {
+      const next = input.charCodeAt(i + 1);
+
+      if (next >= 0xdc00 && next <= 0xdfff) {
+        codepoints.push((before - 0xd800) * 0x400 + next - 0xdc00 + 0x10000);
+        i += 1;
+        continue;
+      }
+    }
+
+    codepoints.push(before);
+  }
+
+  return codepoints;
+}
+
+/**
+ * SASLprep.
+ * @param {string} input
+ * @param {Object} opts
+ * @param {boolean} opts.allowUnassigned
+ * @returns {string}
+ */
+function saslprep(input, opts = {}) {
+  if (typeof input !== 'string') {
+    throw new TypeError('Expected string.');
+  }
+
+  if (input.length === 0) {
+    return '';
+  }
+
+  // 1. Map
+  const mapped_input = toCodePoints(input)
+    // 1.1 mapping to space
+    .map(character => (mapping2space.get(character) ? 0x20 : character))
+    // 1.2 mapping to nothing
+    .filter(character => !mapping2nothing.get(character));
+
+  // 2. Normalize
+  const normalized_input = String.fromCodePoint
+    .apply(null, mapped_input)
+    .normalize('NFKC');
+
+  const normalized_map = toCodePoints(normalized_input);
+
+  // 3. Prohibit
+  const hasProhibited = normalized_map.some(character =>
+    prohibited_characters.get(character)
+  );
+
+  if (hasProhibited) {
+    throw new Error(
+      'Prohibited character, see https://tools.ietf.org/html/rfc4013#section-2.3'
+    );
+  }
+
+  // Unassigned Code Points
+  if (opts.allowUnassigned !== true) {
+    const hasUnassigned = normalized_map.some(character =>
+      unassigned_code_points.get(character)
+    );
+
+    if (hasUnassigned) {
+      throw new Error(
+        'Unassigned code point, see https://tools.ietf.org/html/rfc4013#section-2.5'
+      );
+    }
+  }
+
+  // 4. check bidi
+
+  const hasBidiRAL = normalized_map.some(character =>
+    bidirectional_r_al.get(character)
+  );
+
+  const hasBidiL = normalized_map.some(character =>
+    bidirectional_l.get(character)
+  );
+
+  // 4.1 If a string contains any RandALCat character, the string MUST NOT
+  // contain any LCat character.
+  if (hasBidiRAL && hasBidiL) {
+    throw new Error(
+      'String must not contain RandALCat and LCat at the same time,' +
+        ' see https://tools.ietf.org/html/rfc3454#section-6'
+    );
+  }
+
+  /**
+   * 4.2 If a string contains any RandALCat character, a RandALCat
+   * character MUST be the first character of the string, and a
+   * RandALCat character MUST be the last character of the string.
+   */
+
+  const isFirstBidiRAL = bidirectional_r_al.get(
+    getCodePoint(first(normalized_input))
+  );
+  const isLastBidiRAL = bidirectional_r_al.get(
+    getCodePoint(last(normalized_input))
+  );
+
+  if (hasBidiRAL && !(isFirstBidiRAL && isLastBidiRAL)) {
+    throw new Error(
+      'Bidirectional RandALCat character must be the first and the last' +
+        ' character of the string, see https://tools.ietf.org/html/rfc3454#section-6'
+    );
+  }
+
+  return normalized_input;
+}
diff --git a/NodeAPI/node_modules/saslprep/lib/code-points.js b/NodeAPI/node_modules/saslprep/lib/code-points.js
new file mode 100644
index 0000000000000000000000000000000000000000..222182c83cb4627d3ea1e326fb56701a47309f21
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/lib/code-points.js
@@ -0,0 +1,996 @@
+'use strict';
+
+const { range } = require('./util');
+
+/**
+ * A.1 Unassigned code points in Unicode 3.2
+ * @link https://tools.ietf.org/html/rfc3454#appendix-A.1
+ */
+const unassigned_code_points = new Set([
+  0x0221,
+  ...range(0x0234, 0x024f),
+  ...range(0x02ae, 0x02af),
+  ...range(0x02ef, 0x02ff),
+  ...range(0x0350, 0x035f),
+  ...range(0x0370, 0x0373),
+  ...range(0x0376, 0x0379),
+  ...range(0x037b, 0x037d),
+  ...range(0x037f, 0x0383),
+  0x038b,
+  0x038d,
+  0x03a2,
+  0x03cf,
+  ...range(0x03f7, 0x03ff),
+  0x0487,
+  0x04cf,
+  ...range(0x04f6, 0x04f7),
+  ...range(0x04fa, 0x04ff),
+  ...range(0x0510, 0x0530),
+  ...range(0x0557, 0x0558),
+  0x0560,
+  0x0588,
+  ...range(0x058b, 0x0590),
+  0x05a2,
+  0x05ba,
+  ...range(0x05c5, 0x05cf),
+  ...range(0x05eb, 0x05ef),
+  ...range(0x05f5, 0x060b),
+  ...range(0x060d, 0x061a),
+  ...range(0x061c, 0x061e),
+  0x0620,
+  ...range(0x063b, 0x063f),
+  ...range(0x0656, 0x065f),
+  ...range(0x06ee, 0x06ef),
+  0x06ff,
+  0x070e,
+  ...range(0x072d, 0x072f),
+  ...range(0x074b, 0x077f),
+  ...range(0x07b2, 0x0900),
+  0x0904,
+  ...range(0x093a, 0x093b),
+  ...range(0x094e, 0x094f),
+  ...range(0x0955, 0x0957),
+  ...range(0x0971, 0x0980),
+  0x0984,
+  ...range(0x098d, 0x098e),
+  ...range(0x0991, 0x0992),
+  0x09a9,
+  0x09b1,
+  ...range(0x09b3, 0x09b5),
+  ...range(0x09ba, 0x09bb),
+  0x09bd,
+  ...range(0x09c5, 0x09c6),
+  ...range(0x09c9, 0x09ca),
+  ...range(0x09ce, 0x09d6),
+  ...range(0x09d8, 0x09db),
+  0x09de,
+  ...range(0x09e4, 0x09e5),
+  ...range(0x09fb, 0x0a01),
+  ...range(0x0a03, 0x0a04),
+  ...range(0x0a0b, 0x0a0e),
+  ...range(0x0a11, 0x0a12),
+  0x0a29,
+  0x0a31,
+  0x0a34,
+  0x0a37,
+  ...range(0x0a3a, 0x0a3b),
+  0x0a3d,
+  ...range(0x0a43, 0x0a46),
+  ...range(0x0a49, 0x0a4a),
+  ...range(0x0a4e, 0x0a58),
+  0x0a5d,
+  ...range(0x0a5f, 0x0a65),
+  ...range(0x0a75, 0x0a80),
+  0x0a84,
+  0x0a8c,
+  0x0a8e,
+  0x0a92,
+  0x0aa9,
+  0x0ab1,
+  0x0ab4,
+  ...range(0x0aba, 0x0abb),
+  0x0ac6,
+  0x0aca,
+  ...range(0x0ace, 0x0acf),
+  ...range(0x0ad1, 0x0adf),
+  ...range(0x0ae1, 0x0ae5),
+  ...range(0x0af0, 0x0b00),
+  0x0b04,
+  ...range(0x0b0d, 0x0b0e),
+  ...range(0x0b11, 0x0b12),
+  0x0b29,
+  0x0b31,
+  ...range(0x0b34, 0x0b35),
+  ...range(0x0b3a, 0x0b3b),
+  ...range(0x0b44, 0x0b46),
+  ...range(0x0b49, 0x0b4a),
+  ...range(0x0b4e, 0x0b55),
+  ...range(0x0b58, 0x0b5b),
+  0x0b5e,
+  ...range(0x0b62, 0x0b65),
+  ...range(0x0b71, 0x0b81),
+  0x0b84,
+  ...range(0x0b8b, 0x0b8d),
+  0x0b91,
+  ...range(0x0b96, 0x0b98),
+  0x0b9b,
+  0x0b9d,
+  ...range(0x0ba0, 0x0ba2),
+  ...range(0x0ba5, 0x0ba7),
+  ...range(0x0bab, 0x0bad),
+  0x0bb6,
+  ...range(0x0bba, 0x0bbd),
+  ...range(0x0bc3, 0x0bc5),
+  0x0bc9,
+  ...range(0x0bce, 0x0bd6),
+  ...range(0x0bd8, 0x0be6),
+  ...range(0x0bf3, 0x0c00),
+  0x0c04,
+  0x0c0d,
+  0x0c11,
+  0x0c29,
+  0x0c34,
+  ...range(0x0c3a, 0x0c3d),
+  0x0c45,
+  0x0c49,
+  ...range(0x0c4e, 0x0c54),
+  ...range(0x0c57, 0x0c5f),
+  ...range(0x0c62, 0x0c65),
+  ...range(0x0c70, 0x0c81),
+  0x0c84,
+  0x0c8d,
+  0x0c91,
+  0x0ca9,
+  0x0cb4,
+  ...range(0x0cba, 0x0cbd),
+  0x0cc5,
+  0x0cc9,
+  ...range(0x0cce, 0x0cd4),
+  ...range(0x0cd7, 0x0cdd),
+  0x0cdf,
+  ...range(0x0ce2, 0x0ce5),
+  ...range(0x0cf0, 0x0d01),
+  0x0d04,
+  0x0d0d,
+  0x0d11,
+  0x0d29,
+  ...range(0x0d3a, 0x0d3d),
+  ...range(0x0d44, 0x0d45),
+  0x0d49,
+  ...range(0x0d4e, 0x0d56),
+  ...range(0x0d58, 0x0d5f),
+  ...range(0x0d62, 0x0d65),
+  ...range(0x0d70, 0x0d81),
+  0x0d84,
+  ...range(0x0d97, 0x0d99),
+  0x0db2,
+  0x0dbc,
+  ...range(0x0dbe, 0x0dbf),
+  ...range(0x0dc7, 0x0dc9),
+  ...range(0x0dcb, 0x0dce),
+  0x0dd5,
+  0x0dd7,
+  ...range(0x0de0, 0x0df1),
+  ...range(0x0df5, 0x0e00),
+  ...range(0x0e3b, 0x0e3e),
+  ...range(0x0e5c, 0x0e80),
+  0x0e83,
+  ...range(0x0e85, 0x0e86),
+  0x0e89,
+  ...range(0x0e8b, 0x0e8c),
+  ...range(0x0e8e, 0x0e93),
+  0x0e98,
+  0x0ea0,
+  0x0ea4,
+  0x0ea6,
+  ...range(0x0ea8, 0x0ea9),
+  0x0eac,
+  0x0eba,
+  ...range(0x0ebe, 0x0ebf),
+  0x0ec5,
+  0x0ec7,
+  ...range(0x0ece, 0x0ecf),
+  ...range(0x0eda, 0x0edb),
+  ...range(0x0ede, 0x0eff),
+  0x0f48,
+  ...range(0x0f6b, 0x0f70),
+  ...range(0x0f8c, 0x0f8f),
+  0x0f98,
+  0x0fbd,
+  ...range(0x0fcd, 0x0fce),
+  ...range(0x0fd0, 0x0fff),
+  0x1022,
+  0x1028,
+  0x102b,
+  ...range(0x1033, 0x1035),
+  ...range(0x103a, 0x103f),
+  ...range(0x105a, 0x109f),
+  ...range(0x10c6, 0x10cf),
+  ...range(0x10f9, 0x10fa),
+  ...range(0x10fc, 0x10ff),
+  ...range(0x115a, 0x115e),
+  ...range(0x11a3, 0x11a7),
+  ...range(0x11fa, 0x11ff),
+  0x1207,
+  0x1247,
+  0x1249,
+  ...range(0x124e, 0x124f),
+  0x1257,
+  0x1259,
+  ...range(0x125e, 0x125f),
+  0x1287,
+  0x1289,
+  ...range(0x128e, 0x128f),
+  0x12af,
+  0x12b1,
+  ...range(0x12b6, 0x12b7),
+  0x12bf,
+  0x12c1,
+  ...range(0x12c6, 0x12c7),
+  0x12cf,
+  0x12d7,
+  0x12ef,
+  0x130f,
+  0x1311,
+  ...range(0x1316, 0x1317),
+  0x131f,
+  0x1347,
+  ...range(0x135b, 0x1360),
+  ...range(0x137d, 0x139f),
+  ...range(0x13f5, 0x1400),
+  ...range(0x1677, 0x167f),
+  ...range(0x169d, 0x169f),
+  ...range(0x16f1, 0x16ff),
+  0x170d,
+  ...range(0x1715, 0x171f),
+  ...range(0x1737, 0x173f),
+  ...range(0x1754, 0x175f),
+  0x176d,
+  0x1771,
+  ...range(0x1774, 0x177f),
+  ...range(0x17dd, 0x17df),
+  ...range(0x17ea, 0x17ff),
+  0x180f,
+  ...range(0x181a, 0x181f),
+  ...range(0x1878, 0x187f),
+  ...range(0x18aa, 0x1dff),
+  ...range(0x1e9c, 0x1e9f),
+  ...range(0x1efa, 0x1eff),
+  ...range(0x1f16, 0x1f17),
+  ...range(0x1f1e, 0x1f1f),
+  ...range(0x1f46, 0x1f47),
+  ...range(0x1f4e, 0x1f4f),
+  0x1f58,
+  0x1f5a,
+  0x1f5c,
+  0x1f5e,
+  ...range(0x1f7e, 0x1f7f),
+  0x1fb5,
+  0x1fc5,
+  ...range(0x1fd4, 0x1fd5),
+  0x1fdc,
+  ...range(0x1ff0, 0x1ff1),
+  0x1ff5,
+  0x1fff,
+  ...range(0x2053, 0x2056),
+  ...range(0x2058, 0x205e),
+  ...range(0x2064, 0x2069),
+  ...range(0x2072, 0x2073),
+  ...range(0x208f, 0x209f),
+  ...range(0x20b2, 0x20cf),
+  ...range(0x20eb, 0x20ff),
+  ...range(0x213b, 0x213c),
+  ...range(0x214c, 0x2152),
+  ...range(0x2184, 0x218f),
+  ...range(0x23cf, 0x23ff),
+  ...range(0x2427, 0x243f),
+  ...range(0x244b, 0x245f),
+  0x24ff,
+  ...range(0x2614, 0x2615),
+  0x2618,
+  ...range(0x267e, 0x267f),
+  ...range(0x268a, 0x2700),
+  0x2705,
+  ...range(0x270a, 0x270b),
+  0x2728,
+  0x274c,
+  0x274e,
+  ...range(0x2753, 0x2755),
+  0x2757,
+  ...range(0x275f, 0x2760),
+  ...range(0x2795, 0x2797),
+  0x27b0,
+  ...range(0x27bf, 0x27cf),
+  ...range(0x27ec, 0x27ef),
+  ...range(0x2b00, 0x2e7f),
+  0x2e9a,
+  ...range(0x2ef4, 0x2eff),
+  ...range(0x2fd6, 0x2fef),
+  ...range(0x2ffc, 0x2fff),
+  0x3040,
+  ...range(0x3097, 0x3098),
+  ...range(0x3100, 0x3104),
+  ...range(0x312d, 0x3130),
+  0x318f,
+  ...range(0x31b8, 0x31ef),
+  ...range(0x321d, 0x321f),
+  ...range(0x3244, 0x3250),
+  ...range(0x327c, 0x327e),
+  ...range(0x32cc, 0x32cf),
+  0x32ff,
+  ...range(0x3377, 0x337a),
+  ...range(0x33de, 0x33df),
+  0x33ff,
+  ...range(0x4db6, 0x4dff),
+  ...range(0x9fa6, 0x9fff),
+  ...range(0xa48d, 0xa48f),
+  ...range(0xa4c7, 0xabff),
+  ...range(0xd7a4, 0xd7ff),
+  ...range(0xfa2e, 0xfa2f),
+  ...range(0xfa6b, 0xfaff),
+  ...range(0xfb07, 0xfb12),
+  ...range(0xfb18, 0xfb1c),
+  0xfb37,
+  0xfb3d,
+  0xfb3f,
+  0xfb42,
+  0xfb45,
+  ...range(0xfbb2, 0xfbd2),
+  ...range(0xfd40, 0xfd4f),
+  ...range(0xfd90, 0xfd91),
+  ...range(0xfdc8, 0xfdcf),
+  ...range(0xfdfd, 0xfdff),
+  ...range(0xfe10, 0xfe1f),
+  ...range(0xfe24, 0xfe2f),
+  ...range(0xfe47, 0xfe48),
+  0xfe53,
+  0xfe67,
+  ...range(0xfe6c, 0xfe6f),
+  0xfe75,
+  ...range(0xfefd, 0xfefe),
+  0xff00,
+  ...range(0xffbf, 0xffc1),
+  ...range(0xffc8, 0xffc9),
+  ...range(0xffd0, 0xffd1),
+  ...range(0xffd8, 0xffd9),
+  ...range(0xffdd, 0xffdf),
+  0xffe7,
+  ...range(0xffef, 0xfff8),
+  ...range(0x10000, 0x102ff),
+  0x1031f,
+  ...range(0x10324, 0x1032f),
+  ...range(0x1034b, 0x103ff),
+  ...range(0x10426, 0x10427),
+  ...range(0x1044e, 0x1cfff),
+  ...range(0x1d0f6, 0x1d0ff),
+  ...range(0x1d127, 0x1d129),
+  ...range(0x1d1de, 0x1d3ff),
+  0x1d455,
+  0x1d49d,
+  ...range(0x1d4a0, 0x1d4a1),
+  ...range(0x1d4a3, 0x1d4a4),
+  ...range(0x1d4a7, 0x1d4a8),
+  0x1d4ad,
+  0x1d4ba,
+  0x1d4bc,
+  0x1d4c1,
+  0x1d4c4,
+  0x1d506,
+  ...range(0x1d50b, 0x1d50c),
+  0x1d515,
+  0x1d51d,
+  0x1d53a,
+  0x1d53f,
+  0x1d545,
+  ...range(0x1d547, 0x1d549),
+  0x1d551,
+  ...range(0x1d6a4, 0x1d6a7),
+  ...range(0x1d7ca, 0x1d7cd),
+  ...range(0x1d800, 0x1fffd),
+  ...range(0x2a6d7, 0x2f7ff),
+  ...range(0x2fa1e, 0x2fffd),
+  ...range(0x30000, 0x3fffd),
+  ...range(0x40000, 0x4fffd),
+  ...range(0x50000, 0x5fffd),
+  ...range(0x60000, 0x6fffd),
+  ...range(0x70000, 0x7fffd),
+  ...range(0x80000, 0x8fffd),
+  ...range(0x90000, 0x9fffd),
+  ...range(0xa0000, 0xafffd),
+  ...range(0xb0000, 0xbfffd),
+  ...range(0xc0000, 0xcfffd),
+  ...range(0xd0000, 0xdfffd),
+  0xe0000,
+  ...range(0xe0002, 0xe001f),
+  ...range(0xe0080, 0xefffd),
+]);
+
+/**
+ * B.1 Commonly mapped to nothing
+ * @link https://tools.ietf.org/html/rfc3454#appendix-B.1
+ */
+const commonly_mapped_to_nothing = new Set([
+  0x00ad,
+  0x034f,
+  0x1806,
+  0x180b,
+  0x180c,
+  0x180d,
+  0x200b,
+  0x200c,
+  0x200d,
+  0x2060,
+  0xfe00,
+  0xfe01,
+  0xfe02,
+  0xfe03,
+  0xfe04,
+  0xfe05,
+  0xfe06,
+  0xfe07,
+  0xfe08,
+  0xfe09,
+  0xfe0a,
+  0xfe0b,
+  0xfe0c,
+  0xfe0d,
+  0xfe0e,
+  0xfe0f,
+  0xfeff,
+]);
+
+/**
+ * C.1.2 Non-ASCII space characters
+ * @link https://tools.ietf.org/html/rfc3454#appendix-C.1.2
+ */
+const non_ASCII_space_characters = new Set([
+  0x00a0 /* NO-BREAK SPACE */,
+  0x1680 /* OGHAM SPACE MARK */,
+  0x2000 /* EN QUAD */,
+  0x2001 /* EM QUAD */,
+  0x2002 /* EN SPACE */,
+  0x2003 /* EM SPACE */,
+  0x2004 /* THREE-PER-EM SPACE */,
+  0x2005 /* FOUR-PER-EM SPACE */,
+  0x2006 /* SIX-PER-EM SPACE */,
+  0x2007 /* FIGURE SPACE */,
+  0x2008 /* PUNCTUATION SPACE */,
+  0x2009 /* THIN SPACE */,
+  0x200a /* HAIR SPACE */,
+  0x200b /* ZERO WIDTH SPACE */,
+  0x202f /* NARROW NO-BREAK SPACE */,
+  0x205f /* MEDIUM MATHEMATICAL SPACE */,
+  0x3000 /* IDEOGRAPHIC SPACE */,
+]);
+
+/**
+ * 2.3.  Prohibited Output
+ * @type {Set}
+ */
+const prohibited_characters = new Set([
+  ...non_ASCII_space_characters,
+
+  /**
+   * C.2.1 ASCII control characters
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.2.1
+   */
+  ...range(0, 0x001f) /* [CONTROL CHARACTERS] */,
+  0x007f /* DELETE */,
+
+  /**
+   * C.2.2 Non-ASCII control characters
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.2.2
+   */
+  ...range(0x0080, 0x009f) /* [CONTROL CHARACTERS] */,
+  0x06dd /* ARABIC END OF AYAH */,
+  0x070f /* SYRIAC ABBREVIATION MARK */,
+  0x180e /* MONGOLIAN VOWEL SEPARATOR */,
+  0x200c /* ZERO WIDTH NON-JOINER */,
+  0x200d /* ZERO WIDTH JOINER */,
+  0x2028 /* LINE SEPARATOR */,
+  0x2029 /* PARAGRAPH SEPARATOR */,
+  0x2060 /* WORD JOINER */,
+  0x2061 /* FUNCTION APPLICATION */,
+  0x2062 /* INVISIBLE TIMES */,
+  0x2063 /* INVISIBLE SEPARATOR */,
+  ...range(0x206a, 0x206f) /* [CONTROL CHARACTERS] */,
+  0xfeff /* ZERO WIDTH NO-BREAK SPACE */,
+  ...range(0xfff9, 0xfffc) /* [CONTROL CHARACTERS] */,
+  ...range(0x1d173, 0x1d17a) /* [MUSICAL CONTROL CHARACTERS] */,
+
+  /**
+   * C.3 Private use
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.3
+   */
+  ...range(0xe000, 0xf8ff) /* [PRIVATE USE, PLANE 0] */,
+  ...range(0xf0000, 0xffffd) /* [PRIVATE USE, PLANE 15] */,
+  ...range(0x100000, 0x10fffd) /* [PRIVATE USE, PLANE 16] */,
+
+  /**
+   * C.4 Non-character code points
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.4
+   */
+  ...range(0xfdd0, 0xfdef) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0xfffe, 0xffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x1fffe, 0x1ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x2fffe, 0x2ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x3fffe, 0x3ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x4fffe, 0x4ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x5fffe, 0x5ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x6fffe, 0x6ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x7fffe, 0x7ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x8fffe, 0x8ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x9fffe, 0x9ffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0xafffe, 0xaffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0xbfffe, 0xbffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0xcfffe, 0xcffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0xdfffe, 0xdffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0xefffe, 0xeffff) /* [NONCHARACTER CODE POINTS] */,
+  ...range(0x10fffe, 0x10ffff) /* [NONCHARACTER CODE POINTS] */,
+
+  /**
+   * C.5 Surrogate codes
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.5
+   */
+  ...range(0xd800, 0xdfff),
+
+  /**
+   * C.6 Inappropriate for plain text
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.6
+   */
+  0xfff9 /* INTERLINEAR ANNOTATION ANCHOR */,
+  0xfffa /* INTERLINEAR ANNOTATION SEPARATOR */,
+  0xfffb /* INTERLINEAR ANNOTATION TERMINATOR */,
+  0xfffc /* OBJECT REPLACEMENT CHARACTER */,
+  0xfffd /* REPLACEMENT CHARACTER */,
+
+  /**
+   * C.7 Inappropriate for canonical representation
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.7
+   */
+  ...range(0x2ff0, 0x2ffb) /* [IDEOGRAPHIC DESCRIPTION CHARACTERS] */,
+
+  /**
+   * C.8 Change display properties or are deprecated
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.8
+   */
+  0x0340 /* COMBINING GRAVE TONE MARK */,
+  0x0341 /* COMBINING ACUTE TONE MARK */,
+  0x200e /* LEFT-TO-RIGHT MARK */,
+  0x200f /* RIGHT-TO-LEFT MARK */,
+  0x202a /* LEFT-TO-RIGHT EMBEDDING */,
+  0x202b /* RIGHT-TO-LEFT EMBEDDING */,
+  0x202c /* POP DIRECTIONAL FORMATTING */,
+  0x202d /* LEFT-TO-RIGHT OVERRIDE */,
+  0x202e /* RIGHT-TO-LEFT OVERRIDE */,
+  0x206a /* INHIBIT SYMMETRIC SWAPPING */,
+  0x206b /* ACTIVATE SYMMETRIC SWAPPING */,
+  0x206c /* INHIBIT ARABIC FORM SHAPING */,
+  0x206d /* ACTIVATE ARABIC FORM SHAPING */,
+  0x206e /* NATIONAL DIGIT SHAPES */,
+  0x206f /* NOMINAL DIGIT SHAPES */,
+
+  /**
+   * C.9 Tagging characters
+   * @link https://tools.ietf.org/html/rfc3454#appendix-C.9
+   */
+  0xe0001 /* LANGUAGE TAG */,
+  ...range(0xe0020, 0xe007f) /* [TAGGING CHARACTERS] */,
+]);
+
+/**
+ * D.1 Characters with bidirectional property "R" or "AL"
+ * @link https://tools.ietf.org/html/rfc3454#appendix-D.1
+ */
+const bidirectional_r_al = new Set([
+  0x05be,
+  0x05c0,
+  0x05c3,
+  ...range(0x05d0, 0x05ea),
+  ...range(0x05f0, 0x05f4),
+  0x061b,
+  0x061f,
+  ...range(0x0621, 0x063a),
+  ...range(0x0640, 0x064a),
+  ...range(0x066d, 0x066f),
+  ...range(0x0671, 0x06d5),
+  0x06dd,
+  ...range(0x06e5, 0x06e6),
+  ...range(0x06fa, 0x06fe),
+  ...range(0x0700, 0x070d),
+  0x0710,
+  ...range(0x0712, 0x072c),
+  ...range(0x0780, 0x07a5),
+  0x07b1,
+  0x200f,
+  0xfb1d,
+  ...range(0xfb1f, 0xfb28),
+  ...range(0xfb2a, 0xfb36),
+  ...range(0xfb38, 0xfb3c),
+  0xfb3e,
+  ...range(0xfb40, 0xfb41),
+  ...range(0xfb43, 0xfb44),
+  ...range(0xfb46, 0xfbb1),
+  ...range(0xfbd3, 0xfd3d),
+  ...range(0xfd50, 0xfd8f),
+  ...range(0xfd92, 0xfdc7),
+  ...range(0xfdf0, 0xfdfc),
+  ...range(0xfe70, 0xfe74),
+  ...range(0xfe76, 0xfefc),
+]);
+
+/**
+ * D.2 Characters with bidirectional property "L"
+ * @link https://tools.ietf.org/html/rfc3454#appendix-D.2
+ */
+const bidirectional_l = new Set([
+  ...range(0x0041, 0x005a),
+  ...range(0x0061, 0x007a),
+  0x00aa,
+  0x00b5,
+  0x00ba,
+  ...range(0x00c0, 0x00d6),
+  ...range(0x00d8, 0x00f6),
+  ...range(0x00f8, 0x0220),
+  ...range(0x0222, 0x0233),
+  ...range(0x0250, 0x02ad),
+  ...range(0x02b0, 0x02b8),
+  ...range(0x02bb, 0x02c1),
+  ...range(0x02d0, 0x02d1),
+  ...range(0x02e0, 0x02e4),
+  0x02ee,
+  0x037a,
+  0x0386,
+  ...range(0x0388, 0x038a),
+  0x038c,
+  ...range(0x038e, 0x03a1),
+  ...range(0x03a3, 0x03ce),
+  ...range(0x03d0, 0x03f5),
+  ...range(0x0400, 0x0482),
+  ...range(0x048a, 0x04ce),
+  ...range(0x04d0, 0x04f5),
+  ...range(0x04f8, 0x04f9),
+  ...range(0x0500, 0x050f),
+  ...range(0x0531, 0x0556),
+  ...range(0x0559, 0x055f),
+  ...range(0x0561, 0x0587),
+  0x0589,
+  0x0903,
+  ...range(0x0905, 0x0939),
+  ...range(0x093d, 0x0940),
+  ...range(0x0949, 0x094c),
+  0x0950,
+  ...range(0x0958, 0x0961),
+  ...range(0x0964, 0x0970),
+  ...range(0x0982, 0x0983),
+  ...range(0x0985, 0x098c),
+  ...range(0x098f, 0x0990),
+  ...range(0x0993, 0x09a8),
+  ...range(0x09aa, 0x09b0),
+  0x09b2,
+  ...range(0x09b6, 0x09b9),
+  ...range(0x09be, 0x09c0),
+  ...range(0x09c7, 0x09c8),
+  ...range(0x09cb, 0x09cc),
+  0x09d7,
+  ...range(0x09dc, 0x09dd),
+  ...range(0x09df, 0x09e1),
+  ...range(0x09e6, 0x09f1),
+  ...range(0x09f4, 0x09fa),
+  ...range(0x0a05, 0x0a0a),
+  ...range(0x0a0f, 0x0a10),
+  ...range(0x0a13, 0x0a28),
+  ...range(0x0a2a, 0x0a30),
+  ...range(0x0a32, 0x0a33),
+  ...range(0x0a35, 0x0a36),
+  ...range(0x0a38, 0x0a39),
+  ...range(0x0a3e, 0x0a40),
+  ...range(0x0a59, 0x0a5c),
+  0x0a5e,
+  ...range(0x0a66, 0x0a6f),
+  ...range(0x0a72, 0x0a74),
+  0x0a83,
+  ...range(0x0a85, 0x0a8b),
+  0x0a8d,
+  ...range(0x0a8f, 0x0a91),
+  ...range(0x0a93, 0x0aa8),
+  ...range(0x0aaa, 0x0ab0),
+  ...range(0x0ab2, 0x0ab3),
+  ...range(0x0ab5, 0x0ab9),
+  ...range(0x0abd, 0x0ac0),
+  0x0ac9,
+  ...range(0x0acb, 0x0acc),
+  0x0ad0,
+  0x0ae0,
+  ...range(0x0ae6, 0x0aef),
+  ...range(0x0b02, 0x0b03),
+  ...range(0x0b05, 0x0b0c),
+  ...range(0x0b0f, 0x0b10),
+  ...range(0x0b13, 0x0b28),
+  ...range(0x0b2a, 0x0b30),
+  ...range(0x0b32, 0x0b33),
+  ...range(0x0b36, 0x0b39),
+  ...range(0x0b3d, 0x0b3e),
+  0x0b40,
+  ...range(0x0b47, 0x0b48),
+  ...range(0x0b4b, 0x0b4c),
+  0x0b57,
+  ...range(0x0b5c, 0x0b5d),
+  ...range(0x0b5f, 0x0b61),
+  ...range(0x0b66, 0x0b70),
+  0x0b83,
+  ...range(0x0b85, 0x0b8a),
+  ...range(0x0b8e, 0x0b90),
+  ...range(0x0b92, 0x0b95),
+  ...range(0x0b99, 0x0b9a),
+  0x0b9c,
+  ...range(0x0b9e, 0x0b9f),
+  ...range(0x0ba3, 0x0ba4),
+  ...range(0x0ba8, 0x0baa),
+  ...range(0x0bae, 0x0bb5),
+  ...range(0x0bb7, 0x0bb9),
+  ...range(0x0bbe, 0x0bbf),
+  ...range(0x0bc1, 0x0bc2),
+  ...range(0x0bc6, 0x0bc8),
+  ...range(0x0bca, 0x0bcc),
+  0x0bd7,
+  ...range(0x0be7, 0x0bf2),
+  ...range(0x0c01, 0x0c03),
+  ...range(0x0c05, 0x0c0c),
+  ...range(0x0c0e, 0x0c10),
+  ...range(0x0c12, 0x0c28),
+  ...range(0x0c2a, 0x0c33),
+  ...range(0x0c35, 0x0c39),
+  ...range(0x0c41, 0x0c44),
+  ...range(0x0c60, 0x0c61),
+  ...range(0x0c66, 0x0c6f),
+  ...range(0x0c82, 0x0c83),
+  ...range(0x0c85, 0x0c8c),
+  ...range(0x0c8e, 0x0c90),
+  ...range(0x0c92, 0x0ca8),
+  ...range(0x0caa, 0x0cb3),
+  ...range(0x0cb5, 0x0cb9),
+  0x0cbe,
+  ...range(0x0cc0, 0x0cc4),
+  ...range(0x0cc7, 0x0cc8),
+  ...range(0x0cca, 0x0ccb),
+  ...range(0x0cd5, 0x0cd6),
+  0x0cde,
+  ...range(0x0ce0, 0x0ce1),
+  ...range(0x0ce6, 0x0cef),
+  ...range(0x0d02, 0x0d03),
+  ...range(0x0d05, 0x0d0c),
+  ...range(0x0d0e, 0x0d10),
+  ...range(0x0d12, 0x0d28),
+  ...range(0x0d2a, 0x0d39),
+  ...range(0x0d3e, 0x0d40),
+  ...range(0x0d46, 0x0d48),
+  ...range(0x0d4a, 0x0d4c),
+  0x0d57,
+  ...range(0x0d60, 0x0d61),
+  ...range(0x0d66, 0x0d6f),
+  ...range(0x0d82, 0x0d83),
+  ...range(0x0d85, 0x0d96),
+  ...range(0x0d9a, 0x0db1),
+  ...range(0x0db3, 0x0dbb),
+  0x0dbd,
+  ...range(0x0dc0, 0x0dc6),
+  ...range(0x0dcf, 0x0dd1),
+  ...range(0x0dd8, 0x0ddf),
+  ...range(0x0df2, 0x0df4),
+  ...range(0x0e01, 0x0e30),
+  ...range(0x0e32, 0x0e33),
+  ...range(0x0e40, 0x0e46),
+  ...range(0x0e4f, 0x0e5b),
+  ...range(0x0e81, 0x0e82),
+  0x0e84,
+  ...range(0x0e87, 0x0e88),
+  0x0e8a,
+  0x0e8d,
+  ...range(0x0e94, 0x0e97),
+  ...range(0x0e99, 0x0e9f),
+  ...range(0x0ea1, 0x0ea3),
+  0x0ea5,
+  0x0ea7,
+  ...range(0x0eaa, 0x0eab),
+  ...range(0x0ead, 0x0eb0),
+  ...range(0x0eb2, 0x0eb3),
+  0x0ebd,
+  ...range(0x0ec0, 0x0ec4),
+  0x0ec6,
+  ...range(0x0ed0, 0x0ed9),
+  ...range(0x0edc, 0x0edd),
+  ...range(0x0f00, 0x0f17),
+  ...range(0x0f1a, 0x0f34),
+  0x0f36,
+  0x0f38,
+  ...range(0x0f3e, 0x0f47),
+  ...range(0x0f49, 0x0f6a),
+  0x0f7f,
+  0x0f85,
+  ...range(0x0f88, 0x0f8b),
+  ...range(0x0fbe, 0x0fc5),
+  ...range(0x0fc7, 0x0fcc),
+  0x0fcf,
+  ...range(0x1000, 0x1021),
+  ...range(0x1023, 0x1027),
+  ...range(0x1029, 0x102a),
+  0x102c,
+  0x1031,
+  0x1038,
+  ...range(0x1040, 0x1057),
+  ...range(0x10a0, 0x10c5),
+  ...range(0x10d0, 0x10f8),
+  0x10fb,
+  ...range(0x1100, 0x1159),
+  ...range(0x115f, 0x11a2),
+  ...range(0x11a8, 0x11f9),
+  ...range(0x1200, 0x1206),
+  ...range(0x1208, 0x1246),
+  0x1248,
+  ...range(0x124a, 0x124d),
+  ...range(0x1250, 0x1256),
+  0x1258,
+  ...range(0x125a, 0x125d),
+  ...range(0x1260, 0x1286),
+  0x1288,
+  ...range(0x128a, 0x128d),
+  ...range(0x1290, 0x12ae),
+  0x12b0,
+  ...range(0x12b2, 0x12b5),
+  ...range(0x12b8, 0x12be),
+  0x12c0,
+  ...range(0x12c2, 0x12c5),
+  ...range(0x12c8, 0x12ce),
+  ...range(0x12d0, 0x12d6),
+  ...range(0x12d8, 0x12ee),
+  ...range(0x12f0, 0x130e),
+  0x1310,
+  ...range(0x1312, 0x1315),
+  ...range(0x1318, 0x131e),
+  ...range(0x1320, 0x1346),
+  ...range(0x1348, 0x135a),
+  ...range(0x1361, 0x137c),
+  ...range(0x13a0, 0x13f4),
+  ...range(0x1401, 0x1676),
+  ...range(0x1681, 0x169a),
+  ...range(0x16a0, 0x16f0),
+  ...range(0x1700, 0x170c),
+  ...range(0x170e, 0x1711),
+  ...range(0x1720, 0x1731),
+  ...range(0x1735, 0x1736),
+  ...range(0x1740, 0x1751),
+  ...range(0x1760, 0x176c),
+  ...range(0x176e, 0x1770),
+  ...range(0x1780, 0x17b6),
+  ...range(0x17be, 0x17c5),
+  ...range(0x17c7, 0x17c8),
+  ...range(0x17d4, 0x17da),
+  0x17dc,
+  ...range(0x17e0, 0x17e9),
+  ...range(0x1810, 0x1819),
+  ...range(0x1820, 0x1877),
+  ...range(0x1880, 0x18a8),
+  ...range(0x1e00, 0x1e9b),
+  ...range(0x1ea0, 0x1ef9),
+  ...range(0x1f00, 0x1f15),
+  ...range(0x1f18, 0x1f1d),
+  ...range(0x1f20, 0x1f45),
+  ...range(0x1f48, 0x1f4d),
+  ...range(0x1f50, 0x1f57),
+  0x1f59,
+  0x1f5b,
+  0x1f5d,
+  ...range(0x1f5f, 0x1f7d),
+  ...range(0x1f80, 0x1fb4),
+  ...range(0x1fb6, 0x1fbc),
+  0x1fbe,
+  ...range(0x1fc2, 0x1fc4),
+  ...range(0x1fc6, 0x1fcc),
+  ...range(0x1fd0, 0x1fd3),
+  ...range(0x1fd6, 0x1fdb),
+  ...range(0x1fe0, 0x1fec),
+  ...range(0x1ff2, 0x1ff4),
+  ...range(0x1ff6, 0x1ffc),
+  0x200e,
+  0x2071,
+  0x207f,
+  0x2102,
+  0x2107,
+  ...range(0x210a, 0x2113),
+  0x2115,
+  ...range(0x2119, 0x211d),
+  0x2124,
+  0x2126,
+  0x2128,
+  ...range(0x212a, 0x212d),
+  ...range(0x212f, 0x2131),
+  ...range(0x2133, 0x2139),
+  ...range(0x213d, 0x213f),
+  ...range(0x2145, 0x2149),
+  ...range(0x2160, 0x2183),
+  ...range(0x2336, 0x237a),
+  0x2395,
+  ...range(0x249c, 0x24e9),
+  ...range(0x3005, 0x3007),
+  ...range(0x3021, 0x3029),
+  ...range(0x3031, 0x3035),
+  ...range(0x3038, 0x303c),
+  ...range(0x3041, 0x3096),
+  ...range(0x309d, 0x309f),
+  ...range(0x30a1, 0x30fa),
+  ...range(0x30fc, 0x30ff),
+  ...range(0x3105, 0x312c),
+  ...range(0x3131, 0x318e),
+  ...range(0x3190, 0x31b7),
+  ...range(0x31f0, 0x321c),
+  ...range(0x3220, 0x3243),
+  ...range(0x3260, 0x327b),
+  ...range(0x327f, 0x32b0),
+  ...range(0x32c0, 0x32cb),
+  ...range(0x32d0, 0x32fe),
+  ...range(0x3300, 0x3376),
+  ...range(0x337b, 0x33dd),
+  ...range(0x33e0, 0x33fe),
+  ...range(0x3400, 0x4db5),
+  ...range(0x4e00, 0x9fa5),
+  ...range(0xa000, 0xa48c),
+  ...range(0xac00, 0xd7a3),
+  ...range(0xd800, 0xfa2d),
+  ...range(0xfa30, 0xfa6a),
+  ...range(0xfb00, 0xfb06),
+  ...range(0xfb13, 0xfb17),
+  ...range(0xff21, 0xff3a),
+  ...range(0xff41, 0xff5a),
+  ...range(0xff66, 0xffbe),
+  ...range(0xffc2, 0xffc7),
+  ...range(0xffca, 0xffcf),
+  ...range(0xffd2, 0xffd7),
+  ...range(0xffda, 0xffdc),
+  ...range(0x10300, 0x1031e),
+  ...range(0x10320, 0x10323),
+  ...range(0x10330, 0x1034a),
+  ...range(0x10400, 0x10425),
+  ...range(0x10428, 0x1044d),
+  ...range(0x1d000, 0x1d0f5),
+  ...range(0x1d100, 0x1d126),
+  ...range(0x1d12a, 0x1d166),
+  ...range(0x1d16a, 0x1d172),
+  ...range(0x1d183, 0x1d184),
+  ...range(0x1d18c, 0x1d1a9),
+  ...range(0x1d1ae, 0x1d1dd),
+  ...range(0x1d400, 0x1d454),
+  ...range(0x1d456, 0x1d49c),
+  ...range(0x1d49e, 0x1d49f),
+  0x1d4a2,
+  ...range(0x1d4a5, 0x1d4a6),
+  ...range(0x1d4a9, 0x1d4ac),
+  ...range(0x1d4ae, 0x1d4b9),
+  0x1d4bb,
+  ...range(0x1d4bd, 0x1d4c0),
+  ...range(0x1d4c2, 0x1d4c3),
+  ...range(0x1d4c5, 0x1d505),
+  ...range(0x1d507, 0x1d50a),
+  ...range(0x1d50d, 0x1d514),
+  ...range(0x1d516, 0x1d51c),
+  ...range(0x1d51e, 0x1d539),
+  ...range(0x1d53b, 0x1d53e),
+  ...range(0x1d540, 0x1d544),
+  0x1d546,
+  ...range(0x1d54a, 0x1d550),
+  ...range(0x1d552, 0x1d6a3),
+  ...range(0x1d6a8, 0x1d7c9),
+  ...range(0x20000, 0x2a6d6),
+  ...range(0x2f800, 0x2fa1d),
+  ...range(0xf0000, 0xffffd),
+  ...range(0x100000, 0x10fffd),
+]);
+
+module.exports = {
+  unassigned_code_points,
+  commonly_mapped_to_nothing,
+  non_ASCII_space_characters,
+  prohibited_characters,
+  bidirectional_r_al,
+  bidirectional_l,
+};
diff --git a/NodeAPI/node_modules/saslprep/lib/memory-code-points.js b/NodeAPI/node_modules/saslprep/lib/memory-code-points.js
new file mode 100644
index 0000000000000000000000000000000000000000..cb0289c8706a9dc30752c2b567ff0cf9635333b2
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/lib/memory-code-points.js
@@ -0,0 +1,39 @@
+'use strict';
+
+const fs = require('fs');
+const path = require('path');
+const bitfield = require('sparse-bitfield');
+
+/* eslint-disable-next-line security/detect-non-literal-fs-filename */
+const memory = fs.readFileSync(path.resolve(__dirname, '../code-points.mem'));
+let offset = 0;
+
+/**
+ * Loads each code points sequence from buffer.
+ * @returns {bitfield}
+ */
+function read() {
+  const size = memory.readUInt32BE(offset);
+  offset += 4;
+
+  const codepoints = memory.slice(offset, offset + size);
+  offset += size;
+
+  return bitfield({ buffer: codepoints });
+}
+
+const unassigned_code_points = read();
+const commonly_mapped_to_nothing = read();
+const non_ASCII_space_characters = read();
+const prohibited_characters = read();
+const bidirectional_r_al = read();
+const bidirectional_l = read();
+
+module.exports = {
+  unassigned_code_points,
+  commonly_mapped_to_nothing,
+  non_ASCII_space_characters,
+  prohibited_characters,
+  bidirectional_r_al,
+  bidirectional_l,
+};
diff --git a/NodeAPI/node_modules/saslprep/lib/util.js b/NodeAPI/node_modules/saslprep/lib/util.js
new file mode 100644
index 0000000000000000000000000000000000000000..506bdc992db0f0c28cd99d30fc8e0c6f03db914b
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/lib/util.js
@@ -0,0 +1,21 @@
+'use strict';
+
+/**
+ * Create an array of numbers.
+ * @param {number} from
+ * @param {number} to
+ * @returns {number[]}
+ */
+function range(from, to) {
+  // TODO: make this inlined.
+  const list = new Array(to - from + 1);
+
+  for (let i = 0; i < list.length; i += 1) {
+    list[i] = from + i;
+  }
+  return list;
+}
+
+module.exports = {
+  range,
+};
diff --git a/NodeAPI/node_modules/saslprep/package.json b/NodeAPI/node_modules/saslprep/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..23c35627b53f7df5c89d304d304cebfd5f55243d
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/package.json
@@ -0,0 +1,72 @@
+{
+  "name": "saslprep",
+  "version": "1.0.3",
+  "description": "SASLprep: Stringprep Profile for User Names and Passwords, rfc4013.",
+  "main": "index.js",
+  "scripts": {
+    "test": "npm run lint && npm run unit-test",
+    "lint": "npx eslint --quiet .",
+    "unit-test": "npx jest",
+    "gen-code-points": "node generate-code-points.js > code-points.mem"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/reklatsmasters/saslprep.git"
+  },
+  "keywords": [
+    "sasl",
+    "saslprep",
+    "stringprep",
+    "rfc4013",
+    "4013"
+  ],
+  "author": "Dmitry Tsvettsikh <me@reklatsmasters.com>",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/reklatsmasters/saslprep/issues"
+  },
+  "engines": {
+    "node": ">=6"
+  },
+  "homepage": "https://github.com/reklatsmasters/saslprep#readme",
+  "devDependencies": {
+    "@nodertc/eslint-config": "^0.2.1",
+    "eslint": "^5.16.0",
+    "jest": "^23.6.0",
+    "prettier": "^1.14.3"
+  },
+  "dependencies": {
+    "sparse-bitfield": "^3.0.3"
+  },
+  "eslintConfig": {
+    "extends": "@nodertc",
+    "rules": {
+      "camelcase": "off",
+      "no-continue": "off"
+    },
+    "overrides": [
+      {
+        "files": [
+          "test/*.js"
+        ],
+        "env": {
+          "jest": true
+        },
+        "rules": {
+          "require-jsdoc": "off"
+        }
+      }
+    ]
+  },
+  "jest": {
+    "modulePaths": [
+      "<rootDir>"
+    ],
+    "testMatch": [
+      "**/test/*.js"
+    ],
+    "testPathIgnorePatterns": [
+      "<rootDir>/node_modules/"
+    ]
+  }
+}
diff --git a/NodeAPI/node_modules/saslprep/readme.md b/NodeAPI/node_modules/saslprep/readme.md
new file mode 100644
index 0000000000000000000000000000000000000000..8ff3d70d7bc01de7ac0cec648d1be30f108cfb6b
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/readme.md
@@ -0,0 +1,31 @@
+# saslprep
+[![Build Status](https://travis-ci.org/reklatsmasters/saslprep.svg?branch=master)](https://travis-ci.org/reklatsmasters/saslprep)
+[![npm](https://img.shields.io/npm/v/saslprep.svg)](https://npmjs.org/package/saslprep)
+[![node](https://img.shields.io/node/v/saslprep.svg)](https://npmjs.org/package/saslprep)
+[![license](https://img.shields.io/npm/l/saslprep.svg)](https://npmjs.org/package/saslprep)
+[![downloads](https://img.shields.io/npm/dm/saslprep.svg)](https://npmjs.org/package/saslprep)
+
+Stringprep Profile for User Names and Passwords, [rfc4013](https://tools.ietf.org/html/rfc4013)
+
+### Usage
+
+```js
+const saslprep = require('saslprep')
+
+saslprep('password\u00AD') // password
+saslprep('password\u0007') // Error: prohibited character
+```
+
+### API
+
+##### `saslprep(input: String, opts: Options): String`
+
+Normalize user name or password.
+
+##### `Options.allowUnassigned: bool`
+
+A special behavior for unassigned code points, see https://tools.ietf.org/html/rfc4013#section-2.5. Disabled by default.
+
+## License
+
+MIT, 2017-2019 (c) Dmitriy Tsvettsikh
diff --git a/NodeAPI/node_modules/saslprep/test/index.js b/NodeAPI/node_modules/saslprep/test/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..80c71af5e31aa1a3a9743398ace8779451522013
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/test/index.js
@@ -0,0 +1,76 @@
+'use strict';
+
+const saslprep = require('..');
+
+const chr = String.fromCodePoint;
+
+test('should work with liatin letters', () => {
+  const str = 'user';
+  expect(saslprep(str)).toEqual(str);
+});
+
+test('should work be case preserved', () => {
+  const str = 'USER';
+  expect(saslprep(str)).toEqual(str);
+});
+
+test('should work with high code points (> U+FFFF)', () => {
+  const str = '\uD83D\uDE00';
+  expect(saslprep(str, { allowUnassigned: true })).toEqual(str);
+});
+
+test('should remove `mapped to nothing` characters', () => {
+  expect(saslprep('I\u00ADX')).toEqual('IX');
+});
+
+test('should replace `Non-ASCII space characters` with space', () => {
+  expect(saslprep('a\u00A0b')).toEqual('a\u0020b');
+});
+
+test('should normalize as NFKC', () => {
+  expect(saslprep('\u00AA')).toEqual('a');
+  expect(saslprep('\u2168')).toEqual('IX');
+});
+
+test('should throws when prohibited characters', () => {
+  // C.2.1 ASCII control characters
+  expect(() => saslprep('a\u007Fb')).toThrow();
+
+  // C.2.2 Non-ASCII control characters
+  expect(() => saslprep('a\u06DDb')).toThrow();
+
+  // C.3 Private use
+  expect(() => saslprep('a\uE000b')).toThrow();
+
+  // C.4 Non-character code points
+  expect(() => saslprep(`a${chr(0x1fffe)}b`)).toThrow();
+
+  // C.5 Surrogate codes
+  expect(() => saslprep('a\uD800b')).toThrow();
+
+  // C.6 Inappropriate for plain text
+  expect(() => saslprep('a\uFFF9b')).toThrow();
+
+  // C.7 Inappropriate for canonical representation
+  expect(() => saslprep('a\u2FF0b')).toThrow();
+
+  // C.8 Change display properties or are deprecated
+  expect(() => saslprep('a\u200Eb')).toThrow();
+
+  // C.9 Tagging characters
+  expect(() => saslprep(`a${chr(0xe0001)}b`)).toThrow();
+});
+
+test('should not containt RandALCat and LCat bidi', () => {
+  expect(() => saslprep('a\u06DD\u00AAb')).toThrow();
+});
+
+test('RandALCat should be first and last', () => {
+  expect(() => saslprep('\u0627\u0031\u0628')).not.toThrow();
+  expect(() => saslprep('\u0627\u0031')).toThrow();
+});
+
+test('should handle unassigned code points', () => {
+  expect(() => saslprep('a\u0487')).toThrow();
+  expect(() => saslprep('a\u0487', { allowUnassigned: true })).not.toThrow();
+});
diff --git a/NodeAPI/node_modules/saslprep/test/util.js b/NodeAPI/node_modules/saslprep/test/util.js
new file mode 100644
index 0000000000000000000000000000000000000000..355db3f85e8ef143c524c9eed428f76dc1fdfba1
--- /dev/null
+++ b/NodeAPI/node_modules/saslprep/test/util.js
@@ -0,0 +1,16 @@
+'use strict';
+
+const { setFlagsFromString } = require('v8');
+const { range } = require('../lib/util');
+
+// 984 by default.
+setFlagsFromString('--stack_size=500');
+
+test('should work', () => {
+  const list = range(1, 3);
+  expect(list).toEqual([1, 2, 3]);
+});
+
+test('should work for large ranges', () => {
+  expect(() => range(1, 1e6)).not.toThrow();
+});
diff --git a/NodeAPI/node_modules/sparse-bitfield/.npmignore b/NodeAPI/node_modules/sparse-bitfield/.npmignore
new file mode 100644
index 0000000000000000000000000000000000000000..3c3629e647f5ddf82548912e337bea9826b434af
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/NodeAPI/node_modules/sparse-bitfield/.travis.yml b/NodeAPI/node_modules/sparse-bitfield/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..c0428217037e472e73fc90e620d9f71bae940c31
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+node_js:
+  - '0.10'
+  - '0.12'
+  - '4.0'
+  - '5.0'
diff --git a/NodeAPI/node_modules/sparse-bitfield/LICENSE b/NodeAPI/node_modules/sparse-bitfield/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..bae9da7bfae2b5e22cfb0945b362b23ca822c8bb
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Mathias Buus
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/NodeAPI/node_modules/sparse-bitfield/README.md b/NodeAPI/node_modules/sparse-bitfield/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..7b6b8f9ed33bc995571f0138ac1450b7420a6642
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/README.md
@@ -0,0 +1,62 @@
+# sparse-bitfield
+
+Bitfield implementation that allocates a series of 1kb buffers to support sparse bitfields
+without allocating a massive buffer. If you want to simple implementation of a flat bitfield
+see the [bitfield](https://github.com/fb55/bitfield) module.
+
+This module is mostly useful if you need a big bitfield where you won't nessecarily set every bit.
+
+```
+npm install sparse-bitfield
+```
+
+[![build status](http://img.shields.io/travis/mafintosh/sparse-bitfield.svg?style=flat)](http://travis-ci.org/mafintosh/sparse-bitfield)
+
+## Usage
+
+``` js
+var bitfield = require('sparse-bitfield')
+var bits = bitfield()
+
+bits.set(0, true) // set first bit
+bits.set(1, true) // set second bit
+bits.set(1000000000000, true) // set the 1.000.000.000.000th bit
+```
+
+Running the above example will allocate two 1kb buffers internally.
+Each 1kb buffer can hold information about 8192 bits so the first one will be used to store information about the first two bits and the second will be used to store the 1.000.000.000.000th bit.
+
+## API
+
+#### `var bits = bitfield([options])`
+
+Create a new bitfield. Options include
+
+``` js
+{
+  pageSize: 1024, // how big should the partial buffers be
+  buffer: anExistingBitfield,
+  trackUpdates: false // track when pages are being updated in the pager
+}
+```
+
+#### `bits.set(index, value)`
+
+Set a bit to true or false.
+
+#### `bits.get(index)`
+
+Get the value of a bit.
+
+#### `bits.pages`
+
+A [memory-pager](https://github.com/mafintosh/memory-pager) instance that is managing the underlying memory.
+If you set `trackUpdates` to true in the constructor you can use `.lastUpdate()` on this instance to get the last updated memory page.
+
+#### `var buffer = bits.toBuffer()`
+
+Get a single buffer representing the entire bitfield.
+
+## License
+
+MIT
diff --git a/NodeAPI/node_modules/sparse-bitfield/index.js b/NodeAPI/node_modules/sparse-bitfield/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..ff458c974fcd4e6051b44b3ae2e4674c3ce70b01
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/index.js
@@ -0,0 +1,95 @@
+var pager = require('memory-pager')
+
+module.exports = Bitfield
+
+function Bitfield (opts) {
+  if (!(this instanceof Bitfield)) return new Bitfield(opts)
+  if (!opts) opts = {}
+  if (Buffer.isBuffer(opts)) opts = {buffer: opts}
+
+  this.pageOffset = opts.pageOffset || 0
+  this.pageSize = opts.pageSize || 1024
+  this.pages = opts.pages || pager(this.pageSize)
+
+  this.byteLength = this.pages.length * this.pageSize
+  this.length = 8 * this.byteLength
+
+  if (!powerOfTwo(this.pageSize)) throw new Error('The page size should be a power of two')
+
+  this._trackUpdates = !!opts.trackUpdates
+  this._pageMask = this.pageSize - 1
+
+  if (opts.buffer) {
+    for (var i = 0; i < opts.buffer.length; i += this.pageSize) {
+      this.pages.set(i / this.pageSize, opts.buffer.slice(i, i + this.pageSize))
+    }
+    this.byteLength = opts.buffer.length
+    this.length = 8 * this.byteLength
+  }
+}
+
+Bitfield.prototype.get = function (i) {
+  var o = i & 7
+  var j = (i - o) / 8
+
+  return !!(this.getByte(j) & (128 >> o))
+}
+
+Bitfield.prototype.getByte = function (i) {
+  var o = i & this._pageMask
+  var j = (i - o) / this.pageSize
+  var page = this.pages.get(j, true)
+
+  return page ? page.buffer[o + this.pageOffset] : 0
+}
+
+Bitfield.prototype.set = function (i, v) {
+  var o = i & 7
+  var j = (i - o) / 8
+  var b = this.getByte(j)
+
+  return this.setByte(j, v ? b | (128 >> o) : b & (255 ^ (128 >> o)))
+}
+
+Bitfield.prototype.toBuffer = function () {
+  var all = alloc(this.pages.length * this.pageSize)
+
+  for (var i = 0; i < this.pages.length; i++) {
+    var next = this.pages.get(i, true)
+    var allOffset = i * this.pageSize
+    if (next) next.buffer.copy(all, allOffset, this.pageOffset, this.pageOffset + this.pageSize)
+  }
+
+  return all
+}
+
+Bitfield.prototype.setByte = function (i, b) {
+  var o = i & this._pageMask
+  var j = (i - o) / this.pageSize
+  var page = this.pages.get(j, false)
+
+  o += this.pageOffset
+
+  if (page.buffer[o] === b) return false
+  page.buffer[o] = b
+
+  if (i >= this.byteLength) {
+    this.byteLength = i + 1
+    this.length = this.byteLength * 8
+  }
+
+  if (this._trackUpdates) this.pages.updated(page)
+
+  return true
+}
+
+function alloc (n) {
+  if (Buffer.alloc) return Buffer.alloc(n)
+  var b = new Buffer(n)
+  b.fill(0)
+  return b
+}
+
+function powerOfTwo (x) {
+  return !(x & (x - 1))
+}
diff --git a/NodeAPI/node_modules/sparse-bitfield/package.json b/NodeAPI/node_modules/sparse-bitfield/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..092a23f61733e43de499a599f591362523243032
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/package.json
@@ -0,0 +1,27 @@
+{
+  "name": "sparse-bitfield",
+  "version": "3.0.3",
+  "description": "Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer",
+  "main": "index.js",
+  "dependencies": {
+    "memory-pager": "^1.0.2"
+  },
+  "devDependencies": {
+    "buffer-alloc": "^1.1.0",
+    "standard": "^9.0.0",
+    "tape": "^4.6.3"
+  },
+  "scripts": {
+    "test": "standard && tape test.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/mafintosh/sparse-bitfield.git"
+  },
+  "author": "Mathias Buus (@mafintosh)",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/mafintosh/sparse-bitfield/issues"
+  },
+  "homepage": "https://github.com/mafintosh/sparse-bitfield"
+}
diff --git a/NodeAPI/node_modules/sparse-bitfield/test.js b/NodeAPI/node_modules/sparse-bitfield/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..ae42ef467309493e2a01cc51d567fae98382b5d4
--- /dev/null
+++ b/NodeAPI/node_modules/sparse-bitfield/test.js
@@ -0,0 +1,79 @@
+var alloc = require('buffer-alloc')
+var tape = require('tape')
+var bitfield = require('./')
+
+tape('set and get', function (t) {
+  var bits = bitfield()
+
+  t.same(bits.get(0), false, 'first bit is false')
+  bits.set(0, true)
+  t.same(bits.get(0), true, 'first bit is true')
+  t.same(bits.get(1), false, 'second bit is false')
+  bits.set(0, false)
+  t.same(bits.get(0), false, 'first bit is reset')
+  t.end()
+})
+
+tape('set large and get', function (t) {
+  var bits = bitfield()
+
+  t.same(bits.get(9999999999999), false, 'large bit is false')
+  bits.set(9999999999999, true)
+  t.same(bits.get(9999999999999), true, 'large bit is true')
+  t.same(bits.get(9999999999999 + 1), false, 'large bit + 1 is false')
+  bits.set(9999999999999, false)
+  t.same(bits.get(9999999999999), false, 'large bit is reset')
+  t.end()
+})
+
+tape('get and set buffer', function (t) {
+  var bits = bitfield({trackUpdates: true})
+
+  t.same(bits.pages.get(0, true), undefined)
+  t.same(bits.pages.get(Math.floor(9999999999999 / 8 / 1024), true), undefined)
+  bits.set(9999999999999, true)
+
+  var bits2 = bitfield()
+  var upd = bits.pages.lastUpdate()
+  bits2.pages.set(Math.floor(upd.offset / 1024), upd.buffer)
+  t.same(bits2.get(9999999999999), true, 'bit is set')
+  t.end()
+})
+
+tape('toBuffer', function (t) {
+  var bits = bitfield()
+
+  t.same(bits.toBuffer(), alloc(0))
+
+  bits.set(0, true)
+
+  t.same(bits.toBuffer(), bits.pages.get(0).buffer)
+
+  bits.set(9000, true)
+
+  t.same(bits.toBuffer(), Buffer.concat([bits.pages.get(0).buffer, bits.pages.get(1).buffer]))
+  t.end()
+})
+
+tape('pass in buffer', function (t) {
+  var bits = bitfield()
+
+  bits.set(0, true)
+  bits.set(9000, true)
+
+  var clone = bitfield(bits.toBuffer())
+
+  t.same(clone.get(0), true)
+  t.same(clone.get(9000), true)
+  t.end()
+})
+
+tape('set small buffer', function (t) {
+  var buf = alloc(1)
+  buf[0] = 255
+  var bits = bitfield(buf)
+
+  t.same(bits.get(0), true)
+  t.same(bits.pages.get(0).buffer.length, bits.pageSize)
+  t.end()
+})
diff --git a/NodeAPI/node_modules/string_decoder/.travis.yml b/NodeAPI/node_modules/string_decoder/.travis.yml
new file mode 100644
index 0000000000000000000000000000000000000000..3347a7254650582da5339323466f84fe079fc270
--- /dev/null
+++ b/NodeAPI/node_modules/string_decoder/.travis.yml
@@ -0,0 +1,50 @@
+sudo: false
+language: node_js
+before_install:
+  - npm install -g npm@2
+  - test $NPM_LEGACY && npm install -g npm@latest-3 || npm install npm -g
+notifications:
+  email: false
+matrix:
+  fast_finish: true
+  include:
+  - node_js: '0.8'
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: '0.10'
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: '0.11'
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: '0.12'
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: 1
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: 2
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: 3
+    env:
+      - TASK=test
+      - NPM_LEGACY=true
+  - node_js: 4
+    env: TASK=test
+  - node_js: 5
+    env: TASK=test
+  - node_js: 6
+    env: TASK=test
+  - node_js: 7
+    env: TASK=test
+  - node_js: 8
+    env: TASK=test
+  - node_js: 9
+    env: TASK=test
diff --git a/NodeAPI/node_modules/string_decoder/LICENSE b/NodeAPI/node_modules/string_decoder/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..778edb20730ef48c01002248f4d51e7752c13487
--- /dev/null
+++ b/NodeAPI/node_modules/string_decoder/LICENSE
@@ -0,0 +1,48 @@
+Node.js is licensed for use as follows:
+
+"""
+Copyright Node.js contributors. All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
+This license applies to parts of Node.js originating from the
+https://github.com/joyent/node repository:
+
+"""
+Copyright Joyent, Inc. and other Node contributors. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
+"""
+
diff --git a/NodeAPI/node_modules/string_decoder/README.md b/NodeAPI/node_modules/string_decoder/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..5fd58315ed588027742dde690a31cd0a2610649d
--- /dev/null
+++ b/NodeAPI/node_modules/string_decoder/README.md
@@ -0,0 +1,47 @@
+# string_decoder
+
+***Node-core v8.9.4 string_decoder for userland***
+
+
+[![NPM](https://nodei.co/npm/string_decoder.png?downloads=true&downloadRank=true)](https://nodei.co/npm/string_decoder/)
+[![NPM](https://nodei.co/npm-dl/string_decoder.png?&months=6&height=3)](https://nodei.co/npm/string_decoder/)
+
+
+```bash
+npm install --save string_decoder
+```
+
+***Node-core string_decoder for userland***
+
+This package is a mirror of the string_decoder implementation in Node-core.
+
+Full documentation may be found on the [Node.js website](https://nodejs.org/dist/v8.9.4/docs/api/).
+
+As of version 1.0.0 **string_decoder** uses semantic versioning.
+
+## Previous versions
+
+Previous version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10.
+
+## Update
+
+The *build/* directory contains a build script that will scrape the source from the [nodejs/node](https://github.com/nodejs/node) repo given a specific Node version.
+
+## Streams Working Group
+
+`string_decoder` is maintained by the Streams Working Group, which
+oversees the development and maintenance of the Streams API within
+Node.js. The responsibilities of the Streams Working Group include:
+
+* Addressing stream issues on the Node.js issue tracker.
+* Authoring and editing stream documentation within the Node.js project.
+* Reviewing changes to stream subclasses within the Node.js project.
+* Redirecting changes to streams from the Node.js project to this
+  project.
+* Assisting in the implementation of stream providers within Node.js.
+* Recommending versions of `readable-stream` to be included in Node.js.
+* Messaging about the future of streams to give the community advance
+  notice of changes.
+
+See [readable-stream](https://github.com/nodejs/readable-stream) for
+more details.
diff --git a/NodeAPI/node_modules/string_decoder/lib/string_decoder.js b/NodeAPI/node_modules/string_decoder/lib/string_decoder.js
new file mode 100644
index 0000000000000000000000000000000000000000..2e89e63f7933e42b8ba543ede35d2a8fa3e4f100
--- /dev/null
+++ b/NodeAPI/node_modules/string_decoder/lib/string_decoder.js
@@ -0,0 +1,296 @@
+// Copyright Joyent, Inc. and other Node contributors.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a
+// copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to permit
+// persons to whom the Software is furnished to do so, subject to the
+// following conditions:
+//
+// The above copyright notice and this permission notice shall be included
+// in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+'use strict';
+
+/*<replacement>*/
+
+var Buffer = require('safe-buffer').Buffer;
+/*</replacement>*/
+
+var isEncoding = Buffer.isEncoding || function (encoding) {
+  encoding = '' + encoding;
+  switch (encoding && encoding.toLowerCase()) {
+    case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
+      return true;
+    default:
+      return false;
+  }
+};
+
+function _normalizeEncoding(enc) {
+  if (!enc) return 'utf8';
+  var retried;
+  while (true) {
+    switch (enc) {
+      case 'utf8':
+      case 'utf-8':
+        return 'utf8';
+      case 'ucs2':
+      case 'ucs-2':
+      case 'utf16le':
+      case 'utf-16le':
+        return 'utf16le';
+      case 'latin1':
+      case 'binary':
+        return 'latin1';
+      case 'base64':
+      case 'ascii':
+      case 'hex':
+        return enc;
+      default:
+        if (retried) return; // undefined
+        enc = ('' + enc).toLowerCase();
+        retried = true;
+    }
+  }
+};
+
+// Do not cache `Buffer.isEncoding` when checking encoding names as some
+// modules monkey-patch it to support additional encodings
+function normalizeEncoding(enc) {
+  var nenc = _normalizeEncoding(enc);
+  if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
+  return nenc || enc;
+}
+
+// StringDecoder provides an interface for efficiently splitting a series of
+// buffers into a series of JS strings without breaking apart multi-byte
+// characters.
+exports.StringDecoder = StringDecoder;
+function StringDecoder(encoding) {
+  this.encoding = normalizeEncoding(encoding);
+  var nb;
+  switch (this.encoding) {
+    case 'utf16le':
+      this.text = utf16Text;
+      this.end = utf16End;
+      nb = 4;
+      break;
+    case 'utf8':
+      this.fillLast = utf8FillLast;
+      nb = 4;
+      break;
+    case 'base64':
+      this.text = base64Text;
+      this.end = base64End;
+      nb = 3;
+      break;
+    default:
+      this.write = simpleWrite;
+      this.end = simpleEnd;
+      return;
+  }
+  this.lastNeed = 0;
+  this.lastTotal = 0;
+  this.lastChar = Buffer.allocUnsafe(nb);
+}
+
+StringDecoder.prototype.write = function (buf) {
+  if (buf.length === 0) return '';
+  var r;
+  var i;
+  if (this.lastNeed) {
+    r = this.fillLast(buf);
+    if (r === undefined) return '';
+    i = this.lastNeed;
+    this.lastNeed = 0;
+  } else {
+    i = 0;
+  }
+  if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
+  return r || '';
+};
+
+StringDecoder.prototype.end = utf8End;
+
+// Returns only complete characters in a Buffer
+StringDecoder.prototype.text = utf8Text;
+
+// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
+StringDecoder.prototype.fillLast = function (buf) {
+  if (this.lastNeed <= buf.length) {
+    buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
+    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+  }
+  buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
+  this.lastNeed -= buf.length;
+};
+
+// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
+// continuation byte. If an invalid byte is detected, -2 is returned.
+function utf8CheckByte(byte) {
+  if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
+  return byte >> 6 === 0x02 ? -1 : -2;
+}
+
+// Checks at most 3 bytes at the end of a Buffer in order to detect an
+// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
+// needed to complete the UTF-8 character (if applicable) are returned.
+function utf8CheckIncomplete(self, buf, i) {
+  var j = buf.length - 1;
+  if (j < i) return 0;
+  var nb = utf8CheckByte(buf[j]);
+  if (nb >= 0) {
+    if (nb > 0) self.lastNeed = nb - 1;
+    return nb;
+  }
+  if (--j < i || nb === -2) return 0;
+  nb = utf8CheckByte(buf[j]);
+  if (nb >= 0) {
+    if (nb > 0) self.lastNeed = nb - 2;
+    return nb;
+  }
+  if (--j < i || nb === -2) return 0;
+  nb = utf8CheckByte(buf[j]);
+  if (nb >= 0) {
+    if (nb > 0) {
+      if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
+    }
+    return nb;
+  }
+  return 0;
+}
+
+// Validates as many continuation bytes for a multi-byte UTF-8 character as
+// needed or are available. If we see a non-continuation byte where we expect
+// one, we "replace" the validated continuation bytes we've seen so far with
+// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
+// behavior. The continuation byte check is included three times in the case
+// where all of the continuation bytes for a character exist in the same buffer.
+// It is also done this way as a slight performance increase instead of using a
+// loop.
+function utf8CheckExtraBytes(self, buf, p) {
+  if ((buf[0] & 0xC0) !== 0x80) {
+    self.lastNeed = 0;
+    return '\ufffd';
+  }
+  if (self.lastNeed > 1 && buf.length > 1) {
+    if ((buf[1] & 0xC0) !== 0x80) {
+      self.lastNeed = 1;
+      return '\ufffd';
+    }
+    if (self.lastNeed > 2 && buf.length > 2) {
+      if ((buf[2] & 0xC0) !== 0x80) {
+        self.lastNeed = 2;
+        return '\ufffd';
+      }
+    }
+  }
+}
+
+// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
+function utf8FillLast(buf) {
+  var p = this.lastTotal - this.lastNeed;
+  var r = utf8CheckExtraBytes(this, buf, p);
+  if (r !== undefined) return r;
+  if (this.lastNeed <= buf.length) {
+    buf.copy(this.lastChar, p, 0, this.lastNeed);
+    return this.lastChar.toString(this.encoding, 0, this.lastTotal);
+  }
+  buf.copy(this.lastChar, p, 0, buf.length);
+  this.lastNeed -= buf.length;
+}
+
+// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
+// partial character, the character's bytes are buffered until the required
+// number of bytes are available.
+function utf8Text(buf, i) {
+  var total = utf8CheckIncomplete(this, buf, i);
+  if (!this.lastNeed) return buf.toString('utf8', i);
+  this.lastTotal = total;
+  var end = buf.length - (total - this.lastNeed);
+  buf.copy(this.lastChar, 0, end);
+  return buf.toString('utf8', i, end);
+}
+
+// For UTF-8, a replacement character is added when ending on a partial
+// character.
+function utf8End(buf) {
+  var r = buf && buf.length ? this.write(buf) : '';
+  if (this.lastNeed) return r + '\ufffd';
+  return r;
+}
+
+// UTF-16LE typically needs two bytes per character, but even if we have an even
+// number of bytes available, we need to check if we end on a leading/high
+// surrogate. In that case, we need to wait for the next two bytes in order to
+// decode the last character properly.
+function utf16Text(buf, i) {
+  if ((buf.length - i) % 2 === 0) {
+    var r = buf.toString('utf16le', i);
+    if (r) {
+      var c = r.charCodeAt(r.length - 1);
+      if (c >= 0xD800 && c <= 0xDBFF) {
+        this.lastNeed = 2;
+        this.lastTotal = 4;
+        this.lastChar[0] = buf[buf.length - 2];
+        this.lastChar[1] = buf[buf.length - 1];
+        return r.slice(0, -1);
+      }
+    }
+    return r;
+  }
+  this.lastNeed = 1;
+  this.lastTotal = 2;
+  this.lastChar[0] = buf[buf.length - 1];
+  return buf.toString('utf16le', i, buf.length - 1);
+}
+
+// For UTF-16LE we do not explicitly append special replacement characters if we
+// end on a partial character, we simply let v8 handle that.
+function utf16End(buf) {
+  var r = buf && buf.length ? this.write(buf) : '';
+  if (this.lastNeed) {
+    var end = this.lastTotal - this.lastNeed;
+    return r + this.lastChar.toString('utf16le', 0, end);
+  }
+  return r;
+}
+
+function base64Text(buf, i) {
+  var n = (buf.length - i) % 3;
+  if (n === 0) return buf.toString('base64', i);
+  this.lastNeed = 3 - n;
+  this.lastTotal = 3;
+  if (n === 1) {
+    this.lastChar[0] = buf[buf.length - 1];
+  } else {
+    this.lastChar[0] = buf[buf.length - 2];
+    this.lastChar[1] = buf[buf.length - 1];
+  }
+  return buf.toString('base64', i, buf.length - n);
+}
+
+function base64End(buf) {
+  var r = buf && buf.length ? this.write(buf) : '';
+  if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
+  return r;
+}
+
+// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
+function simpleWrite(buf) {
+  return buf.toString(this.encoding);
+}
+
+function simpleEnd(buf) {
+  return buf && buf.length ? this.write(buf) : '';
+}
\ No newline at end of file
diff --git a/NodeAPI/node_modules/string_decoder/package.json b/NodeAPI/node_modules/string_decoder/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..518c3eb9fb1ffbf72bfdf6fed252117b73164673
--- /dev/null
+++ b/NodeAPI/node_modules/string_decoder/package.json
@@ -0,0 +1,31 @@
+{
+  "name": "string_decoder",
+  "version": "1.1.1",
+  "description": "The string_decoder module from Node core",
+  "main": "lib/string_decoder.js",
+  "dependencies": {
+    "safe-buffer": "~5.1.0"
+  },
+  "devDependencies": {
+    "babel-polyfill": "^6.23.0",
+    "core-util-is": "^1.0.2",
+    "inherits": "^2.0.3",
+    "tap": "~0.4.8"
+  },
+  "scripts": {
+    "test": "tap test/parallel/*.js && node test/verify-dependencies",
+    "ci": "tap test/parallel/*.js test/ours/*.js --tap | tee test.tap && node test/verify-dependencies.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/nodejs/string_decoder.git"
+  },
+  "homepage": "https://github.com/nodejs/string_decoder",
+  "keywords": [
+    "string",
+    "decoder",
+    "browser",
+    "browserify"
+  ],
+  "license": "MIT"
+}
diff --git a/NodeAPI/node_modules/util-deprecate/History.md b/NodeAPI/node_modules/util-deprecate/History.md
new file mode 100644
index 0000000000000000000000000000000000000000..acc8675372e980824723cfcfec09c0ba43a3195a
--- /dev/null
+++ b/NodeAPI/node_modules/util-deprecate/History.md
@@ -0,0 +1,16 @@
+
+1.0.2 / 2015-10-07
+==================
+
+  * use try/catch when checking `localStorage` (#3, @kumavis)
+
+1.0.1 / 2014-11-25
+==================
+
+  * browser: use `console.warn()` for deprecation calls
+  * browser: more jsdocs
+
+1.0.0 / 2014-04-30
+==================
+
+  * initial commit
diff --git a/NodeAPI/node_modules/util-deprecate/LICENSE b/NodeAPI/node_modules/util-deprecate/LICENSE
new file mode 100644
index 0000000000000000000000000000000000000000..6a60e8c225c9baca25907f87c74b428e5d85de0c
--- /dev/null
+++ b/NodeAPI/node_modules/util-deprecate/LICENSE
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/NodeAPI/node_modules/util-deprecate/README.md b/NodeAPI/node_modules/util-deprecate/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..75622fa7c250a6605f4778d9dffe97bf60291d17
--- /dev/null
+++ b/NodeAPI/node_modules/util-deprecate/README.md
@@ -0,0 +1,53 @@
+util-deprecate
+==============
+### The Node.js `util.deprecate()` function with browser support
+
+In Node.js, this module simply re-exports the `util.deprecate()` function.
+
+In the web browser (i.e. via browserify), a browser-specific implementation
+of the `util.deprecate()` function is used.
+
+
+## API
+
+A `deprecate()` function is the only thing exposed by this module.
+
+``` javascript
+// setup:
+exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');
+
+
+// users see:
+foo();
+// foo() is deprecated, use bar() instead
+foo();
+foo();
+```
+
+
+## License
+
+(The MIT License)
+
+Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/NodeAPI/node_modules/util-deprecate/browser.js b/NodeAPI/node_modules/util-deprecate/browser.js
new file mode 100644
index 0000000000000000000000000000000000000000..549ae2f065ea5add2c4b3667e412a9d0e7d2b1af
--- /dev/null
+++ b/NodeAPI/node_modules/util-deprecate/browser.js
@@ -0,0 +1,67 @@
+
+/**
+ * Module exports.
+ */
+
+module.exports = deprecate;
+
+/**
+ * Mark that a method should not be used.
+ * Returns a modified function which warns once by default.
+ *
+ * If `localStorage.noDeprecation = true` is set, then it is a no-op.
+ *
+ * If `localStorage.throwDeprecation = true` is set, then deprecated functions
+ * will throw an Error when invoked.
+ *
+ * If `localStorage.traceDeprecation = true` is set, then deprecated functions
+ * will invoke `console.trace()` instead of `console.error()`.
+ *
+ * @param {Function} fn - the function to deprecate
+ * @param {String} msg - the string to print to the console when `fn` is invoked
+ * @returns {Function} a new "deprecated" version of `fn`
+ * @api public
+ */
+
+function deprecate (fn, msg) {
+  if (config('noDeprecation')) {
+    return fn;
+  }
+
+  var warned = false;
+  function deprecated() {
+    if (!warned) {
+      if (config('throwDeprecation')) {
+        throw new Error(msg);
+      } else if (config('traceDeprecation')) {
+        console.trace(msg);
+      } else {
+        console.warn(msg);
+      }
+      warned = true;
+    }
+    return fn.apply(this, arguments);
+  }
+
+  return deprecated;
+}
+
+/**
+ * Checks `localStorage` for boolean values for the given `name`.
+ *
+ * @param {String} name
+ * @returns {Boolean}
+ * @api private
+ */
+
+function config (name) {
+  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
+  try {
+    if (!global.localStorage) return false;
+  } catch (_) {
+    return false;
+  }
+  var val = global.localStorage[name];
+  if (null == val) return false;
+  return String(val).toLowerCase() === 'true';
+}
diff --git a/NodeAPI/node_modules/util-deprecate/node.js b/NodeAPI/node_modules/util-deprecate/node.js
new file mode 100644
index 0000000000000000000000000000000000000000..5e6fcff5ddd3fbf8bdda6310c224114d30b7509e
--- /dev/null
+++ b/NodeAPI/node_modules/util-deprecate/node.js
@@ -0,0 +1,6 @@
+
+/**
+ * For Node.js, simply re-export the core `util.deprecate` function.
+ */
+
+module.exports = require('util').deprecate;
diff --git a/NodeAPI/node_modules/util-deprecate/package.json b/NodeAPI/node_modules/util-deprecate/package.json
new file mode 100644
index 0000000000000000000000000000000000000000..2e79f89a90f58369ef197534e8488158f379d264
--- /dev/null
+++ b/NodeAPI/node_modules/util-deprecate/package.json
@@ -0,0 +1,27 @@
+{
+  "name": "util-deprecate",
+  "version": "1.0.2",
+  "description": "The Node.js `util.deprecate()` function with browser support",
+  "main": "node.js",
+  "browser": "browser.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/TooTallNate/util-deprecate.git"
+  },
+  "keywords": [
+    "util",
+    "deprecate",
+    "browserify",
+    "browser",
+    "node"
+  ],
+  "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/TooTallNate/util-deprecate/issues"
+  },
+  "homepage": "https://github.com/TooTallNate/util-deprecate"
+}
diff --git a/NodeAPI/package-lock.json b/NodeAPI/package-lock.json
index c0d70ef7afead99b2a2ac57a3c26f7caa97608a7..394a61daae788c702f66e8c58ea76645de1c0c9e 100644
--- a/NodeAPI/package-lock.json
+++ b/NodeAPI/package-lock.json
@@ -12,6 +12,7 @@
         "body-parser": "^1.19.0",
         "ejs": "^3.1.6",
         "express": "^4.17.1",
+        "mongodb": "^3.6.8",
         "pug": "^3.0.2",
         "request": "^2.88.2"
       }
@@ -168,6 +169,15 @@
         "tweetnacl": "^0.14.3"
       }
     },
+    "node_modules/bl": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz",
+      "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==",
+      "dependencies": {
+        "readable-stream": "^2.3.5",
+        "safe-buffer": "^5.1.1"
+      }
+    },
     "node_modules/body-parser": {
       "version": "1.19.0",
       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@@ -197,6 +207,14 @@
         "concat-map": "0.0.1"
       }
     },
+    "node_modules/bson": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz",
+      "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg==",
+      "engines": {
+        "node": ">=0.6.19"
+      }
+    },
     "node_modules/bytes": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
@@ -345,6 +363,14 @@
         "node": ">=0.4.0"
       }
     },
+    "node_modules/denque": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz",
+      "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ==",
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
     "node_modules/depd": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@@ -720,6 +746,11 @@
       "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
       "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
     },
+    "node_modules/isarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+    },
     "node_modules/isstream": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
@@ -798,6 +829,12 @@
         "node": ">= 0.6"
       }
     },
+    "node_modules/memory-pager": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
+      "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
+      "optional": true
+    },
     "node_modules/merge-descriptors": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -852,6 +889,44 @@
         "node": "*"
       }
     },
+    "node_modules/mongodb": {
+      "version": "3.6.8",
+      "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz",
+      "integrity": "sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==",
+      "dependencies": {
+        "bl": "^2.2.1",
+        "bson": "^1.1.4",
+        "denque": "^1.4.1",
+        "optional-require": "^1.0.3",
+        "safe-buffer": "^5.1.2"
+      },
+      "engines": {
+        "node": ">=4"
+      },
+      "optionalDependencies": {
+        "saslprep": "^1.0.0"
+      },
+      "peerDependenciesMeta": {
+        "aws4": {
+          "optional": true
+        },
+        "bson-ext": {
+          "optional": true
+        },
+        "kerberos": {
+          "optional": true
+        },
+        "mongodb-client-encryption": {
+          "optional": true
+        },
+        "mongodb-extjson": {
+          "optional": true
+        },
+        "snappy": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/ms": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -892,6 +967,14 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/optional-require": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz",
+      "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA==",
+      "engines": {
+        "node": ">=4"
+      }
+    },
     "node_modules/parseurl": {
       "version": "1.3.3",
       "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -915,6 +998,11 @@
       "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
       "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
     },
+    "node_modules/process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+    },
     "node_modules/promise": {
       "version": "7.3.1",
       "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
@@ -1090,6 +1178,20 @@
         "node": ">= 0.8"
       }
     },
+    "node_modules/readable-stream": {
+      "version": "2.3.7",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+      "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+      "dependencies": {
+        "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"
+      }
+    },
     "node_modules/request": {
       "version": "2.88.2",
       "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
@@ -1151,6 +1253,18 @@
       "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
       "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
     },
+    "node_modules/saslprep": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
+      "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
+      "optional": true,
+      "dependencies": {
+        "sparse-bitfield": "^3.0.3"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
     "node_modules/send": {
       "version": "0.17.1",
       "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
@@ -1198,6 +1312,15 @@
       "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
       "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
     },
+    "node_modules/sparse-bitfield": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
+      "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
+      "optional": true,
+      "dependencies": {
+        "memory-pager": "^1.0.2"
+      }
+    },
     "node_modules/sshpk": {
       "version": "1.16.1",
       "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@@ -1230,6 +1353,14 @@
         "node": ">= 0.6"
       }
     },
+    "node_modules/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==",
+      "dependencies": {
+        "safe-buffer": "~5.1.0"
+      }
+    },
     "node_modules/supports-color": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@@ -1318,6 +1449,11 @@
         "punycode": "^2.1.0"
       }
     },
+    "node_modules/util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+    },
     "node_modules/utils-merge": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
@@ -1500,6 +1636,15 @@
         "tweetnacl": "^0.14.3"
       }
     },
+    "bl": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz",
+      "integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==",
+      "requires": {
+        "readable-stream": "^2.3.5",
+        "safe-buffer": "^5.1.1"
+      }
+    },
     "body-parser": {
       "version": "1.19.0",
       "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@@ -1526,6 +1671,11 @@
         "concat-map": "0.0.1"
       }
     },
+    "bson": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/bson/-/bson-1.1.6.tgz",
+      "integrity": "sha512-EvVNVeGo4tHxwi8L6bPj3y3itEvStdwvvlojVxxbyYfoaxJ6keLgrTuKdyfEAszFK+H3olzBuafE0yoh0D1gdg=="
+    },
     "bytes": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
@@ -1647,6 +1797,11 @@
       "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
       "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
     },
+    "denque": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/denque/-/denque-1.5.0.tgz",
+      "integrity": "sha512-CYiCSgIF1p6EUByQPlGkKnP1M9g0ZV3qMIrqMqZqdwazygIA/YP2vrbcyl1h/WppKJTdl1F85cXIle+394iDAQ=="
+    },
     "depd": {
       "version": "1.1.2",
       "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
@@ -1939,6 +2094,11 @@
       "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
       "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
     },
+    "isarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
+    },
     "isstream": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
@@ -2005,6 +2165,12 @@
       "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
       "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
     },
+    "memory-pager": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz",
+      "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==",
+      "optional": true
+    },
     "merge-descriptors": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
@@ -2041,6 +2207,19 @@
         "brace-expansion": "^1.1.7"
       }
     },
+    "mongodb": {
+      "version": "3.6.8",
+      "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz",
+      "integrity": "sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==",
+      "requires": {
+        "bl": "^2.2.1",
+        "bson": "^1.1.4",
+        "denque": "^1.4.1",
+        "optional-require": "^1.0.3",
+        "safe-buffer": "^5.1.2",
+        "saslprep": "^1.0.0"
+      }
+    },
     "ms": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
@@ -2069,6 +2248,11 @@
         "ee-first": "1.1.1"
       }
     },
+    "optional-require": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz",
+      "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA=="
+    },
     "parseurl": {
       "version": "1.3.3",
       "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
@@ -2089,6 +2273,11 @@
       "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
       "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
     },
+    "process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag=="
+    },
     "promise": {
       "version": "7.3.1",
       "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz",
@@ -2249,6 +2438,20 @@
         "unpipe": "1.0.0"
       }
     },
+    "readable-stream": {
+      "version": "2.3.7",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
+      "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
+      "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"
+      }
+    },
     "request": {
       "version": "2.88.2",
       "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
@@ -2302,6 +2505,15 @@
       "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
       "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
     },
+    "saslprep": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/saslprep/-/saslprep-1.0.3.tgz",
+      "integrity": "sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag==",
+      "optional": true,
+      "requires": {
+        "sparse-bitfield": "^3.0.3"
+      }
+    },
     "send": {
       "version": "0.17.1",
       "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
@@ -2345,6 +2557,15 @@
       "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
       "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
     },
+    "sparse-bitfield": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz",
+      "integrity": "sha1-/0rm5oZWBWuks+eSqzM004JzyhE=",
+      "optional": true,
+      "requires": {
+        "memory-pager": "^1.0.2"
+      }
+    },
     "sshpk": {
       "version": "1.16.1",
       "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
@@ -2366,6 +2587,14 @@
       "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz",
       "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow="
     },
+    "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==",
+      "requires": {
+        "safe-buffer": "~5.1.0"
+      }
+    },
     "supports-color": {
       "version": "5.5.0",
       "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
@@ -2433,6 +2662,11 @@
         "punycode": "^2.1.0"
       }
     },
+    "util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
+    },
     "utils-merge": {
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
diff --git a/NodeAPI/package.json b/NodeAPI/package.json
index 88e2f5e18a65194a003e877c6987df7cf71e3e94..b8baa601aff36ae09cc0894e49e68cf3fc89b8ee 100644
--- a/NodeAPI/package.json
+++ b/NodeAPI/package.json
@@ -12,6 +12,7 @@
     "body-parser": "^1.19.0",
     "ejs": "^3.1.6",
     "express": "^4.17.1",
+    "mongodb": "^3.6.8",
     "pug": "^3.0.2",
     "request": "^2.88.2"
   }
diff --git a/app.py b/app.py
index 80fed2dbcc118df875182d9fc7df6062b018caa2..2169d4f0f1bae4f8c94e08a9fa8a60624127319d 100644
--- a/app.py
+++ b/app.py
@@ -4,6 +4,7 @@ import pickle
 import json
 
 app = Flask(__name__) #Initialize the flask App
+
 model = pickle.load(open('model.pickle', 'rb'))
 mlb = pickle.load(open('mlb.pickle','rb'))
 vectorizer = pickle.load(open('vectorizer.pickle','rb'))
@@ -19,5 +20,6 @@ def predict():
         "predictionRaw": json.dumps(prediction[0].tolist())
     }
 
+
 if __name__ == "__main__":
     app.run(threaded=True)
\ No newline at end of file