Refactor couch_httpd_auth's AuthModule construct

We were missing the change necessary to upgrade user documents with the
move to pbkdf2 in a cluster. This also adds the ability for an
AuthModule to return a context that will be used when updating user
credentials.

COUCHDB-2491
Export session utility functions

Other auth solutions will want to reuse these functions. These should
probably be moved to a separate auth utility module but this seems like
the most prudent course of action.

COUCHDB-2491
Merge branch '2491-refactor-couch-httpd-auth'

Fixes #21