ClearFuncs refactoring

Finally pulling out and cleaning up all that duplicate auth code in ClearFuncs(). This should start to clear enough dust away to be able to see into a restructuring of some eauth routines.