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 simple smoketest for clipboard access
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
add `setup.py jsversion`

for writing the IPython version to `IPython.version` in javascript.

supersedes #4357