Auth subsystem refactoring and tweaks.