Improve message converstion to MD, add error checking, and improve some styles