Login guidance

**DO NOT MERGE**

Supercedes #172.

Had problems with cherry-picking and git submodules again, so shamelessly used the diffs instead. Sorry @jystewart.

My intention is to apply style guide and rewrite for clarity, then ask someone to merge.