Login and registration work.

This has part 1 of the registration work and part of the login work.