api: per_page now coerces to int
Moved factories into common test module
Added CSV serializer
Adde csv format to api and tided up api view
csv: proper quoting & (better) unicode handling
api: nicer error reporting for invalid requests