Added a Markdown Gist extension

Markdown gist extension plus a couple of fixes. Kept them in separate commits.