Added md5 hash instead of plaintext password
Moved login logic to User model