Move login helpers into their own file.
Begin process of moving helpers into lib/.

This is probably incredibly annoying for some users but I CANNOT
HELP MYSELF. Sorry.