Factor out CORS tests
Turn corsify_view into a decorator