Refactoring and removal of all old auth code (hooray)