Extracted a bunch of user related functionality to User.class.php from
Login.class.php.

Added a lot of comments all around. Proper ones.