Implemented the logic for account login.
Allows new account creation.
Improved save().