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.
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
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
Merge pull request #4703 from damianavila/math_macro

Mathjax macro in jinja HTML templates.
Merge pull request #4565 from minrk/format_check

various display type validations

to protect notebooks from invalid display data, and add informative errors for invalid data.