diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 61d9fee..44ff142 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1690,7 +1690,7 @@ function install_get_localization_release($version = \Drupal::VERSION) {
     }
   }
 
-  // All releases may fall back to the previous major release (e.g., 8.1 falls
+  // All releases may a fallback to the previous major release (e.g., 8.1 falls
   // back to 7.0, 8.x-dev falls back to 7.0). This will probably only be used
   // for early dev releases or languages with an inactive translation team.
   $alternatives[] = $info['major'] - 1 . '.0';
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index bbeb9cb..fba130e 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -340,23 +340,87 @@ function list_themes($refresh = FALSE) {
 }
 
 /**
- * Generates themed output (internal use only).
- *
- * _theme() is an internal function. Do not call this function directly as it
- * will prevent the following items from working correctly:
- * - Render caching.
- * - JavaScript and CSS asset attachment.
- * - Pre / post render hooks.
- * - Defaults provided by hook_element_info(), including attached assets.
- * Instead, build a render array with a #theme key, and either return the
- * array (where possible) or call drupal_render() to convert it to HTML.
- *
- * All requests for themed output must go through this function, which is
- * invoked as part of the @link theme_render drupal_render() process @endlink.
- * The appropriate theme function is indicated by the #theme property
- * of a renderable array. _theme() examines the request and routes it to the
- * appropriate @link themeable theme function or template @endlink, by checking
- * the theme registry.
+ * Generates themed output.
+ *
+ * All requests for themed output must go through this function (however,
+ * calling the _theme() function directly is very strongly discouraged - see
+ * next paragraph). It examines the request and routes it to the appropriate
+ * @link themeable theme function or template @endlink, by checking the theme
+ * registry.
+ *
+ * Avoid calling this function directly. It is preferable to replace direct
+ * calls to the _theme() function with calls to drupal_render() by passing a
+ * render array with a #theme key to drupal_render(), which in turn calls
+ * _theme().
+ *
+ * @section sec_theme_hooks Theme Hooks
+ * Most commonly, the first argument to this function is the name of the theme
+ * hook. For instance, to theme a taxonomy term, the theme hook name is
+ * 'taxonomy_term'. Modules register theme hooks within a hook_theme()
+ * implementation and provide a default implementation via a function named
+ * theme_HOOK() (e.g., theme_taxonomy_term()) or via a template file named
+ * according to the value of the 'template' key registered with the theme hook
+ * (see hook_theme() for details). Default templates are implemented with the
+ * Twig rendering engine and are named the same as the theme hook, with
+ * underscores changed to hyphens, so for the 'taxonomy_term' theme hook, the
+ * default template is 'taxonomy-term.html.twig'.
+ *
+ * @subsection sub_overriding_theme_hooks Overriding Theme Hooks
+ * Themes may also register new theme hooks within a hook_theme()
+ * implementation, but it is more common for themes to override default
+ * implementations provided by modules than to register entirely new theme
+ * hooks. Themes can override a default implementation by implementing a
+ * function named THEME_HOOK() (for example, the 'bartik' theme overrides the
+ * default implementation of the 'menu_tree' theme hook by implementing a
+ * bartik_menu_tree() function), or by adding a template file within its folder
+ * structure that follows the template naming structure used by the theme's
+ * rendering engine (for example, since the Bartik theme uses the Twig rendering
+ * engine, it overrides the default implementation of the 'page' theme hook by
+ * containing a 'page.html.twig' file within its folder structure).
+ *
+ * @subsection sub_preprocess_templates Preprocessing for Template Files
+ * If the implementation is a template file, several functions are called before
+ * the template file is invoked to modify the $variables array. These make up
+ * the "preprocessing" phase, and are executed (if they exist), in the following
+ * order (note that in the following list, HOOK indicates the theme hook name,
+ * MODULE indicates a module name, THEME indicates a theme name, and ENGINE
+ * indicates a theme engine name):
+ * - template_preprocess(&$variables, $hook): Creates a default set of variables
+ *   for all theme hooks with template implementations.
+ * - template_preprocess_HOOK(&$variables): Should be implemented by the module
+ *   that registers the theme hook, to set up default variables.
+ * - MODULE_preprocess(&$variables, $hook): hook_preprocess() is invoked on all
+ *   implementing modules.
+ * - MODULE_preprocess_HOOK(&$variables): hook_preprocess_HOOK() is invoked on
+ *   all implementing modules, so that modules that didn't define the theme hook
+ *   can alter the variables.
+ * - ENGINE_engine_preprocess(&$variables, $hook): Allows the theme engine to
+ *   set necessary variables for all theme hooks with template implementations.
+ * - ENGINE_engine_preprocess_HOOK(&$variables): Allows the theme engine to set
+ *   necessary variables for the particular theme hook.
+ * - THEME_preprocess(&$variables, $hook): Allows the theme to set necessary
+ *   variables for all theme hooks with template implementations.
+ * - THEME_preprocess_HOOK(&$variables): Allows the theme to set necessary
+ *   variables specific to the particular theme hook.
+ *
+ * @subsection sub_preprocess_theme_funcs Preprocessing for Theme Functions
+ * If the implementation is a function, only the theme-hook-specific preprocess
+ * functions (the ones ending in _HOOK) are called from the list above. This is
+ * because theme hooks with function implementations need to be fast, and
+ * calling the non-theme-hook-specific preprocess functions for them would incur
+ * a noticeable performance penalty.
+ *
+ * @subsection sub_alternate_suggestions Suggesting Alternate Hooks
+ * Alternate hooks can be suggested by implementing the hook-specific
+ * hook_theme_suggestions_HOOK_alter() or the generic
+ * hook_theme_suggestions_alter(). These alter hooks are used to manipulate an
+ * array of suggested alternate theme hooks to use, in reverse order of
+ * priority. _theme() will use the highest priority implementation that exists.
+ * If none exists, _theme() will use the implementation for the theme hook it
+ * was called with. These suggestions are similar to and are used for similar
+ * reasons as calling _theme() with an array as the $hook parameter (see below).
+ * The difference is whether the suggestions are determined by the code that
+ * calls _theme() or by altering the suggestions via the suggestion alter hooks.
  *
  * @param $hook
  *   The name of the theme hook to call. If the name contains a
@@ -864,17 +928,17 @@ function theme_get_setting($setting_name, $theme = NULL) {
       }
       foreach ($theme_keys as $theme_key) {
         if (!empty($themes[$theme_key]->info['settings'])) {
-          $cache[$theme]->merge($themes[$theme_key]->info['settings']);
+          $cache[$theme]->mergeData($themes[$theme_key]->info['settings']);
         }
       }
     }
 
     // Get the global settings from configuration.
-    $cache[$theme]->merge(\Drupal::config('system.theme.global')->get());
+    $cache[$theme]->mergeData(\Drupal::config('system.theme.global')->get());
 
     if ($theme) {
       // Get the saved theme-specific settings from the configuration system.
-      $cache[$theme]->merge(\Drupal::config($theme . '.settings')->get());
+      $cache[$theme]->mergeData(\Drupal::config($theme . '.settings')->get());
 
       // If the theme does not support a particular feature, override the global
       // setting and set the value to NULL.
diff --git a/core/lib/Drupal/Core/Annotation/Translation.php b/core/lib/Drupal/Core/Annotation/Translation.php
index 5726878..ebb2655 100644
--- a/core/lib/Drupal/Core/Annotation/Translation.php
+++ b/core/lib/Drupal/Core/Annotation/Translation.php
@@ -24,11 +24,6 @@
  * Remove spaces after @ in your actual plugin - these are put into this sample
  * code so that it is not recognized as annotation.
  *
- * To provide replacement values for placeholders, use the "arguments" array:
- * @code
- *   title = @ Translation("Bundle !title", arguments = {"!title" = "Foo"}),
- * @endcode
- *
  * It is also possible to provide a context with the text, similar to t():
  * @code
  *   title = @ Translation("Bundle", context = "Validation"),
@@ -60,35 +55,20 @@ class Translation extends AnnotationBase {
   protected $translation;
 
   /**
-   * The translation manager.
-   *
-   * @var \Drupal\Core\StringTranslation\TranslationInterface
-   */
-  protected $translationManager;
-
-  /**
-   * Constructs a new class instance.
+   * Constructs a Translation object.
    *
    * Parses values passed into this class through the t() function in Drupal and
    * handles an optional context for the string.
-   *
-   * @param array $values
-   *   Possible array keys:
-   *   - value (required): the string that is to be translated.
-   *   - arguments (optional): an array with placeholder replacements, keyed by
-   *     placeholder.
-   *   - context (optional): a string that describes the context of "value";
    */
-  public function __construct(array $values) {
+  public function __construct($values) {
     $string = $values['value'];
-    $arguments = isset($values['arguments']) ? $values['arguments'] : array();
     $options = array();
     if (!empty($values['context'])) {
       $options = array(
         'context' => $values['context'],
       );
     }
-    $this->translation = $this->getTranslationManager()->translate($string, $arguments, $options);
+    $this->translation = t($string, array(), $options);
   }
 
   /**
@@ -98,18 +78,4 @@ public function get() {
     return $this->translation;
   }
 
-  /**
-   * Returns the translation manager.
-   *
-   * @return \Drupal\Core\StringTranslation\TranslationInterface
-   *   The translation manager.
-   */
-  protected function getTranslationManager() {
-    if (!$this->translationManager) {
-      $this->translationManager = \Drupal::translation();
-    }
-
-    return $this->translationManager;
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Config/Config.php b/core/lib/Drupal/Core/Config/Config.php
index cafc026..e000200 100644
--- a/core/lib/Drupal/Core/Config/Config.php
+++ b/core/lib/Drupal/Core/Config/Config.php
@@ -9,7 +9,9 @@
 
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Config\ConfigNameException;
 use Drupal\Core\Config\Schema\SchemaIncompleteException;
+use Drupal\Core\DependencyInjection\DependencySerialization;
 use Drupal\Core\TypedData\PrimitiveInterface;
 use Drupal\Core\TypedData\Type\FloatInterface;
 use Drupal\Core\TypedData\Type\IntegerInterface;
@@ -19,7 +21,20 @@
 /**
  * Defines the default configuration object.
  */
-class Config extends StorableConfigBase {
+class Config extends DependencySerialization {
+
+  /**
+   * The maximum length of a configuration object name.
+   *
+   * Many filesystems (including HFS, NTFS, and ext4) have a maximum file name
+   * length of 255 characters. To ensure that no configuration objects
+   * incompatible with this limitation are created, we enforce a maximum name
+   * length of 250 characters (leaving 5 characters for the file extension).
+   *
+   * @see http://en.wikipedia.org/wiki/Comparison_of_file_systems
+   */
+  const MAX_NAME_LENGTH = 250;
+
   /**
    * An event dispatcher instance to use for configuration events.
    *
@@ -30,11 +45,39 @@ class Config extends StorableConfigBase {
   /**
    * The language object used to override configuration data.
    *
-   * @var \Drupal\Core\Language\Language
+   * @var Drupal\Core\Language\Language
    */
   protected $language;
 
   /**
+   * The name of the configuration object.
+   *
+   * @var string
+   */
+  protected $name;
+
+  /**
+   * Whether the configuration object is new or has been saved to the storage.
+   *
+   * @var bool
+   */
+  protected $isNew = TRUE;
+
+  /**
+   * The data of the configuration object.
+   *
+   * @var array
+   */
+  protected $data = array();
+
+  /**
+   * The original data of the configuration object.
+   *
+   * @var array
+   */
+  protected $originalData = array();
+
+  /**
    * The current runtime data.
    *
    * The configuration data from storage merged with language, module and
@@ -59,11 +102,25 @@ class Config extends StorableConfigBase {
   protected $moduleOverrides;
 
   /**
-   * The current settings overrides.
+   * The storage used to load and save this configuration object.
    *
-   * @var array
+   * @var \Drupal\Core\Config\StorageInterface
+   */
+  protected $storage;
+
+  /**
+   * The config schema wrapper object for this configuration object.
+   *
+   * @var \Drupal\Core\Config\Schema\Element
    */
-  protected $settingsOverrides;
+  protected $schemaWrapper;
+
+  /**
+   * The typed config manager.
+   *
+   * @var \Drupal\Core\Config\TypedConfigManager
+   */
+  protected $typedConfigManager;
 
   /**
    * Constructs a configuration object.
@@ -89,19 +146,111 @@ public function __construct($name, StorageInterface $storage, EventDispatcherInt
   }
 
   /**
-   * {@inheritdoc}
+   * Initializes a configuration object with pre-loaded data.
+   *
+   * @param array $data
+   *   Array of loaded data for this configuration object.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
    */
   public function initWithData(array $data) {
-    parent::initWithData($data);
     $this->settingsOverrides = array();
     $this->languageOverrides = array();
     $this->moduleOverrides = array();
-    $this->setData($data);
+    $this->isNew = FALSE;
+    $this->replaceData($data);
+    $this->originalData = $this->data;
     return $this;
   }
 
   /**
-   * {@inheritdoc}
+   * Returns the name of this configuration object.
+   *
+   * @return string
+   *   The name of the configuration object.
+   */
+  public function getName() {
+    return $this->name;
+  }
+
+  /**
+   * Sets the name of this configuration object.
+   *
+   * @param string $name
+   *  The name of the configuration object.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
+   */
+  public function setName($name) {
+    $this->name = $name;
+    return $this;
+  }
+
+  /**
+   * Validates the configuration object name.
+   *
+   * @param string $name
+   *  The name of the configuration object.
+   *
+   * @throws \Drupal\Core\Config\ConfigNameException
+   *
+   * @see Config::MAX_NAME_LENGTH
+   */
+  public static function validateName($name) {
+    // The name must be namespaced by owner.
+    if (strpos($name, '.') === FALSE) {
+      throw new ConfigNameException(format_string('Missing namespace in Config object name @name.', array(
+        '@name' => $name,
+      )));
+    }
+    // The name must be shorter than Config::MAX_NAME_LENGTH characters.
+    if (strlen($name) > self::MAX_NAME_LENGTH) {
+      throw new ConfigNameException(format_string('Config object name @name exceeds maximum allowed length of @length characters.', array(
+        '@name' => $name,
+        '@length' => self::MAX_NAME_LENGTH,
+      )));
+    }
+
+    // The name must not contain any of the following characters:
+    // : ? * < > " ' / \
+    if (preg_match('/[:?*<>"\'\/\\\\]/', $name)) {
+      throw new ConfigNameException(format_string('Invalid character in Config object name @name.', array(
+        '@name' => $name,
+      )));
+    }
+  }
+
+  /**
+   * Returns whether this configuration object is new.
+   *
+   * @return bool
+   *   TRUE if this configuration object does not exist in storage.
+   */
+  public function isNew() {
+    return $this->isNew;
+  }
+
+  /**
+   * Gets data from this configuration object.
+   *
+   * @param string $key
+   *   A string that maps to a key within the configuration data.
+   *   For instance in the following configuration array:
+   *   @code
+   *   array(
+   *     'foo' => array(
+   *       'bar' => 'baz',
+   *     ),
+   *   );
+   *   @endcode
+   *   A key of 'foo.bar' would return the string 'baz'. However, a key of 'foo'
+   *   would return array('bar' => 'baz').
+   *   If no key is specified, then the entire data array is returned.
+   *
+   * @return mixed
+   *   The data that was requested.
    */
   public function get($key = '') {
     if (!isset($this->overriddenData)) {
@@ -123,9 +272,33 @@ public function get($key = '') {
   }
 
   /**
-   * {@inheritdoc}
+   * Replaces the data of this configuration object.
+   *
+   * @param array $data
+   *   The new configuration data.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
    */
   public function setData(array $data) {
+    $this->replaceData($data);
+    return $this;
+  }
+
+  /**
+   * Replaces the data of this configuration object.
+   *
+   * This function is separate from setData() to avoid load() state tracking.
+   * A load() would destroy the replaced data (for example on import). Do not
+   * call set() when inside load().
+   *
+   * @param array $data
+   *   The new configuration data.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
+   */
+  protected function replaceData(array $data) {
     $this->data = $data;
     $this->resetOverriddenData();
     return $this;
@@ -218,25 +391,56 @@ protected function resetOverriddenData() {
   }
 
   /**
-   * {@inheritdoc}
+   * Sets a value in this configuration object.
+   *
+   * @param string $key
+   *   Identifier to store value in configuration.
+   * @param mixed $value
+   *   Value to associate with identifier.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
    */
   public function set($key, $value) {
-    parent::set($key, $value);
+    // The dot/period is a reserved character; it may appear between keys, but
+    // not within keys.
+    $parts = explode('.', $key);
+    if (count($parts) == 1) {
+      $this->data[$key] = $value;
+    }
+    else {
+      NestedArray::setValue($this->data, $parts, $value);
+    }
     $this->resetOverriddenData();
     return $this;
   }
 
   /**
-   * {@inheritdoc}
+   * Unsets a value in this configuration object.
+   *
+   * @param string $key
+   *   Name of the key whose value should be unset.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
    */
   public function clear($key) {
-    parent::clear($key);
+    $parts = explode('.', $key);
+    if (count($parts) == 1) {
+      unset($this->data[$key]);
+    }
+    else {
+      NestedArray::unsetValue($this->data, $parts);
+    }
     $this->resetOverriddenData();
     return $this;
   }
 
   /**
-   * {@inheritdoc}
+   * Saves the configuration object.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object.
    */
   public function save() {
     // Validate the configuration object name before saving.
@@ -297,7 +501,7 @@ public function getStorage() {
    */
   public function merge(array $data_to_merge) {
     // Preserve integer keys so that configuration keys are not changed.
-    $this->setData(NestedArray::mergeDeepArray(array($this->data, $data_to_merge), TRUE));
+    $this->replaceData(NestedArray::mergeDeepArray(array($this->data, $data_to_merge), TRUE));
     return $this;
   }
 
@@ -447,3 +651,4 @@ public function getOriginal($key = '', $apply_overrides = TRUE) {
     }
   }
 }
+
diff --git a/core/lib/Drupal/Core/Config/ConfigBase.php b/core/lib/Drupal/Core/Config/ConfigBase.php
deleted file mode 100644
index 7d12d51..0000000
--- a/core/lib/Drupal/Core/Config/ConfigBase.php
+++ /dev/null
@@ -1,209 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Core\Config\ConfigBase.
- */
-
-namespace Drupal\Core\Config;
-
-use Drupal\Component\Utility\NestedArray;
-use Drupal\Component\Utility\String;
-use \Drupal\Core\DependencyInjection\DependencySerialization;
-
-abstract class ConfigBase extends DependencySerialization {
-
-  /**
-   * The name of the configuration object.
-   *
-   * @var string
-   */
-  protected $name;
-
-  /**
-   * The data of the configuration object.
-   *
-   * @var array
-   */
-  protected $data = array();
-
-  /**
-   * The maximum length of a configuration object name.
-   *
-   * Many filesystems (including HFS, NTFS, and ext4) have a maximum file name
-   * length of 255 characters. To ensure that no configuration objects
-   * incompatible with this limitation are created, we enforce a maximum name
-   * length of 250 characters (leaving 5 characters for the file extension).
-   *
-   * @see http://en.wikipedia.org/wiki/Comparison_of_file_systems
-   *
-   * Configuration objects not stored on the filesystem should still be
-   * restricted in name length so name can be used as a cache key.
-   */
-  const MAX_NAME_LENGTH = 250;
-
-  /**
-   * Returns the name of this configuration object.
-   *
-   * @return string
-   *   The name of the configuration object.
-   */
-  public function getName() {
-    return $this->name;
-  }
-
-  /**
-   * Sets the name of this configuration object.
-   *
-   * @param string $name
-   *  The name of the configuration object.
-   *
-   * @return $this
-   *   The configuration object.
-   */
-  public function setName($name) {
-    $this->name = $name;
-    return $this;
-  }
-
-  /**
-   * Validates the configuration object name.
-   *
-   * @param string $name
-   *  The name of the configuration object.
-   *
-   * @throws \Drupal\Core\Config\ConfigNameException
-   *
-   * @see Config::MAX_NAME_LENGTH
-   */
-  public static function validateName($name) {
-    // The name must be namespaced by owner.
-    if (strpos($name, '.') === FALSE) {
-      throw new ConfigNameException(String::format('Missing namespace in Config object name @name.', array(
-        '@name' => $name,
-      )));
-    }
-    // The name must be shorter than Config::MAX_NAME_LENGTH characters.
-    if (strlen($name) > self::MAX_NAME_LENGTH) {
-      throw new ConfigNameException(String::format('Config object name @name exceeds maximum allowed length of @length characters.', array(
-        '@name' => $name,
-        '@length' => self::MAX_NAME_LENGTH,
-      )));
-    }
-
-    // The name must not contain any of the following characters:
-    // : ? * < > " ' / \
-    if (preg_match('/[:?*<>"\'\/\\\\]/', $name)) {
-      throw new ConfigNameException(String::format('Invalid character in Config object name @name.', array(
-        '@name' => $name,
-      )));
-    }
-  }
-
-  /**
-   * Gets data from this configuration object.
-   *
-   * @param string $key
-   *   A string that maps to a key within the configuration data.
-   *   For instance in the following configuration array:
-   *   @code
-   *   array(
-   *     'foo' => array(
-   *       'bar' => 'baz',
-   *     ),
-   *   );
-   *   @endcode
-   *   A key of 'foo.bar' would return the string 'baz'. However, a key of 'foo'
-   *   would return array('bar' => 'baz').
-   *   If no key is specified, then the entire data array is returned.
-   *
-   * @return mixed
-   *   The data that was requested.
-   */
-  public function get($key = '') {
-    if (empty($key)) {
-      return $this->data;
-    }
-    else {
-      $parts = explode('.', $key);
-      if (count($parts) == 1) {
-        return isset($this->data[$key]) ? $this->data[$key] : NULL;
-      }
-      else {
-        $value = NestedArray::getValue($this->data, $parts, $key_exists);
-        return $key_exists ? $value : NULL;
-      }
-    }
-  }
-
-  /**
-   * Replaces the data of this configuration object.
-   *
-   * @param array $data
-   *   The new configuration data.
-   *
-   * @return $this
-   *   The configuration object.
-   */
-  public function setData(array $data) {
-    $this->data = $data;
-    return $this;
-  }
-
-  /**
-   * Sets a value in this configuration object.
-   *
-   * @param string $key
-   *   Identifier to store value in configuration.
-   * @param mixed $value
-   *   Value to associate with identifier.
-   *
-   * @return $this
-   *   The configuration object.
-   */
-  public function set($key, $value) {
-    // The dot/period is a reserved character; it may appear between keys, but
-    // not within keys.
-    $parts = explode('.', $key);
-    if (count($parts) == 1) {
-      $this->data[$key] = $value;
-    }
-    else {
-      NestedArray::setValue($this->data, $parts, $value);
-    }
-    return $this;
-  }
-
-  /**
-   * Unsets a value in this configuration object.
-   *
-   * @param string $key
-   *   Name of the key whose value should be unset.
-   *
-   * @return $this
-   *   The configuration object.
-   */
-  public function clear($key) {
-    $parts = explode('.', $key);
-    if (count($parts) == 1) {
-      unset($this->data[$key]);
-    }
-    else {
-      NestedArray::unsetValue($this->data, $parts);
-    }
-    return $this;
-  }
-
-  /**
-   * Merges data into a configuration object.
-   *
-   * @param array $data_to_merge
-   *   An array containing data to merge.
-   *
-   * @return $this
-   *   The configuration object.
-   */
-  public function merge(array $data_to_merge) {
-    return $this->setData(NestedArray::mergeDeepArray(array($this->data, $data_to_merge), TRUE));
-  }
-}
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
index 8a26ec0..a70ad36 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
@@ -66,6 +66,13 @@ class ConfigStorageController extends EntityStorageControllerBase implements Con
   protected $configStorage;
 
   /**
+   * The entity query factory.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryFactory
+   */
+  protected $entityQueryFactory;
+
+  /**
    * Constructs a ConfigStorageController object.
    *
    * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
@@ -74,10 +81,12 @@ class ConfigStorageController extends EntityStorageControllerBase implements Con
    *   The config factory service.
    * @param \Drupal\Core\Config\StorageInterface $config_storage
    *   The config storage service.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query_factory
+   *   The entity query factory.
    * @param \Drupal\Component\Uuid\UuidInterface $uuid_service
    *   The UUID service.
    */
-  public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInterface $config_factory, StorageInterface $config_storage, UuidInterface $uuid_service) {
+  public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInterface $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service) {
     parent::__construct($entity_type);
 
     $this->idKey = $this->entityType->getKey('id');
@@ -85,6 +94,7 @@ public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInter
 
     $this->configFactory = $config_factory;
     $this->configStorage = $config_storage;
+    $this->entityQueryFactory = $entity_query_factory;
     $this->uuidService = $uuid_service;
   }
 
@@ -96,6 +106,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
       $entity_type,
       $container->get('config.factory'),
       $container->get('config.storage'),
+      $container->get('entity.query'),
       $container->get('uuid')
     );
   }
@@ -164,6 +175,13 @@ public function deleteRevision($revision_id) {
   /**
    * {@inheritdoc}
    */
+  public function getQuery($conjunction = 'AND') {
+    return $this->entityQueryFactory->get($this->entityTypeId, $conjunction);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getConfigPrefix() {
     return $this->entityType->getConfigPrefix() . '.';
   }
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php
index 4ffe876..114fa33 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageControllerInterface.php
@@ -31,6 +31,20 @@
   public function importCreate($name, Config $new_config, Config $old_config);
 
   /**
+   * Returns an entity query instance.
+   *
+   * @param string $conjunction
+   *   - AND: all of the conditions on the query need to match.
+   *   - OR: at least one of the conditions on the query need to match.
+   *
+   * @return \Drupal\Core\Entity\Query\QueryInterface
+   *   The query instance.
+   *
+   * @see \Drupal\Core\Entity\EntityStorageControllerInterface::getQueryServicename()
+   */
+  public function getQuery($conjunction = 'AND');
+
+  /**
    * Updates configuration upon synchronizing configuration changes.
    *
    * This callback is invoked when configuration is synchronized between storages
diff --git a/core/lib/Drupal/Core/Config/StorableConfigBase.php b/core/lib/Drupal/Core/Config/StorableConfigBase.php
deleted file mode 100644
index 8b05f95..0000000
--- a/core/lib/Drupal/Core/Config/StorableConfigBase.php
+++ /dev/null
@@ -1,185 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\Core\Config\StorableConfigBase.
- */
-
-namespace Drupal\Core\Config;
-
-use Drupal\Component\Utility\String;
-use Drupal\Core\Config\Schema\SchemaIncompleteException;
-use Drupal\Core\TypedData\PrimitiveInterface;
-use Drupal\Core\TypedData\Type\FloatInterface;
-use Drupal\Core\TypedData\Type\IntegerInterface;
-
-abstract class StorableConfigBase extends ConfigBase {
-
-  /**
-   * The storage used to load and save this configuration object.
-   *
-   * @var \Drupal\Core\Config\StorageInterface
-   */
-  protected $storage;
-
-  /**
-   * The config schema wrapper object for this configuration object.
-   *
-   * @var \Drupal\Core\Config\Schema\Element
-   */
-  protected $schemaWrapper;
-
-  /**
-   * The typed config manager.
-   *
-   * @var \Drupal\Core\Config\TypedConfigManager
-   */
-  protected $typedConfigManager;
-
-  /**
-   * Whether the configuration object is new or has been saved to the storage.
-   *
-   * @var bool
-   */
-  protected $isNew = TRUE;
-
-  /**
-   * The data of the configuration object.
-   *
-   * @var array
-   */
-  protected $originalData = array();
-
-  /**
-   * Saves the configuration object.
-   *
-   * @return \Drupal\Core\Config\Config
-   *   The configuration object.
-   */
-  abstract public function save();
-
-  /**
-   * Deletes the configuration object.
-   *
-   * @return \Drupal\Core\Config\Config
-   *   The configuration object.
-   */
-  abstract public function delete();
-
-  /**
-   * Initializes a configuration object with pre-loaded data.
-   *
-   * @param array $data
-   *   Array of loaded data for this configuration object.
-   *
-   * @return $this
-   *   The configuration object.
-   */
-  public function initWithData(array $data) {
-    $this->isNew = FALSE;
-    $this->setData($data);
-    $this->originalData = $this->data;
-    return $this;
-  }
-
-  /**
-   * Returns whether this configuration object is new.
-   *
-   * @return bool
-   *   TRUE if this configuration object does not exist in storage.
-   */
-  public function isNew() {
-    return $this->isNew;
-  }
-
-  /**
-   * Retrieves the storage used to load and save this configuration object.
-   *
-   * @return \Drupal\Core\Config\StorageInterface
-   *   The configuration storage object.
-   */
-  public function getStorage() {
-    return $this->storage;
-  }
-
-  /**
-   * Gets the schema wrapper for the whole configuration object.
-   *
-   * The schema wrapper is dependent on the configuration name and the whole
-   * data structure, so if the name or the data changes in any way, the wrapper
-   * should be reset.
-   *
-   * @return \Drupal\Core\Config\Schema\Element
-   */
-  protected function getSchemaWrapper() {
-    if (!isset($this->schemaWrapper)) {
-      $definition = $this->typedConfigManager->getDefinition($this->name);
-      $this->schemaWrapper = $this->typedConfigManager->create($definition, $this->data);
-    }
-    return $this->schemaWrapper;
-  }
-
-  /**
-   * Casts the value to correct data type using the configuration schema.
-   *
-   * @param string $key
-   *   A string that maps to a key within the configuration data.
-   * @param string $value
-   *   Value to associate with the key.
-   *
-   * @return mixed
-   *   The value cast to the type indicated in the schema.
-   *
-   * @throws \Drupal\Core\Config\UnsupportedDataTypeConfigException
-   *   Exception on unsupported/undefined data type deducted.
-   */
-  protected function castValue($key, $value) {
-    if ($value === NULL) {
-      $value = NULL;
-    }
-    elseif (is_scalar($value)) {
-      try {
-        $element = $this->getSchemaWrapper()->get($key);
-        if ($element instanceof PrimitiveInterface) {
-          // Special handling for integers and floats since the configuration
-          // system is primarily concerned with saving values from the Form API
-          // we have to special case the meaning of an empty string for numeric
-          // types. In PHP this would be casted to a 0 but for the purposes of
-          // configuration we need to treat this as a NULL.
-          if ($value === '' && ($element instanceof IntegerInterface || $element instanceof FloatInterface)) {
-            $value = NULL;
-          }
-          else {
-            $value = $element->getCastedValue();
-          }
-        }
-        else {
-          // Config only supports primitive data types. If the config schema
-          // does define a type $element will be an instance of
-          // \Drupal\Core\Config\Schema\Property. Convert it to string since it
-          // is the safest possible type.
-          $value = $element->getString();
-        }
-      }
-      catch (SchemaIncompleteException $e) {
-        // @todo throw an exception due to an incomplete schema.
-        // Fix as part of https://drupal.org/node/2183983.
-      }
-    }
-    else {
-      // Throw exception on any non-scalar or non-array value.
-      if (!is_array($value)) {
-        throw new UnsupportedDataTypeConfigException(String::format('Invalid data type for config element @name:@key', array(
-          '@name' => $this->getName(),
-          '@key' => $key,
-        )));
-      }
-      // Recurse into any nested keys.
-      foreach ($value as $nested_value_key => $nested_value) {
-        $value[$nested_value_key] = $this->castValue($key . '.' . $nested_value_key, $nested_value);
-      }
-    }
-    return $value;
-  }
-
-}
diff --git a/core/lib/Drupal/Core/Database/Query/Query.php b/core/lib/Drupal/Core/Database/Query/Query.php
index 790ed5c..ad1f75e 100644
--- a/core/lib/Drupal/Core/Database/Query/Query.php
+++ b/core/lib/Drupal/Core/Database/Query/Query.php
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Contains \Drupal\Core\Database\Query\Query.
+ * Definition of Drupal\Core\Database\Query\Query
  */
 
 namespace Drupal\Core\Database\Query;
@@ -106,9 +106,6 @@ public function __clone() {
 
   /**
    * Runs the query against the database.
-   *
-   * @return \Drupal\Core\Database\StatementInterface|null
-   *   A prepared statement, or NULL if the query is not valid.
    */
   abstract protected function execute();
 
@@ -118,7 +115,7 @@ public function __clone() {
    * The toString operation is how we compile a query object to a prepared
    * statement.
    *
-   * @return string
+   * @return
    *   A prepared statement query string for this object.
    */
   abstract public function __toString();
@@ -134,7 +131,7 @@ public function uniqueIdentifier() {
    * Gets the next placeholder value for this query object.
    *
    * @return int
-   *   The next placeholder value.
+   *   Next placeholder value.
    */
   public function nextPlaceholder() {
     return $this->nextPlaceholder++;
@@ -154,7 +151,8 @@ public function nextPlaceholder() {
    * @param $comment
    *   The comment string to be inserted into the query.
    *
-   * @return $this
+   * @return \Drupal\Core\Database\Query\Query
+   *   The called object.
    */
   public function comment($comment) {
     $this->comments[] = $comment;
@@ -173,7 +171,7 @@ public function comment($comment) {
    * $comments =& $query->getComments();
    * @endcode
    *
-   * @return array
+   * @return
    *   A reference to the comments array structure.
    */
   public function &getComments() {
diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 54a3555..394bbde 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -2,7 +2,7 @@
 
 /**
  * @file
- * Contains \Drupal\Core\Database\Query\Select.
+ * Definition of Drupal\Core\Database\Query\Select
  */
 
 namespace Drupal\Core\Database\Query;
@@ -121,18 +121,6 @@ class Select extends Query implements SelectInterface {
    */
   protected $forUpdate = FALSE;
 
-  /**
-   * Constructs a Select object.
-   *
-   * @param string $table
-   *   The name of the table that is being queried.
-   * @param string $alias
-   *   The alias for the table.
-   * @param \Drupal\Core\Database\Connection $connection
-   *   Database connection object.
-   * @param array $options
-   *   Array of query options.
-   */
   public function __construct($table, $alias = NULL, Connection $connection, $options = array()) {
     $options['return'] = Database::RETURN_STATEMENT;
     parent::__construct($connection, $options);
@@ -142,68 +130,45 @@ public function __construct($table, $alias = NULL, Connection $connection, $opti
     $this->addJoin(NULL, $table, $alias);
   }
 
-  /**
-   * {@inheritdoc}
-   */
+  /* Implementations of Drupal\Core\Database\Query\AlterableInterface. */
+
   public function addTag($tag) {
     $this->alterTags[$tag] = 1;
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function hasTag($tag) {
     return isset($this->alterTags[$tag]);
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function hasAllTags() {
     return !(boolean)array_diff(func_get_args(), array_keys($this->alterTags));
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function hasAnyTag() {
     return (boolean)array_intersect(func_get_args(), array_keys($this->alterTags));
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function addMetaData($key, $object) {
     $this->alterMetaData[$key] = $object;
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function getMetaData($key) {
     return isset($this->alterMetaData[$key]) ? $this->alterMetaData[$key] : NULL;
   }
 
-  /**
-   * {@inheritdoc}
-   */
+  /* Implementations of Drupal\Core\Database\Query\ConditionInterface for the WHERE clause. */
+
   public function condition($field, $value = NULL, $operator = NULL) {
     $this->where->condition($field, $value, $operator);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function &conditions() {
     return $this->where->conditions();
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function arguments() {
     if (!$this->compiled()) {
       return NULL;
@@ -236,49 +201,31 @@ public function arguments() {
     return $args;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function where($snippet, $args = array()) {
     $this->where->where($snippet, $args);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function isNull($field) {
     $this->where->isNull($field);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function isNotNull($field) {
     $this->where->isNotNull($field);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function exists(SelectInterface $select) {
     $this->where->exists($select);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function notExists(SelectInterface $select) {
     $this->where->notExists($select);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function compile(Connection $connection, PlaceholderInterface $queryPlaceholder) {
     $this->where->compile($connection, $queryPlaceholder);
     $this->having->compile($connection, $queryPlaceholder);
@@ -296,9 +243,6 @@ public function compile(Connection $connection, PlaceholderInterface $queryPlace
     }
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function compiled() {
     if (!$this->where->compiled() || !$this->having->compiled()) {
       return FALSE;
@@ -322,68 +266,32 @@ public function compiled() {
     return TRUE;
   }
 
-  /**
-   * {@inheritdoc}
-   */
+  /* Implementations of Drupal\Core\Database\Query\ConditionInterface for the HAVING clause. */
+
   public function havingCondition($field, $value = NULL, $operator = NULL) {
     $this->having->condition($field, $value, $operator);
     return $this;
   }
 
-  /**
-   * Gets a list of all conditions in the HAVING clause.
-   *
-   * This method returns by reference. That allows alter hooks to access the
-   * data structure directly and manipulate it before it gets compiled.
-   *
-   * @return array
-   *   An array of conditions.
-   *
-   * @see \Drupal\Core\Database\Query\ConditionInterface::conditions()
-   */
   public function &havingConditions() {
     return $this->having->conditions();
   }
 
-  /**
-   * Gets a list of all values to insert into the HAVING clause.
-   *
-   * @return array
-   *   An associative array of placeholders and values.
-   */
   public function havingArguments() {
     return $this->having->arguments();
   }
 
-  /**
-   * Adds an arbitrary HAVING clause to the query.
-   *
-   * @param $snippet
-   *   A portion of a HAVING clause as a prepared statement. It must use named
-   *   placeholders, not ? placeholders.
-   * @param $args
-   *   (optional) An associative array of arguments.
-   *
-   * @return $this
-   */
   public function having($snippet, $args = array()) {
     $this->having->where($snippet, $args);
     return $this;
   }
 
-  /**
-   * Compiles the HAVING clause for later retrieval.
-   *
-   * @param $connection
-   *   The database connection for which to compile the clause.
-   */
   public function havingCompile(Connection $connection) {
     $this->having->compile($connection, $this);
   }
 
-  /**
-   * {@inheritdoc}
-   */
+  /* Implementations of Drupal\Core\Database\Query\ExtendableInterface. */
+
   public function extend($extender_name) {
     $override_class = $extender_name . '_' . $this->connection->driver();
     if (class_exists($override_class)) {
@@ -392,61 +300,26 @@ public function extend($extender_name) {
     return new $extender_name($this, $this->connection);
   }
 
-  /**
-   * Sets a condition in the HAVING clause that the specified field be NULL.
-   *
-   * @param $field
-   *   The name of the field to check.
-   *
-   * @return $this
-   */
   public function havingIsNull($field) {
     $this->having->isNull($field);
     return $this;
   }
 
-  /**
-   * Sets a condition in the HAVING clause that the specified field be NOT NULL.
-   *
-   * @param $field
-   *   The name of the field to check.
-   *
-   * @return $this
-   */
   public function havingIsNotNull($field) {
     $this->having->isNotNull($field);
     return $this;
   }
 
-  /**
-   * Sets a HAVING condition that the specified subquery returns values.
-   *
-   * @param \Drupal\Core\Database\Query\SelectInterface $select
-   *   The subquery that must contain results.
-   *
-   * @return $this
-   */
   public function havingExists(SelectInterface $select) {
     $this->having->exists($select);
     return $this;
   }
 
-  /**
-   * Sets a HAVING condition that the specified subquery returns no values.
-   *
-   * @param \Drupal\Core\Database\Query\SelectInterface $select
-   *   The subquery that must contain results.
-   *
-   * @return $this
-   */
   public function havingNotExists(SelectInterface $select) {
     $this->having->notExists($select);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function forUpdate($set = TRUE) {
     if (isset($set)) {
       $this->forUpdate = $set;
@@ -454,51 +327,32 @@ public function forUpdate($set = TRUE) {
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
+  /* Alter accessors to expose the query data to alter hooks. */
+
   public function &getFields() {
     return $this->fields;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function &getExpressions() {
     return $this->expressions;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function &getOrderBy() {
     return $this->order;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function &getGroupBy() {
     return $this->group;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function &getTables() {
     return $this->tables;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function &getUnion() {
     return $this->union;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function getArguments(PlaceholderInterface $queryPlaceholder = NULL) {
     if (!isset($queryPlaceholder)) {
       $queryPlaceholder = $this;
@@ -508,14 +362,17 @@ public function getArguments(PlaceholderInterface $queryPlaceholder = NULL) {
   }
 
   /**
-   * {@inheritdoc}
+   * Indicates if preExecute() has already been called on that object.
    */
   public function isPrepared() {
     return $this->prepared;
   }
 
   /**
-   * {@inheritdoc}
+   * Generic preparation and validation for a SELECT query.
+   *
+   * @return
+   *   TRUE if the validation was successful, FALSE if not.
    */
   public function preExecute(SelectInterface $query = NULL) {
     // If no query object is passed in, use $this.
@@ -553,9 +410,6 @@ public function preExecute(SelectInterface $query = NULL) {
     return $this->prepared;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function execute() {
     // If validation fails, simply return NULL.
     // Note that validation routines in preExecute() may throw exceptions instead.
@@ -567,17 +421,11 @@ public function execute() {
     return $this->connection->query((string) $this, $args, $this->queryOptions);
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function distinct($distinct = TRUE) {
     $this->distinct = $distinct;
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function addField($table_alias, $field, $alias = NULL) {
     // If no alias is specified, first try the field name itself.
     if (empty($alias)) {
@@ -606,10 +454,8 @@ public function addField($table_alias, $field, $alias = NULL) {
     return $alias;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function fields($table_alias, array $fields = array()) {
+
     if ($fields) {
       foreach ($fields as $field) {
         // We don't care what alias was assigned.
@@ -624,9 +470,6 @@ public function fields($table_alias, array $fields = array()) {
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function addExpression($expression, $alias = NULL, $arguments = array()) {
     if (empty($alias)) {
       $alias = 'expression';
@@ -648,38 +491,24 @@ public function addExpression($expression, $alias = NULL, $arguments = array())
     return $alias;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function join($table, $alias = NULL, $condition = NULL, $arguments = array()) {
     return $this->addJoin('INNER', $table, $alias, $condition, $arguments);
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function innerJoin($table, $alias = NULL, $condition = NULL, $arguments = array()) {
     return $this->addJoin('INNER', $table, $alias, $condition, $arguments);
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function leftJoin($table, $alias = NULL, $condition = NULL, $arguments = array()) {
     return $this->addJoin('LEFT OUTER', $table, $alias, $condition, $arguments);
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function rightJoin($table, $alias = NULL, $condition = NULL, $arguments = array()) {
     return $this->addJoin('RIGHT OUTER', $table, $alias, $condition, $arguments);
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function addJoin($type, $table, $alias = NULL, $condition = NULL, $arguments = array()) {
+
     if (empty($alias)) {
       if ($table instanceof SelectInterface) {
         $alias = 'subquery';
@@ -711,9 +540,6 @@ public function addJoin($type, $table, $alias = NULL, $condition = NULL, $argume
     return $alias;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function orderBy($field, $direction = 'ASC') {
     // Only allow ASC and DESC, default to ASC.
     $direction = strtoupper($direction) == 'DESC' ? 'DESC' : 'ASC';
@@ -721,26 +547,17 @@ public function orderBy($field, $direction = 'ASC') {
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function orderRandom() {
     $alias = $this->addExpression('RAND()', 'random_field');
     $this->orderBy($alias);
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function range($start = NULL, $length = NULL) {
     $this->range = func_num_args() ? array('start' => $start, 'length' => $length) : array();
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function union(SelectInterface $query, $type = '') {
     // Handle UNION aliasing.
     switch ($type) {
@@ -763,16 +580,13 @@ public function union(SelectInterface $query, $type = '') {
     return $this;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function groupBy($field) {
     $this->group[$field] = $field;
     return $this;
   }
 
   /**
-   * {@inheritdoc}
+   * Implements SelectInterface::countQuery().
    */
   public function countQuery() {
     $count = $this->prepareCountQuery();
@@ -846,9 +660,6 @@ protected function prepareCountQuery() {
     return $count;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function __toString() {
     // For convenience, we compile the query ourselves if the caller forgot
     // to do it. This allows constructs like "(string) $query" to work. When
@@ -968,9 +779,6 @@ public function __toString() {
     return $query;
   }
 
-  /**
-   * {@inheritdoc}
-   */
   public function __clone() {
     // On cloning, also clone the dependent objects. However, we do not
     // want to clone the database connection object as that would duplicate the
diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php
index 7c39f19..5416935 100644
--- a/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerBase.php
@@ -8,7 +8,6 @@
 namespace Drupal\Core\Entity;
 use Drupal\Core\Entity\Query\QueryInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * A base entity storage controller class.
@@ -195,17 +194,10 @@ protected function buildPropertyQuery(QueryInterface $entity_query, array $value
    */
   public function loadByProperties(array $values = array()) {
     // Build a query to fetch the entity IDs.
-    $entity_query = $this->getQuery();
+    $entity_query = \Drupal::entityQuery($this->entityTypeId);
     $this->buildPropertyQuery($entity_query, $values);
     $result = $entity_query->execute();
     return $result ? $this->loadMultiple($result) : array();
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function getQuery($conjunction = 'AND') {
-    return \Drupal::entityQuery($this->getEntityTypeId(), $conjunction);
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php b/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php
index 2658aa2..3da5abc 100644
--- a/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php
+++ b/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php
@@ -155,21 +155,6 @@ public function save(EntityInterface $entity);
   public function getQueryServicename();
 
   /**
-   * Returns an entity query instance.
-   *
-   * @param string $conjunction
-   *   (optional) The logical operator for the query, either:
-   *   - AND: all of the conditions on the query need to match.
-   *   - OR: at least one of the conditions on the query need to match.
-   *
-   * @return \Drupal\Core\Entity\Query\QueryInterface
-   *   The query instance.
-   *
-   * @see \Drupal\Core\Entity\EntityStorageControllerInterface::getQueryServicename()
-   */
-  public function getQuery($conjunction = 'AND');
-
-  /**
    * Returns the entity type ID.
    *
    * @return string
diff --git a/core/lib/Drupal/Core/Theme/ThemeSettings.php b/core/lib/Drupal/Core/Theme/ThemeSettings.php
index 6749f01..d20b843 100644
--- a/core/lib/Drupal/Core/Theme/ThemeSettings.php
+++ b/core/lib/Drupal/Core/Theme/ThemeSettings.php
@@ -7,12 +7,12 @@
 
 namespace Drupal\Core\Theme;
 
-use Drupal\Core\Config\ConfigBase;
+use Drupal\Component\Utility\NestedArray;
 
 /**
  * Defines the default theme settings object.
  */
-class ThemeSettings extends ConfigBase {
+class ThemeSettings {
 
   /**
    * The theme of the theme settings object.
@@ -22,13 +22,21 @@ class ThemeSettings extends ConfigBase {
   protected $theme;
 
   /**
+   * The data of the theme settings object.
+   *
+   * @var array
+   */
+  protected $data;
+
+  /**
    * Constructs a theme settings object.
    *
-   * @param string $theme
+   * @param string $name
    *   The name of the theme settings object being constructed.
    */
   public function __construct($theme) {
     $this->theme = $theme;
+    $this->data = array();
   }
 
   /**
@@ -40,4 +48,113 @@ public function __construct($theme) {
   public function getTheme() {
     return $this->theme;
   }
+
+  /**
+   * Gets data from this theme settings object.
+   *
+   * @param string $key
+   *   A string that maps to a key within the theme settings data.
+   *   For instance in the following theme settings array:
+   *   @code
+   *   array(
+   *     'foo' => array(
+   *       'bar' => 'baz',
+   *     ),
+   *   );
+   *   @endcode
+   *   A key of 'foo.bar' would return the string 'baz'. However, a key of 'foo'
+   *   would return array('bar' => 'baz').
+   *   If no key is specified, then the entire data array is returned.
+   *
+   *
+   * @return mixed
+   *   The data that was requested.
+   */
+  public function get($key = '') {
+    if (empty($key)) {
+      return $this->data;
+    }
+    else {
+      $parts = explode('.', $key);
+      if (count($parts) == 1) {
+        return isset($this->data[$key]) ? $this->data[$key] : NULL;
+      }
+      else {
+        $value = NestedArray::getValue($this->data, $parts, $key_exists);
+        return $key_exists ? $value : NULL;
+      }
+    }
+  }
+
+  /**
+   * Replaces the data of this theme settings object.
+   *
+   * @param array $data
+   *   The new theme settings data.
+   *
+   * @return \Drupal\Core\Theme\ThemeSettings
+   *   The theme settings object.
+   */
+  public function setData(array $data) {
+    $this->data = $data;
+    return $this;
+  }
+
+  /**
+   * Sets value in this theme settings object.
+   *
+   * @param string $key
+   *   Identifier to store value in theme settings.
+   * @param string $value
+   *   Value to associate with identifier.
+   *
+   * @return \Drupal\Core\Theme\ThemeSettings
+   *   The theme settings object.
+   */
+  public function set($key, $value) {
+    // The dot/period is a reserved character; it may appear between keys, but
+    // not within keys.
+    $parts = explode('.', $key);
+    if (count($parts) == 1) {
+      $this->data[$key] = $value;
+    }
+    else {
+      NestedArray::setValue($this->data, $parts, $value);
+    }
+    return $this;
+  }
+
+  /**
+   * Unsets value in this theme settings object.
+   *
+   * @param string $key
+   *   Name of the key whose value should be unset.
+   *
+   * @return \Drupal\Core\Theme\ThemeSettings
+   *   The theme settings object.
+   */
+  public function clear($key) {
+    $parts = explode('.', $key);
+    if (count($parts) == 1) {
+      unset($this->data[$key]);
+    }
+    else {
+      NestedArray::unsetValue($this->data, $parts);
+    }
+    return $this;
+  }
+
+  /**
+   * Merges the data into this theme settings object.
+   *
+   * @param array $data
+   *   Theme settings data to merge.
+   *
+   * @return \Drupal\Core\Theme\ThemeSettings
+   *   The theme settings object.
+   */
+  public function mergeData ($data) {
+    $this->data = NestedArray::mergeDeep($this->data, $data);
+    return $this;
+  }
 }
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php
index 1ba376b..c1eda08 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/Form/OpmlFeedAdd.php
@@ -9,6 +9,7 @@
 
 use Drupal\aggregator\FeedStorageControllerInterface;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Form\FormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Guzzle\Http\Exception\RequestException;
@@ -21,6 +22,13 @@
 class OpmlFeedAdd extends FormBase {
 
   /**
+   * The entity query factory object.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryFactory
+   */
+  protected $queryFactory;
+
+  /**
    * The feed storage.
    *
    * @var \Drupal\aggregator\FeedStorageControllerInterface
@@ -37,12 +45,15 @@ class OpmlFeedAdd extends FormBase {
   /**
    * Constructs a database object.
    *
+   * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
+   *   The entity query object.
    * @param \Drupal\aggregator\FeedStorageControllerInterface $feed_storage
    *   The feed storage.
    * @param \Guzzle\Http\ClientInterface $http_client
    *   The Guzzle HTTP client.
    */
-  public function __construct(FeedStorageControllerInterface $feed_storage, ClientInterface $http_client) {
+  public function __construct(QueryFactory $query_factory, FeedStorageControllerInterface $feed_storage, ClientInterface $http_client) {
+    $this->queryFactory = $query_factory;
     $this->feedStorageController = $feed_storage;
     $this->httpClient = $http_client;
   }
@@ -52,6 +63,7 @@ public function __construct(FeedStorageControllerInterface $feed_storage, Client
    */
   public static function create(ContainerInterface $container) {
     return new static(
+      $container->get('entity.query'),
       $container->get('entity.manager')->getStorageController('aggregator_feed'),
       $container->get('http_default_client')
     );
@@ -152,7 +164,7 @@ public function submitForm(array &$form, array &$form_state) {
       }
 
       // Check for duplicate titles or URLs.
-      $query = $this->feedStorageController->getQuery();
+      $query = $this->queryFactory->get('aggregator_feed');
       $condition = $query->orConditionGroup()
         ->condition('title', $feed['title'])
         ->condition('url', $feed['url']);
diff --git a/core/modules/block/lib/Drupal/block/BlockFormController.php b/core/modules/block/lib/Drupal/block/BlockFormController.php
index 4ce4c81..08bf090 100644
--- a/core/modules/block/lib/Drupal/block/BlockFormController.php
+++ b/core/modules/block/lib/Drupal/block/BlockFormController.php
@@ -11,6 +11,7 @@
 use Drupal\Core\Config\ConfigFactoryInterface;
 use Drupal\Core\Entity\EntityFormController;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Language\Language;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\language\ConfigurableLanguageManagerInterface;
@@ -36,6 +37,13 @@ class BlockFormController extends EntityFormController {
   protected $storageController;
 
   /**
+   * The entity query factory.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryFactory
+   */
+  protected $entityQueryFactory;
+
+  /**
    * The language manager.
    *
    * @var \Drupal\Core\Language\LanguageManagerInterface
@@ -54,13 +62,16 @@ class BlockFormController extends EntityFormController {
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query_factory
+   *   The entity query factory.
    * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
    *   The language manager.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The config factory.
    */
-  public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) {
+  public function __construct(EntityManagerInterface $entity_manager, QueryFactory $entity_query_factory, LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory) {
     $this->storageController = $entity_manager->getStorageController('block');
+    $this->entityQueryFactory = $entity_query_factory;
     $this->languageManager = $language_manager;
     $this->configFactory = $config_factory;
   }
@@ -71,6 +82,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('entity.manager'),
+      $container->get('entity.query'),
       $container->get('language_manager'),
       $container->get('config.factory')
     );
@@ -361,7 +373,7 @@ public function getUniqueMachineName(BlockInterface $block) {
     $suggestion = $block->getPlugin()->getMachineNameSuggestion();
 
     // Get all the blocks which starts with the suggested machine name.
-    $query = $this->storageController->getQuery();
+    $query = $this->entityQueryFactory->get('block');
     $query->condition('id', $suggestion, 'CONTAINS');
     $block_ids = $query->execute();
 
diff --git a/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php
index aa54731..5d9f692 100644
--- a/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php
+++ b/core/modules/block/tests/Drupal/block/Tests/BlockFormControllerTest.php
@@ -31,6 +31,7 @@ public static function getInfo() {
    * @see \Drupal\block\BlockFormController::getUniqueMachineName()
    */
   public function testGetUniqueMachineName() {
+    $block_storage = $this->getMock('Drupal\Core\Config\Entity\ConfigStorageControllerInterface');
     $blocks = array();
 
     $blocks['test'] = $this->getBlockMockWithMachineName('test');
@@ -38,7 +39,9 @@ public function testGetUniqueMachineName() {
     $blocks['other_test_1'] = $this->getBlockMockWithMachineName('other_test');
     $blocks['other_test_2'] = $this->getBlockMockWithMachineName('other_test');
 
-    $query = $this->getMock('Drupal\Core\Entity\Query\QueryInterface');
+    $query = $this->getMockBuilder('Drupal\Core\Entity\Query\QueryInterface')
+      ->disableOriginalConstructor()
+      ->getMock();
     $query->expects($this->exactly(5))
       ->method('condition')
       ->will($this->returnValue($query));
@@ -47,9 +50,12 @@ public function testGetUniqueMachineName() {
       ->method('execute')
       ->will($this->returnValue(array('test', 'other_test', 'other_test_1', 'other_test_2')));
 
-    $block_storage = $this->getMock('Drupal\Core\Config\Entity\ConfigStorageControllerInterface');
-    $block_storage->expects($this->exactly(5))
-      ->method('getQuery')
+    $query_factory = $this->getMockBuilder('Drupal\Core\Entity\Query\QueryFactory')
+      ->disableOriginalConstructor()
+      ->getMock();
+    $query_factory->expects($this->exactly(5))
+      ->method('get')
+      ->with('block', 'AND')
       ->will($this->returnValue($query));
 
     $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
@@ -62,7 +68,7 @@ public function testGetUniqueMachineName() {
 
     $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
 
-    $block_form_controller = new BlockFormController($entity_manager, $language_manager, $config_factory);
+    $block_form_controller = new BlockFormController($entity_manager, $query_factory, $language_manager, $config_factory);
 
     // Ensure that the block with just one other instance gets the next available
     // name suggestion.
diff --git a/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php b/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php
index e2ce52a..5fed1db 100644
--- a/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php
+++ b/core/modules/comment/lib/Drupal/comment/Form/CommentAdminOverview.php
@@ -13,6 +13,7 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Datetime\Date;
 use Drupal\Core\Entity\EntityManager;
+use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Form\FormBase;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -37,6 +38,13 @@ class CommentAdminOverview extends FormBase {
   protected $commentStorage;
 
   /**
+   * The entity query service.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryFactory
+   */
+  protected $entityQuery;
+
+  /**
    * Date service object.
    *
    * @var \Drupal\Core\Datetime\Date
@@ -57,14 +65,17 @@ class CommentAdminOverview extends FormBase {
    *   The entity manager service.
    * @param \Drupal\comment\CommentStorageControllerInterface $comment_storage
    *   The comment storage.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query
+   *   The entity query service.
    * @param \Drupal\Core\Datetime\Date $date
    *   The date service.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    *   The module handler.
    */
-  public function __construct(EntityManager $entity_manager, CommentStorageControllerInterface $comment_storage, Date $date, ModuleHandlerInterface $module_handler) {
+  public function __construct(EntityManager $entity_manager, CommentStorageControllerInterface $comment_storage, QueryFactory $entity_query, Date $date, ModuleHandlerInterface $module_handler) {
     $this->entityManager = $entity_manager;
     $this->commentStorage = $comment_storage;
+    $this->entityQuery = $entity_query;
     $this->date = $date;
     $this->moduleHandler = $module_handler;
   }
@@ -76,6 +87,7 @@ public static function create(ContainerInterface $container) {
     return new static(
       $container->get('entity.manager'),
       $container->get('entity.manager')->getStorageController('comment'),
+      $container->get('entity.query'),
       $container->get('date'),
       $container->get('module_handler')
     );
@@ -155,7 +167,7 @@ public function buildForm(array $form, array &$form_state, $type = 'new') {
       ),
       'operations' => $this->t('Operations'),
     );
-    $cids = $this->commentStorage->getQuery()
+    $cids = $this->entityQuery->get('comment')
      ->condition('status', $status)
      ->tableSort($header)
      ->pager(50)
diff --git a/core/modules/field/lib/Drupal/field/FieldConfigStorageController.php b/core/modules/field/lib/Drupal/field/FieldConfigStorageController.php
index 7fb0866..f6d8759 100644
--- a/core/modules/field/lib/Drupal/field/FieldConfigStorageController.php
+++ b/core/modules/field/lib/Drupal/field/FieldConfigStorageController.php
@@ -54,6 +54,8 @@ class FieldConfigStorageController extends ConfigStorageController {
    *   The config factory service.
    * @param \Drupal\Core\Config\StorageInterface $config_storage
    *   The config storage service.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query_factory
+   *   The entity query factory.
    * @param \Drupal\Component\Uuid\UuidInterface $uuid_service
    *   The UUID service.
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -63,8 +65,8 @@ class FieldConfigStorageController extends ConfigStorageController {
    * @param \Drupal\Core\KeyValueStore\StateInterface $state
    *   The state key value store.
    */
-  public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInterface $config_factory, StorageInterface $config_storage, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, ModuleHandler $module_handler, StateInterface $state) {
-    parent::__construct($entity_type, $config_factory, $config_storage, $uuid_service);
+  public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInterface $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, ModuleHandler $module_handler, StateInterface $state) {
+    parent::__construct($entity_type, $config_factory, $config_storage, $entity_query_factory, $uuid_service);
     $this->entityManager = $entity_manager;
     $this->moduleHandler = $module_handler;
     $this->state = $state;
@@ -78,6 +80,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
       $entity_type,
       $container->get('config.factory'),
       $container->get('config.storage'),
+      $container->get('entity.query'),
       $container->get('uuid'),
       $container->get('entity.manager'),
       $container->get('module_handler'),
diff --git a/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php b/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php
index d18fbf3..1251b5e 100644
--- a/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php
+++ b/core/modules/field/lib/Drupal/field/FieldInstanceConfigStorageController.php
@@ -52,6 +52,8 @@ class FieldInstanceConfigStorageController extends ConfigStorageController {
    *   The config factory service.
    * @param \Drupal\Core\Config\StorageInterface $config_storage
    *   The config storage service.
+   * @param \Drupal\Core\Entity\Query\QueryFactory $entity_query_factory
+   *   The entity query factory.
    * @param \Drupal\Component\Uuid\UuidInterface $uuid_service
    *   The UUID service.
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
@@ -59,8 +61,8 @@ class FieldInstanceConfigStorageController extends ConfigStorageController {
    * @param \Drupal\Core\KeyValueStore\StateInterface $state
    *   The state key value store.
    */
-  public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInterface $config_factory, StorageInterface $config_storage, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, StateInterface $state) {
-    parent::__construct($entity_type, $config_factory, $config_storage, $uuid_service);
+  public function __construct(EntityTypeInterface $entity_type, ConfigFactoryInterface $config_factory, StorageInterface $config_storage, QueryFactory $entity_query_factory, UuidInterface $uuid_service, EntityManagerInterface $entity_manager, StateInterface $state) {
+    parent::__construct($entity_type, $config_factory, $config_storage, $entity_query_factory, $uuid_service);
     $this->entityManager = $entity_manager;
     $this->state = $state;
   }
@@ -73,6 +75,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
       $entity_type,
       $container->get('config.factory'),
       $container->get('config.storage'),
+      $container->get('entity.query'),
       $container->get('uuid'),
       $container->get('entity.manager'),
       $container->get('state')
diff --git a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php
index 51a7241..ee9d0b8 100644
--- a/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php
+++ b/core/modules/menu_link/lib/Drupal/menu_link/MenuLinkStorageController.php
@@ -166,7 +166,7 @@ public function updateParentalStatus(EntityInterface $entity, $exclude = FALSE)
     // If plid == 0, there is nothing to update.
     if ($entity->plid) {
       // Check if at least one visible child exists in the table.
-      $query = $this->getQuery();
+      $query = \Drupal::entityQuery($this->entityTypeId);
       $query
         ->condition('menu_name', $entity->menu_name)
         ->condition('hidden', 0)
@@ -259,7 +259,7 @@ public function moveChildren(EntityInterface $entity) {
    * {@inheritdoc}
    */
   public function countMenuLinks($menu_name) {
-    $query = $this->getQuery();
+    $query = \Drupal::entityQuery($this->entityTypeId);
     $query
       ->condition('menu_name', $menu_name)
       ->count();
@@ -275,7 +275,7 @@ public function getParentFromHierarchy(EntityInterface $entity) {
       $parent = FALSE;
       $parent_path = substr($parent_path, 0, strrpos($parent_path, '/'));
 
-      $query = $this->getQuery();
+      $query = \Drupal::entityQuery($this->entityTypeId);
       $query
         ->condition('mlid', $entity->id(), '<>')
         ->condition('module', 'system')
diff --git a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
index 4efc395..84b9a57 100644
--- a/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
+++ b/core/modules/node/tests/modules/node_test_views/test_views/views.view.test_node_row_plugin.yml
@@ -42,14 +42,14 @@ display:
     display_plugin: default
     display_title: Master
     id: default
-    position: 0
+    position: {  }
   page_1:
     display_options:
       path: test-node-row-plugin
     display_plugin: page
     display_title: Page
     id: page_1
-    position: 0
+    position: {  }
 label: test_node_row_plugin
 langcode: en
 module: views
diff --git a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
index ac94508..caae9f7 100644
--- a/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
+++ b/core/modules/system/lib/Drupal/system/Form/DateFormatFormBase.php
@@ -14,6 +14,7 @@
 use Drupal\Core\Language\Language;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Drupal\Core\Datetime\DrupalDateTime;
+use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Entity\EntityFormController;
 
 /**
@@ -29,6 +30,13 @@
   protected $patternType;
 
   /**
+   * The entity query factory.
+   *
+   * @var \Drupal\Core\Entity\Query\QueryFactory
+   */
+  protected $queryFactory;
+
+  /**
    * The date service.
    *
    * @var \Drupal\Core\Datetime\Date
@@ -45,15 +53,18 @@
   /**
    * Constructs a new date format form.
    *
+   * @param \Drupal\Core\Entity\Query\QueryFactory $query_factory
+   *   The entity query factory.
    * @param \Drupal\Core\Datetime\Date $date_service
    *   The date service.
    * @param \Drupal\Core\Config\Entity\ConfigStorageControllerInterface $date_format_storage
    *   The date format storage controller.
    */
-  public function __construct(Date $date_service, ConfigStorageControllerInterface $date_format_storage) {
+  public function __construct(QueryFactory $query_factory, Date $date_service, ConfigStorageControllerInterface $date_format_storage) {
     $date = new DrupalDateTime();
     $this->patternType = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
 
+    $this->queryFactory = $query_factory;
     $this->dateService = $date_service;
     $this->dateFormatStorage = $date_format_storage;
   }
@@ -63,6 +74,7 @@ public function __construct(Date $date_service, ConfigStorageControllerInterface
    */
   public static function create(ContainerInterface $container) {
     return new static(
+      $container->get('entity.query'),
       $container->get('date'),
       $container->get('entity.manager')->getStorageController('date_format')
     );
@@ -82,8 +94,8 @@ public static function create(ContainerInterface $container) {
    *   TRUE if this format already exists, FALSE otherwise.
    */
   public function exists($entity_id, array $element,  array $form_state) {
-    return (bool) $this->dateFormatStorage
-      ->getQuery()
+    return (bool) $this->queryFactory
+      ->get($this->entity->getEntityTypeId())
       ->condition('id', $element['#field_prefix'] . $entity_id)
       ->execute();
   }
diff --git a/core/modules/system/theme.api.php b/core/modules/system/theme.api.php
index c86b161..931707b 100644
--- a/core/modules/system/theme.api.php
+++ b/core/modules/system/theme.api.php
@@ -9,104 +9,74 @@
  * layer. Each theme can take control over most of Drupal's output, and
  * has complete control over the CSS.
  *
- * The theme layer is utilized by specifying theme implementations in a
- * renderable array. The names of the keys in a renderable array
- * determine how the information in the array is converted to themed output.
- *
- * To invoke a theme implementation on a renderable array, define a key named
- * '#theme' and assign it a string value that is the name of a theme hook. Any
- * variables that the theme hook requires may be supplied as additional keys --
- * prepended with a '#' character -- in the renderable array.
+ * Inside Drupal, the theme layer is utilized by the use of the _theme()
+ * function, which is passed the name of a component (the theme hook)
+ * and an array of variables. For example,
+ * _theme('table', array('header' => $header, 'rows' => $rows));
+ * Additionally, the _theme() function can take an array of theme
+ * hooks, which can be used to provide 'fallback' implementations to
+ * allow for more specific control of output. For example, the function:
+ * _theme(array('table__foo', 'table'), $variables) would look to see if
+ * 'table__foo' is registered anywhere; if it is not, it would 'fall back'
+ * to the generic 'table' implementation. This can be used to attach specific
+ * theme functions to named objects, allowing the themer more control over
+ * specific types of output.
+ *
+ * Calling the _theme() function directly is highly discouraged. Building a
+ * renderable array is preferred. For example, rather than calling
+ * _theme('table', array()) in-place, one can assemble a renderable array as
+ * follows:
  *
  * @code
- * $item_list = array(
- *   '#theme' => 'item_list',
- *   '#items' => $links,
- *   '#title' => t('Next steps'),
+ * $table = array(
+ *   '#type' => 'table',
+ *   '#header' => '',
+ *   '#rows' => array(),
  * );
- *
- * return $item_list;
  * @endcode
  *
- * Do not call _theme() directly; instead, build and return a renderable array.
- * If necessary, the array may be rendered to a string in-place
- * by calling drupal_render().
+ * Note that a table is defined as a type as well as a theme function. Building
+ * it as a type is preferred. The $table array can simply be passed along as
+ * a renderable array in a page build process. If necessary, the array may be
+ * rendered to a string by calling drupal_render().
  *
  * @code
- * $output = drupal_render($item_list);
+ * $output = drupal_render($table);
  * @endcode
  *
- * @section sec_theme_hooks Theme Hooks
- * Modules register theme hooks within a hook_theme()implementation and provide
- * a default implementation via a function named theme_HOOK(). For instance, to
- * theme a taxonomy term, the theme hook name is 'taxonomy_term'. If theming is
- * handled via a function then the corresponding function name is
- * theme_taxonomy_term(). If theming is handled via a template then the file
- * should be named according to the value of the 'template' key registered with
- * the theme hook (see hook_theme() for details). Default templates are
- * implemented with the Twig rendering engine and are named the same as the
- * theme hook, with underscores changed to hyphens, so for the 'taxonomy_term'
- * theme hook, the default template is 'taxonomy-term.html.twig'.
- *
- * @subsection sub_overriding_theme_hooks Overriding Theme Hooks
- * Themes may register new theme hooks within a hook_theme()
- * implementation, but it is more common for themes to override default
- * implementations provided by modules than to register entirely new theme
- * hooks. Themes can override a default implementation by implementing a
- * function named THEME_HOOK() (for example, the 'bartik' theme overrides the
- * default implementation of the 'menu_tree' theme hook by implementing a
- * bartik_menu_tree() function), or by adding a template file within its folder
- * structure that follows the template naming structure used by the theme's
- * rendering engine. For example, since the Bartik theme uses the Twig rendering
- * engine, it overrides the default implementation of the 'page' theme hook by
- * containing a 'page.html.twig' file within its folder structure.
- *
- * @subsection sub_preprocess_templates Preprocessing for Template Files
- * If the implementation is a template file, several functions are called before
- * the template file is invoked to modify the $variables array. These make up
- * the "preprocessing" phase, and are executed (if they exist), in the following
- * order (note that in the following list, HOOK indicates the theme hook name,
- * MODULE indicates a module name, THEME indicates a theme name, and ENGINE
- * indicates a theme engine name):
- * - template_preprocess(&$variables, $hook): Creates a default set of variables
- *   for all theme hooks with template implementations.
- * - template_preprocess_HOOK(&$variables): Should be implemented by the module
- *   that registers the theme hook, to set up default variables.
- * - MODULE_preprocess(&$variables, $hook): hook_preprocess() is invoked on all
- *   implementing modules.
- * - MODULE_preprocess_HOOK(&$variables): hook_preprocess_HOOK() is invoked on
- *   all implementing modules, so that modules that didn't define the theme hook
- *   can alter the variables.
- * - ENGINE_engine_preprocess(&$variables, $hook): Allows the theme engine to
- *   set necessary variables for all theme hooks with template implementations.
- * - ENGINE_engine_preprocess_HOOK(&$variables): Allows the theme engine to set
- *   necessary variables for the particular theme hook.
- * - THEME_preprocess(&$variables, $hook): Allows the theme to set necessary
- *   variables for all theme hooks with template implementations.
- * - THEME_preprocess_HOOK(&$variables): Allows the theme to set necessary
- *   variables specific to the particular theme hook.
- *
- * @subsection sub_preprocess_theme_funcs Preprocessing for Theme Functions
- * If the theming implementation is a function, only the theme-hook-specific
- * preprocess functions (the ones ending in _HOOK) are called from the list
- * above. This is because theme hooks with function implementations need to be
- * fast, and calling the non-theme-hook-specific preprocess functions for them
- * would incur a noticeable performance penalty.
- *
- * @subsection sub_alternate_suggestions Suggesting Alternate Hooks
- * Alternate hooks can be suggested by implementing the hook-specific
- * hook_theme_suggestions_HOOK_alter() or the generic
- * hook_theme_suggestions_alter(). These alter hooks are used to manipulate an
- * array of suggested alternate theme hooks to use, in reverse order of
- * priority. _theme() will use the highest priority implementation that exists.
- * If none exists, _theme() will use the implementation for the theme hook it
- * was called with. These suggestions are similar to and are used for similar
- * reasons as assigning an array of theme hooks to the #theme property of a
- * renderable array. The difference is whether the suggestions are determined
- * when _theme() is called or through altering the suggestions via the
- * suggestion alter hooks.
- *
- * @see drupal_render()
+ * As of Drupal 6, every theme hook is required to be registered by the
+ * module that owns it, so that Drupal can tell what to do with it and
+ * to make it simple for themes to identify and override the behavior
+ * for these calls.
+ *
+ * The theme hooks are registered via hook_theme(), which returns an
+ * array of arrays with information about the hook. It describes the
+ * arguments the function or template will need, and provides
+ * defaults for the template in case they are not filled in. If the default
+ * implementation is a function, by convention it is named theme_HOOK().
+ *
+ * Each module should provide a default implementation for theme_hooks that
+ * it registers. This implementation may be either a function or a template;
+ * if it is a function it must be specified via hook_theme(). By convention,
+ * default implementations of theme hooks are named theme_HOOK. Default
+ * template implementations are stored in the module directory.
+ *
+ * Drupal's default template renderer is Twig. Drupal's theme engines can
+ * provide alternate template engines, such as XTemplate, Smarty and PHPTal.
+ *
+ * In order to create theme-specific implementations of these hooks, themes can
+ * implement their own version of theme hooks, either as functions or templates.
+ * These implementations will be used instead of the default implementation. If
+ * using a pure .theme without an engine, the .theme is required to implement
+ * its own version of hook_theme() to tell Drupal what it is implementing;
+ * themes utilizing an engine will have their well-named theming functions
+ * automatically registered for them. While this can vary based upon the theme
+ * engine, the standard is that theme functions should be named THEMENAME_HOOK.
+ * For example, for Drupal's default theme (Bartik) to implement the 'table'
+ * hook, the theme function should be called bartik_table().
+ *
+ * The theme system is described and defined in theme.inc.
+ *
  * @see _theme()
  * @see hook_theme()
  * @see hooks
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php
index b624351..7246970 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php
@@ -20,12 +20,7 @@ class VocabularyFormController extends EntityFormController {
    */
   public function form(array $form, array &$form_state) {
     $vocabulary = $this->entity;
-    if ($vocabulary->isNew()) {
-      $form['#title'] = $this->t('Add vocabulary');
-    }
-    else {
-      $form['#title'] = $this->t('Edit vocabulary');
-    }
+    $form['#title'] = $this->t('Edit vocabulary');
 
     $form['name'] = array(
       '#type' => 'textfield',
diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml
index 5fd37bc..2dc1c2b 100644
--- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml
+++ b/core/modules/taxonomy/tests/modules/taxonomy_test_views/test_views/views.view.test_groupwise_term.yml
@@ -65,7 +65,7 @@ display:
     display_plugin: default
     display_title: Master
     id: default
-    position: 0
+    position: {  }
 label: test_groupwise
 langcode: und
 module: views
diff --git a/core/modules/user/config/views.view.user_admin_people.yml b/core/modules/user/config/views.view.user_admin_people.yml
index 849697a..86f49be 100644
--- a/core/modules/user/config/views.view.user_admin_people.yml
+++ b/core/modules/user/config/views.view.user_admin_people.yml
@@ -561,7 +561,6 @@ display:
           empty_zero: false
           hide_alter_empty: true
           text: Translate
-          optional: true
           plugin_id: content_translation_link
           provider: content_translation
         dropbutton:
diff --git a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml
index 4dc494a..b0a6665 100644
--- a/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml
+++ b/core/modules/user/tests/modules/user_test_views/test_views/views.view.test_groupwise_user.yml
@@ -77,7 +77,7 @@ display:
     display_plugin: default
     display_title: Master
     id: default
-    position: 0
+    position: {  }
 label: test_groupwise_user
 langcode: und
 module: views
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 5594dd5..363c69b 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -71,7 +71,7 @@
   exit;
 }
 
-$test_list = simpletest_script_get_test_list();
+$test_list = array_fill(0, 20, 'Drupal\toolbar\Tests\ToolbarAdminMenuTest');
 
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
diff --git a/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php b/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php
deleted file mode 100644
index 258279e..0000000
--- a/core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/**
- * @file Contains \Drupal\Tests\Core\Annotation\TranslationTest.
- */
-
-namespace Drupal\Tests\Core\Annotation;
-
-use Drupal\Core\Annotation\Translation;
-use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\Tests\UnitTestCase;
-
-/**
- * Tests the Translation annotation.
- *
- * @covers \Drupal\Core\Annotation\Translation.
- */
-class TranslationTest extends UnitTestCase {
-
-  /**
-   * The translation manager used for testing.
-   *
-   * @var \Drupal\Core\StringTranslation\TranslationInterface|\PHPUnit_Framework_MockObject_MockObject
-   */
-  protected $translationManager;
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function getInfo() {
-    return array(
-      'description' => '',
-      'name' => '\Drupal\Core\Annotation\Translation unit test',
-      'group' => 'System',
-    );
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function setUp() {
-    $this->translationManager = $this->getStringTranslationStub();
-  }
-
-  /**
-   * @covers \Drupal\Core\Annotation\Translation::get()
-   *
-   * @dataProvider providerTestGet
-   */
-  public function testGet(array $values, $expected) {
-    $container = new ContainerBuilder();
-    $container->set('string_translation', $this->translationManager);
-    \Drupal::setContainer($container);
-
-    $arguments = isset($values['arguments']) ? $values['arguments'] : array();
-    $options = isset($values['context']) ? array(
-      'context' => $values['context'],
-    ) : array();
-    $this->translationManager->expects($this->once())
-      ->method('translate')
-      ->with($values['value'], $arguments, $options);
-
-    $annotation = new Translation($values);
-
-    $this->assertSame($expected, $annotation->get());
-  }
-
-  /**
-   * Provides data to self::testGet().
-   */
-  public function providerTestGet() {
-    $data = array();
-    $data[] = array(
-      array(
-        'value' => 'Foo',
-      ),
-      'Foo'
-    );
-    $random = $this->randomName();
-    $random_html_entity = '&' . $random;
-    $data[] = array(
-      array(
-        'value' => 'Foo !bar @baz %qux',
-        'arguments' => array(
-          '!bar' => $random,
-          '@baz' => $random_html_entity,
-          '%qux' => $random_html_entity,
-        ),
-        'context' => $this->randomName(),
-      ),
-      'Foo ' . $random . ' &amp;' . $random . ' <em class="placeholder">&amp;' . $random . '</em>',
-    );
-
-    return $data;
-  }
-
-}
diff --git a/core/tests/Drupal/Tests/UnitTestCase.php b/core/tests/Drupal/Tests/UnitTestCase.php
index f64dca0..b862f12 100644
--- a/core/tests/Drupal/Tests/UnitTestCase.php
+++ b/core/tests/Drupal/Tests/UnitTestCase.php
@@ -190,7 +190,7 @@ public function getStringTranslationStub() {
     $translation = $this->getMock('Drupal\Core\StringTranslation\TranslationInterface');
     $translation->expects($this->any())
       ->method('translate')
-      ->will($this->returnCallback('Drupal\Component\Utility\String::format'));
+      ->will($this->returnCallback(function ($string, array $args = array()) { return strtr($string, $args); }));
     return $translation;
   }
 
