writer: make the writer use swh.model objects instead of (possibly) dicts
And annotate the code as we go.