cleaned indentation, added hashcheck after dbinsertion

Now hashes will only be signed when the hash that was inserted in the database
was the hash of the data that was inserted, this prevents false signatures.
added login/out functionality, though its's safety is doubtable

The passwords are stored as sha256 hashes, to prevent them being stolen
when the db is accessible for malicous users. A salt is being used to
make sure that people can't use rainbowtables when brute-forcing the hashes