Add attribution for original TOC generator
Preserve existing headline id values in TOC

If headlines already have id values defined, use these in the TOC
instead of autogenerating new ones.
Simplify the TOC generator a bit

The TOC generator has a lot of options, most of which we don't use.
Simpler is better, since future folks may have to figure out how it
works.