make close-and-halt work on new tabs in Chrome

this is not possible in Firefox, as new tabs/windows which were *not*
opened via a script ( window.open call ) are not allowed to be closed
via window.close and will yield a message like

--
[11:50:59.691] Scripts may not close windows that were not opened by script. @ http://localhost:8888/static/notebook/js/menubar.js:105
Bundled path.py should not modify the os module
Python 3 compatibility for os.getcwdu()
test that config objects are pickleable
don't create LazyConfigValue on `__` config names

closes #4447
cleanup Config attributes

fixes pickling on Python 3

- don't override get/setattr on dunder names
- fix branching bug in __setitem__
- remove setting `__dict__` attribute
- make _is_section_key a function, not a method
update builtin test - we don't exec in config objects
Merge pull request #4469 from takluyver/py3-getcwdu

Python 3 & getcwdu

We were using the os.getcwdu() function in several places. That doesn't exist on Python 3, but the path.py module was masking that by setting os.getcwdu = os.getcwd. As described in #4462, however, that didn't always work.

This adds a reference in py3compat which points to getcwd on Python 3 and getcwdu in Python 2.
Merge pull request #4410 from ivanov/close-new-tabs-chrome

make close-and-halt work on new tabs in Chrome
Allow incremental builds of the html_noapi docs target
remove unnecessary builtin import
reorder branches in Config.__getitem__

clearer and less duplication this way
don't report that undefined sections are present
test getattr / getitem behavior in Config

for both section and non-section keys when undefined

- get(Section) will create the section and return it
- get(not_section) will create LazyConfigValue and return it
copy values in Config.merge
don't recursively reassign config in Exporter._config_changed
fix TemplateExporter's inheritance from Exporter
Merge pull request #4470 from minrk/pickleconfig

Various Config object cleanups
Merge pull request #4477 from takluyver/html_noapi_incremental

Allow incremental builds of the html_noapi docs target
fix typo in message spec doc

complete_reply have a `matched_text` and not a `text` field.

Fixes  #4485