docs: Warning about consuming response
http: improve chunked res.write(buf) performance

Avoid a costly buffer-to-string operation. Instead, allocate a new
buffer, copy the chunk header and data into it and send that.

The speed difference is negligible on small payloads but it really
shines with larger (10+ kB) chunks. benchmark/http/end-vs-write-end
with 64 kB chunks gives 45-50% higher throughput. With 1 MB chunks,
the difference is a staggering 590%.

Of course, YMMV will vary with real workloads and networks but this
commit should have a positive impact on CPU and memory consumption.

Big kudos to Wyatt Preul (@wpreul) for reporting the issue and providing
the initial patch.

Fixes #5941 and #5944.
events: fix memory leak, don't leak event names

Before this commit, events were set to undefined rather than deleted
from the EventEmitter's backing dictionary for performance reasons:
`delete obj.key` causes a transition of the dictionary's hidden class
and that can be costly.

Unfortunately, that introduces a memory leak when many events are added
and then removed again. The strings containing the event names are never
reclaimed by the garbage collector because they remain part of the
dictionary.

That's why this commit makes EventEmitter delete events again. This
effectively reverts commit 0397223.

Fixes #5970.
test: fix pummel/test-net-connect-memleak

* Run the garbage collector before creating the big array. It doesn't
  matter now but if in the future something in node.js core creates
  a lot of reclaimable garbage, that will break the test's expectation.

* The first RSS check was being done too late. The garbage collector
  might have run before the check, throwing off the 'reclaimed memory'
  calculation.

* Due to changes in how V8 represents the big array internally, the
  actual memory usage is just below 256 MB on x64. Update the test's
  expectation.
test: future-proof simple/test-event-emitter-memory-leak

Run the garbage collector before running the actual test. It doesn't
matter now but if in the future something in node.js core creates a lot
of reclaimable garbage, that will break the test's expectation.
npm: Upgrade to 1.3.7
tls: fix handling of `SNICallback` server option

It shouldn't ignore it!

There're two possibile cases, which should be handled properly:

1. Having a default `SNICallback` which is using contexts, added with
  `server.addContext(...)` routine
2. Having a custom `SNICallback`.

In first case we may want to opt-out setting `.onsniselect` method (and
thus save some CPU time), if there're no contexts added. But, if custom
`SNICallback` is used, `.onsniselect` should always be set, because
server contexts don't affect it.
v8: fix openbsd build

This is [1] applied ahead of time. Summary:

    OpenBSD doesn't have <ucontext.h>. ucontext_t lives in <signal.h>
    and is a typedef for struct sigcontext. There is no uc_mcontext.

[1] https://codereview.chromium.org/21705003/
doc: fs.open, fix flag/mode confusion, etc.

Flags and modes aren't the same, symlinks are followed in all of the
path but the last component, docs should say something about what the
mode argument is for and when its used, fs.openSync should point to the
function that contains the docs for its args, as fs.writeSync does.
doc: document domain.enter() and domain.exit()

Adds the documentation requested in #5017.
v8: back-port fix for CVE-2013-2882

Quoting the CVE:

    Google V8, as used in Google Chrome before 28.0.1500.95, allows
    remote attackers to cause a denial of service or possibly have
    unspecified other impact via vectors that leverage "type confusion."

Likely has zero impact on node.js because it only runs local, trusted
code but let's apply it anyway.

This is a back-port of upstream commit r15665. Original commit log:

    Use internal array as API function cache.

    R=yangguo@chromium.org
    BUG=chromium:260106
    TEST=cctest/test-api/Regress260106

    Review URL: https://codereview.chromium.org/19159003

Fixes #5973.
http: Fix overlooked agent.globalAgent export

Noticed by @bnoordhuis in https://github.com/joyent/node/pull/5991#discussion_r5575946
https: fix default port

https.get('https://github.com/') should use port 443, not 80.
test: Move test-http-default-port from disabled to simple
doc: Update LICENSE for npm's Artistic 2.0
build: embed the mdb_v8.so into the binary

This builds and includes the mdb_v8.so in the binary of node so mdb
can be sure to always use the latest version
build: fix ia32 sunos, elfwrap only needs -64
doc: add a missing word in streams doc

Ignore encoding *if* chunk is a buffer
repl: Add 'smalloc' to list of known modules
tls_wrap: DRY ClientHelloParser

Share ClientHelloParser code between `tls_wrap.cc` and `node_crypto.cc`.

fix #5959