New typed document classes

new public classes which can be read / written from external code.
Added basic (not fully functional) CommonMark export
Visitor pattern for AST / HTML / CommonMark export.

(Sorry for the large commit)
visitor pattern cleanup

the whole iteration stuff should ne be implemented in the document
class.