Fix TOC ID in headers

This resolved problems mentioned in #182: The TOC has links, but
the headers doesn't have IDs so the links don't go anywhere.