HTML emails

Basic code to display and compose messages in HTML.

I added 2 libraries for HTML ⇔ Text (Markdown) conversion, to display pretty HTML if message is text only, and to set the text part of the message when composed in HTML.
We should maybe move this server side, to avoid heavy downloads.
can you please add comment to this whole function? so we have some clues of what it does and how it does it