Add ancestry to TOC anchors (take 2)

Fixes gollum/gollum#678, take 2 of #87.