Updating CodeMirror to c813c94 to fix #1344.
Making keyboard shortcut for showing line numbers consistent.
avoid jsonlib returning Decimal

The only functional change is that Decimal objects will no longer come out of jsonlib, but the code that handles jsonlib's two minor differences wrt other json libraries is now a bit clearer and better documented.

Relevant test is added.
Proper error handling for nbformat versions in client code.

1. Users are warned when an older nbformat notebook is converted.
2. The notebook notifies the user when a notebook that is too new
   is attempted to load.

To test these things, create a simple notebook. Then change its
nbformat field by hand to 2 (to test 1) and then 4 (to test 2).
Merge pull request #1362 from minrk/truncate_history_log

Don't log complete contents of history replies, even in debug

This changes the debug message to include only the length of the history reply, rather than its entire contents, which gets huge, and is an impediment to the legibility of debugging output.
Merge pull request #1364 from minrk/jsonlib

avoid jsonlib returning Decimal

Cleanup jsonlib checking code in IPython.zmq.session for readability, and ensure that floating-point numbers come out of messages as floats instead of Decimal when using jsonlib.
Related to #1359. Removing extra $ that older versions sympy add.

Older versions of sympy put in an extra $ when using
latex(e, mode='plain'). We are removing those before we add our
own to make sure it works.
Changes to Math class and added Latex class.

* Math now adds $$ if the user doesn't provide them.
* Latex is like Math, but doesn't add delimiters.
Merge pull request #1361 from ellisonbg/nbissues

A number of bug fixes for notebook issues that had crept up recently with all the major improvements done on multiple fronts.

In closing #1359, we've changed slightly how Math() works: it now unconditionally surrounds its input with $$...$$, so that it always appears in displayed math mode.  We have also introduced a new display object, Latex(), which does *not* add any latex markup, for other constructs beyond simple math expressions.  This change makes Math() friendlier to use in simple cases and means that Math(sympy.latex(foo)) will produce the expected displayed math results without the user having to add any $ markup.

Summary of fixes:

Fixes #1344: Ctrl + M + L does not toggle line numbering in htmlnotebook.

Fixes #1337: Tab in the notebook after `(` should not indent, only give a tooltip.

Fixes #1339: Notebook printing broken.

Fixes #1348: `Ctrl-m-Ctrl-m` does not switch to markdown cell

Fixes #1359: [sympyprinting] MathJax can't render \root{m}{n}
Ensure handler patterns are str, not unicode

Python < 2.6.5 doesn't accept unicode keys in f(**kwargs), and
base_project_url will always be unicode, which will in turn
make the patterns unicode, and ultimately result in unicode
keys in kwargs to handler._execute(**kwargs) in tornado.
This enforces that base_project_url be ascii in that situation.

Note that the URLs these patterns check against are escaped,
and thus guaranteed to be ASCII: 'héllo' is really 'h%C3%A9llo'.

If you actually use u'héllo' in your regex, it will not match the URLs
you think it should.
load header with engine id when engine dies in TaskScheduler

This ensures that the metadata dict on the *Client* has the engine_uuid of the engine on which the task failed.  It is identical to code elsewhere (Hub, Client) for identifying when engines die.
Turn off interactive mode if module_to_run is given.
allow draft76 websockets (Safari)

Safari still uses draft76, and Tornado 2.2.0 release disables the
access from the draft version by default for security reasons.
This simply sets the tornado flag to True, so we can continue
to support Safari until it upgrades to the RFC 6455 implementation.
Adds a quiet keyword to sync_imports to allow users to surpress messages about imports on remote engines.
ipcontroller cleans up connection files unless reuse=True

Connection files are not valid across sessions if reuse is False, but were previously preserved, which could cause engines to try to connect to the wrong ports if the Controller took too long to start and/or write new connection files.

Also shuffles signal-handling around a bit, so that a clean exit occurs, rather than calling sys.exit directly in the signal handler.
remove calls to meaningless ZMQStream.on_err

The event meant to trigger this callback can never be called, and
the method will be deprecated and eventually removed from PyZMQ.
Add test for writing non-ascii characters to file with %hist.
Fix tests for saving non-ascii history.
Fix for %hist saving non-ascii history to file.

Closes gh-1375
Merge pull request #1368 from minrk/asciipatterns

Ensure handler patterns are str, not unicode