Updating csrf API and middleware
Updating CSRF tests to match new API