Auth restructure

This places login and logout in the same module.

#26 goes in first.