Overhaul and fix the markdown system