Valid html

Make notebook (at least /tree/) valid html, ie, closing all tags...

Diff is huge, but second commit just indent things correctly to avoid that again.

to view the "real" diff cf [this](https://github.com/Carreau/ipython/commit/0ae1d518e4de44cb5c534afc79bed168abcf8da2), or better, diff by [ignoring whitespace with `?w=0`](https://github.com/ipython/ipython/pull/7177/files?w=0)