.js: fix bug in GitHub TOC if first heading is h2

If the very first heading in the MarkDown content is an <h2>, before
there are any <h1> headings, there was previously a bug that prevented
the script from running. This patch fixes this.

Normally, we add <h2> elements as a new sub-list, contained in the
previous <li> element created by an <h1>. If there is no previous <h1>
element, then there is no <li> to add the sub-list to.

There was existing code that was supposed to check this condition, and
create an empty <li> to append the sub-list to, but it was checking if
the wrong element was null (`h1List`, which always exists; we should be
checking `h1li`.)
.js: GitHub TOC script now handles AJAX-y links

Many of GitHub's links aren't plain <a href="..."> links which point
the browser to a new URL, which it loads and executes. Instead, they
use a library called 'pjax' to fetch the new page via AJAX and replace
part of the page with this new content.

This caused a problem for out GitHub TOC because it only ran on page
load. So if a new MarkDown-containing page was loaded via pjax, we
woudn't add/update our TOC for it.

We fix this by creating a DOM Mutation Observer which watches the pjax
content area for new elements which may indicate the page has been
changed. We then re-run our 'add TOC' function.

It's hack-y in some ways, but it seems to work pretty well at the
moment.