Rewrite markdown directive so that we can use it for modal also.
refs #60
Merging master