Adds ancestry to TOC headers (take 4)

Fixes gollum/gollum#678.

OK so I branched off `rc` for this one and merged in the files from PR#109 so there are no conflicts.

If you wanna do the merge conflict manually, use #109 otherwise close it and use this PR.