Added automatic hashing of password when saved to database and a method for checking whether a password is the same as the one stored in the database