Lot of md fixes

 * Fixes for output formatting, including internal anchors
 * Fixes for CommonMark compatible md.
 * Documentation for fixes
Fixed broken links