Improve modularity of markdown.php