Numerous cleanups to login functions/forms
Add a few more docs