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
fix: allow JS test to run after shutdown test

shutdown notebook test closes casper browser, here we re-instatiate it
after the test
don't delete casper instance on shutdown test

a lunch conversation with @minrk and @takluyver lead me to just make a
popup and have it be closed, instead of having to reorder the test suite
so that this test always runs last. Now it doesn't matter what order the
test suite runs in, and gives us a pattern for testing window closing
behavior should we need it elsewhere.
Merge pull request #4451 from ivanov/shutdown-js

fix: allow JS test to run after shutdown test
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