diff --git a/core/core.services.yml b/core/core.services.yml
index bffe0aa..557d757 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -137,10 +137,10 @@ services:
     factory_class: Drupal\Component\Utility\Settings
     factory_method: getSingleton
   state:
-    class: Drupal\Core\KeyValueStore\State
-    arguments: ['@keyvalue']
-    tags:
-      - { name: persist }
+    class: Drupal\Core\KeyValueStore\KeyValueStoreInterface
+    factory_method: get
+    factory_service: keyvalue
+    arguments: [state]
   queue:
     class: Drupal\Core\Queue\QueueFactory
     arguments: ['@settings']
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 3cbbd82..407ad78 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -456,8 +456,10 @@ function install_begin_request(&$install_state) {
     $settings['keyvalue_default'] = 'keyvalue.memory';
     new Settings($settings);
 
-    $container->register('state', 'Drupal\Core\KeyValueStore\State')
-      ->addArgument(new Reference('keyvalue'));
+    $container->register('state', 'Drupal\Core\KeyValueStore\KeyValueStoreInterface')
+      ->setFactoryService(new Reference('keyvalue'))
+      ->setFactoryMethod('get')
+      ->addArgument('state');
 
     // Register Twig template engine for use during install.
     CoreServiceProvider::registerTwig($container);
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index 5441e30..a03ee24 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -288,7 +288,7 @@ public static function keyValue($collection) {
    * needs to be the same across development, production, etc. environments
    * (for example, the system maintenance message) should use \Drupal::config() instead.
    *
-   * @return \Drupal\Core\KeyValueStore\StateInterface
+   * @return \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   public static function state() {
     return static::$container->get('state');
diff --git a/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php b/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
index 22a4a5e..5d43231 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionOptimizer.php
@@ -6,7 +6,8 @@
 
 namespace Drupal\Core\Asset;
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\Asset\AssetCollectionOptimizerInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 /**
  * Optimizes CSS assets.
@@ -37,7 +38,7 @@ class CssCollectionOptimizer implements AssetCollectionOptimizerInterface {
   /**
    * The state key/value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -50,10 +51,10 @@ class CssCollectionOptimizer implements AssetCollectionOptimizerInterface {
    *   The optimizer for a single CSS asset.
    * @param \Drupal\Core\Asset\AssetDumperInterface
    *   The dumper for optimized CSS assets.
-   * @param \Drupal\Core\KeyValueStore\StateInterface
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    *   The state key/value store.
    */
-  public function __construct(AssetCollectionGrouperInterface $grouper, AssetOptimizerInterface $optimizer, AssetDumperInterface $dumper, StateInterface $state) {
+  public function __construct(AssetCollectionGrouperInterface $grouper, AssetOptimizerInterface $optimizer, AssetDumperInterface $dumper, KeyValueStoreInterface $state) {
     $this->grouper = $grouper;
     $this->optimizer = $optimizer;
     $this->dumper = $dumper;
diff --git a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
index e1cb3cd..09846c1 100644
--- a/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/CssCollectionRenderer.php
@@ -6,8 +6,9 @@
 
 namespace Drupal\Core\Asset;
 
+use Drupal\Core\Asset\AssetCollectionRendererInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Component\Utility\String;
-use Drupal\Core\KeyValueStore\StateInterface;
 
 /**
  * Renders CSS assets.
@@ -17,17 +18,17 @@ class CssCollectionRenderer implements AssetCollectionRendererInterface {
   /**
    * The state key/value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
   /**
    * Constructs a CssCollectionRenderer.
    *
-   * @param \Drupal\Core\KeyValueStore\StateInterface
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    *   The state key/value store.
    */
-  public function __construct(StateInterface $state) {
+  public function __construct(KeyValueStoreInterface $state) {
     $this->state = $state;
   }
 
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php b/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
index 4d39a2e..bf4cbf6 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionOptimizer.php
@@ -6,7 +6,8 @@
 
 namespace Drupal\Core\Asset;
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\Asset\AssetCollectionOptimizerInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 
 /**
@@ -38,7 +39,7 @@ class JsCollectionOptimizer implements AssetCollectionOptimizerInterface {
   /**
    * The state key/value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -51,10 +52,10 @@ class JsCollectionOptimizer implements AssetCollectionOptimizerInterface {
    *   The optimizer for a single JS asset.
    * @param \Drupal\Core\Asset\AssetDumperInterface
    *   The dumper for optimized JS assets.
-   * @param \Drupal\Core\KeyValueStore\StateInterface
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    *   The state key/value store.
    */
-  public function __construct(AssetCollectionGrouperInterface $grouper, AssetOptimizerInterface $optimizer, AssetDumperInterface $dumper, StateInterface $state) {
+  public function __construct(AssetCollectionGrouperInterface $grouper, AssetOptimizerInterface $optimizer, AssetDumperInterface $dumper, KeyValueStoreInterface $state) {
     $this->grouper = $grouper;
     $this->optimizer = $optimizer;
     $this->dumper = $dumper;
diff --git a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
index b9de5f8..443387a 100644
--- a/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
+++ b/core/lib/Drupal/Core/Asset/JsCollectionRenderer.php
@@ -6,7 +6,8 @@
 
 namespace Drupal\Core\Asset;
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\Asset\AssetCollectionRendererInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 /**
  * Renders JavaScript assets.
@@ -16,17 +17,17 @@ class JsCollectionRenderer implements AssetCollectionRendererInterface {
   /**
    * The state key/value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
   /**
    * Constructs a CssCollectionRenderer.
    *
-   * @param \Drupal\Core\KeyValueStore\StateInterface
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    *   The state key/value store.
    */
-  public function __construct(StateInterface $state) {
+  public function __construct(KeyValueStoreInterface $state) {
     $this->state = $state;
   }
 
diff --git a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
index 67923b4..d82c8cf 100644
--- a/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
+++ b/core/lib/Drupal/Core/Entity/FieldableDatabaseStorageController.php
@@ -611,16 +611,13 @@ public function delete(array $entities) {
           ->execute();
       }
 
-      foreach ($entities as $entity) {
-        $this->invokeFieldMethod('delete', $entity);
-        $this->deleteFieldItems($entity);
-      }
-
       // Reset the cache as soon as the changes have been applied.
       $this->resetCache($ids);
 
       $entity_class::postDelete($this, $entities);
       foreach ($entities as $entity) {
+        $this->invokeFieldMethod('delete', $entity);
+        $this->deleteFieldItems($entity);
         $this->invokeHook('delete', $entity);
       }
       // Ignore slave server temporarily.
@@ -672,11 +669,11 @@ public function save(EntityInterface $entity) {
         if ($this->revisionDataTable) {
           $this->savePropertyData($entity, 'revision_data_table');
         }
+        $this->resetCache(array($entity->id()));
         $entity->setNewRevision(FALSE);
+        $entity->postSave($this, TRUE);
         $this->invokeFieldMethod('update', $entity);
         $this->saveFieldItems($entity, TRUE);
-        $this->resetCache(array($entity->id()));
-        $entity->postSave($this, TRUE);
         $this->invokeHook('update', $entity);
         if ($this->dataTable) {
           $this->invokeTranslationHooks($entity);
@@ -699,13 +696,13 @@ public function save(EntityInterface $entity) {
           $this->savePropertyData($entity, 'revision_data_table');
         }
 
+        // Reset general caches, but keep caches specific to certain entities.
+        $this->resetCache(array());
 
         $entity->enforceIsNew(FALSE);
+        $entity->postSave($this, FALSE);
         $this->invokeFieldMethod('insert', $entity);
         $this->saveFieldItems($entity, FALSE);
-        // Reset general caches, but keep caches specific to certain entities.
-        $this->resetCache(array());
-        $entity->postSave($this, FALSE);
         $this->invokeHook('insert', $entity);
       }
 
diff --git a/core/lib/Drupal/Core/Extension/CachedModuleHandler.php b/core/lib/Drupal/Core/Extension/CachedModuleHandler.php
index 0def7f3..6e09432 100644
--- a/core/lib/Drupal/Core/Extension/CachedModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/CachedModuleHandler.php
@@ -8,7 +8,7 @@
 namespace Drupal\Core\Extension;
 
 use Drupal\Core\Cache\CacheBackendInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 /**
  * Class that manages enabled modules in a Drupal installation.
@@ -18,7 +18,7 @@ class CachedModuleHandler extends ModuleHandler implements CachedModuleHandlerIn
   /**
    * State key/value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -39,7 +39,7 @@ class CachedModuleHandler extends ModuleHandler implements CachedModuleHandlerIn
   /**
    * Constructs a new CachedModuleHandler object.
    */
-  public function __construct(array $module_list = array(), StateInterface $state, CacheBackendInterface $bootstrap_cache) {
+  public function __construct(array $module_list = array(), KeyValueStoreInterface $state, CacheBackendInterface $bootstrap_cache) {
     parent::__construct($module_list);
     $this->state = $state;
     $this->bootstrapCache = $bootstrap_cache;
diff --git a/core/lib/Drupal/Core/Field/ConfigEntityReferenceItemBase.php b/core/lib/Drupal/Core/Field/ConfigEntityReferenceItemBase.php
index bbd1747..8169e27 100644
--- a/core/lib/Drupal/Core/Field/ConfigEntityReferenceItemBase.php
+++ b/core/lib/Drupal/Core/Field/ConfigEntityReferenceItemBase.php
@@ -10,7 +10,6 @@
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\field\FieldInstanceInterface;
-use Drupal\field\FieldInterface;
 
 /**
  * A common base class for configurable entity reference fields.
@@ -73,13 +72,16 @@ public function getPropertyDefinitions() {
    * Copied from \Drupal\field\Plugin\Field\FieldType\LegacyConfigFieldItem,
    * since we cannot extend it.
    */
-  public static function schema(FieldInterface $field) {
-    $definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->type);
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    $definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_definition->getType());
     $module = $definition['provider'];
     module_load_install($module);
     $callback = "{$module}_field_schema";
     if (function_exists($callback)) {
-      return $callback($field);
+      return $callback($field_definition);
+    }
+    else {
+      return parent::schema($field_definition);
     }
   }
 
diff --git a/core/lib/Drupal/Core/Field/ConfigFieldItemInterface.php b/core/lib/Drupal/Core/Field/ConfigFieldItemInterface.php
index 555070a..980714d 100644
--- a/core/lib/Drupal/Core/Field/ConfigFieldItemInterface.php
+++ b/core/lib/Drupal/Core/Field/ConfigFieldItemInterface.php
@@ -7,48 +7,12 @@
 
 namespace Drupal\Core\Field;
 
-use Drupal\field\FieldInterface;
-
 /**
  * Interface definition for 'configurable field type' plugins.
  */
 interface ConfigFieldItemInterface extends FieldItemInterface {
 
   /**
-   * Returns the schema for the field.
-   *
-   * This method is static, because the field schema information is needed on
-   * creation of the field. No field instances exist by then, and it is not
-   * possible to instantiate a FieldItemInterface object yet.
-   *
-   * @param \Drupal\field\FieldInterface $field
-   *   The field definition.
-   *
-   * @return array
-   *   An associative array with the following key/value pairs:
-   *   - columns: An array of Schema API column specifications, keyed by column
-   *     name. This specifies what comprises a value for a given field. For
-   *     example, a value for a number field is simply 'value', while a value
-   *     for a formatted text field is the combination of 'value' and 'format'.
-   *     It is recommended to avoid having the column definitions depend on
-   *     field settings when possible. No assumptions should be made on how
-   *     storage engines internally use the original column name to structure
-   *     their storage.
-   *   - indexes: (optional) An array of Schema API index definitions. Only
-   *     columns that appear in the 'columns' array are allowed. Those indexes
-   *     will be used as default indexes. Callers of field_create_field() can
-   *     specify additional indexes or, at their own risk, modify the default
-   *     indexes specified by the field-type module. Some storage engines might
-   *     not support indexes.
-   *   - foreign keys: (optional) An array of Schema API foreign key
-   *     definitions. Note, however, that the field data is not necessarily
-   *     stored in SQL. Also, the possible usage is limited, as you cannot
-   *     specify another field as related, only existing SQL tables,
-   *     such as {taxonomy_term_data}.
-   */
-  public static function schema(FieldInterface $field);
-
-  /**
    * Returns a form for the field-level settings.
    *
    * Invoked from \Drupal\field_ui\Form\FieldEditForm to allow administrators to
diff --git a/core/lib/Drupal/Core/Field/FieldDefinition.php b/core/lib/Drupal/Core/Field/FieldDefinition.php
index 0829820..5f9b800 100644
--- a/core/lib/Drupal/Core/Field/FieldDefinition.php
+++ b/core/lib/Drupal/Core/Field/FieldDefinition.php
@@ -10,6 +10,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\TypedData\DataDefinition;
 use Drupal\Core\TypedData\ListDefinition;
+use Drupal\field\FieldException;
 
 /**
  * A class for defining entity fields.
@@ -17,6 +18,13 @@
 class FieldDefinition extends ListDefinition implements FieldDefinitionInterface {
 
   /**
+   * The field schema.
+   *
+   * @var array
+   */
+  protected $schema;
+
+  /**
    * Creates a new field definition.
    *
    * @param string $type
@@ -201,4 +209,54 @@ public function getDefaultValue(EntityInterface $entity) {
     return $this->getSetting('default_value');
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getSchema() {
+    if (!isset($this->schema)) {
+      // Get the schema from the field item class.
+      $definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($this->getFieldType());
+      $class = $definition['class'];
+      $schema = $class::schema($this);
+      // Fill in default values for optional entries.
+      $schema += array('indexes' => array(), 'foreign keys' => array());
+
+      // Check that the schema does not include forbidden column names.
+      if (array_intersect(array_keys($schema['columns']), static::getReservedColumns())) {
+        throw new FieldException('Illegal field type columns.');
+      }
+
+      // Merge custom indexes with those specified by the field type. Custom
+      // indexes prevail.
+      $schema['indexes'] = $this->indexes + $schema['indexes'];
+
+      $this->schema = $schema;
+    }
+
+    return $this->schema;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getColumns() {
+    $schema = $this->getSchema();
+    // A typical use case for the method is to iterate on the columns, while
+    // some other use cases rely on identifying the first column with the key()
+    // function. Since the schema is persisted in the Field object, we take care
+    // of resetting the array pointer so that the former does not interfere with
+    // the latter.
+    reset($schema['columns']);
+    return $schema['columns'];
+  }
+
+  /**
+   * A list of columns that can not be used as field type columns.
+   *
+   * @return array
+   */
+  public static function getReservedColumns() {
+    return array('deleted');
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php
index 76f0ef9..8cb0e0c 100644
--- a/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php
+++ b/core/lib/Drupal/Core/Field/FieldDefinitionInterface.php
@@ -209,4 +209,33 @@ public function isMultiple();
    */
   public function getDefaultValue(EntityInterface $entity);
 
+  /**
+   * Returns the field schema.
+   *
+   * @return array
+   *   The field schema, as an array of key/value pairs in the format returned
+   *   by hook_field_schema():
+   *   - columns: An array of Schema API column specifications, keyed by column
+   *     name. This specifies what comprises a single value for a given field.
+   *     No assumptions should be made on how storage backends internally use
+   *     the original column name to structure their storage.
+   *   - indexes: An array of Schema API index definitions. Some storage
+   *     backends might not support indexes.
+   *   - foreign keys: An array of Schema API foreign key definitions. Note,
+   *     however, that depending on the storage backend specified for the field,
+   *     the field data is not necessarily stored in SQL.
+   */
+  public function getSchema();
+
+  /**
+   * Returns the field columns, as defined in the field schema.
+   *
+   * @return array
+   *   The array of field columns, keyed by column name, in the same format
+   *   returned by getSchema().
+   *
+   * @see \Drupal\field\Entity\FieldInterface::getSchema()
+   */
+  public function getColumns();
+
 }
diff --git a/core/lib/Drupal/Core/Field/FieldItemInterface.php b/core/lib/Drupal/Core/Field/FieldItemInterface.php
index 5524cb4..b9154db 100644
--- a/core/lib/Drupal/Core/Field/FieldItemInterface.php
+++ b/core/lib/Drupal/Core/Field/FieldItemInterface.php
@@ -24,6 +24,40 @@
 interface FieldItemInterface extends ComplexDataInterface {
 
   /**
+   * Returns the schema for the field.
+   *
+   * This method is static because the field schema information is needed on
+   * creation of the field. FieldItemInterface objects instantiated at that
+   * time are not reliable as field instance settings might be missing.
+   *
+   * Computed fields should return an empty array.
+   *
+   * @param \Drupal\Core\Field\FieldDefinitionInterface $field_definition
+   *   The field definition.
+   *
+   * @return array
+   *   An associative array with the following key/value pairs:
+   *   - columns: An array of Schema API column specifications, keyed by column
+   *     name. The columns need to be a subset of the properties defined in
+   *     getPropertyDefinitions(). It is recommended to avoid having the column
+   *     definitions depend on field settings when possible. No assumptions
+   *     should be made on how storage engines internally use the original
+   *     column name to structure their storage.
+   *   - indexes: (optional) An array of Schema API index definitions. Only
+   *     columns that appear in the 'columns' array are allowed. Those indexes
+   *     will be used as default indexes. Callers of field_create_field() can
+   *     specify additional indexes or, at their own risk, modify the default
+   *     indexes specified by the field-type module. Some storage engines might
+   *     not support indexes.
+   *   - foreign keys: (optional) An array of Schema API foreign key
+   *     definitions. Note, however, that the field data is not necessarily
+   *     stored in SQL. Also, the possible usage is limited, as you cannot
+   *     specify another field as related, only existing SQL tables,
+   *     such as {taxonomy_term_data}.
+   */
+  public static function schema(FieldDefinitionInterface $field_definition);
+
+  /**
    * Gets the entity that field belongs to.
    *
    * @return \Drupal\Core\Entity\EntityInterface
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
index 994957c..1d9884f 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/BooleanItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -42,4 +43,19 @@ public function getPropertyDefinitions() {
     return static::$propertyDefinitions;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'int',
+          'size' => 'tiny',
+          'not null' => TRUE,
+        ),
+      ),
+    );
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php
index 59984c8..c1276dd 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/DateItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 
 /**
@@ -43,4 +44,20 @@ public function getPropertyDefinitions() {
     }
     return static::$propertyDefinitions;
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'varchar',
+          'length' => 20,
+          'not null' => FALSE,
+        ),
+      ),
+    );
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php
index 5a2c107..aee1a4a 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EmailItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -43,6 +44,39 @@ public function getPropertyDefinitions() {
     return static::$propertyDefinitions;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'varchar',
+          'length' => EMAIL_MAX_LENGTH,
+          'not null' => FALSE,
+        ),
+      ),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getConstraints() {
+    $constraint_manager = \Drupal::typedData()->getValidationConstraintManager();
+    $constraints = parent::getConstraints();
+
+    $constraints[] = $constraint_manager->create('ComplexData', array(
+      'value' => array(
+        'Length' => array(
+          'max' => EMAIL_MAX_LENGTH,
+          'maxMessage' => t('%name: the e-mail address can not be longer than @max characters.', array('%name' => $this->getFieldDefinition()->getLabel(), '@max' => EMAIL_MAX_LENGTH)),
+        )
+      ),
+    ));
+
+    return $constraints;
+  }
 
   /**
    * {@inheritdoc}
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
index f773ffd..0c8c8a2 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/EntityReferenceItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -85,6 +86,43 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    $target_type = $field_definition->getSetting('target_type');
+    $target_type_info = \Drupal::entityManager()->getDefinition($target_type);
+
+    if (is_subclass_of($target_type_info['class'], '\Drupal\Core\Entity\ContentEntityInterface')) {
+      $columns = array(
+        'target_id' => array(
+          'description' => 'The ID of the target entity.',
+          'type' => 'int',
+          'unsigned' => TRUE,
+          'not null' => TRUE,
+        ),
+      );
+    }
+    else {
+      $columns = array(
+        'target_id' => array(
+          'description' => 'The ID of the target entity.',
+          'type' => 'varchar',
+          'length' => '255',
+        ),
+      );
+    }
+
+    $schema = array(
+      'columns' => $columns,
+      'indexes' => array(
+        'target_id' => array('target_id'),
+      ),
+    );
+
+    return $schema;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function __get($name) {
     $name = ($name == 'value') ? 'target_id' : $name;
     return parent::__get($name);
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php
index e489a2f..045af1c 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/FloatItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -42,4 +43,19 @@ public function getPropertyDefinitions() {
     }
     return static::$propertyDefinitions;
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'float',
+          'not null' => FALSE,
+        ),
+      ),
+    );
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php
index 82f088a..ec49cdb 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -42,4 +43,19 @@ public function getPropertyDefinitions() {
     }
     return static::$propertyDefinitions;
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'int',
+          'not null' => TRUE,
+        ),
+      ),
+    );
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
index bd4d877..3bae65b 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Language\Language;
 use Drupal\Core\TypedData\DataDefinition;
@@ -58,6 +59,21 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'varchar',
+          'length' => 12,
+          'not null' => FALSE,
+        ),
+      ),
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function setValue($values, $notify = TRUE) {
     // Treat the values as property value of the language property, if no array
     // is given as this handles language codes and objects.
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LegacyConfigFieldItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LegacyConfigFieldItem.php
index 8c24ca9..b0f74fb 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LegacyConfigFieldItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LegacyConfigFieldItem.php
@@ -7,10 +7,10 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\PrepareCacheInterface;
 use Drupal\Core\Entity\EntityStorageControllerInterface;
 use Drupal\Core\Field\ConfigFieldItemBase;
-use Drupal\field\FieldInterface;
 use Drupal\field\FieldInstanceInterface;
 
 /**
@@ -31,13 +31,13 @@
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
-    $definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field->type);
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    $definition = \Drupal::service('plugin.manager.field.field_type')->getDefinition($field_definition->type);
     $module = $definition['provider'];
     module_load_install($module);
     $callback = "{$module}_field_schema";
     if (function_exists($callback)) {
-      return $callback($field);
+      return $callback($field_definition);
     }
   }
 
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
index 9c63b33..ce78a40 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -17,6 +18,9 @@
  *   id = "string",
  *   label = @Translation("String"),
  *   description = @Translation("An entity field containing a string value."),
+ *   settings = {
+ *     "max_length" = "255"
+ *   },
  *   configurable = FALSE
  * )
  */
@@ -42,4 +46,20 @@ public function getPropertyDefinitions() {
     }
     return static::$propertyDefinitions;
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'varchar',
+          'length' => $field_definition->getSetting('max_length'),
+          'not null' => FALSE,
+        ),
+      ),
+    );
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
index c1be221..4cad163 100644
--- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UriItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Field\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -42,4 +43,18 @@ public function getPropertyDefinitions() {
     return self::$propertyDefinitions;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array(
+      'columns' => array(
+        'value' => array(
+          'type' => 'text',
+          'not null' => TRUE,
+        ),
+      ),
+    );
+  }
+
 }
diff --git a/core/lib/Drupal/Core/KeyValueStore/State.php b/core/lib/Drupal/Core/KeyValueStore/State.php
deleted file mode 100644
index 9a7d7aa..0000000
--- a/core/lib/Drupal/Core/KeyValueStore/State.php
+++ /dev/null
@@ -1,124 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains Drupal\Core\KeyValueStore\StateInterface.
- */
-
-namespace Drupal\Core\KeyValueStore;
-
-/**
- * Provides the state system using a key value store.
- */
-class State implements StateInterface {
-
-  /**
-   * The key value store to use.
-   *
-   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
-   */
-  protected $keyValueStore;
-
-  /**
-   * Static state cache.
-   *
-   * @var array
-   */
-  protected $cache = array();
-
-  /**
-   * Constructs a State object.
-   *
-   * @param \Drupal\Core\KeyValueStore\KeyValueFactory $key_value_factory
-   *  The key value store to use.
-   */
-  function __construct(KeyValueFactory $key_value_factory) {
-    $this->keyValueStore = $key_value_factory->get('state');
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function get($key, $default = NULL) {
-    $values = $this->getMultiple(array($key));
-    return isset($values[$key]) ? $values[$key] : $default;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getMultiple(array $keys) {
-    $values = array();
-    $load = array();
-    foreach ($keys as $key) {
-      // Check if we have a value in the cache.
-      if (isset($this->cache[$key])) {
-        $values[$key] = $this->cache[$key];
-      }
-      // Load the value if we don't have an explicit NULL value.
-      elseif (!array_key_exists($key, $this->cache)) {
-        $load[] = $key;
-      }
-    }
-
-    if ($load) {
-      $loaded_values = $this->keyValueStore->getMultiple($load);
-      foreach ($load as $key) {
-        // If we find a value, even one that is NULL, add it to the cache and
-        // return it.
-        if (isset($loaded_values[$key]) || array_key_exists($key, $loaded_values)) {
-          $values[$key] = $loaded_values[$key];
-          $this->cache[$key] = $loaded_values[$key];
-        }
-        else {
-          $this->cache[$key] = NULL;
-        }
-      }
-    }
-
-    return $values;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function set($key, $value) {
-    $this->cache[$key] = $value;
-    $this->keyValueStore->set($key, $value);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function setMultiple(array $data) {
-    foreach ($data as $key => $value) {
-      $this->cache[$key] = $value;
-    }
-    $this->keyValueStore->setMultiple($data);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function delete($key) {
-    $this->deleteMultiple(array($key));
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function deleteMultiple(array $keys) {
-    foreach ($keys as $key) {
-      unset($this->cache[$key]);
-    }
-    $this->keyValueStore->deleteMultiple($keys);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function resetCache() {
-    $this->cache = array();
-  }
-
-}
diff --git a/core/lib/Drupal/Core/KeyValueStore/StateInterface.php b/core/lib/Drupal/Core/KeyValueStore/StateInterface.php
deleted file mode 100644
index f5f3da6..0000000
--- a/core/lib/Drupal/Core/KeyValueStore/StateInterface.php
+++ /dev/null
@@ -1,80 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains Drupal\Core\KeyValueStore\StateInterface.
- */
-
-namespace Drupal\Core\KeyValueStore;
-
-/**
- * Defines the interface for the state system.
- */
-interface StateInterface {
-
-  /**
-   * Returns the stored value for a given key.
-   *
-   * @param string $key
-   *   The key of the data to retrieve.
-   * @param mixed $default
-   *   The default value to use if the key is not found.
-   *
-   * @return mixed
-   *   The stored value, or NULL if no value exists.
-   */
-  public function get($key, $default = NULL);
-
-  /**
-   * Returns the stored key/value pairs for a given set of keys.
-   *
-   * @param array $keys
-   *   A list of keys to retrieve.
-   *
-   * @return array
-   *   An associative array of items successfully returned, indexed by key.
-   */
-  public function getMultiple(array $keys);
-
-  /**
-   * Saves a value for a given key.
-   *
-   * @param string $key
-   *   The key of the data to store.
-   * @param mixed $value
-   *   The data to store.
-   */
-  public function set($key, $value);
-
-  /**
-   * Saves key/value pairs.
-   *
-   * @param array $data
-   *   An associative array of key/value pairs.
-   */
-  public function setMultiple(array $data);
-
-  /**
-   * Deletes an item.
-   *
-   * @param string $key
-   *   The item name to delete.
-   */
-  public function delete($key);
-
-  /**
-   * Deletes multiple items.
-   *
-   * @param array $keys
-   *   A list of item names to delete.
-   */
-  public function deleteMultiple(array $keys);
-
-  /**
-   * Resets the static cache.
-   *
-   * This is mainly used in testing environments.
-   */
-  public function resetCache();
-
-}
diff --git a/core/lib/Drupal/Core/Language/LanguageManager.php b/core/lib/Drupal/Core/Language/LanguageManager.php
index e6526f2..532d404 100644
--- a/core/lib/Drupal/Core/Language/LanguageManager.php
+++ b/core/lib/Drupal/Core/Language/LanguageManager.php
@@ -9,7 +9,7 @@
 
 use Drupal\Component\Utility\MapArray;
 use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Symfony\Component\HttpFoundation\Request;
 
 /**
@@ -27,7 +27,7 @@ class LanguageManager {
   /**
    * The Key/Value Store to use for state.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state = NULL;
 
@@ -65,12 +65,12 @@ class LanguageManager {
   /**
    * Constructs an LanguageManager object.
    *
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   (optional) The state keyvalue store. Defaults to NULL.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   (optional) The module handler service. Defaults to NULL.
    */
-  public function __construct(StateInterface $state = NULL, ModuleHandlerInterface $module_handler = NULL) {
+  public function __construct(KeyValueStoreInterface $state = NULL, ModuleHandlerInterface $module_handler = NULL) {
     $this->state = $state;
     $this->moduleHandler = $module_handler;
   }
diff --git a/core/lib/Drupal/Core/Path/AliasManager.php b/core/lib/Drupal/Core/Path/AliasManager.php
index 151bb23..72e5707 100644
--- a/core/lib/Drupal/Core/Path/AliasManager.php
+++ b/core/lib/Drupal/Core/Path/AliasManager.php
@@ -21,6 +21,13 @@ class AliasManager implements AliasManagerInterface {
   protected $connection;
 
   /**
+   * The Key/Value Store to use for state
+   *
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
+   */
+  protected $state;
+
+  /**
    * Language manager for retrieving the default langcode when none is specified.
    *
    * @var \Drupal\Core\Language\LanguageManager
diff --git a/core/lib/Drupal/Core/Path/AliasWhitelist.php b/core/lib/Drupal/Core/Path/AliasWhitelist.php
index 2c151b5..9e3a6a1 100644
--- a/core/lib/Drupal/Core/Path/AliasWhitelist.php
+++ b/core/lib/Drupal/Core/Path/AliasWhitelist.php
@@ -11,7 +11,7 @@
 use Drupal\Core\Cache\CacheCollector;
 use Drupal\Core\Database\Connection;
 use Drupal\Core\DestructableInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Lock\LockBackendInterface;
 use Drupal\Core\Utility\CacheArray;
 
@@ -23,7 +23,7 @@ class AliasWhitelist extends CacheCollector {
   /**
    * The Key/Value Store to use for state.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -43,12 +43,12 @@ class AliasWhitelist extends CacheCollector {
    *   The cache backend.
    * @param \Drupal\Core\Lock\LockBackendInterface $lock
    *   The lock backend.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state keyvalue store.
    * @param \Drupal\Core\Database\Connection $connection
    *   The database connection.
    */
-  public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, StateInterface $state, Connection $connection) {
+  public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, KeyValueStoreInterface $state, Connection $connection) {
     parent::__construct($cid, $cache, $lock);
     $this->state = $state;
     $this->connection = $connection;
diff --git a/core/lib/Drupal/Core/PrivateKey.php b/core/lib/Drupal/Core/PrivateKey.php
index 762a664..fd8bb55 100644
--- a/core/lib/Drupal/Core/PrivateKey.php
+++ b/core/lib/Drupal/Core/PrivateKey.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\Core;
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Component\Utility\Crypt;
 
 /**
@@ -18,17 +18,17 @@ class PrivateKey {
   /**
    * The state service.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
   /**
    * Constructs the token generator.
    *
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state service.
    */
-  function __construct(StateInterface $state) {
+  function __construct(KeyValueStoreInterface $state) {
     $this->state = $state;
   }
 
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index fa5caee..d6b95e8 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -912,11 +912,6 @@ function comment_entity_load($entities, $entity_type) {
   foreach ($result as $record) {
     $parts = explode('__', $record->field_id, 2);
     list(, $field_name) = $parts;
-
-    // Skip fields that entity does not have.
-    if (!$entities[$record->entity_id]->hasField($field_name)) {
-      continue;
-    }
     $comment_statistics = $entities[$record->entity_id]->get($field_name);
     $comment_statistics->cid = $record->cid;
     $comment_statistics->last_comment_timestamp = $record->last_comment_timestamp;
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php
index a68f8db..3145e8f 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldType/CommentItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\comment\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\ConfigFieldItemBase;
 
 /**
@@ -71,7 +71,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'status' => array(
diff --git a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php
index 3fbcca1..ca7e56c 100644
--- a/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php
+++ b/core/modules/datetime/lib/Drupal/datetime/Plugin/Field/FieldType/DateTimeItem.php
@@ -7,10 +7,9 @@
 
 namespace Drupal\datetime\Plugin\Field\FieldType;
 
-use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\PrepareCacheInterface;
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
 use Drupal\Core\Field\ConfigFieldItemBase;
 
 /**
@@ -61,7 +60,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/email/lib/Drupal/email/ConfigurableEmailItem.php b/core/modules/email/lib/Drupal/email/ConfigurableEmailItem.php
index e61b39b..65e08da 100644
--- a/core/modules/email/lib/Drupal/email/ConfigurableEmailItem.php
+++ b/core/modules/email/lib/Drupal/email/ConfigurableEmailItem.php
@@ -7,8 +7,8 @@
 
 namespace Drupal\email;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem;
-use Drupal\field\FieldInterface;
 use Drupal\Core\Field\ConfigFieldItemInterface;
 
 /**
@@ -19,52 +19,6 @@
 class ConfigurableEmailItem extends EmailItem implements ConfigFieldItemInterface {
 
   /**
-   * Defines the max length for an email address
-   *
-   * The maximum length of an e-mail address is 254 characters. RFC 3696
-   * specifies a total length of 320 characters, but mentions that
-   * addresses longer than 256 characters are not normally useful. Erratum
-   * 1690 was then released which corrected this value to 254 characters.
-   * @see http://tools.ietf.org/html/rfc3696#section-3
-   * @see http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690
-   */
-  const EMAIL_MAX_LENGTH = 254;
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function schema(FieldInterface $field) {
-    return array(
-      'columns' => array(
-        'value' => array(
-          'type' => 'varchar',
-          'length' => static::EMAIL_MAX_LENGTH,
-          'not null' => FALSE,
-        ),
-      ),
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getConstraints() {
-    $constraint_manager = \Drupal::typedData()->getValidationConstraintManager();
-    $constraints = parent::getConstraints();
-
-    $constraints[] = $constraint_manager->create('ComplexData', array(
-      'value' => array(
-        'Length' => array(
-          'max' => static::EMAIL_MAX_LENGTH,
-          'maxMessage' => t('%name: the e-mail address can not be longer than @max characters.', array('%name' => $this->getFieldDefinition()->getLabel(), '@max' => static::EMAIL_MAX_LENGTH)),
-        )
-      ),
-    ));
-
-    return $constraints;
-  }
-
-  /**
    * {@inheritdoc}
    */
   public function settingsForm(array $form, array &$form_state, $has_data) {
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php
index 15c625c..6b9c662 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/ConfigurableEntityReferenceItem.php
@@ -7,9 +7,10 @@
 
 namespace Drupal\entity_reference;
 
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\ConfigEntityReferenceItemBase;
 use Drupal\Core\Field\ConfigFieldItemInterface;
+use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 
 /**
  * Alternative plugin implementation of the 'entity_reference' field type.
@@ -25,43 +26,21 @@ class ConfigurableEntityReferenceItem extends ConfigEntityReferenceItemBase impl
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
-    $target_type = $field->getSetting('target_type');
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    $schema = parent::schema($field_definition);
+
+    $target_type = $field_definition->getSetting('target_type');
     $target_type_info = \Drupal::entityManager()->getDefinition($target_type);
 
     if (is_subclass_of($target_type_info['class'], '\Drupal\Core\Entity\ContentEntityInterface')) {
-      $columns = array(
-        'target_id' => array(
-          'description' => 'The ID of the target entity.',
-          'type' => 'int',
-          'unsigned' => TRUE,
-          'not null' => TRUE,
-        ),
-        'revision_id' => array(
-          'description' => 'The revision ID of the target entity.',
-          'type' => 'int',
-          'unsigned' => TRUE,
-          'not null' => FALSE,
-        ),
-      );
-    }
-    else {
-      $columns = array(
-        'target_id' => array(
-          'description' => 'The ID of the target entity.',
-          'type' => 'varchar',
-          'length' => '255',
-        ),
+      $schema['columns']['revision_id'] = array(
+        'description' => 'The revision ID of the target entity.',
+        'type' => 'int',
+        'unsigned' => TRUE,
+        'not null' => FALSE,
       );
     }
 
-    $schema = array(
-      'columns' => $columns,
-      'indexes' => array(
-        'target_id' => array('target_id'),
-      ),
-    );
-
     return $schema;
   }
 
diff --git a/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php b/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php
index 7c2e381..0438c67 100644
--- a/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php
+++ b/core/modules/field/lib/Drupal/field/Entity/FieldInstance.php
@@ -681,4 +681,19 @@ public function getItemDefinition() {
     }
     return $this->itemDefinition;
   }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getSchema() {
+    return $this->field->getSchema();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getColumns() {
+    return $this->field->getColumns();
+  }
+
 }
diff --git a/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php b/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
index 3e69ae6..799d100 100644
--- a/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
+++ b/core/modules/field/lib/Drupal/field/FieldInstanceStorageController.php
@@ -16,7 +16,7 @@
 use Drupal\Component\Uuid\UuidInterface;
 use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\Extension\ModuleHandler;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 /**
  * Controller class for field instances.
@@ -45,7 +45,7 @@ class FieldInstanceStorageController extends ConfigStorageController {
   /**
    * The state keyvalue collection.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -68,10 +68,10 @@ class FieldInstanceStorageController extends ConfigStorageController {
    *   The entity manager.
    * @param \Drupal\Core\Extension\ModuleHandler $module_handler
    *   The module handler.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    */
-  public function __construct($entity_type, array $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, ModuleHandler $module_handler, StateInterface $state) {
+  public function __construct($entity_type, array $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, ModuleHandler $module_handler, KeyValueStoreInterface $state) {
     parent::__construct($entity_type, $entity_info, $config_factory, $config_storage, $entity_query_factory, $uuid_service);
     $this->entityManager = $entity_manager;
     $this->moduleHandler = $module_handler;
diff --git a/core/modules/field/lib/Drupal/field/FieldInterface.php b/core/modules/field/lib/Drupal/field/FieldInterface.php
index 78de421..ed2658c 100644
--- a/core/modules/field/lib/Drupal/field/FieldInterface.php
+++ b/core/modules/field/lib/Drupal/field/FieldInterface.php
@@ -16,35 +16,6 @@
 interface FieldInterface extends ConfigEntityInterface, FieldDefinitionInterface {
 
   /**
-   * Returns the field schema.
-   *
-   * @return array
-   *   The field schema, as an array of key/value pairs in the format returned
-   *   by hook_field_schema():
-   *   - columns: An array of Schema API column specifications, keyed by column
-   *     name. This specifies what comprises a single value for a given field.
-   *     No assumptions should be made on how storage backends internally use
-   *     the original column name to structure their storage.
-   *   - indexes: An array of Schema API index definitions. Some storage
-   *     backends might not support indexes.
-   *   - foreign keys: An array of Schema API foreign key definitions. Note,
-   *     however, that depending on the storage backend specified for the field,
-   *     the field data is not necessarily stored in SQL.
-   */
-  public function getSchema();
-
-  /**
-   * Returns the field columns, as defined in the field schema.
-   *
-   * @return array
-   *   The array of field columns, keyed by column name, in the same format
-   *   returned by getSchema().
-   *
-   * @see \Drupal\field\Entity\FieldInterface::getSchema()
-   */
-  public function getColumns();
-
-  /**
    * Returns the list of bundles where the field has instances.
    *
    * @return array
diff --git a/core/modules/field/lib/Drupal/field/FieldStorageController.php b/core/modules/field/lib/Drupal/field/FieldStorageController.php
index 3f6408f..061bfec 100644
--- a/core/modules/field/lib/Drupal/field/FieldStorageController.php
+++ b/core/modules/field/lib/Drupal/field/FieldStorageController.php
@@ -16,7 +16,7 @@
 use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\Config\StorageInterface;
 use Drupal\Core\Extension\ModuleHandler;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 
 /**
  * Controller class for fields.
@@ -40,7 +40,7 @@ class FieldStorageController extends ConfigStorageController {
   /**
    * The state keyvalue collection.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -63,10 +63,10 @@ class FieldStorageController extends ConfigStorageController {
    *   The entity manager.
    * @param \Drupal\Core\Extension\ModuleHandler $module_handler
    *   The module handler.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    */
-  public function __construct($entity_type, array $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, ModuleHandler $module_handler, StateInterface $state) {
+  public function __construct($entity_type, array $entity_info, ConfigFactory $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, ModuleHandler $module_handler, KeyValueStoreInterface $state) {
     parent::__construct($entity_type, $entity_info, $config_factory, $config_storage, $entity_query_factory, $uuid_service);
     $this->entityManager = $entity_manager;
     $this->moduleHandler = $module_handler;
diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php
index fedd03c..15d05cd 100644
--- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php
+++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/ShapeItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\field_test\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\ConfigFieldItemBase;
 
 /**
@@ -53,16 +53,16 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     $foreign_keys = array();
     // The 'foreign keys' key is not always used in tests.
-    if ($field->getSetting('foreign_key_name')) {
+    if ($field_definition->getSetting('foreign_key_name')) {
       $foreign_keys['foreign keys'] = array(
         // This is a dummy foreign key definition, references a table that
         // doesn't exist, but that's not a problem.
-        $field->getSetting('foreign_key_name') => array(
-          'table' => $field->getSetting('foreign_key_name'),
-          'columns' => array($field->getSetting('foreign_key_name') => 'id'),
+        $field_definition->getSetting('foreign_key_name') => array(
+          'table' => $field_definition->getSetting('foreign_key_name'),
+          'columns' => array($field_definition->getSetting('foreign_key_name') => 'id'),
         ),
       );
     }
diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php
index 1c1c4e5..f8cd226 100644
--- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php
+++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Field/FieldType/TestItem.php
@@ -7,11 +7,9 @@
 
 namespace Drupal\field_test\Plugin\Field\FieldType;
 
-use Drupal\Core\Entity\Annotation\FieldType;
-use Drupal\Core\Annotation\Translation;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\PrepareCacheInterface;
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
 use Drupal\Core\Field\ConfigFieldItemBase;
 
 /**
@@ -59,7 +57,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php
index 188ae85..9bb9dd0 100644
--- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php
+++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php
@@ -7,9 +7,9 @@
 
 namespace Drupal\file\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
 use Drupal\Core\Field\ConfigFieldItemInterface;
 
 /**
@@ -49,7 +49,7 @@ class FileItem extends EntityReferenceItem implements ConfigFieldItemInterface {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'target_id' => array(
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php b/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
index b6fb820..96305bd 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileManagedTestBase.php
@@ -38,8 +38,6 @@ function setUp() {
    *   'insert', etc.
    */
   function assertFileHooksCalled($expected) {
-    \Drupal::state()->resetCache();
-
     // Determine which hooks were called.
     $actual = array_keys(array_filter(file_test_get_all_calls()));
 
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumUninstallTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumUninstallTest.php
index d1f0e65..7243fa6 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumUninstallTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumUninstallTest.php
@@ -37,48 +37,9 @@ function testForumUninstallWithField() {
     $field = field_info_field('node', 'taxonomy_forums');
     $this->assertNotNull($field, 'The taxonomy_forums field exists.');
 
-    // Create a taxonomy term.
-    $term = entity_create('taxonomy_term', array(
-      'name' => t('A term'),
-      'langcode' => language_default()->id,
-      'description' => '',
-      'parent' => array(0),
-      'vid' => 'forums',
-      'forum_container' => 0,
-    ));
-    $term->save();
-
-    // Create a forum node.
-    $node = $this->drupalCreateNode(array(
-      'title' => 'A forum post',
-      'type' => 'forum',
-      'taxonomy_forums' => array(array('target_id' => $term->id())),
-    ));
-
-    // Create at least one comment against the forum node.
-    $comment = entity_create('comment', array(
-      'entity_id' => $node->nid->value,
-      'entity_type' => 'node',
-      'field_name' => 'comment_forum',
-      'pid' => 0,
-      'uid' => 0,
-      'status' => COMMENT_PUBLISHED,
-      'subject' => $this->randomName(),
-      'hostname' => '127.0.0.1',
-    ));
-    $comment->save();
-
     // Uninstall the forum module which should trigger field deletion.
     $this->container->get('module_handler')->uninstall(array('forum'));
 
-    // We want to test the handling of removing the forum comment field, so we
-    // ensure there is at least one other comment field attached to a node type
-    // so that comment_entity_load() runs for nodes.
-    \Drupal::service('comment.manager')->addDefaultField('node', 'forum', 'another_comment_field', COMMENT_OPEN);
-
-    $this->drupalGet('node/' . $node->nid->value);
-    $this->assertResponse(200);
-
     // Check that the field is now deleted.
     $field = field_info_field('node', 'taxonomy_forums');
     $this->assertNull($field, 'The taxonomy_forums field has been deleted.');
diff --git a/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php
index b1e56f3..1cface2 100644
--- a/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php
+++ b/core/modules/image/lib/Drupal/image/Plugin/Field/FieldType/ImageItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\image\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\file\Plugin\Field\FieldType\FileItem;
 
 /**
@@ -70,7 +70,7 @@ class ImageItem extends FileItem {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'target_id' => array(
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageFallbackTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageFallbackTest.php
index 4123fc0..ba50def 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageFallbackTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageFallbackTest.php
@@ -26,7 +26,7 @@ public static function getInfo() {
   /**
    * The state storage service.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
diff --git a/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php b/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php
index edd2d96..1102aec 100644
--- a/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php
+++ b/core/modules/link/lib/Drupal/link/Plugin/Field/FieldType/LinkItem.php
@@ -9,7 +9,7 @@
 
 use Drupal\Core\Field\ConfigFieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'link' field type.
@@ -54,7 +54,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'url' => array(
diff --git a/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php b/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php
index ea4c9ce..c33da33 100644
--- a/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php
+++ b/core/modules/locale/lib/Drupal/locale/Form/TranslateFormBase.php
@@ -11,7 +11,7 @@
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageManager;
 use Drupal\locale\StringStorageInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -31,7 +31,7 @@
   /**
    * The state store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -54,12 +54,12 @@
    *
    * @param \Drupal\locale\StringStorageInterface $locale_storage
    *   The locale storage.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state service.
    * @param \Drupal\Core\Language\LanguageManager $language_manager
    *   The language manager.
    */
-  public function __construct(StringStorageInterface $locale_storage, StateInterface $state, LanguageManager $language_manager) {
+  public function __construct(StringStorageInterface $locale_storage, KeyValueStoreInterface $state, LanguageManager $language_manager) {
     $this->localeStorage = $locale_storage;
     $this->state = $state;
     $this->languageManager = $language_manager;
diff --git a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
index 143881f..087944e 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/Search/NodeSearch.php
@@ -14,7 +14,7 @@
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\Session\AccountInterface;
@@ -68,7 +68,7 @@ class NodeSearch extends SearchPluginBase implements AccessibleInterface, Search
   /**
    * The Drupal state object used to set 'node.cron_last'.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -111,7 +111,7 @@ static public function create(ContainerInterface $container, array $configuratio
       $container->get('entity.manager'),
       $container->get('module_handler'),
       $container->get('config.factory')->get('search.settings'),
-      $container->get('state'),
+      $container->get('keyvalue')->get('state'),
       $container->get('current_user')
     );
   }
@@ -133,12 +133,12 @@ static public function create(ContainerInterface $container, array $configuratio
    *   A module manager object.
    * @param \Drupal\Core\Config\Config $search_settings
    *   A config object for 'search.settings'.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The Drupal state object used to set 'node.cron_last'.
    * @param \Drupal\Core\Session\AccountInterface $account
    *   The $account object to use for checking for access to advanced search.
    */
-  public function __construct(array $configuration, $plugin_id, array $plugin_definition, Connection $database, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, Config $search_settings, StateInterface $state, AccountInterface $account = NULL) {
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, Connection $database, EntityManagerInterface $entity_manager, ModuleHandlerInterface $module_handler, Config $search_settings, KeyValueStoreInterface $state, AccountInterface $account = NULL) {
     $this->database = $database;
     $this->entityManager = $entity_manager;
     $this->moduleHandler = $module_handler;
diff --git a/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/DecimalItem.php b/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/DecimalItem.php
index 16353db..58b52a2 100644
--- a/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/DecimalItem.php
+++ b/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/DecimalItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\number\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Component\Utility\MapArray;
 
 /**
@@ -48,13 +48,13 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
           'type' => 'numeric',
-          'precision' => $field->settings['precision'],
-          'scale' => $field->settings['scale'],
+          'precision' => $field_definition->settings['precision'],
+          'scale' => $field_definition->settings['scale'],
           'not null' => FALSE
         )
       ),
diff --git a/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/FloatItem.php b/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/FloatItem.php
index 88ee07f..5765147 100644
--- a/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/FloatItem.php
+++ b/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/FloatItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\number\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'number_float' field type.
@@ -43,7 +43,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/IntegerItem.php b/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/IntegerItem.php
index dfe35f6..6c44d76 100644
--- a/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/IntegerItem.php
+++ b/core/modules/number/lib/Drupal/number/Plugin/Field/FieldType/IntegerItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\number\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'number_integer' field type.
@@ -43,7 +43,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php
index 601bc0b..6d75cac 100644
--- a/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php
+++ b/core/modules/path/lib/Drupal/path/Plugin/Field/FieldType/PathItem.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\path\Plugin\Field\FieldType;
 
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
 
@@ -45,4 +46,11 @@ public function getPropertyDefinitions() {
     return static::$propertyDefinitions;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldDefinitionInterface $field_definition) {
+    return array();
+  }
+
 }
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
index cef8953..19bc077 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/views/display/RestExport.php
@@ -8,7 +8,7 @@
 namespace Drupal\rest\Plugin\views\display;
 
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\views\Annotation\ViewsDisplay;
 use Drupal\Core\Annotation\Translation;
@@ -99,14 +99,14 @@ class RestExport extends PathPluginBase {
    *   The plugin implementation definition.
    * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
    *   The route provider
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    * @param \Drupal\Core\ContentNegotiation $content_negotiation
    *   The content negotiation library.
    * @param \Symfony\Component\HttpFoundation\Request $request
    *   The request object.
    */
-  public function __construct(array $configuration, $plugin_id, array $plugin_definition, RouteProviderInterface $route_provider, StateInterface $state, ContentNegotiation $content_negotiation, Request $request) {
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, RouteProviderInterface $route_provider, KeyValueStoreInterface $state, ContentNegotiation $content_negotiation, Request $request) {
     parent::__construct($configuration, $plugin_id, $plugin_definition, $route_provider, $state);
     $this->contentNegotiation = $content_negotiation;
     $this->request = $request;
diff --git a/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php b/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
index 05c6d5d..ae4bb43 100644
--- a/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
+++ b/core/modules/rest/tests/Drupal/rest/Tests/CollectRoutesTest.php
@@ -82,7 +82,7 @@ protected function setUp() {
       ->getMock();
     $container->set('router.route_provider', $route_provider);
 
-    $state = $this->getMock('\Drupal\Core\KeyValueStore\StateInterface');
+    $state = $this->getMock('\Drupal\Core\KeyValueStore\KeyValueStoreInterface');
     $container->set('state', $state);
 
     $style_manager = $this->getMockBuilder('\Drupal\views\Plugin\ViewsPluginManager')
diff --git a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php
index 0d3e115..d7e566f 100644
--- a/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php
+++ b/core/modules/search/lib/Drupal/search/Form/SearchSettingsForm.php
@@ -10,7 +10,7 @@
 use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\Config\Context\ContextInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\search\SearchPluginManager;
 use Drupal\Core\Form\ConfigFormBase;
@@ -45,7 +45,7 @@ class SearchSettingsForm extends ConfigFormBase {
   /**
    * The Drupal state storage service.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -60,10 +60,10 @@ class SearchSettingsForm extends ConfigFormBase {
    *   The manager for search plugins.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key/value store interface, gives access to state based config settings.
    */
-  public function __construct(ConfigFactory $config_factory, ContextInterface $context, SearchPluginManager $manager, ModuleHandlerInterface $module_handler, StateInterface $state) {
+  public function __construct(ConfigFactory $config_factory, ContextInterface $context, SearchPluginManager $manager, ModuleHandlerInterface $module_handler, KeyValueStoreInterface $state) {
     parent::__construct($config_factory, $context);
     $this->searchSettings = $config_factory->get('search.settings');
     $this->searchPluginManager = $manager;
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index dee1760..5eb5b26 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -175,8 +175,10 @@ public function containerBuild(ContainerBuilder $container) {
         ->addArgument(new Reference('service_container'))
         ->addArgument(new Reference('settings'));
 
-      $container->register('state', 'Drupal\Core\KeyValueStore\State')
-        ->addArgument(new Reference('keyvalue'));
+      $container->register('state', 'Drupal\Core\KeyValueStore\KeyValueStoreInterface')
+        ->setFactoryService(new Reference('keyvalue'))
+        ->setFactoryMethod('get')
+        ->addArgument('state');
     }
 
     if ($container->hasDefinition('path_processor_alias')) {
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 79d8b8f..219762f 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -1008,7 +1008,6 @@ protected function refreshVariables() {
     // Clear the tag cache.
     drupal_static_reset('Drupal\Core\Cache\CacheBackendInterface::tagCache');
     \Drupal::service('config.factory')->reset();
-    \Drupal::state()->resetCache();
   }
 
   /**
diff --git a/core/modules/system/entity.api.php b/core/modules/system/entity.api.php
index 3cf9535..c44b4fd 100644
--- a/core/modules/system/entity.api.php
+++ b/core/modules/system/entity.api.php
@@ -287,10 +287,7 @@ function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
 }
 
 /**
- * Respond to creation of a new entity.
- *
- * This hook runs once the entity has been stored. Note that hook
- * implementations may not alter the stored entity data.
+ * Act on entities when inserted.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object.
@@ -308,10 +305,7 @@ function hook_entity_insert(Drupal\Core\Entity\EntityInterface $entity) {
 }
 
 /**
- * Respond to updates to an entity.
- *
- * This hook runs once the entity storage has been updated. Note that hook
- * implementations may not alter the stored entity data.
+ * Act on entities when updated.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object.
@@ -328,10 +322,7 @@ function hook_entity_update(Drupal\Core\Entity\EntityInterface $entity) {
 }
 
 /**
- * Respond to creation of a new entity translation.
- *
- * This hook runs once the entity translation has been stored. Note that hook
- * implementations may not alter the stored entity translation data.
+ * Acts after storing a new entity translation.
  *
  * @param \Drupal\Core\Entity\EntityInterface $translation
  *   The entity object of the translation just stored.
@@ -345,9 +336,7 @@ function hook_entity_translation_insert(\Drupal\Core\Entity\EntityInterface $tra
 }
 
 /**
- * Respond to entity translation deletion.
- *
- * This hook runs once the entity translation has been deleted from storage.
+ * Acts after deleting an entity translation from the storage.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The original entity object.
@@ -364,6 +353,8 @@ function hook_entity_translation_delete(\Drupal\Core\Entity\EntityInterface $tra
 /**
  * Act before entity deletion.
  *
+ * This hook runs after the entity type-specific predelete hook.
+ *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object for the entity that is about to be deleted.
  */
@@ -391,7 +382,7 @@ function hook_entity_predelete(Drupal\Core\Entity\EntityInterface $entity) {
 /**
  * Respond to entity deletion.
  *
- * This hook runs once the entity has been deleted from the storage.
+ * This hook runs after the entity type-specific delete hook.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object for the entity that has been deleted.
@@ -407,7 +398,7 @@ function hook_entity_delete(Drupal\Core\Entity\EntityInterface $entity) {
 /**
  * Respond to entity revision deletion.
  *
- * This hook runs once the entity revision has been deleted from the storage.
+ * This hook runs after the entity type-specific revision delete hook.
  *
  * @param \Drupal\Core\Entity\EntityInterface $entity
  *   The entity object for the entity revision that has been deleted.
diff --git a/core/modules/system/lib/Drupal/system/Form/CronForm.php b/core/modules/system/lib/Drupal/system/Form/CronForm.php
index 5d94762..84dddb1 100644
--- a/core/modules/system/lib/Drupal/system/Form/CronForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/CronForm.php
@@ -9,7 +9,7 @@
 
 use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\Config\Context\ContextInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\RedirectResponse;
@@ -22,7 +22,7 @@ class CronForm extends ConfigFormBase {
   /**
    * Stores the state storage service.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -33,10 +33,10 @@ class CronForm extends ConfigFormBase {
    *   The factory for configuration objects.
    * @param \Drupal\Core\Config\Context\ContextInterface $context
    *   The configuration context used for this configuration object.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    */
-  public function __construct(ConfigFactory $config_factory, ContextInterface $context, StateInterface $state) {
+  public function __construct(ConfigFactory $config_factory, ContextInterface $context, KeyValueStoreInterface $state) {
     parent::__construct($config_factory, $context);
     $this->state = $state;
   }
diff --git a/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php b/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php
index 693dc28..fa10960 100644
--- a/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php
+++ b/core/modules/system/lib/Drupal/system/Form/SiteMaintenanceModeForm.php
@@ -9,7 +9,7 @@
 
 use Drupal\Core\Config\ConfigFactory;
 use Drupal\Core\Config\Context\ContextInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Form\ConfigFormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
@@ -21,7 +21,7 @@ class SiteMaintenanceModeForm extends ConfigFormBase {
   /**
    * The state keyvalue collection.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -32,10 +32,10 @@ class SiteMaintenanceModeForm extends ConfigFormBase {
    *   The factory for configuration objects.
    * @param \Drupal\Core\Config\Context\ContextInterface $context
    *   The configuration context to use.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state keyvalue collection to use.
    */
-  public function __construct(ConfigFactory $config_factory, ContextInterface $context, StateInterface $state) {
+  public function __construct(ConfigFactory $config_factory, ContextInterface $context, KeyValueStoreInterface $state) {
     parent::__construct($config_factory, $context);
     $this->state = $state;
   }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php
index ccf6070..3391a14 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityUnitTestBase.php
@@ -32,7 +32,7 @@
   /**
    * The state service.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index c0b0f02..a9187b2 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -66,6 +66,18 @@
 const REGIONS_ALL = 'all';
 
 /**
+ * Defines the max length for an email address
+ *
+ * The maximum length of an e-mail address is 254 characters. RFC 3696
+ * specifies a total length of 320 characters, but mentions that
+ * addresses longer than 256 characters are not normally useful. Erratum
+ * 1690 was then released which corrected this value to 254 characters.
+ * @see http://tools.ietf.org/html/rfc3696#section-3
+ * @see http://www.rfc-editor.org/errata_search.php?rfc=3696&eid=1690
+ */
+const EMAIL_MAX_LENGTH = 254;
+
+/**
  * Implements hook_help().
  */
 function system_help($path, $arg) {
@@ -339,8 +351,7 @@ function system_element_info() {
   $types['email'] = array(
     '#input' => TRUE,
     '#size' => 60,
-    // user.module is not loaded in case of early bootstrap errors.
-    '#maxlength' => defined('EMAIL_MAX_LENGTH') ? EMAIL_MAX_LENGTH : 255,
+    '#maxlength' => EMAIL_MAX_LENGTH,
     '#autocomplete_route_name' => FALSE,
     '#process' => array('form_process_autocomplete', 'ajax_process_form', 'form_process_pattern'),
     '#element_validate' => array('form_validate_email'),
diff --git a/core/modules/system/tests/modules/service_provider_test/lib/Drupal/service_provider_test/TestClass.php b/core/modules/system/tests/modules/service_provider_test/lib/Drupal/service_provider_test/TestClass.php
index 9078493..1c8ea06 100644
--- a/core/modules/system/tests/modules/service_provider_test/lib/Drupal/service_provider_test/TestClass.php
+++ b/core/modules/system/tests/modules/service_provider_test/lib/Drupal/service_provider_test/TestClass.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\service_provider_test;
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\DestructableInterface;
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
 use Symfony\Component\HttpKernel\Event\GetResponseEvent;
@@ -18,17 +18,17 @@ class TestClass implements EventSubscriberInterface, DestructableInterface {
   /**
    * The state keyvalue collection.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
   /**
    * Constructor.
    *
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    */
-  public function __construct(StateInterface $state) {
+  public function __construct(KeyValueStoreInterface $state) {
     $this->state = $state;
   }
 
diff --git a/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php b/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php
index 8581bdf..e23d6fa 100644
--- a/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php
+++ b/core/modules/telephone/lib/Drupal/telephone/Plugin/Field/FieldType/TelephoneItem.php
@@ -9,7 +9,7 @@
 
 use Drupal\Core\Field\ConfigFieldItemBase;
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'telephone' field type.
@@ -34,7 +34,7 @@ class TelephoneItem extends ConfigFieldItemBase {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php
index cd783f9..bf415c5 100644
--- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php
+++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextItem.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\text\Plugin\Field\FieldType;
 
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'text' field type.
@@ -31,12 +31,12 @@ class TextItem extends TextItemBase {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
           'type' => 'varchar',
-          'length' => $field->settings['max_length'],
+          'length' => $field_definition->getSetting('max_length'),
           'not null' => FALSE,
         ),
         'format' => array(
diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php
index 9911a93..7e378fc 100644
--- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php
+++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\text\Plugin\Field\FieldType;
 
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'text_long' field type.
@@ -28,7 +28,7 @@ class TextLongItem extends TextItemBase {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php
index 1efad43..36df950 100644
--- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php
+++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextWithSummaryItem.php
@@ -8,7 +8,7 @@
 namespace Drupal\text\Plugin\Field\FieldType;
 
 use Drupal\Core\TypedData\DataDefinition;
-use Drupal\field\FieldInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
 
 /**
  * Plugin implementation of the 'text_with_summary' field type.
@@ -57,7 +57,7 @@ public function getPropertyDefinitions() {
   /**
    * {@inheritdoc}
    */
-  public static function schema(FieldInterface $field) {
+  public static function schema(FieldDefinitionInterface $field_definition) {
     return array(
       'columns' => array(
         'value' => array(
diff --git a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
index 07d35e9..236b293 100644
--- a/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
+++ b/core/modules/user/lib/Drupal/user/Form/UserPasswordForm.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\user\Form;
 
+use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem;
 use Drupal\Core\Form\FormBase;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageManager;
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php b/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php
index 642120f..03dd2ea 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserValidationTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\user\Tests;
 
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Field\Plugin\Field\FieldType\EmailItem;
 use Drupal\simpletest\DrupalUnitTestBase;
 
 /**
@@ -109,9 +110,9 @@ function testValidation() {
     $mail = $this->randomName(EMAIL_MAX_LENGTH - 11) . '@example.com';
     $user->set('mail', $mail);
     $violations = $user->validate();
-    $this->assertEqual(count($violations), 1, 'Violation found when email is too long');
+    $this->assertEqual(count($violations), 2, 'Violation found when email is too long');
     $this->assertEqual($violations[0]->getPropertyPath(), 'mail.0.value');
-    $this->assertEqual($violations[0]->getMessage(), t('This value is not a valid email address.'));
+    $this->assertEqual($violations[0]->getMessage(), t('%name: the e-mail address can not be longer than @max characters.', array('%name' => $user->get('mail')->getFieldDefinition()->getLabel(), '@max' => EMAIL_MAX_LENGTH)));
 
     // Provoke a e-mail collision with an exsiting user.
     $user->set('mail', 'existing@example.com');
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 79e9cab..6533a14 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -25,11 +25,6 @@
 const USERNAME_MAX_LENGTH = 60;
 
 /**
- * Maximum length of user e-mail text field.
- */
-const EMAIL_MAX_LENGTH = 255;
-
-/**
  * Only administrators can create user accounts.
  */
 const USER_REGISTER_ADMINISTRATORS_ONLY = 'admin_only';
diff --git a/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php b/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php
index c8b0437..26108b9 100644
--- a/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php
+++ b/core/modules/views/lib/Drupal/views/EventSubscriber/RouteSubscriber.php
@@ -10,7 +10,7 @@
 use Drupal\Component\Utility\MapArray;
 use Drupal\Core\DestructableInterface;
 use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Routing\RouteSubscriberBase;
 use Drupal\views\Plugin\views\display\DisplayRouterInterface;
 use Drupal\views\ViewExecutable;
@@ -44,7 +44,7 @@ class RouteSubscriber extends RouteSubscriberBase implements DestructableInterfa
   /**
    * The state key value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -60,10 +60,10 @@ class RouteSubscriber extends RouteSubscriberBase implements DestructableInterfa
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    */
-  public function __construct(EntityManagerInterface $entity_manager, StateInterface $state) {
+  public function __construct(EntityManagerInterface $entity_manager, KeyValueStoreInterface $state) {
     $this->viewStorageController = $entity_manager->getStorageController('view');
     $this->state = $state;
   }
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
index 01790c2..f5fcc5a 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/PathPluginBase.php
@@ -7,7 +7,7 @@
 
 namespace Drupal\views\Plugin\views\display;
 
-use Drupal\Core\KeyValueStore\StateInterface;
+use Drupal\Core\KeyValueStore\KeyValueStoreInterface;
 use Drupal\Core\Routing\RouteCompiler;
 use Drupal\Core\Routing\RouteProviderInterface;
 use Drupal\views\Views;
@@ -35,7 +35,7 @@
   /**
    * The state key value store.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface
    */
   protected $state;
 
@@ -50,10 +50,10 @@
    *   The plugin implementation definition.
    * @param \Drupal\Core\Routing\RouteProviderInterface $route_provider
    *   The route provider.
-   * @param \Drupal\Core\KeyValueStore\StateInterface $state
+   * @param \Drupal\Core\KeyValueStore\KeyValueStoreInterface $state
    *   The state key value store.
    */
-  public function __construct(array $configuration, $plugin_id, array $plugin_definition, RouteProviderInterface $route_provider, StateInterface $state) {
+  public function __construct(array $configuration, $plugin_id, array $plugin_definition, RouteProviderInterface $route_provider, KeyValueStoreInterface $state) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
 
     $this->routeProvider = $route_provider;
diff --git a/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php b/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php
index 6e4c644..8a69bd3 100644
--- a/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php
+++ b/core/modules/views/tests/Drupal/views/Tests/EventSubscriber/RouteSubscriberTest.php
@@ -44,7 +44,7 @@ class RouteSubscriberTest extends UnitTestCase {
   /**
    * The mocked key value storage.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected $state;
 
@@ -68,7 +68,7 @@ protected function setUp() {
       ->method('getStorageController')
       ->with('view')
       ->will($this->returnValue($this->viewStorageController));
-    $this->state = $this->getMock('\Drupal\Core\KeyValueStore\StateInterface');
+    $this->state = $this->getMock('\Drupal\Core\KeyValueStore\KeyValueStoreInterface');
     $this->routeSubscriber = new TestRouteSubscriber($this->entityManager, $this->state);
   }
 
diff --git a/core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php b/core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
index 0f5289f..8b87a45 100644
--- a/core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
+++ b/core/modules/views/tests/Drupal/views/Tests/Plugin/display/PathPluginBaseTest.php
@@ -43,7 +43,7 @@ class PathPluginBaseTest extends UnitTestCase {
   /**
    * The mocked key value storage.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected $state;
 
@@ -62,7 +62,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->routeProvider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $this->state = $this->getMock('\Drupal\Core\KeyValueStore\StateInterface');
+    $this->state = $this->getMock('\Drupal\Core\KeyValueStore\KeyValueStoreInterface');
     $this->pathPlugin = $this->getMockBuilder('Drupal\views\Plugin\views\display\PathPluginBase')
       ->setConstructorArgs(array(array(), 'path_base', array(), $this->routeProvider, $this->state))
       ->setMethods(NULL)
diff --git a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php
index 12a0984..b30bb34 100644
--- a/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php
+++ b/core/modules/views_ui/tests/Drupal/views_ui/Tests/ViewListControllerTest.php
@@ -77,7 +77,7 @@ public function testBuildRowEntityList() {
       array(array(), 'default', $display_manager->getDefinition('default'))
     );
     $route_provider = $this->getMock('Drupal\Core\Routing\RouteProviderInterface');
-    $state = $this->getMock('\Drupal\Core\KeyValueStore\StateInterface');
+    $state = $this->getMock('\Drupal\Core\KeyValueStore\KeyValueStoreInterface');
     $page_display = $this->getMock('Drupal\views\Plugin\views\display\Page',
       array('initDisplay', 'getPath'),
       array(array(), 'default', $display_manager->getDefinition('page'), $route_provider, $state)
diff --git a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
index fecb135..bfbe65c 100644
--- a/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Asset/CssCollectionRendererUnitTest.php
@@ -66,7 +66,7 @@ class CssCollectionRendererUnitTest extends UnitTestCase {
   /**
    * The state mock class.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected $state;
 
@@ -81,7 +81,7 @@ public static function getInfo() {
   function setUp() {
     parent::setUp();
 
-    $this->state = $this->getMock('Drupal\Core\KeyValueStore\StateInterface');
+    $this->state = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface');
 
     $this->renderer = new CssCollectionRenderer($this->state);
     $this->file_css_group = array(
diff --git a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
index 9f864f8..a77a939 100644
--- a/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
+++ b/core/tests/Drupal/Tests/Core/PrivateKeyTest.php
@@ -19,7 +19,7 @@ class PrivateKeyTest extends UnitTestCase {
   /**
    * The state mock class.
    *
-   * @var \Drupal\Core\KeyValueStore\StateInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\KeyValueStore\KeyValueStoreInterface|\PHPUnit_Framework_MockObject_MockObject
    */
   protected $state;
 
@@ -52,7 +52,7 @@ public function setUp() {
     parent::setUp();
     $this->key = Crypt::randomStringHashed(55);
 
-    $this->state = $this->getMock('Drupal\Core\KeyValueStore\StateInterface');
+    $this->state = $this->getMock('Drupal\Core\KeyValueStore\KeyValueStoreInterface');
 
     $this->privateKey = new PrivateKey($this->state);
   }
