Added hash

Added sha1 hash functionality for password.
Changed some superfluous code to be shorter. (mostly to update database)