Output CSV when asked for ?format=csv

Closes #4