tweaked the document mapper to be more like sqla
implements csvwriter repo