Add failing test for gh-3547
Simplify caching of modules from %run-ing scripts.

Previously, we cleared and re-used a single FakeModule instance in which to
run cells, and cached copies of the modules' namespaces to prevent them from
being cleared. Now, we cache one FakeModule instance per script file, clearing
it and re-using it if the same script is re-run. This seems more robust.

Closes gh-3547
Another passing test :-)
Minor tweak to test for Python 3
Mention API changes in whatsnew doc
added examples and info for nbconvert
more informative "template not found" message
added listing of known exporters on error
print supported TARGETs for nbconvert --help
Update docstring of new_main_mod() method
Capture error messages while stopping ipython clusters using batch (qdel, bkill) commands. Helps diagnosing issues during cluster shutdown, which are otherwise silently ignored.
Merge pull request #3600 from chapmanb/master

Improved logging for errors during BatchLauncher.stop

This is a logging/debugging improvement that catches and reports errors when shutting down clusters using a BatchLauncher (qdel/bkill). The previous behavior was to silently fail if the external command failed. The patch captures error output and reports potential issues to the log.
Merge pull request #3594 from Carreau/fixes-3563

Fix duplicate completion in notebook

comparaison between kernel completion and context-completin were
returning duplicate entry in some cases, due to trailing space.
sripping trailing space in comparaison prevent this.

closes #3563
Merge pull request #3583 from ivanov/nb-small-things

Merged
Merge pull request #3555 from takluyver/i3547

Simplify caching of modules with %run.

Previously, we cleared and re-used a single FakeModule instance in which to run scripts, and cached copies of the modules' namespaces to prevent them from being cleared. Now, we cache one FakeModule instance per script file, clearing it and re-using it if the same script is re-run.

Closes #3547, and fixes another test that was marked as a known failure.
statelessify matjaxutils

stateless-ification of function that was using module level
variable to share data.

Now varaible are passed around, and usage of replace math
require user to pass a return value of remove_math around