Ensure base64 always gets byte strings to keep it happy on Python 3
Fix tests that expect to find the CSRF token in a response body