Auth restructure

This places login and logout in the same module.