Manually document py3compat module.

Automatic documentation doesn't work well with things that have
alternative definitions inside conditional blocks.
Fix "Source" text for the "Other Syntax" section of the notebook

Before it was shown as the "Display" one because of a missing end of
line.
Merge pull request #4533 from ivanov/display-isolated

propagate display metadata to all mimetypes

Additionally, this PR removes in-memory short keys in favor of using mimetype keys within the notebook javascript code, and tests toJSON/fromJSON codepaths for all of the supported mimetypes.

The change fixes the dropping of unrecognized mime-types from the notebook document.
Added a math jinja macro containing the scripts to load mathjax.
Added missing braces.
check return types of formatters

and show error messages when formatters fail
validate that text display data is text

at DisplayObject construction time
Changed name of file from math to mathjax.
protect javascript from invalid mime-type data

everything is a string, if anything else is sent,
drop it so it doesn't show up in the notebook document.
handle (data, metadata) in @check_return
revert output area changes
validate output types in append_output

validates from files, as well as from kernels
xpects typo
test append_output with invalid data
Change location of mathjax macro.
image formatters allow both bytes and unicode (b64-encoded)
b64 unicode literals for images
only load %guiref in qtconsole with python kernels - fixes #4787
Merge pull request #4776 from takluyver/doc-py3compat

Manually document py3compat module.
Merge pull request #4781 from ccordoba12/fix-mathnb

Fix "Source" text for the "Other Syntax" section of the "Typesetting Math" notebook