Fix up auth process to be a bit better code-wise. Next up? UI!