Add reentrant conversion to Showdown footnotes.

Fixes #4668.

However, note that multi-paragraph footnotes are still broken. I'm not sure how to fix this; there seems to be the intention that it should work, but I don't really understand the code, and for my purposes, just inline formatting is good enough for my footnotes.
Sorry for the confusion. The code adds the return-to-text link at the end of the last paragraph of the markup generated by the footnote comment. This involves regex hackery and the code should make it more clear.

So: we remove the final end P tag, and add our own ending including the return link. We don't add an opening P tag, because it's already added by the Markdown conversion.

Relatedly, the comment at the top of the file indicates that the footnotes extension should handle multi-paragraph footnotes, but I don't think this is the case.

If anyone is interested in making the code clearer, perhaps by way of comments, that would be great, because I am just about to embark on a cross-country road trip. If not, maybe I'll get bored in the backseat and do it myself!