Fixed bug 2040 relating to the last character being chopped off in the html2text conversion.
Fixed bug 2040 relating to the last character being chopped off in the
html2text conversion.

While there I tidied up the source and fixed up a problem where the links
were being printed BEFORE the text they refer to (now they are directly after)

dilawar/moodle