Add AMD support

Wraps `toMarkdown` global in closure and exposes it to Common, AMD and root (window et al).