pass line number in paragraph to line_emit() so that it can be
passed to reenumerate_footnotes()
free footnotes after outputting.
rework generation of footnote mark strings.
remove some debug output
fix footnote mark allocation bugs.