diff --git a/core/includes/common.inc b/core/includes/common.inc
index dfd20fa..8f17293 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -4160,7 +4160,7 @@ function drupal_render_cid_parts($granularity = NULL) {
     // resource drag for sites with many users, so when a module is being
     // equivocal, we favor the less expensive 'PER_ROLE' pattern.
     if ($granularity & DRUPAL_CACHE_PER_ROLE) {
-      $cid_parts[] = 'r.' . implode(',', $user->roles);
+      $cid_parts[] = 'r.' . implode(',', $user->getRoles());
     }
     elseif ($granularity & DRUPAL_CACHE_PER_USER) {
       $cid_parts[] = 'u.' . $user->id();
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index eefe926..50b87b6 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -2535,8 +2535,8 @@ function install_configure_form_submit($form, &$form_state) {
   // We precreated user 1 with placeholder values. Let's save the real values.
   $account = user_load(1);
   $account->init = $account->mail = $form_state['values']['account']['mail'];
-  $account->roles = !empty($account->roles) ? $account->roles : array();
-  $account->status = 1;
+  $account->roles = $account->getRoles();
+  $account->activate();
   $account->timezone = $form_state['values']['date_default_timezone'];
   $account->pass = $form_state['values']['account']['pass'];
   $account->name = $form_state['values']['account']['name'];
diff --git a/core/includes/session.inc b/core/includes/session.inc
index 572ac21..ae37211 100644
--- a/core/includes/session.inc
+++ b/core/includes/session.inc
@@ -113,10 +113,10 @@ function _drupal_session_read($sid) {
   // We found the client's session record and they are an authenticated,
   // active user.
   if ($values && $values['uid'] > 0 && $values['status'] == 1) {
-    $user = new UserSession($values);
     // Add roles element to $user.
     $rids = db_query("SELECT ur.rid FROM {users_roles} ur WHERE ur.uid = :uid", array(':uid' => $user->id()))->fetchCol();
-    $user->roles = array_merge(array(DRUPAL_AUTHENTICATED_RID), $rids);
+    $values['roles'] = array_merge(array(DRUPAL_AUTHENTICATED_RID), $rids);
+    $user = new UserSession($values);
   }
   elseif ($user) {
     // The user is anonymous or blocked. Only preserve two fields from the
@@ -177,7 +177,7 @@ function _drupal_session_write($sid, $value) {
 
     // For performance reasons, do not update the sessions table, unless
     // $_SESSION has changed or more than 180 has passed since the last update.
-    if ($is_changed || !isset($user->timestamp) || REQUEST_TIME - $user->timestamp > settings()->get('session_write_interval', 180)) {
+    if ($is_changed || !$user->getLastAccessedTime() || REQUEST_TIME - $user->getLastAccessedTime() > settings()->get('session_write_interval', 180)) {
       // Either ssid or sid or both will be added from $key below.
       $fields = array(
         'uid' => $user->id(),
@@ -214,7 +214,7 @@ function _drupal_session_write($sid, $value) {
     }
 
     // Likewise, do not update access time more than once per 180 seconds.
-    if ($user->isAuthenticated() && REQUEST_TIME - $user->access > settings()->get('session_write_interval', 180)) {
+    if ($user->isAuthenticated() && REQUEST_TIME - $user->getLastAccessedTime() > settings()->get('session_write_interval', 180)) {
       db_update('users')
         ->fields(array(
           'access' => REQUEST_TIME
diff --git a/core/lib/Drupal/Core/Password/PasswordInterface.php b/core/lib/Drupal/Core/Password/PasswordInterface.php
index e14a6d8..76908cf 100644
--- a/core/lib/Drupal/Core/Password/PasswordInterface.php
+++ b/core/lib/Drupal/Core/Password/PasswordInterface.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\Core\Password;
 
+use Drupal\user\UserInterface;
+
 /**
  * Secure password hashing functions for user authentication.
  */
@@ -32,13 +34,13 @@ public function hash($password);
    *
    * @param string $password
    *   A plain-text password
-   * @param Drupal\user\User
-   *   A user object with at least the fields from the {users} table.
+   * @param \Drupal\user\UserInterface $account
+   *   A user entity.
    *
-   * @return bolean.
+   * @return boolean.
    *   TRUE or FALSE.
    */
-  public function check($password, $account);
+  public function check($password, UserInterface $account);
 
   /**
    * Check whether a user's hashed password needs to be replaced with a new hash.
@@ -53,12 +55,12 @@ public function check($password, $account);
    * Alternative implementations of this function might use other criteria based
    * on the fields in $account.
    *
-   * @param Drupal\user\User
-   *   A user object with at least the fields from the {users} table.
+   * @param \Drupal\user\UserInterface $account
+   *   A user entity.
    *
    * @return boolean
    *   TRUE or FALSE.
    */
-  public function userNeedsNewHash($account);
+  public function userNeedsNewHash(UserInterface $account);
 
 }
diff --git a/core/lib/Drupal/Core/Password/PhpassHashedPassword.php b/core/lib/Drupal/Core/Password/PhpassHashedPassword.php
index e14ab4b4..0f943a4 100644
--- a/core/lib/Drupal/Core/Password/PhpassHashedPassword.php
+++ b/core/lib/Drupal/Core/Password/PhpassHashedPassword.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Password;
 
 use Drupal\Component\Utility\Crypt;
+use Drupal\user\UserInterface;
 
 /**
  * Secure password hashing functions based on the Portable PHP password
@@ -214,16 +215,16 @@ public function hash($password) {
   /**
    * Implements Drupal\Core\Password\PasswordInterface::checkPassword().
    */
-  public function check($password, $account) {
-    if (substr($account->pass, 0, 2) == 'U$') {
+  public function check($password, UserInterface $account) {
+    if (substr($account->getPassword(), 0, 2) == 'U$') {
       // This may be an updated password from user_update_7000(). Such hashes
       // have 'U' added as the first character and need an extra md5() (see the
       // Drupal 7 documentation).
-      $stored_hash = substr($account->pass, 1);
+      $stored_hash = substr($account->getPassword(), 1);
       $password = md5($password);
     }
     else {
-      $stored_hash = $account->pass;
+      $stored_hash = $account->getPassword();
     }
 
     $type = substr($stored_hash, 0, 3);
@@ -248,14 +249,14 @@ public function check($password, $account) {
   /**
    * Implements Drupal\Core\Password\PasswordInterface::userNeedsNewHash().
    */
-  public function userNeedsNewHash($account) {
+  public function userNeedsNewHash(UserInterface $account) {
     // Check whether this was an updated password.
-    if ((substr($account->pass, 0, 3) != '$S$') || (strlen($account->pass) != static::HASH_LENGTH)) {
+    if ((substr($account->getPassword(), 0, 3) != '$S$') || (strlen($account->getPassword()) != static::HASH_LENGTH)) {
       return TRUE;
     }
     // Ensure that $count_log2 is within set bounds.
     $count_log2 = $this->enforceLog2Boundaries($this->countLog2);
     // Check whether the iteration count used differs from the standard number.
-    return ($this->getCountLog2($account->pass) !== $count_log2);
+    return ($this->getCountLog2($account->getPassword()) !== $count_log2);
   }
 }
diff --git a/core/lib/Drupal/Core/Session/AccountInterface.php b/core/lib/Drupal/Core/Session/AccountInterface.php
index 3771437..62420a2 100644
--- a/core/lib/Drupal/Core/Session/AccountInterface.php
+++ b/core/lib/Drupal/Core/Session/AccountInterface.php
@@ -114,4 +114,22 @@ public function getPreferredAdminLangcode($default = NULL);
    */
   public function getUsername();
 
+  /**
+   * Returns the e-mail address of this account.
+   *
+   * @return string
+   *   The e-mail address.
+   */
+  public function getEmail();
+
+  /**
+   * The timestamp when the account last accessed the site.
+   *
+   * A value of 0 means the user has never accessed the site.
+   *
+   * @return int
+   *   Timestamp of the last access.
+   */
+  public function getLastAccessedTime();
+
 }
diff --git a/core/lib/Drupal/Core/Session/UserSession.php b/core/lib/Drupal/Core/Session/UserSession.php
index b3dae61..0745db1 100644
--- a/core/lib/Drupal/Core/Session/UserSession.php
+++ b/core/lib/Drupal/Core/Session/UserSession.php
@@ -35,7 +35,7 @@ class UserSession implements AccountInterface {
    *
    * @var array
    */
-  public $roles;
+  protected $roles;
 
   /**
    * Session ID.
@@ -63,7 +63,7 @@ class UserSession implements AccountInterface {
    *
    * @var string.
    */
-  public $timestamp;
+  protected $timestamp;
 
   /**
    * The name of this account.
@@ -87,6 +87,13 @@ class UserSession implements AccountInterface {
   protected $preferred_admin_langcode;
 
   /**
+   * The e-mail address of this account.
+   *
+   * @var string
+   */
+  protected $mail;
+
+  /**
    * Constructs a new user session.
    *
    * @param array $values
@@ -182,4 +189,19 @@ public function getUsername() {
     return $name;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getEmail() {
+    return $this->mail;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getLastAccessedTime() {
+    return $this->timestamp;
+  }
+
+
 }
diff --git a/core/modules/block/lib/Drupal/block/BlockAccessController.php b/core/modules/block/lib/Drupal/block/BlockAccessController.php
index 372e56d..a4827e5 100644
--- a/core/modules/block/lib/Drupal/block/BlockAccessController.php
+++ b/core/modules/block/lib/Drupal/block/BlockAccessController.php
@@ -42,7 +42,7 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
     // For blocks with roles associated, if none of the user's roles matches
     // the settings from this block, access is denied.
     $visibility = $entity->get('visibility');
-    if (!empty($visibility['role']['roles']) && !array_intersect(array_filter($visibility['role']['roles']), $user->roles)) {
+    if (!empty($visibility['role']['roles']) && !array_intersect(array_filter($visibility['role']['roles']), $user->getRoles())) {
       // No match.
       return FALSE;
     }
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php
index ebbdd18..551604d 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockCacheTest.php
@@ -46,7 +46,7 @@ function setUp() {
     $this->normal_user_alt = $this->drupalCreateUser();
     // Sync the roles, since drupalCreateUser() creates separate roles for
     // the same permission sets.
-    $this->normal_user_alt->roles = $this->normal_user->roles;
+    $this->normal_user_alt->roles = $this->normal_user->getRoles();
     $this->normal_user_alt->save();
 
     // Enable our test block.
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index f436966..e9f4c6c 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -1429,7 +1429,7 @@ function comment_preview(Comment $comment) {
 
     if ($account->id()) {
       $comment->uid->target_id = $account->id();
-      $comment->name->value = check_plain($account->name);
+      $comment->name->value = check_plain($account->getUsername());
     }
     elseif (empty($comment->name->value)) {
       $comment->name->value = config('user.settings')->get('anonymous');
@@ -1530,8 +1530,8 @@ function template_preprocess_comment(&$variables) {
     $variables['user_picture'] = array();
   }
 
-  if (config('user.settings')->get('signatures') && !empty($account->signature)) {
-    $variables['signature'] = check_markup($account->signature, $account->signature_format, '', TRUE) ;
+  if (config('user.settings')->get('signatures') && $account->getSignature()) {
+    $variables['signature'] = check_markup($account->getSignature(), $account->getSignatureFormat(), '', TRUE) ;
   }
   else {
     $variables['signature'] = '';
diff --git a/core/modules/comment/comment.tokens.inc b/core/modules/comment/comment.tokens.inc
index 213f352..59483cb 100644
--- a/core/modules/comment/comment.tokens.inc
+++ b/core/modules/comment/comment.tokens.inc
@@ -139,8 +139,7 @@ function comment_tokens($type, $tokens, array $data = array(), array $options =
 
         case 'mail':
           if ($comment->uid->target_id != 0) {
-            $account = user_load($comment->uid->target_id);
-            $mail = $account->mail;
+            $mail = $comment->uid->entity->getEmail();
           }
           else {
             $mail = $comment->mail->value;
diff --git a/core/modules/comment/lib/Drupal/comment/CommentFormController.php b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
index 2264290..84c87c5 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentFormController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentFormController.php
@@ -66,7 +66,7 @@ public function form(array $form, array &$form_state) {
     }
     else {
       if ($user->isAuthenticated()) {
-        $author = $user->name;
+        $author = $user->getUsername();
       }
       else {
         $author = ($comment->name->value ? $comment->name->value : '');
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php
index 27dbf17..5bad9ea 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/Core/Entity/Comment.php
@@ -302,7 +302,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) {
       // We test the value with '===' because we need to modify anonymous
       // users as well.
       if ($this->uid->target_id === $user->id() && $user->isAuthenticated()) {
-        $this->name->value = $user->name;
+        $this->name->value = $user->getUsername();
       }
       // Add the values which aren't passed into the function.
       $this->thread->value = $thread;
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
index f4ef8cf..3ee5bbe 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentAnonymousTest.php
@@ -70,7 +70,7 @@ function testAnonymous() {
     // Ensure anonymous users cannot post in the name of registered users.
     $langcode = Language::LANGCODE_NOT_SPECIFIED;
     $edit = array(
-      'name' => $this->admin_user->name,
+      'name' => $this->admin_user->getUsername(),
       'mail' => $this->randomName() . '@example.com',
       'subject' => $this->randomName(),
       "comment_body[$langcode][0][value]" => $this->randomName(),
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
index ed1a528..8c99d68 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentInterfaceTest.php
@@ -80,8 +80,8 @@ function testCommentInterface() {
 
     // Test changing the comment author to a verified user.
     $this->drupalGet('comment/' . $comment->id() . '/edit');
-    $comment = $this->postComment(NULL, $comment->comment_body->value, $comment->subject->value, array('name' => $this->web_user->name));
-    $this->assertTrue($comment->name->value == $this->web_user->name && $comment->uid->target_id == $this->web_user->id(), 'Comment author successfully changed to a registered user.');
+    $comment = $this->postComment(NULL, $comment->comment_body->value, $comment->subject->value, array('name' => $this->web_user->getUsername()));
+    $this->assertTrue($comment->name->value == $this->web_user->getUsername() && $comment->uid->target_id == $this->web_user->id(), 'Comment author successfully changed to a registered user.');
 
     $this->drupalLogout();
 
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
index a0f0cdc..d36d838 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
@@ -52,7 +52,7 @@ function testCommentLinks() {
 
     // Remove additional user permissions from $this->web_user added by setUp(),
     // since this test is limited to anonymous and authenticated roles only.
-    $roles = $this->web_user->roles;
+    $roles = $this->web_user->getRoles();
     entity_delete_multiple('user_role', array(reset($roles)));
 
     // Matrix of possible environmental conditions and configuration settings.
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
index 0b7cd20..d34ed55 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentPreviewTest.php
@@ -92,7 +92,7 @@ function testCommentEditPreviewSave() {
     $date = new DrupalDateTime('2008-03-02 17:23');
     $edit['subject'] = $this->randomName(8);
     $edit['comment_body[' . $langcode . '][0][value]'] = $this->randomName(16);
-    $edit['name'] = $web_user->name;
+    $edit['name'] = $web_user->getUsername();
     $edit['date[date]'] = $date->format('Y-m-d');
     $edit['date[time]'] = $date->format('H:i:s');
     $raw_date = $date->getTimestamp();
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
index 0880901..a037965 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
@@ -56,7 +56,7 @@ function testCommentTokenReplacement() {
     $tests['[comment:cid]'] = $comment->id();
     $tests['[comment:hostname]'] = check_plain($comment->hostname->value);
     $tests['[comment:name]'] = filter_xss($comment->name->value);
-    $tests['[comment:mail]'] = check_plain($this->admin_user->mail);
+    $tests['[comment:mail]'] = check_plain($this->admin_user->getEmail());
     $tests['[comment:homepage]'] = check_url($comment->homepage->value);
     $tests['[comment:title]'] = filter_xss($comment->subject->value);
     $tests['[comment:body]'] = $comment->comment_body->processed;
@@ -69,7 +69,7 @@ function testCommentTokenReplacement() {
     $tests['[comment:node:nid]'] = $comment->nid->target_id;
     $tests['[comment:node:title]'] = check_plain($node->title);
     $tests['[comment:author:uid]'] = $comment->uid->target_id;
-    $tests['[comment:author:name]'] = check_plain($this->admin_user->name);
+    $tests['[comment:author:name]'] = check_plain($this->admin_user->getUsername());
 
     // Test to make sure that we generated something for each token.
     $this->assertFalse(in_array(0, array_map('strlen', $tests)), 'No empty tokens generated.');
@@ -82,13 +82,13 @@ function testCommentTokenReplacement() {
     // Generate and test unsanitized tokens.
     $tests['[comment:hostname]'] = $comment->hostname->value;
     $tests['[comment:name]'] = $comment->name->value;
-    $tests['[comment:mail]'] = $this->admin_user->mail;
+    $tests['[comment:mail]'] = $this->admin_user->getEmail();
     $tests['[comment:homepage]'] = $comment->homepage->value;
     $tests['[comment:title]'] = $comment->subject->value;
     $tests['[comment:body]'] = $comment->comment_body->value;
     $tests['[comment:parent:title]'] = $parent_comment->subject->value;
     $tests['[comment:node:title]'] = $node->title;
-    $tests['[comment:author:name]'] = $this->admin_user->name;
+    $tests['[comment:author:name]'] = $this->admin_user->getUsername();
 
     foreach ($tests as $input => $expected) {
       $output = $token_service->replace($input, array('comment' => $comment), array('langcode' => $language_interface->id, 'sanitize' => FALSE));
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index 6412d32..a8a49d6 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -6,6 +6,7 @@
  */
 
 use Drupal\contact\Plugin\Core\Entity\Category;
+use Drupal\user\UserInterface;
 
 /**
  * Implements hook_help().
@@ -122,7 +123,7 @@ function contact_menu() {
  *
  * @see contact_menu()
  */
-function _contact_personal_tab_access($account) {
+function _contact_personal_tab_access(UserInterface $account) {
   global $user;
 
   // Anonymous users cannot have contact forms.
@@ -141,7 +142,7 @@ function _contact_personal_tab_access($account) {
   }
 
   // If requested user has been blocked, do not allow users to contact them.
-  if (empty($account->status)) {
+  if ($account->isBlocked()) {
     return FALSE;
   }
 
@@ -274,7 +275,7 @@ function contact_mail($key, &$message, $params) {
     $variables['!sender-url'] = url($sender_uri['path'], array('absolute' => TRUE, 'language' => $language) + $sender_uri['options']);
   }
   else {
-    $variables['!sender-url'] = $params['sender']->mail;
+    $variables['!sender-url'] = $params['sender']->getEmail();
   }
 
   $options = array('langcode' => $language->id);
diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
index a4abbac..81d95a4 100644
--- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php
+++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
@@ -52,14 +52,14 @@ public function form(array $form, array &$form_state) {
     // prevent the impersonation of other users.
     else {
       $form['name']['#type'] = 'item';
-      $form['name']['#value'] = $user->name;
+      $form['name']['#value'] = $user->getUsername();
       $form['name']['#required'] = FALSE;
-      $form['name']['#markup'] = check_plain(user_format_name($user));
+      $form['name']['#markup'] = check_plain($user->getUsername());
 
       $form['mail']['#type'] = 'item';
-      $form['mail']['#value'] = $user->mail;
+      $form['mail']['#value'] = $user->getEmail();
       $form['mail']['#required'] = FALSE;
-      $form['mail']['#markup'] = check_plain($user->mail);
+      $form['mail']['#markup'] = check_plain($user->getEmail());
     }
 
     // The user contact form has a preset recipient.
@@ -163,7 +163,7 @@ public function save(array $form, array &$form_state) {
     }
     elseif ($recipient = $message->getPersonalRecipient()) {
       // Send to the user in the user's preferred language.
-      $to = $recipient->mail->value;
+      $to = $recipient->getEmail();
       $recipient_langcode = $recipient->getPreferredLangcode();
       $params['recipient'] = $recipient->getBCEntity();
     }
@@ -173,32 +173,32 @@ public function save(array $form, array &$form_state) {
 
     // Send e-mail to the recipient(s).
     $key_prefix = $message->isPersonal() ? 'user' : 'page';
-    drupal_mail('contact', $key_prefix . '_mail', $to, $recipient_langcode, $params, $sender->mail);
+    drupal_mail('contact', $key_prefix . '_mail', $to, $recipient_langcode, $params, $sender->getEmail());
 
     // If requested, send a copy to the user, using the current language.
     if ($message->copySender()) {
-      drupal_mail('contact', $key_prefix . '_copy', $sender->mail, $language_interface->id, $params, $sender->mail);
+      drupal_mail('contact', $key_prefix . '_copy', $sender->getEmail(), $language_interface->id, $params, $sender->getEmail());
     }
 
     // If configured, send an auto-reply, using the current language.
     if (!$message->isPersonal() && $category->reply) {
       // User contact forms do not support an auto-reply message, so this
       // message always originates from the site.
-      drupal_mail('contact', 'page_autoreply', $sender->mail, $language_interface->id, $params);
+      drupal_mail('contact', 'page_autoreply', $sender->getEmail(), $language_interface->id, $params);
     }
 
     \Drupal::service('flood')->register('contact', config('contact.settings')->get('flood.interval'));
     if (!$message->isPersonal()) {
       watchdog('contact', '%sender-name (@sender-from) sent an e-mail regarding %category.', array(
         '%sender-name' => $sender->name,
-        '@sender-from' => $sender->mail,
+        '@sender-from' => $sender->getEmail(),
         '%category' => $category->label(),
       ));
     }
     else {
       watchdog('contact', '%sender-name (@sender-from) sent %recipient-name an e-mail.', array(
         '%sender-name' => $sender->name,
-        '@sender-from' => $sender->mail,
+        '@sender-from' => $sender->getEmail(),
         '%recipient-name' => $message->recipient->name,
       ));
     }
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
index 0f6c72b..7741a3e 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactPersonalTest.php
@@ -72,17 +72,17 @@ function testSendPersonalContactMessage() {
     $mails = $this->drupalGetMails();
     $this->assertEqual(1, count($mails));
     $mail = $mails[0];
-    $this->assertEqual($mail['to'], $this->contact_user->mail);
-    $this->assertEqual($mail['from'], $this->web_user->mail);
+    $this->assertEqual($mail['to'], $this->contact_user->getEmail());
+    $this->assertEqual($mail['from'], $this->web_user->getEmail());
     $this->assertEqual($mail['key'], 'user_mail');
     $variables = array(
       '!site-name' => config('system.site')->get('name'),
       '!subject' => $message['subject'],
-      '!recipient-name' => $this->contact_user->name,
+      '!recipient-name' => $this->contact_user->getUsername(),
     );
     $this->assertEqual($mail['subject'], t('[!site-name] !subject', $variables), 'Subject is in sent message.');
     $this->assertTrue(strpos($mail['body'], t('Hello !recipient-name,', $variables)) !== FALSE, 'Recipient name is in sent message.');
-    $this->assertTrue(strpos($mail['body'], $this->web_user->name) !== FALSE, 'Sender name is in sent message.');
+    $this->assertTrue(strpos($mail['body'], $this->web_user->getUsername()) !== FALSE, 'Sender name is in sent message.');
     $this->assertTrue(strpos($mail['body'], $message['message']) !== FALSE, 'Message body is in sent message.');
   }
 
@@ -154,7 +154,7 @@ function testPersonalContactAccess() {
 
     // Re-create our contacted user as a blocked user.
     $this->contact_user = $this->drupalCreateUser();
-    $this->contact_user->status = 0;
+    $this->contact_user->block();
     $this->contact_user->save();
 
     // Test that blocked users can still be contacted by admin.
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
index 1e21d53..a83be54 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationUITest.php
@@ -169,7 +169,7 @@ protected function assertAuthoringInfo() {
         'created' => REQUEST_TIME - mt_rand(0, 1000),
       );
       $edit = array(
-        'content_translation[name]' => $user->name,
+        'content_translation[name]' => $user->getUsername(),
         'content_translation[created]' => format_date($values[$langcode]['created'], 'custom', 'Y-m-d H:i:s O'),
       );
       $prefix = $index > 0 ? $langcode . '/' : '';
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
index 4930283..cea6282 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Tests/ContentTranslationWorkflowsTest.php
@@ -118,7 +118,7 @@ function testWorkflows() {
   protected function assertWorkflows(UserInterface $user, $expected_status) {
     $default_langcode = $this->langcodes[0];
     $languages = language_list();
-    $args = array('@user_label' => $user->name);
+    $args = array('@user_label' => $user->getUsername());
     $this->drupalLogin($user);
 
     // Check whether the user is allowed to access the entity form in edit mode.
diff --git a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
index 5e3f663..f6abd39 100644
--- a/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
+++ b/core/modules/dblog/lib/Drupal/dblog/Tests/DbLogTest.php
@@ -243,7 +243,7 @@ private function doUser() {
       $ids[] = $row->wid;
     }
     $count_before = (isset($ids)) ? count($ids) : 0;
-    $this->assertTrue($count_before > 0, format_string('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->name)));
+    $this->assertTrue($count_before > 0, format_string('DBLog contains @count records for @name', array('@count' => $count_before, '@name' => $user->getUsername())));
 
     // Login the admin user.
     $this->drupalLogin($this->big_user);
@@ -259,13 +259,13 @@ private function doUser() {
     // Add user.
     // Default display includes name and email address; if too long, the email
     // address is replaced by three periods.
-    $this->assertLogMessage(t('New user: %name %email.', array('%name' => $name, '%email' => '<' . $user->mail . '>')), 'DBLog event was recorded: [add user]');
+    $this->assertLogMessage(t('New user: %name %email.', array('%name' => $name, '%email' => '<' . $user->getEmail() . '>')), 'DBLog event was recorded: [add user]');
     // Login user.
     $this->assertLogMessage(t('Session opened for %name.', array('%name' => $name)), 'DBLog event was recorded: [login user]');
     // Logout user.
     $this->assertLogMessage(t('Session closed for %name.', array('%name' => $name)), 'DBLog event was recorded: [logout user]');
     // Delete user.
-    $message = t('Deleted user: %name %email.', array('%name' => $name, '%email' => '<' . $user->mail . '>'));
+    $message = t('Deleted user: %name %email.', array('%name' => $name, '%email' => '<' . $user->getEmail() . '>'));
     $message_text = truncate_utf8(filter_xss($message, array()), 56, TRUE, TRUE);
     // Verify that the full message displays on the details page.
     $link = FALSE;
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
index f064b77..444bff6 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceSelectionAccessTest.php
@@ -260,7 +260,7 @@ public function testUserHandler() {
         $account = $values;
       }
       $users[$key] = $account;
-      $user_labels[$key] = check_plain($account->name);
+      $user_labels[$key] = check_plain($account->getUsername());
     }
 
     // Test as a non-admin.
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
index 2267b1a..74792c6 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileFieldWidgetTest.php
@@ -241,7 +241,8 @@ function testPrivateFileComment() {
     $user = $this->drupalCreateUser(array('access comments'));
 
     // Grant the admin user required comment permissions.
-    user_role_grant_permissions($this->admin_user->roles[1], array('administer comment fields'));
+    $roles = $this->admin_user->getRoles();
+    user_role_grant_permissions($roles[1], array('administer comment fields'));
 
     // Revoke access comments permission from anon user, grant post to
     // authenticated.
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php
index 87ca50c..a2f840e 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterFormatAccessTest.php
@@ -177,7 +177,8 @@ function testFormatPermissions() {
    */
   function testFormatRoles() {
     // Get the role ID assigned to the regular user.
-    $rid = $this->web_user->roles[0];
+    $roles = $this->web_user->getRoles();
+    $rid = $roles[0];
 
     // Check that this role appears in the list of roles that have access to an
     // allowed text format, but does not appear in the list of roles that have
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
index 486c631..8379ca2 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageUrlRewritingTest.php
@@ -62,7 +62,7 @@ function testUrlRewritingEdgeCases() {
     $request = $this->prepareRequestForGenerator();
     // Check that URL rewriting is not applied to subrequests.
     $this->drupalGet('language_test/subrequest');
-    $this->assertText($this->web_user->name, 'Page correctly retrieved');
+    $this->assertText($this->web_user->getUsername(), 'Page correctly retrieved');
   }
 
   /**
diff --git a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
index e86edbf..075a815 100644
--- a/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
+++ b/core/modules/locale/lib/Drupal/locale/LocaleLookup.php
@@ -74,7 +74,7 @@ public function __construct($langcode, $context, StringStorageInterface $string_
     // Add the current user's role IDs to the cache key, this ensures that, for
     // example, strings for admin menu items and settings forms are not cached
     // for anonymous users.
-    $rids = isset($GLOBALS['user']) ? implode(':', array_keys($GLOBALS['user']->roles)) : '0';
+    $rids = isset($GLOBALS['user']) ? implode(':', array_keys($GLOBALS['user']->getRoles())) : '0';
     parent::__construct("locale:$langcode:$context:$rids", $cache, $lock, array('locale' => TRUE));
   }
 
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
index 473947b..1dbccf9 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTranslationUITest.php
@@ -124,7 +124,7 @@ protected function assertAuthoringInfo() {
         'created' => REQUEST_TIME - mt_rand(0, 1000),
       );
       $edit = array(
-        'name' => $user->name,
+        'name' => $user->getUsername(),
         'date[date]' => format_date($values[$langcode]['created'], 'custom', 'Y-m-d'),
         'date[time]' => format_date($values[$langcode]['created'], 'custom', 'H:i:s'),
       );
diff --git a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
index 2407dfb..c627b12 100644
--- a/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/PageEditTest.php
@@ -132,7 +132,7 @@ function testPageAuthoredBy() {
 
     // Change the authored by field to another user's name (that is not
     // logged in).
-    $edit['name'] = $this->web_user->name;
+    $edit['name'] = $this->web_user->getUsername();
     $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save and keep published'));
     $node = node_load($node->nid, TRUE);
     $this->assertIdentical($node->uid, $this->web_user->id(), 'Node authored by normal user.');
diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php
index a3e0138..0ab0cd4 100644
--- a/core/modules/node/node.api.php
+++ b/core/modules/node/node.api.php
@@ -379,7 +379,7 @@ function hook_node_grants_alter(&$grants, $account, $op) {
 
   if ($op != 'view' && !empty($restricted)) {
     // Now check the roles for this account against the restrictions.
-    foreach ($account->roles as $rid) {
+    foreach ($account->getRoles() as $rid) {
       if (in_array($rid, $restricted)) {
         $grants = array();
       }
diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc
index 7dff75d..c2c1e86 100644
--- a/core/modules/node/node.pages.inc
+++ b/core/modules/node/node.pages.inc
@@ -88,7 +88,7 @@ function node_add($node_type) {
   $langcode = module_invoke('language', 'get_default_langcode', 'node', $type);
   $node = entity_create('node', array(
     'uid' => $user->id(),
-    'name' => (isset($user->name) ? $user->name : ''),
+    'name' => $user->getUsername(),
     'type' => $type,
     'langcode' => $langcode ? $langcode : language_default()->id,
   ))->getBCEntity();
@@ -122,7 +122,7 @@ function node_preview(EntityInterface $node) {
     }
     elseif ($node->uid) {
       $user = user_load($node->uid);
-      $node->name = $user->name;
+      $node->name = $user->getUsername();
     }
 
     $node->changed = REQUEST_TIME;
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
index 345ae8c..653adf7 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CommentAttributesTest.php
@@ -299,7 +299,7 @@ function _testBasicCommentRdfaMarkup($graph, $comment, $account = array()) {
     }
 
     // Author name.
-    $name = empty($account["name"]) ? $this->web_user->name : $account["name"] . " (not verified)";
+    $name = empty($account["name"]) ? $this->web_user->getUsername() : $account["name"] . " (not verified)";
     $expected_value = array(
       'type' => 'literal',
       'value' => $name,
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 3c9bac3..98bd11b 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -387,7 +387,7 @@ function rdf_preprocess_user(&$variables) {
         '#attributes' => array(
           'about' => url($uri['path'], $uri['options']),
           'property' => $name_mapping['properties'],
-          'content' => $account->name,
+          'content' => $account->getUsername(),
           'lang' => '',
         ),
       );
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
index f64a044..2181a77 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchCommentTest.php
@@ -127,7 +127,8 @@ function testSearchResultsComment() {
   function testSearchResultsCommentAccess() {
     $comment_body = 'Test comment body';
     $this->comment_subject = 'Test comment subject';
-    $this->admin_role = $this->admin_user->roles[0];
+    $roles = $this->admin_user->getRoles();
+    $this->admin_role = $roles[0];
 
     // Create a node.
     variable_set('comment_preview_article', DRUPAL_OPTIONAL);
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
index 8d91a82..eabda0f 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchConfigSettingsFormTest.php
@@ -145,8 +145,8 @@ function testSearchModuleDisabling() {
       'user' => array(
         'path' => 'user',
         'title' => 'User',
-        'keys' => $this->search_user->name,
-        'text' => $this->search_user->mail,
+        'keys' => $this->search_user->getUsername(),
+        'text' => $this->search_user->getEmail(),
       ),
       'search_extra_type' => array(
         'path' => 'dummy_path',
diff --git a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
index b9451ad..b9dede6 100644
--- a/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
+++ b/core/modules/search/lib/Drupal/search/Tests/SearchPageTextTest.php
@@ -46,7 +46,7 @@ function testSearchText() {
     $this->assertText(t('Search'));
     $this->assertTitle($title, 'Search page title is correct');
 
-    $edit['keys'] = $this->searching_user->name;
+    $edit['keys'] = $this->searching_user->getUsername();
     $this->drupalPost('search/user', $edit, t('Search'));
     $this->assertText(t('Search'));
     $this->assertTitle($title, 'Search page title is correct');
diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc
index 30530af..7efbf06 100644
--- a/core/modules/shortcut/shortcut.admin.inc
+++ b/core/modules/shortcut/shortcut.admin.inc
@@ -143,7 +143,7 @@ function shortcut_set_switch_submit($form, &$form_state) {
     ));
     $set->save();
     $replacements = array(
-      '%user' => $account->name,
+      '%user' => $account->getUsername(),
       '%set_name' => $set->label(),
       '@switch-url' => url(current_path()),
     );
@@ -161,7 +161,7 @@ function shortcut_set_switch_submit($form, &$form_state) {
     // Switch to a different shortcut set.
     $set = shortcut_set_load($form_state['values']['set']);
     $replacements = array(
-      '%user' => $account->name,
+      '%user' => $account->getUsername(),
       '%set_name' => $set->label(),
     );
     drupal_set_message($account->id() == $user->id() ? t('You are now using the %set_name shortcut set.', $replacements) : t('%user is now using the %set_name shortcut set.', $replacements));
diff --git a/core/modules/shortcut/shortcut.api.php b/core/modules/shortcut/shortcut.api.php
index 567415c..8468c08 100644
--- a/core/modules/shortcut/shortcut.api.php
+++ b/core/modules/shortcut/shortcut.api.php
@@ -32,7 +32,7 @@
  */
 function hook_shortcut_default_set($account) {
   // Use a special set of default shortcuts for administrators only.
-  if (in_array(config('user.settings')->get('admin_role'), $account->roles)) {
+  if (in_array(config('user.settings')->get('admin_role'), $account->getRoles())) {
     return 'admin-shortcuts';
   }
 }
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
index 846d587..e530f91 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/SimpleTestTest.php
@@ -82,7 +82,7 @@ function testInternalBrowser() {
       // Test the maximum redirection option.
       $this->drupalLogout();
       $edit = array(
-        'name' => $user->name,
+        'name' => $user->getUsername(),
         'pass' => $user->pass_raw
       );
       $this->maximumRedirects = 1;
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index f0aa5fd..0a5cc0a 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\ConnectionNotDefinedException;
 use Drupal\Core\Language\Language;
+use Drupal\Core\Session\UserSession;
 use PDO;
 use stdClass;
 use DOMDocument;
@@ -625,7 +626,7 @@ protected function drupalLogin($account) {
     }
 
     $edit = array(
-      'name' => $account->name,
+      'name' => $account->getUsername(),
       'pass' => $account->pass_raw
     );
     $this->drupalPost('user', $edit, t('Log in'));
@@ -634,7 +635,7 @@ protected function drupalLogin($account) {
     if (isset($this->session_id)) {
       $account->session_id = $this->session_id;
     }
-    $pass = $this->assert($this->drupalUserIsLoggedIn($account), format_string('User %name successfully logged in.', array('%name' => $account->name)), 'User login');
+    $pass = $this->assert($this->drupalUserIsLoggedIn($account), format_string('User %name successfully logged in.', array('%name' => $account->getUsername())), 'User login');
     if ($pass) {
       $this->loggedInUser = $account;
     }
@@ -742,12 +743,12 @@ protected function setUp() {
     $conf['simpletest_parent_profile'] = $this->originalProfile;
 
     // Define information about the user 1 account.
-    $this->root_user = (object) array(
+    $this->root_user = new UserSession(array(
       'uid' => 1,
       'name' => 'admin',
       'mail' => 'admin@example.com',
       'pass_raw' => $this->randomName(),
-    );
+    ));
 
     // Reset the static batch to remove Simpletest's batch operations.
     $batch = &batch_get();
@@ -850,7 +851,7 @@ protected function installParameters() {
           'site_mail' => 'simpletest@example.com',
           'account' => array(
             'name' => $this->root_user->name,
-            'mail' => $this->root_user->mail,
+            'mail' => $this->root_user->getEmail(),
             'pass' => array(
               'pass1' => $this->root_user->pass_raw,
               'pass2' => $this->root_user->pass_raw,
diff --git a/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php b/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php
index 2d1c907..15f3801 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Authentication/HttpBasicTest.php
@@ -37,13 +37,13 @@ public static function getInfo() {
   public function testHttpBasic() {
     $account = $this->drupalCreateUser();
 
-    $this->basicAuthGet('router_test/test11', $account->name, $account->pass_raw);
-    $this->assertText($account->name, 'Account name is displayed.');
+    $this->basicAuthGet('router_test/test11', $account->getUsername(), $account->pass_raw);
+    $this->assertText($account->getUsername(), 'Account name is displayed.');
     $this->assertResponse('200', 'HTTP response is OK');
     $this->curlClose();
 
-    $this->basicAuthGet('router_test/test11', $account->name, $this->randomName());
-    $this->assertNoText($account->name, 'Bad basic auth credentials do not authenticate the user.');
+    $this->basicAuthGet('router_test/test11', $account->getUsername(), $this->randomName());
+    $this->assertNoText($account->getUsername(), 'Bad basic auth credentials do not authenticate the user.');
     $this->assertResponse('403', 'Access is not granted.');
     $this->curlClose();
 
@@ -55,7 +55,7 @@ public function testHttpBasic() {
 
     $account = $this->drupalCreateUser(array('access administration pages'));
 
-    $this->basicAuthGet('admin', $account->name, $account->pass_raw);
+    $this->basicAuthGet('admin', $account->getUsername(), $account->pass_raw);
     $this->assertNoLink('Log out', 0, 'User is not logged in');
     $this->assertResponse('403', 'No basic authentication for routes not explicitly defining authentication providers.');
     $this->curlClose();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
index b46f751..d8412b1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
@@ -120,7 +120,7 @@ function testFormatDate() {
     // Create a test user to carry out the tests.
     $test_user = $this->drupalCreateUser();
     $this->drupalLogin($test_user);
-    $edit = array('preferred_langcode' => self::LANGCODE, 'mail' => $test_user->mail, 'timezone' => 'America/Los_Angeles');
+    $edit = array('preferred_langcode' => self::LANGCODE, 'mail' => $test_user->getEmail(), 'timezone' => 'America/Los_Angeles');
     $this->drupalPost('user/' . $test_user->id() . '/edit', $edit, t('Save'));
 
     // Disable session saving as we are about to modify the global $user.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
index ea2b4db..9ad8006 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Datetime/DrupalDateTimeTest.php
@@ -82,7 +82,7 @@ public function testDateTimezone() {
     $this->drupalLogin($test_user);
 
     // Set up the user with a different timezone than the site.
-    $edit = array('mail' => $test_user->mail, 'timezone' => 'Asia/Manila');
+    $edit = array('mail' => $test_user->getEmail(), 'timezone' => 'Asia/Manila');
     $this->drupalPost('user/' . $test_user->id() . '/edit', $edit, t('Save'));
 
     // Disable session saving as we are about to modify the global $user.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
index 0781716..77c816c 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
@@ -118,19 +118,19 @@ protected function assertReadWrite($entity_type) {
     $this->assertTrue($entity->user_id[0] instanceof FieldItemInterface, format_string('%entity_type: Field item implements interface', array('%entity_type' => $entity_type)));
 
     $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->name, $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
 
     // Change the assigned user by entity.
     $new_user = $this->createUser();
     $entity->user_id->entity = $new_user;
     $this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($new_user->name, $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
 
     // Change the assigned user by id.
     $new_user = $this->createUser();
     $entity->user_id->target_id = $new_user->id();
     $this->assertEqual($new_user->id(), $entity->user_id->target_id, format_string('%entity_type: Updated user id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($new_user->name, $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($new_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: Updated user name value can be read.', array('%entity_type' => $entity_type)));
 
     // Try unsetting a field.
     $entity->name->value = NULL;
@@ -218,7 +218,7 @@ protected function assertReadWrite($entity_type) {
     ));
     $this->assertEqual($this->entity_name, $entity->name->value, format_string('%entity_type: Name value can be read.', array('%entity_type' => $entity_type)));
     $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->name, $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
     $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
 
     // Test copying field values.
@@ -329,7 +329,7 @@ protected function assertSave($entity_type) {
     $this->assertEqual(Language::LANGCODE_NOT_SPECIFIED, $entity->langcode->value, format_string('%entity_type: Language code can be read.', array('%entity_type' => $entity_type)));
     $this->assertEqual(language_load(Language::LANGCODE_NOT_SPECIFIED), $entity->langcode->language, format_string('%entity_type: Language object can be read.', array('%entity_type' => $entity_type)));
     $this->assertEqual($this->entity_user->id(), $entity->user_id->target_id, format_string('%entity_type: User id can be read.', array('%entity_type' => $entity_type)));
-    $this->assertEqual($this->entity_user->name, $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
+    $this->assertEqual($this->entity_user->getUsername(), $entity->user_id->entity->name->value, format_string('%entity_type: User name can be read.', array('%entity_type' => $entity_type)));
     $this->assertEqual($this->entity_field_text, $entity->field_test_text->value, format_string('%entity_type: Text field can be read.', array('%entity_type' => $entity_type)));
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index fdb3a70..c4cc4fb 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -384,17 +384,17 @@ function testBreadCrumbs() {
     // Verify breadcrumb on user pages (without menu link) for anonymous user.
     $trail = $home;
     $this->assertBreadcrumb('user', $trail, t('Log in'));
-    $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->name);
+    $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->getUsername());
 
     // Verify breadcrumb on user pages (without menu link) for registered users.
     $this->drupalLogin($this->admin_user);
     $trail = $home;
-    $this->assertBreadcrumb('user', $trail, $this->admin_user->name);
-    $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->name);
+    $this->assertBreadcrumb('user', $trail, $this->admin_user->getUsername());
+    $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->getUsername());
     $trail += array(
-      'user/' . $this->admin_user->id() => $this->admin_user->name,
+      'user/' . $this->admin_user->id() => $this->admin_user->getUsername(),
     );
-    $this->assertBreadcrumb('user/' . $this->admin_user->id() . '/edit', $trail, $this->admin_user->name);
+    $this->assertBreadcrumb('user/' . $this->admin_user->id() . '/edit', $trail, $this->admin_user->getUsername());
 
     // Create a second user to verify breadcrumb on user pages again.
     $this->web_user = $this->drupalCreateUser(array(
@@ -406,23 +406,23 @@ function testBreadCrumbs() {
     // Verify correct breadcrumb and page title on another user's account pages
     // (without menu link).
     $trail = $home;
-    $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->name);
+    $this->assertBreadcrumb('user/' . $this->admin_user->id(), $trail, $this->admin_user->getUsername());
     $trail += array(
-      'user/' . $this->admin_user->id() => $this->admin_user->name,
+      'user/' . $this->admin_user->id() => $this->admin_user->getUsername(),
     );
-    $this->assertBreadcrumb('user/' . $this->admin_user->id() . '/edit', $trail, $this->admin_user->name);
+    $this->assertBreadcrumb('user/' . $this->admin_user->id() . '/edit', $trail, $this->admin_user->getUsername());
 
     // Verify correct breadcrumb and page title when viewing own user account
     // pages (without menu link).
     $trail = $home;
-    $this->assertBreadcrumb('user/' . $this->web_user->id(), $trail, $this->web_user->name);
+    $this->assertBreadcrumb('user/' . $this->web_user->id(), $trail, $this->web_user->getUsername());
     $trail += array(
-      'user/' . $this->web_user->id() => $this->web_user->name,
+      'user/' . $this->web_user->id() => $this->web_user->getUsername(),
     );
     $tree = array(
       'user' => t('My account'),
     );
-    $this->assertBreadcrumb('user/' . $this->web_user->id() . '/edit', $trail, $this->web_user->name, $tree);
+    $this->assertBreadcrumb('user/' . $this->web_user->id() . '/edit', $trail, $this->web_user->getUsername(), $tree);
 
     // Add a Tools menu links for 'user' and $this->admin_user.
     // Although it may be faster to manage these links via low-level API
@@ -437,7 +437,7 @@ function testBreadCrumbs() {
     $link_user = reset($menu_links_user);
 
     $edit = array(
-      'link_title' => $this->admin_user->name . ' link',
+      'link_title' => $this->admin_user->getUsername() . ' link',
       'link_path' => 'user/' . $this->admin_user->id(),
     );
     $this->drupalPost("admin/structure/menu/manage/$menu/add", $edit, t('Save'));
diff --git a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
index 201b58a..6a782ed 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Path/UrlAlterFunctionalTest.php
@@ -37,7 +37,7 @@ function testUrlAlter() {
     $this->drupalLogin($account);
 
     $uid = $account->id();
-    $name = $account->name;
+    $name = $account->getUsername();
 
     // Test a single altered path.
     $this->drupalGet("user/$name");
diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php
index e0e8e10..657138d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionHttpsTest.php
@@ -53,7 +53,7 @@ protected function testHttpsSession() {
     $this->drupalGet('user');
     $form = $this->xpath('//form[@id="user-login-form"]');
     $form[0]['action'] = $this->httpsUrl('user');
-    $edit = array('name' => $user->name, 'pass' => $user->pass_raw);
+    $edit = array('name' => $user->getUsername(), 'pass' => $user->pass_raw);
     $this->drupalPost(NULL, $edit, t('Log in'));
 
     // Test a second concurrent session.
@@ -96,7 +96,7 @@ protected function testHttpsSession() {
     $this->drupalGet('user');
     $form = $this->xpath('//form[@id="user-login-form"]');
     $form[0]['action'] = $this->httpUrl('user');
-    $edit = array('name' => $user->name, 'pass' => $user->pass_raw);
+    $edit = array('name' => $user->getUsername(), 'pass' => $user->pass_raw);
     $this->drupalPost(NULL, $edit, t('Log in'));
     $this->drupalGet($this->httpUrl('admin/config'));
     $this->assertResponse(200);
@@ -152,7 +152,7 @@ protected function testHttpsSession() {
     $form[0]['action'] = $this->httpsUrl('user');
 
     $edit = array(
-      'name' => $user->name,
+      'name' => $user->getUsername(),
       'pass' => $user->pass_raw,
     );
     $this->drupalPost(NULL, $edit, t('Log in'));
diff --git a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
index 220e672..7310de5 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Session/SessionTest.php
@@ -62,12 +62,12 @@ function testSessionSaveRegenerate() {
     // We cannot use $this->drupalLogin($user); because we exit in
     // session_test_user_login() which breaks a normal assertion.
     $edit = array(
-      'name' => $user->name,
+      'name' => $user->getUsername(),
       'pass' => $user->pass_raw
     );
     $this->drupalPost('user', $edit, t('Log in'));
     $this->drupalGet('user');
-    $pass = $this->assertText($user->name, format_string('Found name: %name', array('%name' => $user->name)), 'User login');
+    $pass = $this->assertText($user->getUsername(), format_string('Found name: %name', array('%name' => $user->getUsername())), 'User login');
     $this->_logged_in = $pass;
 
     $this->drupalGet('session-test/id');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
index eb4ba4a..35af9a3 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/AccessDeniedTest.php
@@ -59,7 +59,7 @@ function testAccessDenied() {
     // Log out and check that the user login block is shown on custom 403 pages.
     $this->drupalLogout();
     $this->drupalGet('admin');
-    $this->assertText($this->admin_user->name, 'Found the custom 403 page');
+    $this->assertText($this->admin_user->getUsername(), 'Found the custom 403 page');
     $this->assertText(t('Username'), 'Blocks are shown on the custom 403 page');
 
     // Log back in and remove the custom 403 page.
@@ -87,7 +87,7 @@ function testAccessDenied() {
     // Check that we can log in from the 403 page.
     $this->drupalLogout();
     $edit = array(
-      'name' => $this->admin_user->name,
+      'name' => $this->admin_user->getUsername(),
       'pass' => $this->admin_user->pass_raw,
     );
     $this->drupalPost('admin/config/system/site-information', $edit, t('Log in'));
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php
index a794f77..107d9c7 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PageNotFoundTest.php
@@ -42,6 +42,6 @@ function testPageNotFound() {
     $this->drupalPost('admin/config/system/site-information', $edit, t('Save configuration'));
 
     $this->drupalGet($this->randomName(10));
-    $this->assertText($this->admin_user->name, 'Found the custom 404 page');
+    $this->assertText($this->admin_user->getUsername(), 'Found the custom 404 page');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php
index 92e37be..10ec647 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PasswordHashingTest.php
@@ -35,10 +35,10 @@ function testPasswordHashing() {
     // The md5 password should be flagged as needing an update.
     $this->assertTrue($password_hasher->userNeedsNewHash($account), 'User with md5 password needs a new hash.');
     // Re-hash the password.
-    $old_hash = $account->pass;
+    $old_hash = $account->getPassword();
     $account->pass = $password_hasher->hash($password);
     $this->assertIdentical($password_hasher->getCountLog2($account->pass), $password_hasher::MIN_HASH_COUNT, 'Re-hashed password has the minimum number of log2 iterations.');
-    $this->assertTrue($account->pass != $old_hash, 'Password hash changed.');
+    $this->assertTrue($account->getPassword() != $old_hash, 'Password hash changed.');
     $this->assertTrue($password_hasher->check($password, $account), 'Password check succeeds.');
     // Since the log2 setting hasn't changed and the user has a valid password,
     // $password_hasher->userNeedsNewHash() should return FALSE.
@@ -48,10 +48,10 @@ function testPasswordHashing() {
     $password_hasher = new PhpassHashedPassword($password_hasher::MIN_HASH_COUNT + 1);
     $this->assertTrue($password_hasher->userNeedsNewHash($account), 'User needs a new hash after incrementing the log2 count.');
     // Re-hash the password.
-    $old_hash = $account->pass;
+    $old_hash = $account->getPassword();
     $account->pass = $password_hasher->hash($password);
     $this->assertIdentical($password_hasher->getCountLog2($account->pass), $password_hasher::MIN_HASH_COUNT + 1, 'Re-hashed password has the correct number of log2 iterations.');
-    $this->assertTrue($account->pass != $old_hash, 'Password hash changed again.');
+    $this->assertTrue($account->getPassword() != $old_hash, 'Password hash changed again.');
     // Now the hash should be OK.
     $this->assertFalse($password_hasher->userNeedsNewHash($account), 'Re-hashed password does not need a new hash.');
     $this->assertTrue($password_hasher->check($password, $account), 'Password check succeeds with re-hashed password.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
index a5a689c..5a295a2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/SiteMaintenanceTest.php
@@ -79,7 +79,7 @@ function testSiteMaintenance() {
     // Log in user and verify that maintenance mode message is displayed
     // directly after login.
     $edit = array(
-      'name' => $this->user->name,
+      'name' => $this->user->getUsername(),
       'pass' => $this->user->pass_raw,
     );
     $this->drupalPost(NULL, $edit, t('Log in'));
@@ -108,7 +108,7 @@ function testSiteMaintenance() {
 
     // Submit password reset form.
     $edit = array(
-      'name' => $this->user->name,
+      'name' => $this->user->getUsername(),
     );
     $this->drupalPost('user/password', $edit, t('E-mail new password'));
     $mails = $this->drupalGetMails();
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
index 24dbb26..742ec0f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
@@ -44,9 +44,9 @@ function testTokenReplacement() {
     $source .= '[bogus:token]';        // Non-existent token
 
     $target  = check_plain($node->title);
-    $target .= check_plain($account->name);
+    $target .= check_plain($account->getUsername());
     $target .= format_interval(REQUEST_TIME - $node->created, 2, $language_interface->id);
-    $target .= check_plain($user->name);
+    $target .= check_plain($user->getUsername());
     $target .= format_date(REQUEST_TIME, 'short', '', NULL, $language_interface->id);
 
     // Test that the clear parameter cleans out non-existent tokens.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php
index 843106e..226213b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/FastTest.php
@@ -39,8 +39,8 @@ function setUp() {
    */
   function testUserAutocomplete() {
     $this->drupalLogin($this->account);
-    $this->drupalGet('user/autocomplete', array('query' => array('q' => $this->account->name)));
-    $this->assertRaw($this->account->name);
+    $this->drupalGet('user/autocomplete', array('query' => array('q' => $this->account->getUsername())));
+    $this->assertRaw($this->account->getUsername());
     $this->assertNoText('registry initialized', 'The registry was not initialized');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
index 3f625b1..94457646 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Update/UpdateScriptTest.php
@@ -64,7 +64,7 @@ function testUpdateAccess() {
     $user1 = user_load(1);
     $user1->pass_raw = user_password();
     $user1->pass = drupal_container()->get('password')->hash(trim($user1->pass_raw));
-    db_query("UPDATE {users} SET pass = :pass WHERE uid = :uid", array(':pass' => $user1->pass, ':uid' => $user1->id()));
+    db_query("UPDATE {users} SET pass = :pass WHERE uid = :uid", array(':pass' => $user1->getPassword(), ':uid' => $user1->id()));
     $this->drupalLogin($user1);
     $this->drupalGet($this->update_url, array('external' => TRUE));
     $this->assertResponse(200);
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index a8dcd13..305a074 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -2642,9 +2642,9 @@ function hook_update_N(&$sandbox) {
     ->execute();
 
   foreach ($users as $user) {
-    $user->name .= '!';
+    $user->setUsername($user->getUsername() . '!');
     db_update('users')
-      ->fields(array('name' => $user->name))
+      ->fields(array('name' => $user->getUsername()))
       ->condition('uid', $user->id())
       ->execute();
 
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index ac42ea3..060f4db 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -10,6 +10,7 @@
 use Drupal\Core\Language\Language;
 use Drupal\Core\Utility\ModuleInfo;
 use Drupal\system\Plugin\Block\SystemMenuBlock;
+use Drupal\user\UserInterface;
 use Symfony\Component\HttpFoundation\JsonResponse;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Response;
@@ -2413,9 +2414,9 @@ function system_form_user_register_form_alter(&$form, &$form_state) {
 /**
  * Implements hook_user_presave().
  */
-function system_user_presave($account) {
+function system_user_presave(UserInterface $account) {
   $config = config('system.timezone');
-  if ($config->get('user.configurable') && empty($account->timezone) && !$config->get('user.default')) {
+  if ($config->get('user.configurable') && !$account->getTimeZone() && !$config->get('user.default')) {
     $account->timezone = $config->get('default');
   }
 }
@@ -2446,7 +2447,7 @@ function system_user_timezone(&$form, &$form_state) {
   $form['timezone']['timezone'] = array(
     '#type' => 'select',
     '#title' => t('Time zone'),
-    '#default_value' => isset($account->timezone) ? $account->timezone : ($account->id() == $user->id() ? config('system.timezone')->get('default') : ''),
+    '#default_value' => $account->getTimezone() ? $account->getTimezone() : ($account->id() == $user->id() ? config('system.timezone')->get('default') : ''),
     '#options' => system_time_zones($account->id() != $user->id()),
     '#description' => t('Select the desired local time and time zone. Dates and times throughout this site will be displayed using this time zone.'),
   );
diff --git a/core/modules/system/tests/modules/database_test/database_test.module b/core/modules/system/tests/modules/database_test/database_test.module
index 8772662..2d14ab6 100644
--- a/core/modules/system/tests/modules/database_test/database_test.module
+++ b/core/modules/system/tests/modules/database_test/database_test.module
@@ -234,7 +234,7 @@ function database_test_theme_tablesort($form, &$form_state) {
   $status = array(t('blocked'), t('active'));
   foreach (user_load_multiple($uids) as $account) {
     $options[$account->id()] = array(
-      'username' => check_plain($account->name),
+      'username' => check_plain($account->getUsername()),
       'status' =>  $status[$account->status],
     );
   }
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index cb56e2b..762d7fc 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -2263,7 +2263,7 @@ function form_test_two_instances() {
   global $user;
   $node1 = entity_create('node', array(
     'uid' => $user->id(),
-    'name' => (isset($user->name) ? $user->name : ''),
+    'name' => $user->getUsername(),
     'type' => 'page',
     'langcode' => Language::LANGCODE_NOT_SPECIFIED,
   ));
diff --git a/core/modules/system/tests/modules/router_test/lib/Drupal/router_test/TestContent.php b/core/modules/system/tests/modules/router_test/lib/Drupal/router_test/TestContent.php
index 37c68b0..c37f5be 100644
--- a/core/modules/system/tests/modules/router_test/lib/Drupal/router_test/TestContent.php
+++ b/core/modules/system/tests/modules/router_test/lib/Drupal/router_test/TestContent.php
@@ -27,7 +27,7 @@ public function test1() {
    */
   public function test11() {
     $account  = \Drupal::request()->attributes->get('account');
-    return isset($account->name) ? $account->name : '';
+    return $account->getUsername();
   }
 
 }
diff --git a/core/modules/system/tests/modules/session_test/session_test.module b/core/modules/system/tests/modules/session_test/session_test.module
index 73bf3ff..b6e1a53 100644
--- a/core/modules/system/tests/modules/session_test/session_test.module
+++ b/core/modules/system/tests/modules/session_test/session_test.module
@@ -147,7 +147,7 @@ function _session_test_set_not_started() {
  * Implements hook_user_login().
  */
 function session_test_user_login($account) {
-  if ($account->name == 'session_test_user') {
+  if ($account->getUsername() == 'session_test_user') {
     // Exit so we can verify that the session was regenerated
     // before hook_user_login() was called.
     exit;
diff --git a/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/PathProcessorTest.php b/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/PathProcessorTest.php
index a27c65c..644dd49 100644
--- a/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/PathProcessorTest.php
+++ b/core/modules/system/tests/modules/url_alter_test/lib/Drupal/url_alter_test/PathProcessorTest.php
@@ -47,7 +47,7 @@ public function processOutbound($path, &$options = array(), Request $request = N
     if (preg_match('!^user/([0-9]+)(/.*)?!', $path, $matches)) {
       if ($account = user_load($matches[1])) {
         $matches += array(2 => '');
-        $path = 'user/' . $account->name . $matches[2];
+        $path = 'user/' . $account->getUsername() . $matches[2];
       }
     }
 
diff --git a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
index c349d6d..4627fb5 100644
--- a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
+++ b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
@@ -233,7 +233,8 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     $format = filter_format_load($edit['format']);
     $format_id = $format->format;
     $permission = filter_permission_name($format);
-    $rid = $this->web_user->roles[0];
+    $roles = $this->web_user->getRoles();
+    $rid = $roles[0];
     user_role_grant_permissions($rid, array($permission));
     $this->drupalLogin($this->web_user);
 
diff --git a/core/modules/user/lib/Drupal/user/Access/RoleAccessCheck.php b/core/modules/user/lib/Drupal/user/Access/RoleAccessCheck.php
index fd9756f..ea709db 100644
--- a/core/modules/user/lib/Drupal/user/Access/RoleAccessCheck.php
+++ b/core/modules/user/lib/Drupal/user/Access/RoleAccessCheck.php
@@ -38,14 +38,14 @@ public function access(Route $route, Request $request) {
 
     $explode_and = array_filter(array_map('trim', explode('+', $rid_string)));
     if (count($explode_and) > 1) {
-      $diff = array_diff($explode_and, $account->roles);
+      $diff = array_diff($explode_and, $account->getRoles());
       if (empty($diff)) {
         return static::ALLOW;
       }
     }
     else {
       $explode_or = array_filter(array_map('trim', explode(',', $rid_string)));
-      $intersection = array_intersect($explode_or, $account->roles);
+      $intersection = array_intersect($explode_or, $account->getRoles());
       if (!empty($intersection)) {
         return static::ALLOW;
       }
diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php
index 950c341..c13f73d 100644
--- a/core/modules/user/lib/Drupal/user/AccountFormController.php
+++ b/core/modules/user/lib/Drupal/user/AccountFormController.php
@@ -42,7 +42,7 @@ public function form(array $form, array &$form_state) {
       '#required' => TRUE,
       '#attributes' => array('class' => array('username'), 'autocorrect' => 'off', 'autocomplete' => 'off', 'autocapitalize' => 'off',
       'spellcheck' => 'false'),
-      '#default_value' => (!$register ? $account->name : ''),
+      '#default_value' => (!$register ? $account->getUsername() : ''),
       '#access' => ($register || ($user->id() == $account->id() && user_access('change own username')) || $admin),
       '#weight' => -10,
     );
@@ -54,8 +54,8 @@ public function form(array $form, array &$form_state) {
       '#type' => 'email',
       '#title' => t('E-mail address'),
       '#description' => t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
-      '#required' => !(empty($account->mail) && user_access('administer users')),
-      '#default_value' => (!$register ? $account->mail : ''),
+      '#required' => !(!$account->getEmail() && user_access('administer users')),
+      '#default_value' => (!$register ? $account->getEmail() : ''),
       '#attributes' => array('autocomplete' => 'off'),
     );
 
@@ -117,10 +117,10 @@ public function form(array $form, array &$form_state) {
     }
 
     if ($admin) {
-      $status = isset($account->status) ? $account->status : 1;
+      $status = $account->isActive();
     }
     else {
-      $status = $register ? $config->get('register') == USER_REGISTER_VISITORS : $account->status;
+      $status = $register ? $config->get('register') == USER_REGISTER_VISITORS : $account->isActive();
     }
 
     $form['account']['status'] = array(
@@ -148,7 +148,7 @@ public function form(array $form, array &$form_state) {
     $form['account']['roles'] = array(
       '#type' => 'checkboxes',
       '#title' => t('Roles'),
-      '#default_value' => (!$register ? $account->roles : array()),
+      '#default_value' => (!$register ? $account->getRoles() : array()),
       '#options' => $roles,
       '#access' => $roles && user_access('administer permissions'),
       DRUPAL_AUTHENTICATED_RID => $checkbox_authenticated,
@@ -171,9 +171,9 @@ public function form(array $form, array &$form_state) {
     $form['signature_settings']['signature'] = array(
       '#type' => 'text_format',
       '#title' => t('Signature'),
-      '#default_value' => isset($account->signature) ? $account->signature : '',
+      '#default_value' => $account->getSignature(),
       '#description' => t('Your signature will be publicly displayed at the end of your comments.'),
-      '#format' => isset($account->signature_format) ? $account->signature_format : NULL,
+      '#format' => $account->getSignatureFormat(),
     );
 
     $user_preferred_langcode = $register ? $language_interface->id : $account->getPreferredLangcode();
diff --git a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
index 8e623d1..a21da24 100644
--- a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
+++ b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
@@ -89,10 +89,10 @@ public function buildForm(array $form, array &$form_state, Request $request = NU
     // Allow logged in users to request this also.
     if ($user->isAuthenticated()) {
       $form['name']['#type'] = 'value';
-      $form['name']['#value'] = $user->mail;
+      $form['name']['#value'] = $user->getEmail();
       $form['mail'] = array(
         '#prefix' => '<p>',
-        '#markup' =>  t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the e-mail.', array('%email' => $user->mail)),
+        '#markup' =>  t('Password reset instructions will be mailed to %email. You must log out to use the password reset link in the e-mail.', array('%email' => $user->getEmail())),
         '#suffix' => '</p>',
       );
     }
@@ -135,7 +135,7 @@ public function submitForm(array &$form, array &$form_state) {
     // Mail one time login URL and instructions using current language.
     $mail = _user_mail_notify('password_reset', $account->getBCEntity(), $langcode);
     if (!empty($mail)) {
-      watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
+      watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->getUsername(), '%email' => $account->getEmail()));
       drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
     }
 
diff --git a/core/modules/user/lib/Drupal/user/Plugin/Action/BlockUser.php b/core/modules/user/lib/Drupal/user/Plugin/Action/BlockUser.php
index dcb733b..4527e72 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/Action/BlockUser.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/Action/BlockUser.php
@@ -27,11 +27,11 @@ class BlockUser extends ActionBase {
    */
   public function execute($account = NULL) {
     // Skip blocking user if they are already blocked.
-    if ($account !== FALSE && $account->status->value == 1) {
+    if ($account !== FALSE && $account->isActive()) {
       // For efficiency manually save the original account before applying any
       // changes.
       $account->original = clone $account;
-      $account->status = 0;
+      $account->block();
       $account->save();
     }
   }
diff --git a/core/modules/user/lib/Drupal/user/Plugin/Action/UnblockUser.php b/core/modules/user/lib/Drupal/user/Plugin/Action/UnblockUser.php
index 6164054..43ddca9 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/Action/UnblockUser.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/Action/UnblockUser.php
@@ -27,8 +27,8 @@ class UnblockUser extends ActionBase {
    */
   public function execute($account = NULL) {
     // Skip unblocking user if they are already unblocked.
-    if ($account !== FALSE && $account->status->value == 0) {
-      $account->status = 1;
+    if ($account !== FALSE && $account->isBlocked()) {
+      $account->activate();
       $account->save();
     }
   }
diff --git a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
index 413cdb7..c3162c6 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
@@ -114,7 +114,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $
       }
 
       // Update user roles if changed.
-      if ($this->roles->getValue() != $this->original->roles->getValue()) {
+      if ($this->getRoles() != $this->original->getRoles()) {
         $storage_controller->deleteUserRoles(array($this->id()));
         $storage_controller->saveRoles($this);
       }
@@ -133,7 +133,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $
     }
     else {
       // Save user roles.
-      if (count($this->roles) > 1) {
+      if (count($this->getRoles()) > 1) {
         $storage_controller->saveRoles($this);
       }
     }
@@ -393,4 +393,12 @@ public function getUsername() {
     return $name;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function setUsername($username) {
+    $this->set('name', $username);
+    return $this;
+  }
+
 }
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php b/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
index 8b10a21..2ba244a 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/access/Role.php
@@ -35,7 +35,7 @@ class Role extends AccessPluginBase {
    * {@inheritdoc}
    */
   public function access(AccountInterface $account) {
-    return user_access('access all views', $account) || array_intersect(array_filter($this->options['role']), $account->roles);
+    return user_access('access all views', $account) || array_intersect(array_filter($this->options['role']), $account->getRoles());
   }
 
   /**
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
index 5e272a1..3742917 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Name.php
@@ -27,7 +27,7 @@ protected function valueForm(&$form, &$form_state) {
       $result = entity_load_multiple_by_properties('user', array('uid' => $this->value));
       foreach ($result as $account) {
         if ($account->id()) {
-          $values[] = $account->name->value;
+          $values[] = $account->getUsername();
         }
         else {
           $values[] = 'Anonymous'; // Intentionally NOT translated.
@@ -130,7 +130,7 @@ function validate_user_strings(&$form, $values) {
 
     $result = entity_load_multiple_by_properties('user', array('name' => $args));
     foreach ($result as $account) {
-      unset($missing[strtolower($account->name->value)]);
+      unset($missing[strtolower($account->getUsername())]);
       $uids[] = $account->id();
     }
 
diff --git a/core/modules/user/lib/Drupal/user/RegisterFormController.php b/core/modules/user/lib/Drupal/user/RegisterFormController.php
index 116f6c2..7c4a7a9 100644
--- a/core/modules/user/lib/Drupal/user/RegisterFormController.php
+++ b/core/modules/user/lib/Drupal/user/RegisterFormController.php
@@ -109,25 +109,25 @@ public function save(array $form, array &$form_state) {
     // New administrative account without notification.
     $uri = $account->uri();
     if ($admin && !$notify) {
-      drupal_set_message(t('Created a new user account for <a href="@url">%name</a>. No e-mail has been sent.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
+      drupal_set_message(t('Created a new user account for <a href="@url">%name</a>. No e-mail has been sent.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->getUsername())));
     }
     // No e-mail verification required; log in user immediately.
-    elseif (!$admin && !config('user.settings')->get('verify_mail') && $account->status) {
+    elseif (!$admin && !config('user.settings')->get('verify_mail') && $account->isActive()) {
       _user_mail_notify('register_no_approval_required', $account);
       user_login_finalize($account);
       drupal_set_message(t('Registration successful. You are now logged in.'));
       $form_state['redirect'] = '';
     }
     // No administrator approval required.
-    elseif ($account->status || $notify) {
-      if (empty($account->mail) && $notify) {
-        drupal_set_message(t('The new user <a href="@url">%name</a> was created without an email address, so no welcome message was sent.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
+    elseif ($account->isActive() || $notify) {
+      if (!$account->getEmail() && $notify) {
+        drupal_set_message(t('The new user <a href="@url">%name</a> was created without an email address, so no welcome message was sent.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->getUsername())));
       }
       else {
         $op = $notify ? 'register_admin_created' : 'register_no_approval_required';
         if (_user_mail_notify($op, $account)) {
           if ($notify) {
-            drupal_set_message(t('A welcome message with further instructions has been e-mailed to the new user <a href="@url">%name</a>.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->name)));
+            drupal_set_message(t('A welcome message with further instructions has been e-mailed to the new user <a href="@url">%name</a>.', array('@url' => url($uri['path'], $uri['options']), '%name' => $account->getUsername())));
           }
           else {
             drupal_set_message(t('A welcome message with further instructions has been sent to your e-mail address.'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminListingTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminListingTest.php
index 3662671..9254059 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAdminListingTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminListingTest.php
@@ -39,7 +39,7 @@ public function testUserListing() {
     }
     // Create a blocked user.
     $account = $this->drupalCreateUser()->getNGEntity();
-    $account->status = 0;
+    $account->block();
     $account->save();
     $accounts[$account->label()] = $account;
 
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
index b9c01fa..f264a77 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAdminTest.php
@@ -43,7 +43,7 @@ function testUserAdmin() {
     $this->assertText($user_a->name, 'Found user A on admin users page');
     $this->assertText($user_b->name, 'Found user B on admin users page');
     $this->assertText($user_c->name, 'Found user C on admin users page');
-    $this->assertText($admin_user->name, 'Found Admin user on admin users page');
+    $this->assertText($admin_user->getUsername(), 'Found Admin user on admin users page');
 
     // Test for existence of edit link in table.
     $link = l(t('Edit'), "user/" . $user_a->id() . "/edit", array('query' => array('destination' => 'admin/people')));
@@ -55,7 +55,7 @@ function testUserAdmin() {
     $this->assertEqual(1, count($result), 'Filter by username returned the right amount.');
     $this->assertEqual($user_a->name, (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
 
-    $this->drupalGet('admin/people', array('query' => array('user' => $user_a->mail)));
+    $this->drupalGet('admin/people', array('query' => array('user' => $user_a->getEmail())));
     $result = $this->xpath('//table/tbody/tr');
     $this->assertEqual(1, count($result), 'Filter by username returned the right amount.');
     $this->assertEqual($user_a->name, (string) $result[0]->td[1]->span, 'Filter by username returned the right user.');
@@ -69,7 +69,7 @@ function testUserAdmin() {
     $this->assertText($user_c->name, 'Found user C on filtered by perm admin users page');
 
     // Filter the users by role. Grab the system-generated role name for User C.
-    $roles = $user_c->roles;
+    $roles = $user_c->getRoles();
     unset($roles[array_search(DRUPAL_AUTHENTICATED_RID, $roles)]);
     $this->drupalGet('admin/people', array('query' => array('role' => reset($roles))));
 
@@ -80,13 +80,13 @@ function testUserAdmin() {
 
     // Test blocking of a user.
     $account = user_load($user_c->id());
-    $this->assertEqual($account->status, 1, 'User C not blocked');
+    $this->assertTrue($account->isActive(), 'User C not blocked');
     $edit = array();
     $edit['action'] = 'user_block_user_action';
     $edit['user_bulk_form[1]'] = TRUE;
     $this->drupalPost('admin/people', $edit, t('Apply'));
     $account = user_load($user_c->id(), TRUE);
-    $this->assertEqual($account->status, 0, 'User C blocked');
+    $this->assertTrue($account->isBlocked(), 'User C blocked');
 
     // Test filtering on admin page for blocked users
     $this->drupalGet('admin/people', array('query' => array('status' => 0)));
@@ -100,8 +100,8 @@ function testUserAdmin() {
     $editunblock['user_bulk_form[1]'] = TRUE;
     $this->drupalPost('admin/people', $editunblock, t('Apply'));
     $account = user_load($user_c->id(), TRUE);
-    $this->assertEqual($account->status, 1, 'User C unblocked');
-    $this->assertMail("to", $account->mail, "Activation mail sent to user C");
+    $this->assertTrue($account->isActive(), 'User C unblocked');
+    $this->assertMail("to", $account->getEmail(), "Activation mail sent to user C");
 
     // Test blocking and unblocking another user from /user/[uid]/edit form and sending of activation mail
     $user_d = $this->drupalCreateUser(array());
@@ -112,7 +112,7 @@ function testUserAdmin() {
     $this->drupalPost('user/' . $account1->id() . '/edit', array('status' => TRUE), t('Save'));
     $account1 = user_load($user_d->id(), TRUE);
     $this->assertEqual($account1->status, 1, 'User D unblocked');
-    $this->assertMail("to", $account1->mail, "Activation mail sent to user D");
+    $this->assertMail("to", $account1->getEmail(), "Activation mail sent to user D");
   }
 
   /**
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
index 5ae414c..46518f4 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserAutocompleteTest.php
@@ -35,17 +35,18 @@ function setUp() {
   function testUserAutocomplete() {
     // Check access from unprivileged user, should be denied.
     $this->drupalLogin($this->unprivileged_user);
-    $this->drupalGet('user/autocomplete', array('query' => array('q' => $this->unprivileged_user->name[0])));
+    $username = $this->unprivileged_user->getUsername();
+    $this->drupalGet('user/autocomplete', array('query' => array('q' => $username[0])));
     $this->assertResponse(403, 'Autocompletion access denied to user without permission.');
 
     // Check access from privileged user.
     $this->drupalLogout();
     $this->drupalLogin($this->privileged_user);
-    $this->drupalGet('user/autocomplete', array('query' => array('q' => $this->unprivileged_user->name[0])));
+    $this->drupalGet('user/autocomplete', array('query' => array('q' => $username[0])));
     $this->assertResponse(200, 'Autocompletion access allowed.');
 
     // Using first letter of the user's name, make sure the user's full name is in the results.
-    $this->assertRaw($this->unprivileged_user->name, 'User name found in autocompletion results.');
+    $this->assertRaw($this->unprivileged_user->getUsername(), 'User name found in autocompletion results.');
 
     $anonymous_name = $this->randomString() . '<script>alert();</script>';
     config('user.settings')->set('anonymous', $anonymous_name)->save();
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php
index 776f383..99bee6e 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserBlocksTests.php
@@ -54,7 +54,7 @@ function testUserLoginBlock() {
 
     // Log in using the block.
     $edit = array();
-    $edit['name'] = $user->name;
+    $edit['name'] = $user->getUsername();
     $edit['pass'] = $user->pass_raw;
     $this->drupalPost('admin/people/permissions', $edit, t('Log in'));
     $this->assertNoText(t('User login'), 'Logged in.');
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
index c45a21f..547f77f 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCancelTest.php
@@ -50,10 +50,10 @@ function testUserCancelWithoutPermission() {
 
     // Attempt bogus account cancellation request confirmation.
     $timestamp = $account->login;
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime()));
     $this->assertResponse(403, 'Bogus cancelling request rejected.');
     $account = user_load($account->id());
-    $this->assertTrue($account->status == 1, 'User account was not canceled.');
+    $this->assertTrue($account->isActive(), 'User account was not canceled.');
 
     // Confirm user's content has not been altered.
     $test_node = node_load($node->nid, TRUE);
@@ -124,17 +124,17 @@ function testUserCancelInvalid() {
 
     // Attempt bogus account cancellation request confirmation.
     $bogus_timestamp = $timestamp + 60;
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->getLastLoginTime()));
     $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), 'Bogus cancelling request rejected.');
     $account = user_load($account->id());
-    $this->assertTrue($account->status == 1, 'User account was not canceled.');
+    $this->assertTrue($account->isActive(), 'User account was not canceled.');
 
     // Attempt expired account cancellation request confirmation.
     $bogus_timestamp = $timestamp - 86400 - 60;
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$bogus_timestamp/" . user_pass_rehash($account->pass, $bogus_timestamp, $account->getLastLoginTime()));
     $this->assertText(t('You have tried to use an account cancellation link that has expired. Please request a new one using the form below.'), 'Expired cancel account request rejected.');
     $account = user_load($account->id(), TRUE);
-    $this->assertTrue($account->status, 'User account was not canceled.');
+    $this->assertTrue($account->isActive(), 'User account was not canceled.');
 
     // Confirm user's content has not been altered.
     $test_node = node_load($node->nid, TRUE);
@@ -168,12 +168,12 @@ function testUserBlock() {
     $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
 
     // Confirm account cancellation request.
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime()));
     $account = user_load($account->id(), TRUE);
-    $this->assertTrue($account->status == 0, 'User has been blocked.');
+    $this->assertTrue($account->isBlocked(), 'User has been blocked.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->name)), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -206,9 +206,9 @@ function testUserBlockUnpublish() {
     $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
 
     // Confirm account cancellation request.
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime()));
     $account = user_load($account->id(), TRUE);
-    $this->assertTrue($account->status == 0, 'User has been blocked.');
+    $this->assertTrue($account->isBlocked(), 'User has been blocked.');
 
     // Confirm user's content has been unpublished.
     $test_node = node_load($node->nid, TRUE);
@@ -217,7 +217,7 @@ function testUserBlockUnpublish() {
     $this->assertTrue($test_node->status == 0, 'Node revision of the user has been unpublished.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->name)), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been disabled.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -256,7 +256,7 @@ function testUserAnonymize() {
     $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
 
     // Confirm account cancellation request.
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime()));
     $this->assertFalse(user_load($account->id(), TRUE), 'User is not found in the database.');
 
     // Confirm that user's content has been attributed to anonymous user.
@@ -268,7 +268,7 @@ function testUserAnonymize() {
     $this->assertTrue(($test_node->uid != 0 && $test_node->status == 1), "Current revision of the user's node was not attributed to anonymous user.");
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -322,7 +322,7 @@ function testUserDelete() {
     $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
 
     // Confirm account cancellation request.
-    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login));
+    $this->drupalGet("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime()));
     $this->assertFalse(user_load($account->id(), TRUE), 'User is not found in the database.');
 
     // Confirm that user's content has been deleted.
@@ -332,7 +332,7 @@ function testUserDelete() {
     $this->assertFalse(comment_load($comment->id(), TRUE), 'Comment of the user has been deleted.');
 
     // Confirm that the confirmation message made it through to the end user.
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), "Confirmation message displayed to user.");
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), "Confirmation message displayed to user.");
   }
 
   /**
@@ -351,12 +351,12 @@ function testUserCancelByAdmin() {
     // Delete regular user.
     $this->drupalGet('user/' . $account->id() . '/edit');
     $this->drupalPost(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->name)), 'Confirmation form to cancel account displayed.');
+    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername())), 'Confirmation form to cancel account displayed.');
     $this->assertText(t('Select the method to cancel the account above.'), 'Allows to select account cancellation method.');
 
     // Confirm deletion.
     $this->drupalPost(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), 'User deleted.');
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), 'User deleted.');
     $this->assertFalse(user_load($account->id()), 'User is not found in the database.');
   }
 
@@ -379,12 +379,12 @@ function testUserWithoutEmailCancelByAdmin() {
     // Delete regular user without e-mail address.
     $this->drupalGet('user/' . $account->id() . '/edit');
     $this->drupalPost(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->name)), 'Confirmation form to cancel account displayed.');
+    $this->assertRaw(t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername())), 'Confirmation form to cancel account displayed.');
     $this->assertText(t('Select the method to cancel the account above.'), 'Allows to select account cancellation method.');
 
     // Confirm deletion.
     $this->drupalPost(NULL, NULL, t('Cancel account'));
-    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->name)), 'User deleted.');
+    $this->assertRaw(t('%name has been deleted.', array('%name' => $account->getUsername())), 'User deleted.');
     $this->assertFalse(user_load($account->id()), 'User is not found in the database.');
   }
 
@@ -424,7 +424,7 @@ function testMassUserCancelByAdmin() {
     $this->drupalPost(NULL, NULL, t('Cancel accounts'));
     $status = TRUE;
     foreach ($users as $account) {
-      $status = $status && (strpos($this->content, t('%name has been deleted.', array('%name' => $account->name))) !== FALSE);
+      $status = $status && (strpos($this->content, t('%name has been deleted.', array('%name' => $account->getUsername()))) !== FALSE);
       $status = $status && !user_load($account->id(), TRUE);
     }
     $this->assertTrue($status, 'Users deleted and not found in the database.');
@@ -432,7 +432,7 @@ function testMassUserCancelByAdmin() {
     // Ensure that admin account was not cancelled.
     $this->assertText(t('A confirmation request to cancel your account has been sent to your e-mail address.'), 'Account cancellation request mailed message displayed.');
     $admin_user = user_load($admin_user->id());
-    $this->assertTrue($admin_user->status == 1, 'Administrative user is found in the database and enabled.');
+    $this->assertTrue($admin_user->isActive(), 'Administrative user is found in the database and enabled.');
 
     // Verify that uid 1's account was not cancelled.
     $user1 = user_load(1, TRUE);
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
index 565e40e..18f2fbe 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
@@ -72,7 +72,7 @@ protected function testUserAdd() {
       $this->drupalGet('admin/people');
       $this->assertText($edit['name'], 'User found in list of users');
       $user = user_load_by_name($name);
-      $this->assertEqual($user->status == 1, 'User is not blocked');
+      $this->assertEqual($user->isActive(), 'User is not blocked');
     }
   }
 }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
index eb6f1c3..b367e2d 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserEntityCallbacksTest.php
@@ -40,7 +40,7 @@ function setUp() {
    * Test label callback.
    */
   function testLabelCallback() {
-    $this->assertEqual($this->account->label(), $this->account->name, 'The username should be used as label');
+    $this->assertEqual($this->account->label(), $this->account->getUsername(), 'The username should be used as label');
 
     // Setup a random anonymous name to be sure the name is used.
     $name = $this->randomName();
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
index 4dd289b..3935212 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserLoginTest.php
@@ -142,7 +142,7 @@ function testPasswordRehashOnLogin() {
    */
   function assertFailedLogin($account, $flood_trigger = NULL) {
     $edit = array(
-      'name' => $account->name,
+      'name' => $account->getUsername(),
       'pass' => $account->pass_raw,
     );
     $this->drupalPost('user', $edit, t('Log in'));
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
index f01c14e..4e3d138 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPasswordResetTest.php
@@ -44,7 +44,7 @@ public function setUp() {
     // that it is definitely over a second ago.
     $account->login = REQUEST_TIME - mt_rand(10, 100000);
     db_update('users')
-      ->fields(array('login' => $account->login))
+      ->fields(array('login' => $account->getLastLoginTime()))
       ->condition('uid', $account->id())
       ->execute();
   }
@@ -63,25 +63,25 @@ function testUserPasswordReset() {
     $this->assertEqual(count($this->drupalGetMails(array('id' => 'user_password_reset'))), 0, 'No e-mail was sent when requesting a password for an invalid account.');
 
     // Reset the password by username via the password reset page.
-    $edit['name'] = $this->account->name;
+    $edit['name'] = $this->account->getUsername();
     $this->drupalPost(NULL, $edit, t('E-mail new password'));
 
      // Verify that the user was sent an e-mail.
-    $this->assertMail('to', $this->account->mail, 'Password e-mail sent to user.');
-    $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->name, '@site' => config('system.site')->get('name')));
+    $this->assertMail('to', $this->account->getEmail(), 'Password e-mail sent to user.');
+    $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => config('system.site')->get('name')));
     $this->assertMail('subject', $subject, 'Password reset e-mail subject is correct.');
 
     $resetURL = $this->getResetURL();
     $this->drupalGet($resetURL);
 
     // Check the one-time login page.
-    $this->assertText($this->account->name, 'One-time login page contains the correct username.');
+    $this->assertText($this->account->getUsername(), 'One-time login page contains the correct username.');
     $this->assertText(t('This login can be used only once.'), 'Found warning about one-time login.');
 
     // Check successful login.
     $this->drupalPost(NULL, NULL, t('Log in'));
     $this->assertLink(t('Log out'));
-    $this->assertTitle(t('@name | @site', array('@name' => $this->account->name, '@site' => config('system.site')->get('name'))), 'Logged in using password reset link.');
+    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => config('system.site')->get('name'))), 'Logged in using password reset link.');
 
     // Log out, and try to log in again using the same one-time link.
     $this->drupalLogout();
@@ -92,7 +92,7 @@ function testUserPasswordReset() {
     $this->drupalGet('user/password');
     // Count email messages before to compare with after.
     $before = count($this->drupalGetMails(array('id' => 'user_password_reset')));
-    $edit['name'] = $this->account->mail;
+    $edit['name'] = $this->account->getEmail();
     $this->drupalPost(NULL, $edit, t('E-mail new password'));
     $this->assertTrue( count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before + 1, 'E-mail sent when requesting password reset using e-mail address.');
 
@@ -100,7 +100,7 @@ function testUserPasswordReset() {
     $timeout = config('user.settings')->get('password_reset_timeout');
     $bogus_timestamp = REQUEST_TIME - $timeout - 60;
     $_uid = $this->account->id();
-    $this->drupalGet("user/reset/$_uid/$bogus_timestamp/" . user_pass_rehash($this->account->pass, $bogus_timestamp, $this->account->login));
+    $this->drupalGet("user/reset/$_uid/$bogus_timestamp/" . user_pass_rehash($this->account->pass, $bogus_timestamp, $this->account->getLastLoginTime()));
     $this->assertText(t('You have tried to use a one-time login link that has expired. Please request a new one using the form below.'), 'Expired password reset request rejected.');
   }
 
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php
index 3c8cd54..e2e97a1 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserPermissionsTest.php
@@ -28,7 +28,7 @@ function setUp() {
     $this->admin_user = $this->drupalCreateUser(array('administer permissions', 'access user profiles', 'administer site configuration', 'administer modules', 'administer users'));
 
     // Find the new role ID.
-    $all_rids = $this->admin_user->roles;
+    $all_rids = $this->admin_user->getRoles();
     unset($all_rids[array_search(DRUPAL_AUTHENTICATED_RID, $all_rids)]);
     $this->rid = reset($all_rids);
   }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
index 32dc5cc..7028261 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRegistrationTest.php
@@ -46,7 +46,7 @@ function testRegistrationWithEmailVerification() {
     $this->assertText(t('A welcome message with further instructions has been sent to your e-mail address.'), 'User registered successfully.');
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
     $new_user = reset($accounts);
-    $this->assertTrue($new_user->status->value, 'New account is active after registration.');
+    $this->assertTrue($new_user->isActive(), 'New account is active after registration.');
 
     // Allow registration by site visitors, but require administrator approval.
     $config->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
@@ -57,7 +57,7 @@ function testRegistrationWithEmailVerification() {
     $this->container->get('plugin.manager.entity')->getStorageController('user')->resetCache();
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
     $new_user = reset($accounts);
-    $this->assertFalse($new_user->status->value, 'New account is blocked until approved by an administrator.');
+    $this->assertFalse($new_user->isActive(), 'New account is blocked until approved by an administrator.');
   }
 
   function testRegistrationWithoutEmailVerification() {
@@ -136,17 +136,17 @@ function testRegistrationEmailDuplicates() {
 
     $edit = array();
     $edit['name'] = $this->randomName();
-    $edit['mail'] = $duplicate_user->mail;
+    $edit['mail'] = $duplicate_user->getEmail();
 
     // Attempt to create a new account using an existing e-mail address.
     $this->drupalPost('user/register', $edit, t('Create new account'));
-    $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), 'Supplying an exact duplicate email address displays an error message');
+    $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->getEmail())), 'Supplying an exact duplicate email address displays an error message');
 
     // Attempt to bypass duplicate email registration validation by adding spaces.
-    $edit['mail'] = '   ' . $duplicate_user->mail . '   ';
+    $edit['mail'] = '   ' . $duplicate_user->getEmail() . '   ';
 
     $this->drupalPost('user/register', $edit, t('Create new account'));
-    $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->mail)), 'Supplying a duplicate email address with added whitespace displays an error message');
+    $this->assertText(t('The e-mail address @email is already registered.', array('@email' => $duplicate_user->getEmail())), 'Supplying a duplicate email address with added whitespace displays an error message');
   }
 
   function testRegistrationDefaultValues() {
@@ -178,12 +178,12 @@ function testRegistrationDefaultValues() {
     // Check user fields.
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
     $new_user = reset($accounts);
-    $this->assertEqual($new_user->name->value, $name, 'Username matches.');
-    $this->assertEqual($new_user->mail->value, $mail, 'E-mail address matches.');
+    $this->assertEqual($new_user->getUsername(), $name, 'Username matches.');
+    $this->assertEqual($new_user->getEmail(), $mail, 'E-mail address matches.');
     $this->assertEqual($new_user->theme->value, '', 'Correct theme field.');
-    $this->assertEqual($new_user->signature->value, '', 'Correct signature field.');
-    $this->assertTrue(($new_user->created->value > REQUEST_TIME - 20 ), 'Correct creation time.');
-    $this->assertEqual($new_user->status->value, $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.');
+    $this->assertEqual($new_user->getSignature(), '', 'Correct signature field.');
+    $this->assertTrue(($new_user->getCreatedTime() > REQUEST_TIME - 20 ), 'Correct creation time.');
+    $this->assertEqual($new_user->isActive(), $config_user_settings->get('register') == USER_REGISTER_VISITORS ? 1 : 0, 'Correct status field.');
     $this->assertEqual($new_user->timezone->value, $config_system_timezone->get('default'), 'Correct time zone field.');
     $this->assertEqual($new_user->langcode->value, language_default()->id, 'Correct language field.');
     $this->assertEqual($new_user->preferred_langcode->value, language_default()->id, 'Correct preferred language field.');
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php b/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php
index e6e37dc..e47f5cf 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserRolesAssignmentTest.php
@@ -94,10 +94,10 @@ function testCreateUserWithRole() {
   private function userLoadAndCheckRoleAssigned($account, $rid, $is_assigned = TRUE) {
     $account = user_load($account->id(), TRUE);
     if ($is_assigned) {
-      $this->assertTrue(array_search($rid, $account->roles), 'The role is present in the user object.');
+      $this->assertTrue(array_search($rid, $account->getRoles()), 'The role is present in the user object.');
     }
     else {
-      $this->assertFalse(array_search($rid, $account->roles), 'The role is not present in the user object.');
+      $this->assertFalse(array_search($rid, $account->getRoles()), 'The role is not present in the user object.');
     }
   }
 }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php b/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php
index c5239a4..9951068 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserSearchTest.php
@@ -47,21 +47,21 @@ function testUserSearch() {
 
     // Create a blocked user.
     $blocked_user = $this->drupalCreateUser();
-    $blocked_user->status = 0;
+    $blocked_user->block();
     $blocked_user->save();
 
     // Verify that users with "administer users" permissions can see blocked
     // accounts in search results.
-    $edit = array('keys' => $blocked_user->name);
+    $edit = array('keys' => $blocked_user->getUsername());
     $this->drupalPost('search/user/', $edit, t('Search'));
-    $this->assertText($blocked_user->name, 'Blocked users are listed on the user search results for users with the "administer users" permission.');
+    $this->assertText($blocked_user->getUsername(), 'Blocked users are listed on the user search results for users with the "administer users" permission.');
 
     // Verify that users without "administer users" permissions do not see
     // blocked accounts in search results.
     $this->drupalLogin($user1);
-    $edit = array('keys' => $blocked_user->name);
+    $edit = array('keys' => $blocked_user->getUsername());
     $this->drupalPost('search/user/', $edit, t('Search'));
-    $this->assertNoText($blocked_user->name, 'Blocked users are hidden from the user search results.');
+    $this->assertNoText($blocked_user->getUsername(), 'Blocked users are hidden from the user search results.');
 
     $this->drupalLogout();
   }
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
index 56f33c0..f2aa374 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
@@ -63,13 +63,13 @@ function testUserTokenReplacement() {
     $tests = array();
     $tests['[user:uid]'] = $account->id();
     $tests['[user:name]'] = check_plain(user_format_name($account));
-    $tests['[user:mail]'] = check_plain($account->mail);
+    $tests['[user:mail]'] = check_plain($account->getEmail());
     $tests['[user:url]'] = url("user/" . $account->id(), $url_options);
     $tests['[user:edit-url]'] = url("user/" . $account->id() . "/edit", $url_options);
-    $tests['[user:last-login]'] = format_date($account->login, 'medium', '', NULL, $language_interface->id);
-    $tests['[user:last-login:short]'] = format_date($account->login, 'short', '', NULL, $language_interface->id);
-    $tests['[user:created]'] = format_date($account->created, 'medium', '', NULL, $language_interface->id);
-    $tests['[user:created:short]'] = format_date($account->created, 'short', '', NULL, $language_interface->id);
+    $tests['[user:last-login]'] = format_date($account->getLastLoginTime(), 'medium', '', NULL, $language_interface->id);
+    $tests['[user:last-login:short]'] = format_date($account->getLastLoginTime(), 'short', '', NULL, $language_interface->id);
+    $tests['[user:created]'] = format_date($account->getCreatedTime(), 'medium', '', NULL, $language_interface->id);
+    $tests['[user:created:short]'] = format_date($account->getCreatedTime(), 'short', '', NULL, $language_interface->id);
     $tests['[current-user:name]'] = check_plain(user_format_name($global_account));
 
     // Test to make sure that we generated something for each token.
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/AccessTestBase.php b/core/modules/user/lib/Drupal/user/Tests/Views/AccessTestBase.php
index c1a26fc..4ec709d 100644
--- a/core/modules/user/lib/Drupal/user/Tests/Views/AccessTestBase.php
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/AccessTestBase.php
@@ -15,21 +15,21 @@
   /**
    * Contains a user object that can access all views.
    *
-   * @var Drupal\user\User
+   * @var \Drupal\user\UserInterface
    */
   protected $adminUser;
 
   /**
    * Contains a user object that has no special permissions.
    *
-   * @var Drupal\user\User
+   * @var \Drupal\user\UserInterface
    */
   protected $webUser;
 
   /**
    * Contains a user object that has the 'views_test_data test permission'.
    *
-   * @var Drupal\user\User
+   * @var \Drupal\user\UserInterface
    */
   protected $normalUser;
 
@@ -54,11 +54,12 @@ protected function setUp() {
 
     $this->adminUser = $this->drupalCreateUser(array('access all views'));
     $this->webUser = $this->drupalCreateUser();
-    $this->webRole = $this->webUser->roles[0];
+    $roles = $this->webUser->getRoles();
+    $this->webRole = $roles[0];
 
     $this->normalRole = $this->drupalCreateRole(array());
     $this->normalUser = $this->drupalCreateUser(array('views_test_data test permission'));
-    $this->normalUser->getNGEntity()->roles[2] = $this->normalRole;
+    $this->normalUser->addRole($this->normalRole);
     // @todo when all the plugin information is cached make a reset function and
     // call it here.
   }
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/ArgumentValidateTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/ArgumentValidateTest.php
index 6a1145e..418b826 100644
--- a/core/modules/user/lib/Drupal/user/Tests/Views/ArgumentValidateTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/ArgumentValidateTest.php
@@ -41,7 +41,7 @@ function testArgumentValidateUserUid() {
     // Reset safed argument validation.
     $view->argument['null']->argument_validated = NULL;
     // Fail for a string variable since type is 'uid'
-    $this->assertFalse($view->argument['null']->validateArgument($account->name));
+    $this->assertFalse($view->argument['null']->validateArgument($account->getUsername()));
     // Reset safed argument validation.
     $view->argument['null']->argument_validated = NULL;
     // Fail for a valid numeric, but for a user that doesn't exist
@@ -52,7 +52,7 @@ function testArgumentValidateUserName() {
     $account = $this->account;
     // test 'name' case
     $view = $this->view_argument_validate_user('name');
-    $this->assertTrue($view->argument['null']->validateArgument($account->name));
+    $this->assertTrue($view->argument['null']->validateArgument($account->getUsername()));
     // Reset safed argument validation.
     $view->argument['null']->argument_validated = NULL;
     // Fail for a uid variable since type is 'name'
@@ -67,7 +67,7 @@ function testArgumentValidateUserEither() {
     $account = $this->account;
     // test 'either' case
     $view = $this->view_argument_validate_user('either');
-    $this->assertTrue($view->argument['null']->validateArgument($account->name));
+    $this->assertTrue($view->argument['null']->validateArgument($account->getUsername()));
     // Reset safed argument validation.
     $view->argument['null']->argument_validated = NULL;
     // Fail for a uid variable since type is 'name'
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
index da9a68b..d2d42fc 100644
--- a/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/BulkFormTest.php
@@ -70,7 +70,7 @@ public function testBulkForm() {
     $this->assertFalse($account->hasRole($role), 'The user no longer has the custom role.');
 
     // Block a user using the bulk form.
-    $this->assertTrue($account->status->value, 'The user is not blocked.');
+    $this->assertTrue($account->isActive(), 'The user is not blocked.');
     $this->assertRaw($account->label(), 'The user is found in the table.');
     $edit = array(
       'user_bulk_form[1]' => TRUE,
@@ -79,7 +79,7 @@ public function testBulkForm() {
     $this->drupalPost(NULL, $edit, t('Apply'));
     // Re-load the user and check their status.
     $account = entity_load('user', $account->id(), TRUE);
-    $this->assertFalse($account->status->value, 'The user is blocked.');
+    $this->assertTrue($account->isBlocked(), 'The user is blocked.');
     $this->assertNoRaw($account->label(), 'The user is not found in the table.');
 
     // Remove the user status filter from the view.
@@ -98,7 +98,7 @@ public function testBulkForm() {
     );
     $this->drupalPost(NULL, $edit, t('Apply'));
     $anonymous_account = user_load(0);
-    $this->assertFalse($anonymous_account->status, 0, 'Ensure the anonymous user got blocked.');
+    $this->assertTrue($anonymous_account->isBlocked(), 'Ensure the anonymous user got blocked.');
   }
 
 }
diff --git a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldRoleTest.php b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldRoleTest.php
index 28e9983..babadb6 100644
--- a/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldRoleTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/Views/HandlerFieldRoleTest.php
@@ -42,8 +42,8 @@ public function testRole() {
 
     // Add roles to user 1.
     $user = entity_load('user', 1);
-    $user->roles[1]->value = $rolename_a;
-    $user->roles[2]->value = $rolename_b;
+    $user->addRole($rolename_a);
+    $user->addRole($rolename_b);
     $user->save();
 
     $view = views_get_view('test_views_handler_field_role');
diff --git a/core/modules/user/lib/Drupal/user/UserAutocomplete.php b/core/modules/user/lib/Drupal/user/UserAutocomplete.php
index 4d36923..a935200 100644
--- a/core/modules/user/lib/Drupal/user/UserAutocomplete.php
+++ b/core/modules/user/lib/Drupal/user/UserAutocomplete.php
@@ -67,7 +67,7 @@ public function getMatches($string, $include_anonymous = FALSE) {
       }
       $result = $this->connection->select('users')->fields('users', array('name'))->condition('name', db_like($string) . '%', 'LIKE')->range(0, 10)->execute();
       foreach ($result as $account) {
-        $matches[$account->name] = check_plain($account->name);
+        $matches[$account->getUsername()] = check_plain($account->getUsername());
       }
     }
 
diff --git a/core/modules/user/lib/Drupal/user/UserBCDecorator.php b/core/modules/user/lib/Drupal/user/UserBCDecorator.php
index 4568f00..7a5026b 100644
--- a/core/modules/user/lib/Drupal/user/UserBCDecorator.php
+++ b/core/modules/user/lib/Drupal/user/UserBCDecorator.php
@@ -244,5 +244,11 @@ public function getUsername() {
     return $this->decorated->getUsername();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function setUsername($username) {
+    return $this->decorated->setUsername($username);
+  }
 
 }
diff --git a/core/modules/user/lib/Drupal/user/UserInterface.php b/core/modules/user/lib/Drupal/user/UserInterface.php
index fbede92..4a3950d 100644
--- a/core/modules/user/lib/Drupal/user/UserInterface.php
+++ b/core/modules/user/lib/Drupal/user/UserInterface.php
@@ -51,6 +51,17 @@ public function addRole($rid);
   public function removeRole($rid);
 
   /**
+   * Sets the username of this account.
+   *
+   * @param string $username
+   *   The new user name.
+   *
+   * @return \Drupal\user\UserInterface
+   *   The called user entity.
+   */
+  public function setUsername($username);
+
+  /**
    * Returns the hashed password.
    *
    * @return string
@@ -67,14 +78,6 @@ public function getPassword();
   public function setPassword($password);
 
   /**
-   * Returns the e-mail address of the user.
-   *
-   * @return string
-   *   The e-mail address.
-   */
-  public function getEmail();
-
-  /**
    * Sets the e-mail address of the user.
    *
    * @param string $mail
@@ -117,16 +120,6 @@ public function getSignatureFormat();
   public function getCreatedTime();
 
   /**
-   * The timestamp when the user last accessed the site.
-   *
-   * A value of 0 means the user has never accessed the site.
-   *
-   * @return int
-   *   Timestamp of the last access.
-   */
-  public function getLastAccessedTime();
-
-  /**
    * Sets the UNIX timestamp when the user last accessed the site..
    *
    * @param int $timestamp
diff --git a/core/modules/user/lib/Drupal/user/UserStorageController.php b/core/modules/user/lib/Drupal/user/UserStorageController.php
index 8b4653c..809e78d 100644
--- a/core/modules/user/lib/Drupal/user/UserStorageController.php
+++ b/core/modules/user/lib/Drupal/user/UserStorageController.php
@@ -94,13 +94,6 @@ function attachLoad(&$queried_users, $load_revision = FALSE) {
   }
 
   /**
-   * {@inheritdoc}
-   */
-  public function create(array $values) {
-    return parent::create($values)->getBCEntity();
-  }
-
-  /**
    * Overrides Drupal\Core\Entity\DatabaseStorageController::save().
    */
   public function save(EntityInterface $entity) {
@@ -108,11 +101,6 @@ public function save(EntityInterface $entity) {
       $entity->uid->value = $this->database->nextId($this->database->query('SELECT MAX(uid) FROM {users}')->fetchField());
       $entity->enforceIsNew();
     }
-    // There are some cases that pre-set ->original for performance. Make sure
-    // original is not a BC decorator.
-    if ($entity->original instanceof EntityBCDecorator) {
-      $entity->original = $entity->original->getNGEntity();
-    }
     parent::save($entity);
   }
 
@@ -121,11 +109,11 @@ public function save(EntityInterface $entity) {
    */
   public function saveRoles(EntityInterface $user) {
     $query = $this->database->insert('users_roles')->fields(array('uid', 'rid'));
-    foreach ($user->roles as $role) {
-      if (!in_array($role->value, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
+    foreach ($user->getRoles() as $rid) {
+      if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) {
         $query->values(array(
           'uid' => $user->id(),
-          'rid' => $role->value,
+          'rid' => $rid,
         ));
       }
     }
@@ -162,13 +150,13 @@ protected function invokeHook($hook, EntityInterface $entity) {
       $function = 'field_attach_delete_revision';
     }
     if (!empty($this->entityInfo['fieldable']) && function_exists($function)) {
-      $function($entity->getBCEntity());
+      $function($entity);
     }
 
     // Invoke the hook.
-    \Drupal::moduleHandler()->invokeAll($this->entityType . '_' . $hook, array($entity->getBCEntity()));
+    \Drupal::moduleHandler()->invokeAll($this->entityType . '_' . $hook, array($entity));
     // Invoke the respective entity-level hook.
-    \Drupal::moduleHandler()->invokeAll('entity_' . $hook, array($entity->getBCEntity(), $this->entityType));
+    \Drupal::moduleHandler()->invokeAll('entity_' . $hook, array($entity, $this->entityType));
   }
 
   /**
diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc
index bb486ff..27a9b5d 100644
--- a/core/modules/user/user.admin.inc
+++ b/core/modules/user/user.admin.inc
@@ -35,7 +35,6 @@ function user_admin_account() {
   $result = $query->execute();
 
   $destination = drupal_get_destination();
-  $status = array(t('blocked'), t('active'));
   $roles = array_map('check_plain', user_role_names(TRUE));
   $accounts = array();
   foreach ($result as $account) {
@@ -56,10 +55,10 @@ function user_admin_account() {
     );
     $options[$account->id()] = array(
       'username' => drupal_render($username),
-      'status' => $status[$account->status],
+      'status' => $account->isActive() ? t('active') : t('blocked'),
       'roles' => drupal_render($item_list),
-      'member_for' => format_interval(REQUEST_TIME - $account->created),
-      'access' => $account->access ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->access))) : t('never'),
+      'member_for' => format_interval(REQUEST_TIME - $account->getCreatedTime()),
+      'access' => $account->getLastAccessedTime() ? t('@time ago', array('@time' => format_interval(REQUEST_TIME - $account->getLastAccessedTime()))) : t('never'),
     );
     $links = array();
     $links['edit'] = array(
@@ -79,7 +78,7 @@ function user_admin_account() {
       '#links' => $links,
     );
 
-    $options[$account->id()]['title']['data']['#title'] = check_plain($account->name);
+    $options[$account->id()]['title']['data']['#title'] = check_plain($account->getUsername());
 
   }
 
diff --git a/core/modules/user/user.api.php b/core/modules/user/user.api.php
index edb2d6f..9e9fcaf 100644
--- a/core/modules/user/user.api.php
+++ b/core/modules/user/user.api.php
@@ -85,7 +85,7 @@ function hook_user_predelete($account) {
  * @see user_delete_multiple()
  */
 function hook_user_delete($account) {
-  drupal_set_message(t('User: @name has been deleted.', array('@name' => $account->name)));
+  drupal_set_message(t('User: @name has been deleted.', array('@name' => $account->getUsername())));
 }
 
 /**
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index cb1ab7e..21b5f0a 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -602,7 +602,7 @@ function user_user_view(UserInterface $account, EntityDisplay $display) {
     $account->content['member_for'] = array(
       '#type' => 'item',
       '#title' => t('Member for'),
-      '#markup' => format_interval(REQUEST_TIME - $account->created),
+      '#markup' => format_interval(REQUEST_TIME - $account->getCreatedTime()),
     );
   }
 }
@@ -1256,7 +1256,7 @@ function user_cancel_url($account, $options = array()) {
   $timestamp = REQUEST_TIME;
   $langcode = isset($options['langcode']) ? $options['langcode'] : $account->getPreferredLangcode();
   $url_options = array('absolute' => TRUE, 'language' => language_load($langcode));
-  return url("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->getPassword(), $timestamp, $account->login), $url_options);
+  return url("user/" . $account->id() . "/cancel/confirm/$timestamp/" . user_pass_rehash($account->getPassword(), $timestamp, $account->getLastLoginTime()), $url_options);
 }
 
 /**
@@ -1366,10 +1366,10 @@ function _user_cancel($edit, $account, $method) {
       if (!empty($edit['user_cancel_notify'])) {
         _user_mail_notify('status_blocked', $account);
       }
-      $account->status = 0;
+      $account->block();
       $account->save();
-      drupal_set_message(t('%name has been disabled.', array('%name' => $account->name)));
-      watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
+      drupal_set_message(t('%name has been disabled.', array('%name' => $account->getUsername())));
+      watchdog('user', 'Blocked user: %name %email.', array('%name' => $account->getUsername(), '%email' => '<' . $account->getEmail() . '>'), WATCHDOG_NOTICE);
       break;
 
     case 'user_cancel_reassign':
@@ -1379,8 +1379,8 @@ function _user_cancel($edit, $account, $method) {
         _user_mail_notify('status_canceled', $account);
       }
       $account->delete();
-      drupal_set_message(t('%name has been deleted.', array('%name' => $account->name)));
-      watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
+      drupal_set_message(t('%name has been deleted.', array('%name' => $account->getUsername())));
+      watchdog('user', 'Deleted user: %name %email.', array('%name' => $account->getUsername(), '%email' => '<' . $account->getEmail() . '>'), WATCHDOG_NOTICE);
       break;
   }
 
@@ -1784,7 +1784,7 @@ function user_multiple_cancel_confirm($form, &$form_state) {
       '#type' => 'hidden',
       '#value' => $uid,
       '#prefix' => '<li>',
-      '#suffix' => check_plain($account->name->value) . "</li>\n",
+      '#suffix' => check_plain($account->getUsername()) . "</li>\n",
     );
   }
 
@@ -1935,7 +1935,7 @@ function _user_mail_notify($op, $account, $langcode = NULL) {
     if (empty($site_mail)) {
       $site_mail = ini_get('sendmail_from');
     }
-    $mail = drupal_mail('user', $op, $account->mail, $langcode, $params, $site_mail);
+    $mail = drupal_mail('user', $op, $account->getEmail(), $langcode, $params, $site_mail);
     if ($op == 'register_pending_approval') {
       // If a user registered requiring admin approval, notify the admin, too.
       // We use the site default language for this.
@@ -1979,7 +1979,7 @@ function user_form_process_password_confirm($element) {
       'fair' => t('Fair'),
       'good' => t('Good'),
       'strong' => t('Strong'),
-      'username' => (isset($user->name) ? $user->name : ''),
+      'username' => $user->getUsername(),
     );
   }
 
@@ -2191,7 +2191,7 @@ function user_library_info() {
 function user_logout() {
   global $user;
 
-  watchdog('user', 'Session closed for %name.', array('%name' => $user->name));
+  watchdog('user', 'Session closed for %name.', array('%name' => $user->getUsername()));
 
   Drupal::moduleHandler()->invokeAll('user_logout', array($user));
 
diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc
index 6077a27..961607e 100644
--- a/core/modules/user/user.pages.inc
+++ b/core/modules/user/user.pages.inc
@@ -22,14 +22,14 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a
   if ($user->isAuthenticated()) {
     // The existing user is already logged in.
     if ($user->id() == $uid) {
-      drupal_set_message(t('You are logged in as %user. <a href="!user_edit">Change your password.</a>', array('%user' => $user->name, '!user_edit' => url("user/" . $user->id() . "/edit"))));
+      drupal_set_message(t('You are logged in as %user. <a href="!user_edit">Change your password.</a>', array('%user' => $user->getUsername(), '!user_edit' => url("user/" . $user->id() . "/edit"))));
     }
     // A different user is already logged in on the computer.
     else {
       $reset_link_account = user_load($uid);
       if (!empty($reset_link_account)) {
         drupal_set_message(t('Another user (%other_user) is already logged into the site on this computer, but you tried to use a one-time link for user %resetting_user. Please <a href="!logout">logout</a> and try using the link again.',
-          array('%other_user' => $user->name, '%resetting_user' => $reset_link_account->name, '!logout' => url('user/logout'))));
+          array('%other_user' => $user->getUsername(), '%resetting_user' => $reset_link_account->getUsername(), '!logout' => url('user/logout'))));
       } else {
         // Invalid one-time link specifies an unknown user.
         drupal_set_message(t('The one-time login link you clicked is invalid.'));
@@ -43,20 +43,20 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a
     $current = REQUEST_TIME;
     $account = user_load($uid);
     // Verify that the user exists and is active.
-    if ($timestamp <= $current && $account && $account->status) {
+    if ($timestamp <= $current && $account && $account->isActive()) {
       // No time out for first time login.
-      if ($account->login && $current - $timestamp > $timeout) {
+      if ($account->getLastLoginTime() && $current - $timestamp > $timeout) {
         drupal_set_message(t('You have tried to use a one-time login link that has expired. Please request a new one using the form below.'));
         return new RedirectResponse(url('user/password', array('absolute' => TRUE)));
       }
-      elseif ($account->isAuthenticated() && $timestamp >= $account->login && $timestamp <= $current && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->login)) {
+      elseif ($account->isAuthenticated() && $timestamp >= $account->getLastLoginTime() && $timestamp <= $current && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime())) {
         // First stage is a confirmation form, then login
         if ($action == 'login') {
           // Set the new user.
           // user_login_finalize() also updates the login timestamp of the
           // user, which invalidates further use of the one-time login link.
           user_login_finalize($account);
-          watchdog('user', 'User %name used one-time login link at time %timestamp.', array('%name' => $account->name, '%timestamp' => $timestamp));
+          watchdog('user', 'User %name used one-time login link at time %timestamp.', array('%name' => $account->getUsername(), '%timestamp' => $timestamp));
           drupal_set_message(t('You have just used your one-time login link. It is no longer necessary to use this link to log in. Please change your password.'));
           // Let the user's password be changed without the current password check.
           $token = Crypt::randomStringHashed(55);
@@ -67,12 +67,12 @@ function user_pass_reset($form, &$form_state, $uid, $timestamp, $hashed_pass, $a
           )));
         }
         else {
-          if (!$account->login) {
+          if (!$account->getLastLoginTime()) {
             // No expiration for first time login.
-            $form['message'] = array('#markup' => t('<p>This is a one-time login for %user_name.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $account->name)));
+            $form['message'] = array('#markup' => t('<p>This is a one-time login for %user_name.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $account->getUsername())));
           }
           else {
-            $form['message'] = array('#markup' => t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $account->name, '%expiration_date' => format_date($timestamp + $timeout))));
+            $form['message'] = array('#markup' => t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to log in to the site and change your password.</p>', array('%user_name' => $account->getUsername(), '%expiration_date' => format_date($timestamp + $timeout))));
           }
           $form['help'] = array('#markup' => '<p>' . t('This login can be used only once.') . '</p>');
           $form['actions'] = array('#type' => 'actions');
@@ -179,7 +179,7 @@ function user_cancel_confirm_form($form, &$form_state, $account) {
     $question = t('Are you sure you want to cancel your account?');
   }
   else {
-    $question = t('Are you sure you want to cancel the account %name?', array('%name' => $account->name));
+    $question = t('Are you sure you want to cancel the account %name?', array('%name' => $account->getUsername()));
   }
   $default_method = config('user.settings')->get('cancel_method');
   $description = NULL;
@@ -227,7 +227,7 @@ function user_cancel_confirm_form_submit($form, &$form_state) {
     $account->save();
     _user_mail_notify('cancel_confirm', $account);
     drupal_set_message(t('A confirmation request to cancel your account has been sent to your e-mail address.'));
-    watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->name, '%email' => '<' . $account->mail . '>'), WATCHDOG_NOTICE);
+    watchdog('user', 'Sent account cancellation request to %name %email.', array('%name' => $account->getUsername(), '%email' => '<' . $account->getEmail() . '>'), WATCHDOG_NOTICE);
 
     $form_state['redirect'] = "user/" . $account->id();
   }
@@ -306,7 +306,7 @@ function user_cancel_confirm($account, $timestamp = 0, $hashed_pass = '') {
   $account_data = drupal_container()->get('user.data')->get('user', $account->id());
   if (isset($account_data['cancel_method']) && !empty($timestamp) && !empty($hashed_pass)) {
     // Validate expiration and hashed password/login.
-    if ($timestamp <= $current && $current - $timestamp < $timeout && $account->id() && $timestamp >= $account->login && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->login)) {
+    if ($timestamp <= $current && $current - $timestamp < $timeout && $account->id() && $timestamp >= $account->getLastLoginTime() && $hashed_pass == user_pass_rehash($account->pass, $timestamp, $account->getLastLoginTime())) {
       $edit = array(
         'user_cancel_notify' => isset($account_data['cancel_notify']) ? $account_data['cancel_notify'] : config('user.settings')->get('notify.status_canceled'),
       );
diff --git a/core/modules/user/user.tokens.inc b/core/modules/user/user.tokens.inc
index 1f98006..522dec9 100644
--- a/core/modules/user/user.tokens.inc
+++ b/core/modules/user/user.tokens.inc
@@ -92,7 +92,7 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr
           break;
 
         case 'mail':
-          $replacements[$original] = $sanitize ? check_plain($account->mail) : $account->mail;
+          $replacements[$original] = $sanitize ? check_plain($account->getEmail()) : $account->getEmail();
           break;
 
         case 'url':
@@ -105,22 +105,22 @@ function user_tokens($type, $tokens, array $data = array(), array $options = arr
 
         // These tokens are default variations on the chained tokens handled below.
         case 'last-login':
-          $replacements[$original] = !empty($account->login) ? format_date($account->login, 'medium', '', NULL, $langcode) : t('never');
+          $replacements[$original] = $account->getLastLoginTime() ? format_date($account->getLastLoginTime(), 'medium', '', NULL, $langcode) : t('never');
           break;
 
         case 'created':
           // In the case of user_presave the created date may not yet be set.
-          $replacements[$original] = !empty($account->created) ? format_date($account->created, 'medium', '', NULL, $langcode) : t('not yet created');
+          $replacements[$original] = $account->getCreatedTime() ? format_date($account->getCreatedTime(), 'medium', '', NULL, $langcode) : t('not yet created');
           break;
       }
     }
 
     if ($login_tokens = $token_service->findWithPrefix($tokens, 'last-login')) {
-      $replacements += $token_service->generate('date', $login_tokens, array('date' => $account->login), $options);
+      $replacements += $token_service->generate('date', $login_tokens, array('date' => $account->getLastLoginTime()), $options);
     }
 
     if ($registered_tokens = $token_service->findWithPrefix($tokens, 'created')) {
-      $replacements += $token_service->generate('date', $registered_tokens, array('date' => $account->created), $options);
+      $replacements += $token_service->generate('date', $registered_tokens, array('date' => $account->getCreatedTime()), $options);
     }
   }
 
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
index 5dab9c7..d6e1c45 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
@@ -285,7 +285,7 @@ public function generateResultsKey() {
       }
       $key_data = array(
         'build_info' => $build_info,
-        'roles' => $user->roles,
+        'roles' => $user->getRoles(),
         'super-user' => $user->id() == 1, // special caching for super user.
         'langcode' => language(Language::TYPE_INTERFACE)->id,
         'base_url' => $GLOBALS['base_url'],
@@ -314,7 +314,7 @@ public function generateOutputKey() {
     if (!isset($this->outputKey)) {
       $key_data = array(
         'result' => $this->view->result,
-        'roles' => $user->roles,
+        'roles' => $user->getRoles(),
         'super-user' => $user->id() == 1, // special caching for super user.
         'theme' => $GLOBALS['theme'],
         'langcode' => language(Language::TYPE_INTERFACE)->id,
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
index ec65d2c..e893739 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/filter/FilterPluginBase.php
@@ -1365,7 +1365,7 @@ public function storeExposedInput($input, $status) {
     // Check if we store exposed value for current user.
     global $user;
     $allowed_rids = empty($this->options['expose']['remember_roles']) ? array() : array_filter($this->options['expose']['remember_roles']);
-    $intersect_rids = array_intersect(array_keys($allowed_rids), $user->roles);
+    $intersect_rids = array_intersect(array_keys($allowed_rids), $user->getRoles());
     if (empty($intersect_rids)) {
       return;
     }
diff --git a/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php b/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php
index fa80f07..09eaaf8 100644
--- a/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/Plugin/AccessTest.php
@@ -41,13 +41,12 @@ protected function setUp() {
 
     $this->admin_user = $this->drupalCreateUser(array('access all views'));
     $this->web_user = $this->drupalCreateUser();
-    $this->web_role = $this->web_user->roles[0];
+    $roles = $this->web_user->getRoles();
+    $this->web_role = $roles[0];
 
     $this->normal_role = $this->drupalCreateRole(array());
     $this->normal_user = $this->drupalCreateUser(array('views_test_data test permission'));
-
-    // @todo: How to add a new item to the roles field list.
-    $this->normal_user->getNGEntity()->roles[2]->value = $this->normal_role;
+    $this->normal_user->addRole($this->normal_role);
     // @todo when all the plugin information is cached make a reset function and
     // call it here.
   }
diff --git a/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php b/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php
index 97b6e23..799422a 100644
--- a/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php
+++ b/core/tests/Drupal/Tests/Core/Route/RoleAccessCheckTest.php
@@ -161,7 +161,7 @@ public function testRoleAccess($path, $grant_accounts, $deny_accounts) {
     foreach ($grant_accounts as $account) {
       $subrequest = Request::create($path, 'GET');
       $subrequest->attributes->set('account', $account);
-      $message = sprintf('Access granted for user with the roles %s on path: %s', implode(', ', $account->roles), $path);
+      $message = sprintf('Access granted for user with the roles %s on path: %s', implode(', ', $account->getRoles()), $path);
       $this->assertSame(AccessCheckInterface::ALLOW, $role_access_check->access($collection->get($path), $subrequest), $message);
     }
 
@@ -169,7 +169,7 @@ public function testRoleAccess($path, $grant_accounts, $deny_accounts) {
     foreach ($deny_accounts as $account) {
       $subrequest = Request::create($path, 'GET');
       $subrequest->attributes->set('account', $account);
-      $message = sprintf('Access denied for user %s with the roles %s on path: %s', $account->id(), implode(', ', $account->roles), $path);
+      $message = sprintf('Access denied for user %s with the roles %s on path: %s', $account->id(), implode(', ', $account->getRoles()), $path);
       $has_access = $role_access_check->access($collection->get($path), $subrequest);
       $this->assertSame(AccessCheckInterface::DENY, $has_access , $message);
     }
