Implemented token hashing

Now hash digests of tokens are stored in the DB.