Use native map when possible

Implemented on all modern browser.

There is a small behavior difference between $.map and Array.prototype.map
but we don't rely on it.

(jQuery flatten arrays and filters null-like)
create new terminals with POST /api/terminals

instead of GET terminals/new

to be consistent with creating new notebooks.

We had to stop using GET notebooks/new
because browsers would create new notebooks when making preview thumbnails for commonly visited pages, etc.
I assume the same issue would apply to terminals
upate exmaple notebooks to nbformat v4
Make a window immediately, and set its location on response

Avoids the need for async:false
Close new window on error creating terminal
Fix bug where cell toolbars are not redrawn,
when cell metadata is changed.
DEV: Support for configurable list of extra jinja template directories.
DEV: Add IPython.html to the default template path.

This makes it possible to override a file with a template that also
inherits from that file.

For example, this makes it possible to override a single block of
notebook.html by creating a file called notebook.html that inherits from
templates/notebook.html.
Add REST API for retrieving, storing and updating config
Fix docstring, validate JSON on PUT
Apply JSON config updates recursively
Fix writing JSON on Python 2
Return updated config from PATCH requests
DOC: Fix typo in comment.
JS Contents API doesn't need dialog module
Merge pull request #6873 from takluyver/contents-api-no-dialog

JS Contents API doesn't need dialog module
Update pygments monkeypatch for compatibility with Pygments 2.0

Closes gh-6877
Add some explanation about the pygments monkeypatch
DOC: Add whatsnew entry for userspace templates.
Merge pull request #6861 from quantopian/template_dir_option

DEV: Support for configurable list of extra jinja template directories.