Auth refactor to prepare for PYTHON-465.

This also addresses PYTHON-464 and makes
logout sane.