Refactor the commonmark converter class

Addresses #26.
See previous comment