Auth class refactored, repaired and documented.