diff --git a/core/core.services.yml b/core/core.services.yml
index 5cd3422..b8ace10 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -146,6 +146,12 @@ services:
       - { name: cache.bin, default_backend: cache.backend.chainedfast }
     factory: cache_factory:get
     arguments: [bootstrap]
+  cache.container:
+    class: Drupal\Core\Cache\CacheBackendInterface
+    tags:
+      - { name: cache.bin, default_backend: cache.backend.database }
+    factory: cache_factory:get
+    arguments: [container]
   cache.config:
     class: Drupal\Core\Cache\CacheBackendInterface
     tags:
diff --git a/core/lib/Drupal/Core/DependencyInjection/Container.php b/core/lib/Drupal/Core/DependencyInjection/Container.php
index 4e28d54..6085ce3 100644
--- a/core/lib/Drupal/Core/DependencyInjection/Container.php
+++ b/core/lib/Drupal/Core/DependencyInjection/Container.php
@@ -1,5 +1,4 @@
 <?php
-
 /**
  * @file
  * Contains \Drupal\Core\DependencyInjection\Container.
@@ -7,23 +6,596 @@
 
 namespace Drupal\Core\DependencyInjection;
 
-use Symfony\Component\DependencyInjection\Container as SymfonyContainer;
+use ReflectionClass;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\IntrospectableContainerInterface;
+use Symfony\Component\DependencyInjection\ScopeInterface;
+use Symfony\Component\DependencyInjection\Exception\LogicException;
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
 
 /**
- * Extends the symfony container to set the service ID on the created object.
+ * Provides an interface compatible alternative to the default Symfony
+ * dependency injection container specially optimized for Drupal's needs.
+ *
+ * This container is based on a PHP array container definition with a structure
+ * very similar to the YAML file format.
+ *
+ * The best way to initialize this container is to use a
+ * \Drupal\Core\DependencyInjection\ContainerBuilder, compile it and then
+ * retrieve the definition via
+ * \Drupal\Core\DependencyInjection\Dumper/PhpArray::getArray().
+ *
+ * The retrieved array can be cached safely and then passed to this container
+ * via the constructor.
+ *
+ * As the container is unfrozen by default, a second parameter can be passed to
+ * the container to "freeze" the parameter bag.
+ *
+ * This container is different in behavior to the default Symfony container in
+ * the following ways:
+ *
+ * - It only allows lowercase service and parameter names, though it does not
+ *   enforce it for performance reasons.
+ * - Functions that are not part of the interface are explictly not supported:
+ *     getDefinedServiceIds(), getParameterBag(), isFrozen(), compile(),
+ *     getAServiceWithAnIdByCamelCase().
+ * - Scopes are explicitly not allowed, because Symfony 3.0 has deprecated
+ *   them.
+ * - Synchronized services are explicitly not allowed, because Symfony 3.0 has
+ *   deprecated them.
+ *
+ * Drupal specifically does not allow serializing the container and any service
+ * that is set dynamically gets a _serviceID property, so serialization via a
+ * trait can be supported by some services.
+ *
+ * @see \Drupal\Core\DependencyInjection\DependencySerializationTrait
+ *
+ * @ingroup container
  */
-class Container extends SymfonyContainer {
+class Container implements IntrospectableContainerInterface {
+
+  /**
+   * The parameters of the container.
+   *
+   * @var array
+   */
+  protected $parameters = array();
+
+  /**
+   * The aliases of the container.
+   *
+   * @var array
+   */
+  protected $aliases = array();
+
+  /**
+   * The service definitions of the container.
+   *
+   * @var array
+   */
+  protected $serviceDefinitions = array();
+
+  /**
+   * The instantiated services.
+   *
+   * @var array
+   */
+  protected $services = array();
+
+  /**
+   * The instantiated private services.
+   *
+   * @var array
+   */
+  protected $privateServices = array();
+
+  /**
+   * The currently loading services.
+   *
+   * @var array
+   */
+  protected $loading = array();
+
+  /**
+   * Can the container parameters still be changed.
+   *
+   * For testing purposes the container needs to be changed.
+   *
+   * @var bool
+   */
+  protected $frozen = TRUE;
+
+  /**
+   * Uses the machine format.
+   *
+   * @var bool
+   */
+  protected $machineFormat = FALSE;
+
+  /**
+   * Constructs a new Container instance.
+   *
+   * @param array $container_definition
+   *   An array containing the 'services' and 'parameters'
+   * @param bool $frozen
+   *   (optional) Determines whether the container parameters can be changed,
+   *   defaults to FALSE;
+   */
+  public function __construct(array $container_definition = array(), $frozen = FALSE) {
+    $this->aliases = isset($container_definition['aliases']) ? $container_definition['aliases'] : array();
+    $this->parameters = isset($container_definition['parameters']) ? $container_definition['parameters'] : array();
+    $this->serviceDefinitions = isset($container_definition['services']) ? $container_definition['services'] : array();
+    $this->frozen = $frozen;
+    $this->machineFormat = isset($container_definition['machine_format']) ? $container_definition['machine_format'] : FALSE;
+
+    // Register the service_container with itself.
+    $this->services['service_container'] = $this;
+  }
 
   /**
    * {@inheritdoc}
    */
-  public function set($id, $service, $scope = SymfonyContainer::SCOPE_CONTAINER) {
-     parent::set($id, $service, $scope);
+  public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+    if (isset($this->aliases[$id])) {
+      $id = $this->aliases[$id];
+    }
+
+    // Re-use shared service instance if it exists.
+    // @todo re-check the invalidBehavior.
+    if (isset($this->services[$id]) || ($invalidBehavior === ContainerInterface::NULL_ON_INVALID_REFERENCE && array_key_exists($id, $this->services))) {
+      return $this->services[$id];
+    }
+
+    if (isset($this->loading[$id])) {
+      throw new ServiceCircularReferenceException($id, array_keys($this->loading));
+    }
+
+    $definition = isset($this->serviceDefinitions[$id]) ? $this->serviceDefinitions[$id] : NULL;
+
+    if (!$definition && $invalidBehavior === ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+      if (!$id) {
+        throw new ServiceNotFoundException($id);
+      }
+
+      throw new ServiceNotFoundException($id, null, null, $this->getAlternatives($id));
+    }
+
+    // In case something else than ContainerInterface::NULL_ON_INVALID_REFERENCE
+    // is used, the actual wanted behavior is to re-try getting the service at a later point.
+    if (!$definition) {
+      return;
+    }
+
+    if ($this->machineFormat) {
+      $definition = unserialize($definition);
+    }
+
+    // Now create the service.
+    $this->loading[$id] = TRUE;
 
-    // Ensure that the _serviceId property is set on synthetic services as well.
-    if (isset($this->services[$id]) && is_object($this->services[$id]) && !isset($this->services[$id]->_serviceId)) {
-      $this->services[$id]->_serviceId = $id;
+    try {
+      $service = $this->createService($definition, $id);
     }
+    catch (\Exception $e) {
+      unset($this->loading[$id]);
+
+      // Remove a potentially shared service that was constructed incompletely.
+      if (array_key_exists($id, $this->services)) {
+        unset($this->services[$id]);
+      }
+
+      if (self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
+        return;
+      }
+
+      throw $e;
+    }
+
+    unset($this->loading[$id]);
+
+    return $service;
+  }
+
+  protected function createService($definition, $id) {
+    if (isset($definition['synthetic']) && $definition['synthetic'] === TRUE) {
+      throw new RuntimeException(sprintf('You have requested a synthetic service ("%s"). The DIC does not know how to construct this service.', $id));
+    }
+
+    $arguments = array();
+    if (isset($definition['arguments'])) {
+      $arguments = $definition['arguments'];
+
+      if (!$this->machineFormat || $arguments instanceof \stdClass) {
+        $arguments = $this->resolveServicesAndParameters($arguments);
+      }
+    }
+
+    if (isset($definition['file'])) {
+      // @todo Resolve value when unfrozen.
+      require_once $definition['file'];
+    }
+
+    if (isset($definition['factory'])) {
+      $factory = $definition['factory'];
+      if (is_array($factory)) {
+        $factory = $this->resolveServicesAndParameters(array($factory[0], $factory[1]));
+      }
+      $service = call_user_func_array($factory, $arguments);
+    }
+    elseif (isset($definition['factory_method'])) {
+      // @todo All of this is deprecated in Symfony 2.7 - remove it?
+      $method = $definition['factory_method'];
+
+      if (!empty($definition['factory_class'])) {
+        $factory = $definition['factory_class'];
+      }
+      elseif (!empty($definition['factory_service'])) {
+        $factory = $this->get($definition['factory_service']);
+      }
+      else {
+        throw new RuntimeException(sprintf('Cannot create service "%s" from factory method without a factory service or factory class.', $id));
+      }
+      $service = call_user_func_array(array($factory, $method), $arguments);
+    }
+    else {
+      // @todo Resolve value when unfrozen.
+      $class = $definition['class'];
+      $length = count($arguments);
+
+      switch ($length) {
+        case 0:
+          $service = new $class();
+          break;
+        case 1:
+          $service = new $class($arguments[0]);
+          break;
+        case 2:
+          $service = new $class($arguments[0], $arguments[1]);
+          break;
+        case 3:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2]);
+          break;
+        case 4:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3]);
+          break;
+        case 5:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4]);
+          break;
+        case 6:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5]);
+          break;
+        case 7:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5], $arguments[6]);
+          break;
+        case 8:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5], $arguments[6], $arguments[7]);
+          break;
+        case 9:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5], $arguments[6], $arguments[7], $arguments[8]);
+          break;
+        case 10:
+          $service = new $class($arguments[0], $arguments[1], $arguments[2], $arguments[3], $arguments[4], $arguments[5], $arguments[6], $arguments[7], $arguments[8], $arguments[9]);
+          break;
+        default:
+          $r = new ReflectionClass($class);
+          $service = $r->newInstanceArgs($arguments);
+          break;
+      }
+    }
+
+    // Share the service if it is public.
+    if (!isset($definition['public']) || $definition['public'] !== FALSE) {
+      $this->services[$id] = $service;
+    }
+
+    if (isset($definition['calls'])) {
+      foreach ($definition['calls'] as $call) {
+        $method = $call[0];
+        $arguments = array();
+        if (!empty($call[1])) {
+          $arguments = $call[1];
+          if (!$this->machineFormat || $arguments instanceof \stdClass) {
+            $arguments = $this->resolveServicesAndParameters($arguments);
+          }
+        }
+        call_user_func_array(array($service, $method), $arguments);
+      }
+    }
+
+    if (isset($definition['properties'])) {
+      if (!$this->machineFormat || $definition['properties'] instanceof \stdClass) {
+        $definition['properties'] = $this->resolveServicesAndParameters($definition['properties']);
+      }
+      foreach ($definition['properties'] as $key => $value) {
+        $service->{$key} = $value;
+      }
+    }
+
+    if (isset($definition['configurator'])) {
+      $callable = $definition['configurator'];
+      if (is_array($callable)) {
+        $callable = $this->resolveServicesAndParameters($callable);
+      }
+
+      if (!is_callable($callable)) {
+        throw new InvalidArgumentException(sprintf('The configure callable for class "%s" is not a callable.', get_class($service)));
+      }
+
+      call_user_func_array($callable, $service);
+    }
+
+    return $service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function set($id, $service, $scope = self::SCOPE_CONTAINER) {
+    if (isset($service)) {
+      $service->_serviceId = $id;
+    }
+    $this->services[$id] = $service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function has($id) {
+    return isset($this->services[$id]) || isset($this->serviceDefinitions[$id]);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getParameter($name) {
+    if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) {
+      throw new InvalidArgumentException(sprintf('You have requested a non-existent parameter "%s".', $name));
+    }
+
+    return $this->parameters[$name];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function hasParameter($name) {
+    return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setParameter($name, $value) {
+    if ($this->frozen) {
+      throw new LogicException('Impossible to call set() on a frozen ParameterBag.');
+    }
+
+    $this->parameters[$name] = $value;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function initialized($id) {
+    if (isset($this->aliases[$id])) {
+      $id = $this->aliases[$id];
+    }
+
+    return isset($this->services[$id]) || array_key_exists($id, $this->services);
+  }
+
+  /**
+   * Resolves arguments from %parameter and @service to the real values.
+   *
+   * For performance reasons also a \stdClass based approach is supported.
+   *
+   * @param array|\stdClass $arguments
+   *   The arguments to resolve.
+   *
+   * @return array
+   *   The resolved arguments.
+   *
+   * @throws RuntimeException if a parameter/service could not be resolved.
+   */
+  protected function resolveServicesAndParameters($arguments) {
+
+    // Check if this collection needs to be resolved.
+    if ($arguments instanceof \stdClass) {
+      if ($arguments->type !== 'collection') {
+        throw new InvalidArgumentException(sprintf('Undefined type "%s" while resolving parameters and services.', $arguments->type));
+      }
+      // In case there is nothing to resolve, we are done here.
+      if (!$arguments->resolve) {
+        return $arguments->value;
+      }
+      $arguments = $arguments->value;
+    }
+
+    // Process the arguments.
+    foreach ($arguments as $key => $argument) {
+      // Optimized code path.
+      if ($argument instanceof \stdClass) {
+        $type = $argument->type;
+
+        // Check for parameter.
+        if ($type == 'parameter') {
+          $name = $argument->name;
+          if (!isset($this->parameters[$name])) {
+            $arguments[$key] = $this->getParameter($name);
+            continue;
+          }
+
+          // Update argument
+          $argument = $arguments[$key] = $this->parameters[$name];
+
+          // In case there is not a machine readable value behind this, continue.
+          if (!($argument instanceof \stdClass)) {
+            continue;
+          }
+
+          // Fall through.
+          $type = $argument->type;
+        }
+
+        // Create a service.
+        if ($type == 'service') {
+          $id = $argument->id;
+
+          // Does the service already exist?
+          if (isset($this->aliases[$id])) {
+            $id = $this->aliases[$id];
+          }
+
+          if (isset($this->services[$id])) {
+            $arguments[$key] = $this->services[$id];
+            continue;
+          }
+
+          // Return the service.
+          $arguments[$key] = $this->get($id, $argument->invalidBehavior);
+
+          continue;
+        }
+        // Create private service.
+        elseif ($type == 'private_service') {
+          $id = $argument->id;
+
+          // Does the private service already exist.
+          if (isset($this->privateServices[$id])) {
+            $arguments[$key] = $this->privateServices[$id];
+            continue;
+          }
+
+          // Create the private service.
+          // @todo add flag if it should be shared.
+          $this->privateServices[$id] = $this->createService($argument->value, $id);
+          $arguments[$key] = $this->privateServices[$id];
+
+          continue;
+        }
+        // Check for collection.
+        elseif ($type == 'collection') {
+          $value = $argument->value;
+
+          // Does this collection need resolving?
+          if ($argument->resolve) {
+            $arguments[$key] = $this->resolveServicesAndParameters($value);
+          }
+          else {
+            $arguments[$key] = $value;
+          }
+
+          continue;
+        }
+
+        if ($type !== NULL) {
+          throw new InvalidArgumentException(sprintf('Undefined type "%s" while resolving parameters and services.', $type));
+        }
+      }
+
+      // Human readable version.
+      if ($this->machineFormat) {
+        continue;
+      }
+
+      if (is_array($argument)) {
+        $arguments[$key] = $this->resolveServicesAndParameters($argument);
+        continue;
+      }
+
+      if (!is_string($argument)) {
+        continue;
+      }
+
+      // Resolve parameters.
+      if ($argument[0] === '%') {
+        $name = substr($argument, 1, -1);
+        if (!isset($this->parameters[$name])) {
+          $arguments[$key] = $this->getParameter($name);
+          continue;
+        }
+        $argument = $this->parameters[$name];
+        $arguments[$key] = $argument;
+      }
+
+      // Resolve services.
+      if ($argument[0] === '@') {
+        $id = substr($argument, 1);
+        $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
+        if ($id[0] === '?') {
+          $id = substr($id, 1);
+          $invalid_behavior = ContainerInterface::NULL_ON_INVALID_REFERENCE;
+        }
+        if (isset($this->services[$id])) {
+          $arguments[$key] = $this->services[$id];
+        }
+        $arguments[$key] = $this->get($id, $invalid_behavior);
+      }
+    }
+
+    return $arguments;
+  }
+
+  /**
+   * Provides alternatives in case a service was not found.
+   *
+   * @param string $id
+   *   The service to get alternatives for.
+   *
+   * @return string[]
+   *   An array of strings with suitable alternatives.
+   */
+  protected function getAlternatives($id) {
+    $all_service_keys = array_unique(array_merge(array_keys($this->services), array_keys($this->serviceDefinitions)));
+
+    $alternatives = array();
+    foreach ($all_service_keys as $key) {
+      $lev = levenshtein($id, $key);
+      if ($lev <= strlen($id) / 3 || strpos($key, $id) !== FALSE) {
+        $alternatives[] = $key;
+      }
+    }
+
+    return $alternatives;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function enterScope($name) {
+    throw new \BadMethodCallException(sprintf("'%s' is not implemented", __FUNCTION__));
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function leaveScope($name) {
+    throw new \BadMethodCallException(sprintf("'%s' is not implemented", __FUNCTION__));
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function addScope(ScopeInterface $scope) {
+    throw new \BadMethodCallException(sprintf("'%s' is not implemented", __FUNCTION__));
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function hasScope($name) {
+    throw new \BadMethodCallException(sprintf("'%s' is not implemented", __FUNCTION__));
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function isScopeActive($name) {
+    throw new \BadMethodCallException(sprintf("'%s' is not implemented", __FUNCTION__));
   }
 
   /**
diff --git a/core/lib/Drupal/Core/DependencyInjection/Dumper/DebugPhpArrayDumper.php b/core/lib/Drupal/Core/DependencyInjection/Dumper/DebugPhpArrayDumper.php
new file mode 100644
index 0000000..b97efed
--- /dev/null
+++ b/core/lib/Drupal/Core/DependencyInjection/Dumper/DebugPhpArrayDumper.php
@@ -0,0 +1,68 @@
+<?php
+
+/*
+ * @file
+ * Contains \Drupal\Core\DependencyInjection\Dumper
+ */
+
+namespace Drupal\Core\DependencyInjection\Dumper;
+
+use Symfony\Component\DependencyInjection\Alias;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Parameter;
+use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\Dumper;
+use Symfony\Component\ExpressionLanguage\Expression;
+
+/**
+ * DebugPhpArrayDumper dumps a service container as a human readable serialized
+ * PHP array.
+ *
+ * The format of this dumper is very similar to the YAML based format, but
+ * based on PHP arrays instead of YAML strings.
+ *
+ * It is human readable, for a machine optimized version based on this one see
+ * \Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper.
+ */
+class DebugPhpArrayDumper extends PhpArrayDumper
+{
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function dumpCollection($collection) {
+   $code = array();
+
+    foreach ($collection as $key => $value) {
+      if (is_array($value)) {
+        $code[$key] = $this->dumpCollection($value);
+      }
+      else {
+        $code[$key] = $this->dumpValue($value);
+      }
+    }
+
+    return $code;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+    if ($invalid_behavior !== ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+      return sprintf('@?%s', $id);
+    }
+
+    return sprintf('@%s', $id);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getParameterCall($name) {
+    return sprintf('%%%s%%', $name);
+  }
+}
diff --git a/core/lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php b/core/lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php
new file mode 100644
index 0000000..86f08d5
--- /dev/null
+++ b/core/lib/Drupal/Core/DependencyInjection/Dumper/PhpArrayDumper.php
@@ -0,0 +1,456 @@
+<?php
+
+/*
+ * @file
+ * Contains \Drupal\Core\DependencyInjection\Dumper
+ */
+
+namespace Drupal\Core\DependencyInjection\Dumper;
+
+use Symfony\Component\DependencyInjection\Alias;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Definition;
+use Symfony\Component\DependencyInjection\Parameter;
+use Symfony\Component\DependencyInjection\Reference;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\Dumper;
+use Symfony\Component\ExpressionLanguage\Expression;
+
+/**
+ * PhpArrayDumper dumps a service container as a serialized PHP array.
+ *
+ * The format of this dumper is very similar to the ContainerBuilder based
+ * format, but based on PHP arrays and \stdClass objects instead of rich value
+ * objects for performance reasons.
+ *
+ * It is machine readable, for a human readable version based on this one see
+ * \Drupal\Core\DependencyInjection\Dumper\DebugPhpArrayDumper.
+ */
+class PhpArrayDumper extends Dumper
+{
+  /**
+   * {@inheritdoc}
+   */
+  public function dump(array $options = array()) {
+    return serialize($this->getArray());
+  }
+
+  /**
+   * Returns the service container as a PHP array.
+   *
+   * @return array
+   *   A PHP array representation of the service container.
+   */
+  public function getArray() {
+    $definition = array();
+    $definition['aliases'] = $this->getAliases();
+    $definition['parameters'] = $this->getParameters();
+    $definition['services'] = $this->getServiceDefinitions();
+    $definition['machine_format'] = TRUE;
+    return $definition;
+  }
+
+  /**
+   * Returns the aliases as a PHP Array.
+   *
+   * @return array
+   *   The aliases.
+   */
+  protected function getAliases() {
+    $alias_definitions = array();
+
+    $aliases = $this->container->getAliases();
+    foreach ($aliases as $alias => $id) {
+      $id = (string) $id;
+      while (isset($aliases[$id])) {
+        $id = (string) $aliases[$id];
+      }
+      $alias_definitions[$alias] = $id;
+    }
+
+    return $alias_definitions;
+  }
+
+  /**
+   * Returns parameters of the container as a PHP array.
+   *
+   * @return array
+   *   The escaped and prepared parameters of the container.
+   */
+  protected function getParameters() {
+    if (!$this->container->getParameterBag()->all()) {
+      return array();
+    }
+
+    $parameters = $this->container->getParameterBag()->all();
+    $is_frozen = $this->container->isFrozen();
+    return $this->prepareParameters($parameters, $is_frozen);
+  }
+
+  /**
+   * Returns services of the container as a PHP array.
+   *
+   * @return array
+   *   The service definitions.
+   */
+  protected function getServiceDefinitions() {
+    if (!$this->container->getDefinitions()) {
+      return array();
+    }
+
+    $services = array();
+    foreach ($this->container->getDefinitions() as $id => $definition) {
+      if ($definition->isPublic()) {
+        $services[$id] = serialize($this->getServiceDefinition($definition));
+      }
+    }
+
+    return $services;
+  }
+
+  /**
+   * Prepares parameters for the PHP array dumping.
+   *
+   * @param array $parameters
+   *   An array of parameters.
+   *
+   * @param bool  $escape
+   *   Whether keys with '%' should be escaped or not.
+   *
+   * @return array
+   */
+  protected function prepareParameters($parameters, $escape = true) {
+    $filtered = array();
+    foreach ($parameters as $key => $value) {
+      if (is_array($value)) {
+        $value = $this->prepareParameters($value, $escape);
+      }
+      elseif ($value instanceof Reference) {
+        $value = $this->dumpValue($value);
+      }
+
+      $filtered[$key] = $value;
+    }
+
+    return $escape ? $this->escape($filtered) : $filtered;
+  }
+
+  /**
+   * Escapes parameters.
+   *
+   * @param array $parameters
+   *   The parameters to escape for '%' characters.
+   *
+   * @return array
+   *   The escaped parameters.
+   */
+  protected function escape($parameters) {
+    $args = array();
+
+    foreach ($parameters as $key => $value) {
+      if (is_array($value)) {
+        $args[$key] = $this->escape($value);
+      }
+      elseif (is_string($value)) {
+        $args[$key] = str_replace('%', '%%', $value);
+      }
+      else {
+        $args[$key] = $value;
+      }
+    }
+
+    return $args;
+  }
+
+  /**
+   * Gets a service definition as PHP array.
+   *
+   * @param \Symfony\Component\DependencyInjection\Definition $definition
+   *   The definition to process.
+   *
+   * @return array
+   *   The service definition as PHP array.
+   */
+  protected function getServiceDefinition($definition) {
+    $service = array();
+    if ($definition->getClass()) {
+      $service['class'] = $definition->getClass();
+    }
+
+    if (!$definition->isPublic()) {
+      $service['public'] = FALSE;
+    }
+
+    if ($definition->getFile()) {
+      $service['file'] = $definition->getFile();
+    }
+
+    if ($definition->isSynthetic()) {
+      $service['synthetic'] = TRUE;
+    }
+
+    if ($definition->isLazy()) {
+      $service['lazy'] = TRUE;
+    }
+
+    if ($definition->getArguments()) {
+      $service['arguments'] = $this->dumpCollection($definition->getArguments());
+    }
+
+    if ($definition->getProperties()) {
+      $service['properties'] = $this->dumpCollection($definition->getProperties());
+    }
+
+    if ($definition->getMethodCalls()) {
+      $service['calls'] = $this->dumpMethodCalls($definition->getMethodCalls());
+    }
+
+    if (($scope = $definition->getScope()) !== ContainerInterface::SCOPE_CONTAINER) {
+      throw new \InvalidArgumentException("The 'scope' definition is deprecated in Symfony 3.0 and not supported by Drupal 8.");
+    }
+
+    if (($decorated = $definition->getDecoratedService()) !== NULL) {
+      throw new \InvalidArgumentException("The 'decorated' definition is not supported by the Drupal 8 run-time container. The Container Builder should have resolved that during the DecoratorServicePass compiler pass.");
+    }
+
+    if ($callable = $definition->getFactory()) {
+      $service['factory'] = $this->dumpCallable($callable);
+    }
+
+    if ($callable = $definition->getConfigurator()) {
+      $service['configurator'] = $this->dumpCallable($callable);
+    }
+
+    return $service;
+  }
+
+  /**
+   * Dumps method calls to a PHP array.
+   *
+   * @param array $calls
+   *   An array of method calls.
+   *
+   * @return array
+   *   The PHP array representation of the method calls.
+   */
+  protected function dumpMethodCalls($calls) {
+    $code = array();
+
+    foreach ($calls as $key => $call) {
+      $method = $call[0];
+      $arguments = array();
+      if (!empty($call[1])) {
+        $arguments = $this->dumpCollection($call[1]);
+      }
+
+      $code[$key] = [$method, $arguments];
+    }
+
+    return $code;
+  }
+
+
+  /**
+   * Dumps a collection to a PHP array.
+   *
+   * @param mixed $collection
+   *   A collection to process.
+   *
+   * @return \stdClass|array
+   *   The collection in a suitable format.
+   */
+  protected function dumpCollection($collection, &$resolve = FALSE) {
+    $code = array();
+
+    foreach ($collection as $key => $value) {
+      if (is_array($value)) {
+        $resolve_collection = FALSE;
+        $code[$key] = $this->dumpCollection($value, $resolve_collection);
+
+        if ($resolve_collection) {
+          $resolve = TRUE;
+        }
+      }
+      else {
+        if (is_object($value)) {
+          $resolve = TRUE;
+        }
+        $code[$key] = $this->dumpValue($value);
+      }
+    }
+
+    if (!$resolve) {
+      return $collection;
+    }
+
+    return (object) array(
+      'type' => 'collection',
+      'value' => $code,
+      'resolve' => $resolve,
+    );
+  }
+
+  /**
+   * Dumps callable to a PHP array.
+   *
+   * @param callable $callable
+   *   The callable to process.
+   *
+   * @return callable
+   *   The processed callable.
+   */
+  protected function dumpCallable($callable) {
+    if (is_array($callable)) {
+      $callable[0] = $this->dumpValue($callable[0]);
+      $callable = array($callable[0], $callable[1]);
+    }
+
+    return $callable;
+  }
+
+  /**
+   * Returns a private service definition in a suitable format.
+   *
+   * @param string $id
+   *   The ID of the service to get a private definition for.
+   * @param \Symfony\Component\DependencyInjection\Definition $definition
+   *   The definition to process.
+   *
+   * @return \stdClass
+   *   A very lightweight private service value object.
+   */
+  protected function getPrivateServiceCall($id, Definition $definition) {
+    $service_definition = $this->getServiceDefinition($definition);
+    if (!$id) {
+      $hash = sha1(serialize($service_definition));
+      $id = 'private__' . $hash;
+    }
+    return (object) array(
+      'type' => 'private_service',
+      'id' => $id,
+      'value' => $service_definition,
+    );
+  }
+
+  /**
+   * Dumps the value to PHP array format.
+   *
+   * @param mixed $value
+   *   The value to dump.
+   *
+   * @return mixed
+   *   The dumped value in a suitable format.
+   *
+   * @throws RuntimeException When trying to dump object or resource
+   */
+  protected function dumpValue($value) {
+    if (is_array($value)) {
+      $code = array();
+      foreach ($value as $k => $v) {
+        $code[$k] = $this->dumpValue($v);
+      }
+
+      return $code;
+    }
+    elseif ($value instanceof Reference) {
+      return $this->getReferenceCall((string) $value, $value);
+    }
+    elseif ($value instanceof Definition) {
+      return $this->getPrivateServiceCall(NULL, $value);
+    }
+    elseif ($value instanceof Parameter) {
+      return $this->getParameterCall((string) $value);
+    }
+    elseif ($value instanceof Expression) {
+      return $this->getExpressionCall((string) $value);
+    }
+    elseif (is_object($value)) {
+      // Drupal specific: Instantiated objects have a _serviceId parameter.
+      if (isset($value->_serviceId)) {
+        return $this->getReferenceCall($value->_serviceId);
+      }
+      throw new RuntimeException('Unable to dump a service container if a parameter is an object without _serviceId.');
+    }
+    elseif (is_resource($value)) {
+      throw new RuntimeException('Unable to dump a service container if a parameter is a resource.');
+    }
+
+    return $value;
+  }
+
+  /**
+   * Returns a service reference in a suitable PHP array format.
+   *
+   * @param string $id
+   *   The ID of the service to get a reference for.
+   * @param \Symfony\Component\DependencyInjection\Reference $reference
+   *   (optional) The reference object to process, needed to get the invalid
+   *              behavior.
+   *
+   * @return string|\stdClass
+   *   A suitable representation of the servie reference.
+   */
+  protected function getReferenceCall($id, Reference $reference = null) {
+    $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
+
+    if ($reference !== NULL) {
+      $invalid_behavior = $reference->getInvalidBehavior();
+    }
+
+    // Private shared service.
+    $definition = $this->container->getDefinition($id);
+    if (!$definition->isPublic()) {
+      return $this->getPrivateServiceCall($id, $definition);
+    }
+
+    return $this->getServiceCall($id, $invalid_behavior);
+  }
+
+  /**
+   * Returns a service reference in a suitable PHP array format.
+   *
+   * @param string $id
+   *   The ID of the service to get a reference for.
+   * @param int $invalid_behavior
+   *   (optional) The invalid behavior of the service.
+   *
+   * @return string|\stdClass
+   *   A suitable representation of the servie reference.
+   */
+  protected function getServiceCall($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) {
+    return (object) array(
+      'type' => 'service',
+      'id' => $id,
+      'invalidBehavior' => $invalid_behavior,
+    );
+  }
+
+  /**
+   * Dumps a parameter to PHP array format.
+   *
+   * @param string $name
+   *   The name of the parameter to dump.
+   *
+   * @return string|\stdClass
+   *   A suitable representation of the parameter reference.
+   */
+  protected function getParameterCall($name) {
+    return (object) array(
+      'type' => 'parameter',
+      'name' => $name,
+    );
+  }
+
+  /**
+   * The expression to dump to PHP array format.
+   *
+   * @param string $expression
+   *   The expression to dump.
+   *
+   * @throws RuntimeException When trying to dump an expression.
+   */
+  protected function getExpressionCall($expression) {
+    throw new RuntimeException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');
+  }
+}
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 6a5ce77..cb1cc92 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -22,12 +22,10 @@
 use Drupal\Core\Http\TrustedHostsRequestFactory;
 use Drupal\Core\Language\Language;
 use Drupal\Core\PageCache\RequestPolicyInterface;
-use Drupal\Core\PhpStorage\PhpStorageFactory;
 use Drupal\Core\Site\Settings;
 use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
-use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
 use Symfony\Component\HttpFoundation\RedirectResponse;
 use Symfony\Component\HttpFoundation\Request;
 use Symfony\Component\HttpFoundation\RequestStack;
@@ -52,6 +50,41 @@
  */
 class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
 
+  const BOOTSTRAP_CONTAINER_BASE_CLASS = '\Drupal\Core\DependencyInjection\Container';
+  const PHP_ARRAY_DUMPER_CLASS = '\Drupal\Core\DependencyInjection\Dumper\PhpArrayDumper';
+
+  /**
+   * Holds the default bootstrap container definition.
+   *
+   * @var array
+   */
+  protected $defaultBootstrapContainerDefinition = [
+    'parameters' => [],
+    'services' => [
+      'database' => [
+        'class' => 'Drupal\Core\Database\Connection',
+        'factory_class' => 'Drupal\Core\Database\Database',
+        'factory_method' => 'getConnection',
+        'arguments' => ['default'],
+      ],
+      'cache.container' => [
+        'class' => 'Drupal\Core\Cache\DatabaseBackend',
+        'arguments' => ['@database', '@cache_tags_provider.container', 'container'],
+      ],
+      'cache_tags_provider.container' => [
+        'class' => 'Drupal\Core\Cache\DatabaseCacheTagsChecksum',
+        'arguments' => ['@database'],
+      ],
+    ],
+  ];
+
+  /**
+   * Holds the boostrap container instance.
+   *
+   * @var \Symfony\Component\DependencyInjection\ContainerInterface
+   */
+  protected $bootstrapContainer;
+
   /**
    * Holds the container instance.
    *
@@ -97,13 +130,6 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
   protected $moduleData = array();
 
   /**
-   * PHP code storage object to use for the compiled container.
-   *
-   * @var \Drupal\Component\PhpStorage\PhpStorageInterface
-   */
-  protected $storage;
-
-  /**
    * The class loader object.
    *
    * @var \Composer\Autoload\ClassLoader
@@ -393,6 +419,9 @@ public function boot() {
     FileCacheFactory::setConfiguration($configuration);
     FileCacheFactory::setPrefix(Settings::getApcuPrefix('file_cache', $this->root));
 
+    $class = static::BOOTSTRAP_CONTAINER_BASE_CLASS;
+    $this->bootstrapContainer = new $class(Settings::get('bootstrap_container_definition', $this->defaultBootstrapContainerDefinition), TRUE);
+
     // Initialize the container.
     $this->initializeContainer();
 
@@ -711,24 +740,14 @@ public function updateModules(array $module_list, array $module_filenames = arra
   }
 
   /**
-   * Returns the classname based on environment.
+   * Returns the cache key based on environment.
    *
    * @return string
-   *   The class name.
+   *   The cache key.
    */
-  protected function getClassName() {
+  protected function getCacheKey() {
     $parts = array('service_container', $this->environment, hash('crc32b', \Drupal::VERSION . Settings::get('deployment_identifier')));
-    return implode('_', $parts);
-  }
-
-  /**
-   * Returns the container class namespace based on the environment.
-   *
-   * @return string
-   *   The class name.
-   */
-  protected function getClassNamespace() {
-    return 'Drupal\\Core\\DependencyInjection\\Container\\' . $this->environment;
+    return implode(':', $parts);
   }
 
   /**
@@ -770,25 +789,40 @@ protected function initializeContainer() {
     // If the module list hasn't already been set in updateModules and we are
     // not forcing a rebuild, then try and load the container from the disk.
     if (empty($this->moduleList) && !$this->containerNeedsRebuild) {
-      $fully_qualified_class_name = '\\' . $this->getClassNamespace() . '\\' . $this->getClassName();
-
-      // First, try to load from storage.
-      if (!class_exists($fully_qualified_class_name, FALSE)) {
-        $this->storage()->load($this->getClassName() . '.php');
+      try {
+        $cache = $this->bootstrapContainer->get('cache.container')->get($this->getCacheKey());
+      } catch (\Exception $e) {
+        // Ignore exceptions thrown by the database. In case it is really not
+        // available, it will fail during container compilation.
+        $cache = FALSE;
       }
-      // If the load succeeded or the class already existed, use it.
-      if (class_exists($fully_qualified_class_name, FALSE)) {
-        $container = new $fully_qualified_class_name;
+      if ($cache) {
+        $container_definition = $cache->data;
       }
     }
 
-    if (!isset($container)) {
+    if (!isset($container_definition)) {
       $container = $this->compileContainer();
+
+      // Only dump the container if dumping is allowed. This is useful for
+      // KernelTestBase, which never wants to use the real container, but
+      // always the container builder.
+      if ($this->allowDumping) {
+        $dumper_class = static::PHP_ARRAY_DUMPER_CLASS;
+        $dumper = new $dumper_class($container);
+        $container_definition = $dumper->getArray();
+      }
     }
 
     // The container was rebuilt successfully.
     $this->containerNeedsRebuild = FALSE;
 
+    // Only in case we have a container_definition, create a new class.
+    if (isset($container_definition)) {
+      $class = Settings::get('container_base_class', '\Drupal\Core\DependencyInjection\Container');
+      $container = new $class($container_definition, TRUE);
+    }
+
     $this->attachSynthetic($container);
 
     $this->container = $container;
@@ -813,9 +847,8 @@ protected function initializeContainer() {
     \Drupal::setContainer($this->container);
 
     // If needs dumping flag was set, dump the container.
-    $base_class = Settings::get('container_base_class', '\Drupal\Core\DependencyInjection\Container');
-    if ($this->containerNeedsDumping && !$this->dumpDrupalContainer($this->container, $base_class)) {
-      $this->container->get('logger.factory')->get('DrupalKernel')->notice('Container cannot be written to disk');
+    if ($this->containerNeedsDumping && !$this->cacheDrupalContainer($container_definition)) {
+      $this->container->get('logger.factory')->get('DrupalKernel')->notice('Container cannot be saved to cache.');
     }
 
     return $this->container;
@@ -1031,9 +1064,8 @@ public function invalidateContainer() {
       return;
     }
 
-    // Also wipe the PHP Storage caches, so that the container is rebuilt
-    // for the next request.
-    $this->storage()->deleteAll();
+    // Also remove the container definition from the cache backend.
+    $this->bootstrapContainer->get('cache.container')->deleteAll();
   }
 
   /**
@@ -1186,35 +1218,22 @@ protected function getContainerBuilder() {
   }
 
   /**
-   * Dumps the service container to PHP code in the config directory.
-   *
-   * This method is based on the dumpContainer method in the parent class, but
-   * that method is reliant on the Config component which we do not use here.
-   *
-   * @param ContainerBuilder $container
-   *   The service container.
-   * @param string $baseClass
-   *   The name of the container's base class
+   * Stores the container definition in a cache.
    *
    * @return bool
-   *   TRUE if the container was successfully dumped to disk.
+   *   TRUE if the container was successfully cached.
    */
-  protected function dumpDrupalContainer(ContainerBuilder $container, $baseClass) {
-    if (!$this->storage()->writeable()) {
-      return FALSE;
+  protected function cacheDrupalContainer($container_definition) {
+    $saved = TRUE;
+    try {
+      $this->bootstrapContainer->get('cache.container')->set($this->getCacheKey(), $container_definition);
+    }
+    catch (\Exception $e) {
+      $saved = FALSE;
     }
-    // Cache the container.
-    $dumper = new PhpDumper($container);
-    $class = $this->getClassName();
-    $namespace = $this->getClassNamespace();
-    $content = $dumper->dump([
-      'class' => $class,
-      'base_class' => $baseClass,
-      'namespace' => $namespace,
-    ]);
-    return $this->storage()->save($class . '.php', $content);
-  }
 
+    return $saved;
+  }
 
   /**
    * Gets a http kernel from the container
@@ -1226,18 +1245,6 @@ protected function getHttpKernel() {
   }
 
   /**
-   * Gets the PHP code storage object to use for the compiled container.
-   *
-   * @return \Drupal\Component\PhpStorage\PhpStorageInterface
-   */
-  protected function storage() {
-    if (!isset($this->storage)) {
-      $this->storage = PhpStorageFactory::get('service_container');
-    }
-    return $this->storage;
-  }
-
-  /**
    * Returns the active configuration storage to use during building the container.
    *
    * @return \Drupal\Core\Config\StorageInterface
diff --git a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
index a4424ea..ddbd6f7 100644
--- a/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php
@@ -55,13 +55,11 @@ protected function prepareConfigDirectories() {
    *   A request object to use in booting the kernel.
    * @param array $modules_enabled
    *   A list of modules to enable on the kernel.
-   * @param bool $read_only
-   *   Build the kernel in a read only state.
    *
    * @return \Drupal\Core\DrupalKernel
    *   New kernel for testing.
    */
-  protected function getTestKernel(Request $request, array $modules_enabled = NULL, $read_only = FALSE) {
+  protected function getTestKernel(Request $request, array $modules_enabled = NULL) {
     // Manually create kernel to avoid replacing settings.
     $class_loader = require DRUPAL_ROOT . '/autoload.php';
     $kernel = DrupalKernel::createFromRequest($request, $class_loader, 'testing');
@@ -72,11 +70,6 @@ protected function getTestKernel(Request $request, array $modules_enabled = NULL
     }
     $kernel->boot();
 
-    if ($read_only) {
-      $php_storage = Settings::get('php_storage');
-      $php_storage['service_container']['class'] = 'Drupal\Component\PhpStorage\FileReadOnlyStorage';
-      $this->settingsSet('php_storage', $php_storage);
-    }
     return $kernel;
   }
 
@@ -98,24 +91,20 @@ public function testCompileDIC() {
     $kernel = $this->getTestKernel($request);
     $container = $kernel->getContainer();
     $refClass = new \ReflectionClass($container);
-    $is_compiled_container =
-      $refClass->getParentClass()->getName() == 'Drupal\Core\DependencyInjection\Container' &&
-      !$refClass->isSubclassOf('Symfony\Component\DependencyInjection\ContainerBuilder');
+    $is_compiled_container = !$refClass->isSubclassOf('Symfony\Component\DependencyInjection\ContainerBuilder');
     $this->assertTrue($is_compiled_container);
     // Verify that the list of modules is the same for the initial and the
     // compiled container.
     $module_list = array_keys($container->get('module_handler')->getModuleList());
     $this->assertEqual(array_values($modules_enabled), $module_list);
 
-    // Now use the read-only storage implementation, simulating a "production"
+    // Now get the container another time simulating a "production"
     // environment.
-    $container = $this->getTestKernel($request, NULL, TRUE)
+    $container = $this->getTestKernel($request, NULL)
       ->getContainer();
 
     $refClass = new \ReflectionClass($container);
-    $is_compiled_container =
-      $refClass->getParentClass()->getName() == 'Drupal\Core\DependencyInjection\Container' &&
-      !$refClass->isSubclassOf('Symfony\Component\DependencyInjection\ContainerBuilder');
+    $is_compiled_container = !$refClass->isSubclassOf('Symfony\Component\DependencyInjection\ContainerBuilder');
     $this->assertTrue($is_compiled_container);
 
     // Verify that the list of modules is the same for the initial and the
@@ -137,16 +126,16 @@ public function testCompileDIC() {
     // Add another module so that we can test that the new module's bundle is
     // registered to the new container.
     $modules_enabled['service_provider_test'] = 'service_provider_test';
-    $this->getTestKernel($request, $modules_enabled, TRUE);
+    $this->getTestKernel($request, $modules_enabled);
 
-    // Instantiate it a second time and we should still get a ContainerBuilder
-    // class because we are using the read-only PHP storage.
-    $kernel = $this->getTestKernel($request, $modules_enabled, TRUE);
+    // Instantiate it a second time and we should not get a ContainerBuilder
+    // class because we are loading the container definition from the database.
+    $kernel = $this->getTestKernel($request, $modules_enabled);
     $container = $kernel->getContainer();
 
     $refClass = new \ReflectionClass($container);
     $is_container_builder = $refClass->isSubclassOf('Symfony\Component\DependencyInjection\ContainerBuilder');
-    $this->assertTrue($is_container_builder, 'Container is a builder');
+    $this->assertFalse($is_container_builder, 'Container is not a builder');
 
     // Assert that the new module's bundle was registered to the new container.
     $this->assertTrue($container->has('service_provider_test_class'), 'Container has test service');
diff --git a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php b/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php
index 9b67692..ef2fb79 100644
--- a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php
+++ b/core/modules/system/src/Tests/ServiceProvider/ServiceProviderTest.php
@@ -7,14 +7,14 @@
 
 namespace Drupal\system\Tests\ServiceProvider;
 
-use Drupal\simpletest\WebTestBase;
+use Drupal\simpletest\KernelTestBase;
 
 /**
  * Tests service provider registration to the DIC.
  *
  * @group ServiceProvider
  */
-class ServiceProviderTest extends WebTestBase {
+class ServiceProviderTest extends KernelTestBase {
 
   /**
    * Modules to enable.
@@ -27,13 +27,9 @@ class ServiceProviderTest extends WebTestBase {
    * Tests that services provided by module service providers get registered to the DIC.
    */
   function testServiceProviderRegistration() {
-    $this->assertTrue(\Drupal::getContainer()->getDefinition('file.usage')->getClass() == 'Drupal\\service_provider_test\\TestFileUsage', 'Class has been changed');
+    $definition = $this->container->getDefinition('file.usage');
+    $this->assertTrue($definition->getClass() == 'Drupal\\service_provider_test\\TestFileUsage', 'Class has been changed');
     $this->assertTrue(\Drupal::hasService('service_provider_test_class'), 'The service_provider_test_class service has been registered to the DIC');
-    // The event subscriber method in the test class calls drupal_set_message with
-    // a message saying it has fired. This will fire on every page request so it
-    // should show up on the front page.
-    $this->drupalGet('');
-    $this->assertText(t('The service_provider_test event subscriber fired!'), 'The service_provider_test event subscriber fired');
   }
 
   /**
diff --git a/core/modules/system/src/Tests/ServiceProvider/ServiceProviderWebTest.php b/core/modules/system/src/Tests/ServiceProvider/ServiceProviderWebTest.php
new file mode 100644
index 0000000..e743d7b
--- /dev/null
+++ b/core/modules/system/src/Tests/ServiceProvider/ServiceProviderWebTest.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Tests\ServiceProvider\ServiceProviderWebTest.
+ */
+
+namespace Drupal\system\Tests\ServiceProvider;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests service provider registration to the DIC.
+ *
+ * @group ServiceProvider
+ */
+class ServiceProviderWebTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('file', 'service_provider_test');
+
+  /**
+   * Tests that services provided by module service providers get registered to the DIC.
+   */
+  function testServiceProviderRegistrationIntegration() {
+    $this->assertTrue(\Drupal::hasService('service_provider_test_class'), 'The service_provider_test_class service has been registered to the DIC');
+    // The event subscriber method in the test class calls drupal_set_message with
+    // a message saying it has fired. This will fire on every page request so it
+    // should show up on the front page.
+    $this->drupalGet('');
+    $this->assertText(t('The service_provider_test event subscriber fired!'), 'The service_provider_test event subscriber fired');
+  }
+
+}
diff --git a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php
index b5a3b3d..2423d33 100644
--- a/core/modules/system/src/Tests/System/UncaughtExceptionTest.php
+++ b/core/modules/system/src/Tests/System/UncaughtExceptionTest.php
@@ -114,14 +114,7 @@ public function testErrorContainer() {
       'required' => TRUE,
     ];
     $this->writeSettings($settings);
-
-    // Need to rebuild the container, so the dumped container can be tested
-    // and not the container builder.
-    \Drupal::service('kernel')->rebuildContainer();
-
-    // Ensure that we don't use the now broken generated container on the test
-    // process.
-    \Drupal::setContainer($this->container);
+    \Drupal::service('kernel')->invalidateContainer();
 
     $this->drupalGet('');
 
@@ -150,14 +143,7 @@ public function testExceptionContainer() {
       'required' => TRUE,
     ];
     $this->writeSettings($settings);
-
-    // Need to rebuild the container, so the dumped container can be tested
-    // and not the container builder.
-    \Drupal::service('kernel')->rebuildContainer();
-
-    // Ensure that we don't use the now broken generated container on the test
-    // process.
-    \Drupal::setContainer($this->container);
+    \Drupal::service('kernel')->invalidateContainer();
 
     $this->drupalGet('');
 
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/PhpArray/ContainerTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/PhpArray/ContainerTest.php
new file mode 100644
index 0000000..717607a
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/PhpArray/ContainerTest.php
@@ -0,0 +1,606 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\DependencyInjection\PhpArray\ContainerTest.
+ */
+
+namespace Drupal\Tests\Core\DependencyInjection\PhpArray;
+
+use Drupal\Core\DependencyInjection\Container;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Exception\LogicException;
+
+/**
+ * @coversDefaultClass \Drupal\Core\DependencyInjection\Container
+ * @group dic
+ */
+class ContainerTest extends \PHPUnit_Framework_TestCase {
+
+  /**
+   * The tested container.
+   *
+   * @var \Drupal\Core\DependencyInjection\PhpArray\Container
+   */
+  protected $container;
+
+  /**
+   * The container definition used for the test.
+   *
+   * @var []
+   */
+  protected $containerDefinition;
+
+  public function setUp() {
+    $this->containerDefinition = $this->getMockContainerDefinition();
+    $this->container = new Container($this->containerDefinition);
+  }
+
+  /**
+   * Tests that Container::getParameter() works properly.
+   * @covers ::getParameter
+   */
+  public function test_getParameter() {
+    $this->assertEquals($this->containerDefinition['parameters']['some_config'], $this->container->getParameter('some_config'), 'Container parameter matches for %some_config%.');
+    $this->assertEquals($this->containerDefinition['parameters']['some_other_config'], $this->container->getParameter('some_other_config'), 'Container parameter matches for %some_other_config%.');
+  }
+
+  /**
+   * Tests that Container::hasParameter() works properly.
+   * @covers ::hasParameter
+   */
+  public function test_hasParameter() {
+    $this->assertTrue($this->container->hasParameter('some_config'), 'Container parameters include %some_config%.');
+    $this->assertFalse($this->container->hasParameter('some_config_not_exists'), 'Container parameters do not include %some_config_not_exists%.');
+  }
+
+  /**
+   * Tests that Container::setParameter() in an unfrozen case works properly.
+   *
+   * @covers ::setParameter
+   */
+  public function test_setParameter_unfrozenContainer() {
+    $this->container = new Container($this->containerDefinition, FALSE);
+    $this->container->setParameter('some_config', 'new_value');
+    $this->assertEquals('new_value', $this->container->getParameter('some_config'), 'Container parameters can be set.');
+  }
+
+  /**
+   * Tests that Container::setParameter() in a frozen case works properly.
+   *
+   * @covers ::setParameter
+   *
+   * @expectedException LogicException
+   */
+  public function test_setParameter_frozenContainer() {
+    $this->container = new Container($this->containerDefinition, TRUE);
+    $this->container->setParameter('some_config', 'new_value');
+  }
+
+  /**
+   * Tests that Container::get() works properly.
+   * @covers ::get
+   */
+  public function test_get() {
+    $container = $this->container->get('service_container');
+    $this->assertSame($this->container, $container, 'Container can be retrieved from itself.');
+
+    // Retrieve services of the container.
+    $other_service_class = $this->containerDefinition['services']['other.service']['class'];
+    $other_service = $this->container->get('other.service');
+    $this->assertInstanceOf($other_service_class, $other_service, 'other.service has the right class.');
+
+    $some_parameter = $this->containerDefinition['parameters']['some_config'];
+    $some_other_parameter = $this->containerDefinition['parameters']['some_other_config'];
+
+    $service = $this->container->get('service.provider');
+
+    $this->assertEquals($other_service, $service->getSomeOtherService(), '@other.service was injected via constructor.');
+    $this->assertEquals($some_parameter, $service->getSomeParameter(), '%some_config% was injected via constructor.');
+    $this->assertEquals($this->container, $service->getContainer(), 'Container was injected via setter injection.');
+    $this->assertEquals($some_other_parameter, $service->getSomeOtherParameter(), '%some_other_config% was injected via setter injection.');
+    $this->assertEquals($service->_someProperty, 'foo', 'Service has added properties.');
+  }
+
+  /**
+   * Tests that Container::set() works properly.
+   *
+   * @covers ::set
+   */
+  public function test_set() {
+    $this->assertNull($this->container->get('new_id', ContainerInterface::NULL_ON_INVALID_REFERENCE));
+    $mock_service = new MockService();
+    $this->container->set('new_id', $mock_service);
+
+    $this->assertSame($mock_service, $this->container->get('new_id'), 'A manual set service works as expected.');
+  }
+
+  /**
+   * Tests that Container::has() works properly.
+   *
+   * @covers ::has
+   */
+  public function test_has() {
+    $this->assertTrue($this->container->has('other.service'));
+    $this->assertFalse($this->container->has('another.service'));
+
+    // Set the service manually, ensure that its also respected.
+    $mock_service = new MockService();
+    $this->container->set('another.service', $mock_service);
+    $this->assertTrue($this->container->has('another.service'));
+  }
+
+  /**
+   * Tests that Container::get() for circular dependencies works properly.
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException
+   * @covers ::get
+   */
+  public function test_get_circular() {
+    $this->container->get('circular_dependency');
+  }
+
+  /**
+   * Tests that Container::get() for non-existant dependencies works properly.
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
+   * @covers ::get
+   */
+  public function test_get_exception() {
+    $this->container->get('service_not_exists');
+  }
+
+  /**
+   * Tests that Container::get() for non-existant parameters works properly.
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_get_notFound_parameter() {
+    $service = $this->container->get('service_parameter_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE);
+    $this->assertNull($service, 'Service is NULL.');
+  }
+
+  /**
+   * Tests Container::get() with an exception due to missing parameter on the second call.
+   *
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   *
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+   */
+  public function test_get_notFound_parameterWithExceptionOnSecondCall() {
+    $service = $this->container->get('service_parameter_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE);
+    $this->assertNull($service, 'Service is NULL.');
+
+    // Reset the service.
+    $this->container->set('service_parameter_not_exists', NULL);
+    $this->container->get('service_parameter_not_exists');
+  }
+
+  /**
+   * Tests that Container::get() for non-existant parameters works properly.
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_get_notFound_parameter_exception() {
+    $this->container->get('service_parameter_not_exists');
+  }
+
+  /**
+   * Tests that Container::get() for non-existent dependencies works properly.
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_get_notFound_dependency() {
+    $service = $this->container->get('service_dependency_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE);
+    $this->assertNull($service, 'Service is NULL.');
+  }
+
+  /**
+   * Tests that Container::get() for non-existant dependencies works properly.
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_get_notFound_dependency_exception() {
+    $this->container->get('service_dependency_not_exists');
+  }
+
+
+  /**
+   * Tests that Container::get() for non-existant dependencies works properly.
+   * @covers ::get
+   */
+  public function test_get_notFound() {
+    $this->assertNull($this->container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE), 'Not found service does not throw exception.');
+  }
+
+  /**
+   * Tests multiple Container::get() calls for non-existing dependencies work.
+   *
+   * @covers ::get
+   */
+  public function test_get_notFoundMultiple() {
+    $container = new Container([
+      'parameters' => [],
+      'services' => [],
+    ]);
+
+    $this->assertNull($container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE, 'Not found service does not throw exception.'));
+    $this->assertNull($container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE, 'Not found service does not throw exception on second call.'));
+  }
+
+  /**
+   * Tests multiple Container::get() calls with exception on the second time.
+   *
+   * @covers ::get
+   *
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException
+   */
+  public function test_get_notFoundMulitpleWithExceptionOnSecondCall() {
+    $this->assertNull($this->container->get('service_not_exists', ContainerInterface::NULL_ON_INVALID_REFERENCE, 'Not found service does nto throw exception.'));
+    $this->container->get('service_not_exists');
+  }
+
+  /**
+   * Tests that Container::get() for aliased services works properly.
+   * @covers ::get
+   */
+  public function test_get_alias() {
+    $service = $this->container->get('service.provider');
+    $aliased_service = $this->container->get('service.provider_alias');
+    $this->assertSame($service, $aliased_service);
+  }
+
+  /**
+   * Tests that Container::get() for factories via services works properly.
+   * @covers ::get
+   */
+  public function test_get_factoryService() {
+    $factory_service = $this->container->get('factory_service');
+    $factory_service_class = $this->container->getParameter('factory_service_class');
+    $this->assertInstanceOf($factory_service_class, $factory_service);
+  }
+
+  /**
+   * Tests that Container::get() for factories via factory_class works.
+   * @covers ::get
+   */
+  public function test_get_factoryClass() {
+    $service = $this->container->get('service.provider');
+    $factory_service= $this->container->get('factory_class');
+
+    $this->assertInstanceOf(get_class($service), $factory_service);
+    $this->assertEquals('bar', $factory_service->getSomeParameter(), 'Correct parameter was passed via the factory class instantiation.');
+    $this->assertEquals($this->container, $factory_service->getContainer(), 'Container was injected via setter injection.');
+  }
+
+  /**
+   * Tests that Container::get() for wrong factories works correctly.
+   * @expectedException \Symfony\Component\DependencyInjection\Exception\RuntimeException
+   * @covers ::get
+   */
+  public function test_get_factoryWrong() {
+    $this->container->get('wrong_factory');
+  }
+
+  /**
+   * Tests Container::get() for factories via services (Symfony 2.7.0).
+   * @covers ::get
+   */
+  public function test_get_factoryServiceNew() {
+    $factory_service = $this->container->get('factory_service_new');
+    $factory_service_class = $this->container->getParameter('factory_service_class');
+    $this->assertInstanceOf($factory_service_class, $factory_service);
+  }
+
+  /**
+   * Tests that Container::get() for factories via class works (Symfony 2.7.0).
+   * @covers ::get
+   */
+  public function test_get_factoryClassNew() {
+    $service = $this->container->get('service.provider');
+    $factory_service= $this->container->get('factory_class_new');
+
+    $this->assertInstanceOf(get_class($service), $factory_service);
+    $this->assertEquals('bar', $factory_service->getSomeParameter(), 'Correct parameter was passed via the factory class instantiation.');
+    $this->assertEquals($this->container, $factory_service->getContainer(), 'Container was injected via setter injection.');
+  }
+
+
+
+  /**
+   * Tests that private services work correctly.
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_resolveServicesAndParameters_privateService() {
+    $service = $this->container->get('service_using_private');
+    $private_service = $service->getSomeOtherService();
+    $this->assertEquals($private_service->getSomeParameter(), 'really_private_lama', 'Private was found successfully');
+  }
+
+  /**
+   * Tests that services with an array of arguments work correctly.
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_resolveServicesAndParameters_array() {
+    $service = $this->container->get('service_using_array');
+    $other_service = $this->container->get('other.service');
+    $this->assertEquals($other_service, $service->getSomeOtherService(), '@other.service was injected via constructor.');
+  }
+
+  /**
+   * Tests that services that are optional work correctly.
+   * @covers ::get
+   * @covers ::resolveServicesAndParameters
+   */
+  public function test_resolveServicesAndParameters_optional() {
+    $service = $this->container->get('service_with_optional_dependency');
+    $this->assertNull($service->getSomeOtherService(), 'other service was NULL was expected.');
+  }
+
+
+  /**
+   * Tests that Container::initialized works correctly.
+   * @covers ::initialized
+   */
+  public function test_initialized() {
+    $this->assertFalse($this->container->initialized('late.service'), 'Late service is not initialized.');
+    $this->container->get('late.service');
+    $this->assertTrue($this->container->initialized('late.service'), 'Late service is initialized after it was gotten.');
+  }
+
+  /**
+   * Returns a mock container definition.
+   *
+   * @return array
+   *   Associated array with parameters and services.
+   */
+  protected function getMockContainerDefinition() {
+    $fake_service = new \stdClass();
+    $parameters = array();
+    $parameters['some_private_config'] = 'really_private_lama';
+    $parameters['some_config'] = 'foo';
+    $parameters['some_other_config'] = 'lama';
+    $parameters['factory_service_class'] = get_class($fake_service);
+
+    $services = array();
+    $services['service_container'] = array(
+      'class' => '\Drupal\service_container\DependencyInjection\Container',
+    );
+    $services['other.service'] = array(
+      // @todo Support parameter expansion for classes.
+      'class' => get_class($fake_service),
+    );
+    $services['late.service'] = array(
+      'class' => get_class($fake_service),
+    );
+    $services['service.provider'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array('@other.service', '%some_config%'),
+      'properties' => array('_someProperty' => 'foo'),
+      'calls' => array(
+        array('setContainer', array('@service_container')),
+        array('setOtherConfigParameter', array('%some_other_config%')),
+       ),
+      'priority' => 0,
+    );
+    $private_service = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array('@other.service', '%some_private_config%'),
+      'public' => FALSE,
+    );
+    $private_hash = sha1(serialize($private_service));
+
+    $services['service_using_private'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\\MockService',
+      'arguments' => array(
+        (object) array(
+          'type' => 'private_service',
+          'value' => $private_service,
+          'id' => 'private__' . $private_hash,
+        ),
+        '%some_config%'
+      ),
+    );
+
+    $services['service_using_array'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array(array('@other.service'), '%some_private_config%')
+    );
+    $services['service_with_optional_dependency'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array('@?service.does_not_exist', '%some_private_config%')
+    );
+
+    $services['factory_service'] = array(
+      'class' => '\Drupal\service_container\ServiceContainer\ControllerInterface',
+      'factory_method' => 'getFactoryMethod',
+      'factory_service' => 'service.provider',
+      'arguments' => array('%factory_service_class%'),
+    );
+    $services['factory_class'] = array(
+      'class' => '\Drupal\service_container\ServiceContainer\ControllerInterface',
+      'factory_method' => 'getFactoryMethod',
+      'factory_class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array(
+        '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+        array(NULL, 'bar'),
+      ),
+      'calls' => array(
+        array('setContainer', array('@service_container')),
+      ),
+    );
+    $services['factory_service_new'] = array(
+      'class' => '\Drupal\service_container\ServiceContainer\ControllerInterface',
+      'factory' => array(
+        '@service.provider',
+        'getFactoryMethod',
+      ),
+      'arguments' => array('%factory_service_class%'),
+    );
+    $services['factory_class_new'] = array(
+      'class' => '\Drupal\service_container\ServiceContainer\ControllerInterface',
+      'factory' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService::getFactoryMethod',
+      'arguments' => array(
+        '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+        array(NULL, 'bar'),
+      ),
+      'calls' => array(
+        array('setContainer', array('@service_container')),
+      ),
+    );
+
+    $services['wrong_factory'] = array(
+      'class' => '\Drupal\service_container\ServiceContainer\ControllerInterface',
+      'factory_method' => 'getFactoryMethod',
+    );
+    $services['circular_dependency'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array('@circular_dependency'),
+    );
+    $services['service_parameter_not_exists'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array('@service.provider', '%not_exists', -1),
+    );
+    $services['service_dependency_not_exists'] = array(
+      'class' => '\Drupal\Tests\Core\DependencyInjection\PhpArray\MockService',
+      'arguments' => array('@service_not_exists', '%some_config'),
+    );
+
+    $aliases = array();
+    $aliases['service.provider_alias'] = 'service.provider';
+
+    return array(
+      'aliases' => $aliases,
+      'parameters' => $parameters,
+      'services' => $services,
+    );
+  }
+
+}
+
+
+/**
+ * Helper class to test Container::get() method.
+ *
+ * @group dic
+ */
+class MockService {
+
+  /**
+   * @var ContainerInterface
+   */
+  protected $container;
+
+  /**
+   * @var object
+   */
+  protected $someOtherService;
+
+  /**
+   * @var string
+   */
+  protected $someParameter;
+
+  /**
+   * @var string
+   */
+  protected $someOtherParameter;
+
+  /**
+   * Constructs a MockService object.
+   *
+   * @param object $some_other_service
+   *   (optional) Another injected service.
+   * @param string $some_parameter
+   *   (optional) An injected parameter.
+   */
+  public function __construct($some_other_service = NULL, $some_parameter = NULL) {
+    if (is_array($some_other_service)) {
+      $some_other_service = $some_other_service[0];
+    }
+    $this->someOtherService = $some_other_service;
+    $this->someParameter = $some_parameter;
+  }
+
+  /**
+   * Sets the container object.
+   *
+   * @param ContainerInterface $container
+   *   The container to inject via setter injection.
+   */
+  public function setContainer(ContainerInterface $container) {
+    $this->container = $container;
+  }
+
+  /**
+   * Gets the container object.
+   *
+   * @return ContainerInterface
+   *   The internally set container.
+   */
+  public function getContainer() {
+    return $this->container;
+  }
+
+  /**
+   * Gets the someOtherService object.
+   *
+   * @return object
+   *   The injected service.
+   */
+  public function getSomeOtherService() {
+    return $this->someOtherService;
+  }
+
+  /**
+   * Gets the someParameter property.
+   *
+   * @return string
+   *   The injected parameter.
+   */
+  public function getSomeParameter() {
+    return $this->someParameter;
+  }
+
+  /**
+   * Sets the someOtherParameter property.
+   *
+   * @param string $some_other_parameter
+   *   The setter injected parameter.
+   */
+  public function setOtherConfigParameter($some_other_parameter) {
+    $this->someOtherParameter = $some_other_parameter;
+  }
+
+  /**
+   * Gets the someOtherParameter property.
+   *
+   * @return string
+   *   The injected parameter.
+   */
+  public function getSomeOtherParameter() {
+    return $this->someOtherParameter;
+  }
+
+  /**
+   * Provides a factory method to get a service.
+   *
+   * @param string $class
+   *   The class name of the class to instantiate
+   * @param array $arguments
+   *   (optional) Arguments to pass to the new class.
+   *
+   * @return object
+   *   The instantiated service object.
+   */
+  public static function getFactoryMethod($class, $arguments = array()) {
+    $r = new \ReflectionClass($class);
+    $service = ($r->getConstructor() === NULL) ? $r->newInstance() : $r->newInstanceArgs($arguments);
+
+    return $service;
+  }
+
+}
