Capture only one error
Use axios instead of jQuery.ajax

Gives better errors and also added csrf protection
Display nicer logout error
Allow remote requests to /api/emails

They do not need csrf token
Ensure titles
Add agent.csrfToken for tests
Fix assert messages
Fix csrf tokens for tests