Improved authentication system.

A new authentication option is provided, AuthRequestAttribute, that
looks at a servlet request attribute for the userId. This is useful for
getting authentication info from services like Shibboleth.
Cleaned up how internal errors are generated.
Worked on "add to index" operation.

Note that this is part of the experimental "private user indices"
functionality that is off by default.