Better clipboard handling, esp. with pywin32

Ensure that we get unicode from the clipboard when using pywin32.
Closes gh-3386

Also catches the empty clipboard case and displays a short error
message, instead of a huge traceback.
add missing pandoc declarations

Shaded environment and highlighting commands required for code in markdown cells

closes #4245
fix ansi coloring

scoping and command names were incorrect
use align environment, not aligned

aligned is only for when you are already inside a math environment (e.g. inside align)
test changes

- add markdown code block to test notebook
- update ansi filter test
Rework setup to allow installing on Python 2 and 3.

Scripts named ipython and ipython[23], etc.

Neither distutils nor setuptools made this easy.
Remove manually written scripts
Add simple smoketest for clipboard access
Add comment to automatically generated scripts.
Merge pull request #4473 from takluyver/setup23

update script generation in setup.py

These changes:
- Give us scripts called `ipython` and (`ipython2` or `ipython3`) for any installation. (and likewise for each of iptest, ipcontroller, etc.)
- Add a new `setup.py symlink` target, to use instead of `develop`, which installs scripts and symlinks the library into site-packages, without using setuptools.
- Removes the static script entry points - all our entry points are now automatically generated.
Merge pull request #4466 from minrk/pandoc-preamble

various pandoc latex fixes

- add missing declarations to latex_base (required for pandoc-highlighted code in markdown)
- fix ansi color in latex, which didn't work in a variety of ways.

closes #4245
Pass nbformat object to write call to save .py script

Closes gh-4495
Add test for saving notebook with .py script
Merge pull request #4496 from takluyver/i4495

Pass nbformat object to write call to save .py script

Closes #4495
Merge pull request #4460 from takluyver/clipboard-improvements

Better clipboard handling, esp. with pywin32
StreamCapturer should die if main process crashes.
Skip clipboard test on *nix systems if headless.

The clipboard is a matter for the X server.
Merge pull request #4499 from takluyver/clipboard_test_x11

Skip clipboard test on *nix systems if headless.
Merge pull request #4498 from takluyver/daemon-streamcapturer

Daemon StreamCapturer

The StreamCapturer should die if the main thread crashes. On Shiningpanda, a failure in another nose plugin has been causing the tests to hang, because the main thread exits, but the StreamCapturer thread is still alive.

Under normal conditions, the thread will still be shut down cleanly - it will only die a messy death if the main thread does.