Improve integration test

Use some constants for tokens.
Refactor tokenfile to function.
Add expected status code to functions, and make most of them succeed.
Check for that status code, rather than allowing  a range of them.
Close Body so that we don't run out of file handles.
Get user from request and put in authz attribs.

Added integration tests for user-based auth.