Support setting the base heading level for Markdown output.

Also removes an unused private function.
Fix compilation of Diet includes.