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)
If you are going to be re-indenting everything, can you do it with two spaces? Four space indent in HTML makes it hard to read, since there are so many levels of nesting.