[BUG] Fixes various bugs in user auth.

I made made the changes Jacob suggested. Let me know if there are any more changes that need to be made. This uses bcrypt for hashing so you may need to create new users.