diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 4250091..c978c3c 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -3,7 +3,7 @@
 use Drupal\Core\Database\Database;
 use Symfony\Component\ClassLoader\UniversalClassLoader;
 use Symfony\Component\ClassLoader\ApcUniversalClassLoader;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Drupal\Component\DependencyInjection\ContainerBuilder;
 
 /**
  * @file
@@ -2152,6 +2152,10 @@ function _drupal_bootstrap_configuration() {
     // All Drupal-namespaced code in core lives in /core/lib/Drupal.
     'Drupal' => DRUPAL_ROOT . '/core/lib',
   ));
+
+  // @todo This should move elsewhere. Where?
+  drupal_container()->registerFallback('cache.{cache.bin}', 'Drupal\Core\Cache\DatabaseBackend')
+    ->setArguments(array('%cache.bin%'));
 }
 
 /**
@@ -2322,7 +2326,7 @@ function drupal_get_bootstrap_phase() {
  * @param $reset
  *   TRUE or FALSE depending on whether the Container instance is to be reset.
  *
- * @return Symfony\Component\DependencyInjection\ContainerBuilder
+ * @return Drupal\Component\DependencyInjection\ContainerBuilder
  *   The instance of the Drupal Container used to set up and maintain object
  *   instances.
  */
diff --git a/core/includes/cache.inc b/core/includes/cache.inc
index d3c3414..d0b7391 100644
--- a/core/includes/cache.inc
+++ b/core/includes/cache.inc
@@ -28,17 +28,7 @@ function cache($bin = 'cache') {
   // bin names to be passed as arguments.
   $bin = str_replace('cache_', '', $bin);
 
-  // We do not use drupal_static() here because we do not want to change the
-  // storage of a cache bin mid-request.
-  static $cache_objects;
-  if (!isset($cache_objects[$bin])) {
-    $class = variable_get('cache_class_' . $bin);
-    if (!isset($class)) {
-      $class = variable_get('cache_default_class', 'Drupal\Core\Cache\DatabaseBackend');
-    }
-    $cache_objects[$bin] = new $class($bin);
-  }
-  return $cache_objects[$bin];
+  return drupal_container()->get('cache.' . $bin);
 }
 
 /**
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 07e25a0..df421bd 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -297,7 +297,8 @@ function install_begin_request(&$install_state) {
   // because any data put in the cache during the installer is inherently
   // suspect, due to the fact that Drupal is not fully set up yet.
   require_once DRUPAL_ROOT . '/core/includes/cache.inc';
-  $conf['cache_default_class'] = 'Drupal\Core\Cache\InstallBackend';
+  drupal_container()->registerFallback('cache.{cache.bin}', 'Drupal\Core\Cache\InstallBackend')
+    ->setArguments(array('%cache.bin%'));
 
   // Prepare for themed output. We need to run this at the beginning of the
   // page request to avoid a different theme accidentally getting set. (We also
diff --git a/core/lib/Drupal/Component/DependencyInjection/ContainerBuilder.php b/core/lib/Drupal/Component/DependencyInjection/ContainerBuilder.php
new file mode 100644
index 0000000..06b0e4f
--- /dev/null
+++ b/core/lib/Drupal/Component/DependencyInjection/ContainerBuilder.php
@@ -0,0 +1,112 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Component\DependencyInjection\ContainerBuilder.
+ */
+
+namespace Drupal\Component\DependencyInjection;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder as SymfonyContainerBuilder;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+
+/**
+ * @todo Add documentation here.
+ */
+class ContainerBuilder extends SymfonyContainerBuilder {
+  protected $fallbacks = array();
+
+  /**
+   * @todo Add documentation here.
+   */
+  public function registerFallback($idPattern, $class = null) {
+    return $this->fallbacks[strtolower($idPattern)] = new Definition($class);
+  }
+
+  /**
+   * @todo Add documentation here.
+   */
+  public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+    $id = strtolower($id);
+
+    try {
+      return parent::get($id, ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE);
+    }
+    catch (InvalidArgumentException $e) {
+      // If a fallback service definition exists, create a service based on
+      // that, populating the service container with parameters fetched from the
+      // service id.
+      if (!$this->hasDefinition($id) && ($fallback = $this->findFallback($id))) {
+        $parameters = $this->getParametersFromId($id, $fallback);
+        foreach ($parameters as $name => $value) {
+          $this->setParameter($name, $value);
+        }
+        $this->setDefinition($id, $this->fallbacks[$fallback]);
+        $service = $this->get($id, $invalidBehavior);
+        // The parameters values only apply to this particular service id, not
+        // to any others using the same fallback, so clean them up.
+        foreach ($parameters as $name => $value) {
+          $this->setParameter($name, NULL);
+        }
+        return $service;
+      }
+
+      if ($invalidBehavior === ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+        throw $e;
+      }
+    }
+  }
+
+  /**
+   * @todo Add documentation here.
+   */
+  protected function findFallback($id) {
+    // @todo Optimize this by structuring $this->fallbacks to be more
+    //   efficiently searched.
+    foreach ($this->fallbacks as $fallback => $definition) {
+      $regex = '/' . preg_replace('/\\\{.*?\\\}/', '\\w+', preg_quote($fallback, '/')) . '/';
+      if (preg_match($regex, $id)) {
+        return $fallback;
+      }
+    }
+  }
+
+  /**
+   * @todo Add documentation here.
+   */
+  protected function getParametersFromId($id, $fallback) {
+    // @todo Clean this up. Basically, if $fallback = 'a.b.{c.d}.{e.f}.g' and
+    //   $id = 'a.b.foo.bar.g', return array('c.d' => 'foo', 'e.f' => 'bar').
+    $idParts = explode('.', $id);
+    $parameters = array();
+    $fallbackParts = array();
+    $fallbackPart = array();
+    $placeholder = FALSE;
+    foreach (explode('.', $fallback) as $part) {
+      if (substr($part, 0, 1) == '{') {
+        $fallbackPart = array();
+        $placeholder = TRUE;
+      }
+      if (substr($part, -1, 1) == '}') {
+        $placeholder = FALSE;
+        $fallbackPart[] = $part;
+        $part = implode('.', $fallbackPart);
+      }
+      if ($placeholder) {
+        $fallbackPart[] = $part;
+      }
+      else {
+        $fallbackParts[] = $part;
+      }
+    }
+    foreach ($fallbackParts as $i => $part) {
+      if (substr($part, 0, 1) == '{' && substr($part, -1, 1) == '}') {
+        $parameters[substr($part, 1, -1)] = $idParts[$i];
+      }
+    }
+    return $parameters;
+  }
+
+}
