I'll prefer to use the `fieldnames` parameter of the cvs writer, with the name of the fields in a global. Each entry in destination will then be a dictionary with the fields like so:

```python
destination.append({
  'course_id': course_id,
  'position': pos,
  'level': level,
  ...
})
```

That way we don't have to keep the to fields and the entries in sync, and the `--flat` output in json works too.