diff --git a/core/core.services.yml b/core/core.services.yml
index a2d373c..65babf2 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -94,6 +94,9 @@ services:
     tags:
       - { name: persist }
     arguments: ['@config.storage', '@config.context', '@config.typed']
+  config.installer:
+    class: Drupal\Core\Config\ConfigInstaller
+    arguments: ['@config.factory', '@config.storage', '@config.typed', '@entity.manager', '@event_dispatcher', '@uuid']
   config.storage.staging:
     class: Drupal\Core\Config\FileStorage
     factory_class: Drupal\Core\Config\FileStorageFactory
@@ -190,7 +193,7 @@ services:
     arguments: ['@container.namespaces', '@cache.cache', '@language_manager', '@module_handler']
   theme_handler:
     class: Drupal\Core\Extension\ThemeHandler
-    arguments: ['@config.factory', '@module_handler', '@cache.cache', '@info_parser', '@router.builder']
+    arguments: ['@config.factory', '@module_handler', '@cache.cache', '@info_parser', '@config.installer', '@router.builder']
   entity.manager:
     class: Drupal\Core\Entity\EntityManager
     arguments: ['@container.namespaces', '@service_container', '@module_handler', '@cache.cache', '@language_manager', '@string_translation']
diff --git a/core/includes/config.inc b/core/includes/config.inc
index c7fca03..da3499e 100644
--- a/core/includes/config.inc
+++ b/core/includes/config.inc
@@ -16,105 +16,6 @@
  */
 
 /**
- * Installs the default configuration of a given extension.
- *
- * When an extension is installed, it searches all the default configuration
- * directories for all other extensions to locate any configuration with its
- * name prefix. For example, the Node module provides the frontpage view as a
- * default configuration file:
- * core/modules/node/config/views.view.frontpage.yml
- * When the Views module is installed after the Node module is already enabled,
- * the frontpage view will be installed.
- *
- * Additionally, the default configuration directory for the extension being
- * installed is searched to discover if it contains default configuration
- * that is owned by other enabled extensions. So, the frontpage view will also
- * be installed when the Node module is installed after Views.
- *
- * @param string $type
- *   The extension type; e.g., 'module' or 'theme'.
- * @param string $name
- *   The name of the module or theme to install default configuration for.
- *
- * @see \Drupal\Core\Config\ExtensionInstallStorage
- */
-function config_install_default_config($type, $name) {
-  // Get all default configuration owned by this extension.
-  $source_storage = new ExtensionInstallStorage();
-  $config_to_install = $source_storage->listAll($name . '.');
-
-  // Work out if this extension provides default configuration for any other
-  // enabled extensions.
-  $config_dir = drupal_get_path($type, $name) . '/config';
-  if (is_dir($config_dir)) {
-    $default_storage = new FileStorage($config_dir);
-    $other_module_config = array_filter($default_storage->listAll(),
-      function ($value) use ($name) {
-        return !preg_match('/^' . $name . '\./', $value);
-      }
-    );
-    $enabled_extensions = array_keys(\Drupal::moduleHandler()->getModuleList());
-    $enabled_extensions += array_keys(array_filter(list_themes(), function ($theme) {return $theme->status;}));
-
-    $other_module_config = array_filter($other_module_config, function ($config_name) use ($enabled_extensions) {
-      $provider = Unicode::substr($config_name, 0, strpos($config_name, '.'));
-      return in_array($provider, $enabled_extensions);
-    });
-
-    $config_to_install = array_merge($config_to_install, $other_module_config);
-  }
-  if (!empty($config_to_install)) {
-    $entity_manager = Drupal::service('entity.manager');
-    $config_factory = Drupal::service('config.factory');
-    $context = new FreeConfigContext(Drupal::service('event_dispatcher'), Drupal::service('uuid'));
-    $target_storage = Drupal::service('config.storage');
-    $typed_config = Drupal::service('config.typed');
-    $config_factory->enterContext($context);
-    foreach ($config_to_install as $name) {
-      // Only import new config.
-      if ($target_storage->exists($name)) {
-        continue;
-      }
-
-      $new_config = new Config($name, $target_storage, $context, $typed_config);
-      $data = $source_storage->read($name);
-      if ($data !== FALSE) {
-        $new_config->setData($data);
-      }
-      if ($entity_type = config_get_entity_type_by_name($name)) {
-        $entity_manager
-          ->getStorageController($entity_type)
-          ->create($new_config->get())
-          ->save();
-      }
-      else {
-        $new_config->save();
-      }
-
-      // Reset static cache on the config factory.
-      $config_factory->reset($name);
-    }
-    $config_factory->leaveContext();
-  }
-}
-
-/**
- * Uninstalls the default configuration of a given extension.
- *
- * @param string $type
- *   The extension type; e.g., 'module' or 'theme'.
- * @param string $name
- *   The name of the module or theme to install default configuration for.
- */
-function config_uninstall_default_config($type, $name) {
-  $storage = \Drupal::service('config.storage');
-  $config_names = $storage->listAll($name . '.');
-  foreach ($config_names as $config_name) {
-    \Drupal::config($config_name)->delete();
-  }
-}
-
-/**
  * Gets configuration object names starting with a given prefix.
  *
  * @see \Drupal\Core\Config\StorageInterface::listAll()
diff --git a/core/includes/install.inc b/core/includes/install.inc
index 256c79e..67c18b7 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -639,8 +639,8 @@ function drupal_install_system() {
   \Drupal::keyValue('system.schema')->set('system', $system_version);
 
   // System module needs to be enabled and the system/module lists need to be
-  // reset first in order to allow config_install_default_config() to invoke
-  // config import callbacks.
+  // reset first in order to allow installation of default configuration to
+  // invoke config import callbacks.
   // @todo Installation profiles may override the system.module config object.
   \Drupal::config('system.module')
     ->set('enabled.system', 0)
@@ -649,7 +649,7 @@ function drupal_install_system() {
   // Update the module list to include it.
   \Drupal::moduleHandler()->setModuleList(array('system' => $system_path . '/system.module'));
 
-  config_install_default_config('module', 'system');
+  \Drupal::service('config.installer')->installDefaultConfig('module', 'system');
 
   module_invoke('system', 'install');
 }
diff --git a/core/lib/Drupal/Core/Config/ConfigInstaller.php b/core/lib/Drupal/Core/Config/ConfigInstaller.php
new file mode 100644
index 0000000..5936fae
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/ConfigInstaller.php
@@ -0,0 +1,155 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\Core\Config\ConfigInstaller.
+ */
+
+namespace Drupal\Core\Config;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\Component\Uuid\UuidInterface;
+use Drupal\Core\Config\Context\FreeConfigContext;
+use Drupal\Core\Entity\EntityManagerInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+
+class ConfigInstaller implements ConfigInstallerInterface {
+
+  /**
+   * The configuration factory.
+   *
+   * @var \Drupal\Core\Config\ConfigFactory
+   */
+  protected $configFactory;
+
+  /**
+   * The active configuration storage.
+   *
+   * @var \Drupal\Core\Config\StorageInterface
+   */
+  protected $activeStorage;
+
+  /**
+   * The typed configuration manager.
+   *
+   * @var \Drupal\Core\Config\TypedConfigManagerInterface
+   */
+  protected $typedConfig;
+
+  /**
+   * The entity manager.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface
+   */
+  protected $entityManager;
+
+  /**
+   * The event dispatcher.
+   *
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
+   */
+  protected $eventDispatcher;
+
+  /**
+   * The UUID generation service.
+   *
+   * @var \Drupal\Component\Uuid\UuidInterface
+   */
+  protected $uuidService;
+
+  /**
+   * Constructs the configuration installer.
+   *
+   * @param ConfigFactory $config_factory
+   *   The configuration factory.
+   * @param StorageInterface $active_storage
+   *   The active configuration storage.
+   * @param TypedConfigManagerInterface $typed_config
+   *   The typed configuration manager.
+   * @param EntityManagerInterface $entity_manager
+   *   The entity manager.
+   * @param EventDispatcherInterface $event_dispatcher
+   *   The event dispatcher.
+   * @param UuidInterface $uuid_service
+   *   The UUID generation service.
+   */
+  public function __construct(ConfigFactory $config_factory, StorageInterface $active_storage, TypedConfigManagerInterface $typed_config, EntityManagerInterface $entity_manager, EventDispatcherInterface $event_dispatcher, UuidInterface $uuid_service) {
+    $this->configFactory = $config_factory;
+    $this->activeStorage = $active_storage;
+    $this->typedConfig = $typed_config;
+    $this->entityManager = $entity_manager;
+    $this->eventDispatcher = $event_dispatcher;
+    $this->uuidService = $uuid_service;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function installDefaultConfig($type, $name) {
+    // Get all default configuration owned by this extension.
+    $source_storage = new ExtensionInstallStorage();
+    $config_to_install = $source_storage->listAll($name . '.');
+
+      // Work out if this extension provides default configuration for any other
+      // enabled extensions.
+    $config_dir = drupal_get_path($type, $name) . '/config';
+    if (is_dir($config_dir)) {
+      $default_storage = new FileStorage($config_dir);
+      $other_module_config = array_filter($default_storage->listAll(), function ($value) use ($name) {
+        return !preg_match('/^' . $name . '\./', $value);
+      });
+
+      // Read enabled extensions directly from configuration to avoid circular
+      // dependencies with ModuleHandler and ThemeHandler.
+      $enabled_extensions = array_keys((array) $this->configFactory->get('system.module')->get('enabled'));
+      $enabled_extensions += array_keys((array) $this->configFactory->get('system.theme')->get('enabled'));
+
+      $other_module_config = array_filter($other_module_config, function ($config_name) use ($enabled_extensions) {
+        $provider = Unicode::substr($config_name, 0, strpos($config_name, '.'));
+        return in_array($provider, $enabled_extensions);
+      });
+
+      $config_to_install = array_merge($config_to_install, $other_module_config);
+    }
+
+    if (!empty($config_to_install)) {
+      $context = new FreeConfigContext($this->eventDispatcher, $this->uuidService);
+      $this->configFactory->enterContext($context);
+      foreach ($config_to_install as $name) {
+        // Only import new config.
+        if ($this->activeStorage->exists($name)) {
+          continue;
+        }
+
+        $new_config = new Config($name, $this->activeStorage, $context, $this->typedConfig);
+        $data = $source_storage->read($name);
+        if ($data !== FALSE) {
+          $new_config->setData($data);
+        }
+        if ($entity_type = config_get_entity_type_by_name($name)) {
+          $this->entityManager
+            ->getStorageController($entity_type)
+            ->create($new_config->get())
+            ->save();
+        }
+        else {
+          $new_config->save();
+        }
+
+        // Reset static cache on the config factory.
+        $this->configFactory->reset($name);
+      }
+      $this->configFactory->leaveContext();
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function uninstallDefaultConfig($type, $name){
+    $config_names = $this->activeStorage->listAll($name . '.');
+    foreach ($config_names as $config_name) {
+      $this->configFactory->get($config_name)->delete();
+    }
+  }
+}
diff --git a/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php
new file mode 100644
index 0000000..f1c03c0
--- /dev/null
+++ b/core/lib/Drupal/Core/Config/ConfigInstallerInterface.php
@@ -0,0 +1,49 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\Core\Config\ConfigInstallerInterface.
+ */
+
+namespace Drupal\Core\Config;
+
+/**
+ * Interface for classes that installs config.
+ */
+interface ConfigInstallerInterface {
+
+  /**
+   * Installs the default configuration of a given extension.
+   *
+   * When an extension is installed, it searches all the default configuration
+   * directories for all other extensions to locate any configuration with its
+   * name prefix. For example, the Node module provides the frontpage view as a
+   * default configuration file:
+   * core/modules/node/config/views.view.frontpage.yml
+   * When the Views module is installed after the Node module is already enabled,
+   * the frontpage view will be installed.
+   *
+   * Additionally, the default configuration directory for the extension being
+   * installed is searched to discover if it contains default configuration
+   * that is owned by other enabled extensions. So, the frontpage view will also
+   * be installed when the Node module is installed after Views.
+   *
+   * @param string $type
+   *   The extension type; e.g., 'module' or 'theme'.
+   * @param string $name
+   *   The name of the module or theme to install default configuration for.
+   *
+   * @see \Drupal\Core\Config\ExtensionInstallStorage
+   */
+  public function installDefaultConfig($type, $name);
+
+  /**
+   * Uninstalls the default configuration of a given extension.
+   *
+   * @param string $type
+   *   The extension type; e.g., 'module' or 'theme'.
+   * @param string $name
+   *   The name of the module or theme to install default configuration for.
+   */
+  public function uninstallDefaultConfig($type, $name);
+}
diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php
index 92cf2a4..6b33476 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -633,7 +633,7 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
         $version = $versions ? max($versions) : SCHEMA_INSTALLED;
 
         // Install default configuration of the module.
-        config_install_default_config('module', $module);
+        \Drupal::service('config.installer')->installDefaultConfig('module', $module);
 
         // If the module has no current updates, but has some that were
         // previously removed, set the version to the value of
@@ -724,7 +724,7 @@ public function uninstall(array $module_list, $uninstall_dependents = TRUE) {
       drupal_uninstall_schema($module);
 
       // Remove all configuration belonging to the module.
-      config_uninstall_default_config('module', $module);
+      \Drupal::service('config.installer')->uninstallDefaultConfig('module', $module);
 
       // Remove the module's entry from the config.
       $module_config->clear("enabled.$module")->save();
diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php
index 40e59cb..fbd42c5 100644
--- a/core/lib/Drupal/Core/Extension/ThemeHandler.php
+++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php
@@ -10,6 +10,7 @@
 use Drupal\Component\Utility\String;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\ConfigFactory;
+use Drupal\Core\Config\ConfigInstallerInterface;
 use Drupal\Core\Routing\RouteBuilder;
 use Drupal\Core\SystemListingInfo;
 
@@ -64,6 +65,13 @@ class ThemeHandler implements ThemeHandlerInterface {
   protected $cacheBackend;
 
   /**
+   *  The config installer to install configuration.
+   *
+   * @var \Drupal\Core\Config\ConfigInstallerInterface
+   */
+  protected $configInstaller;
+
+  /**
    * The info parser to parse the theme.info.yml files.
    *
    * @var \Drupal\Core\Extension\InfoParserInterface
@@ -95,16 +103,21 @@ class ThemeHandler implements ThemeHandlerInterface {
    *   The cache backend to clear the local tasks cache.
    * @param \Drupal\Core\Extension\InfoParserInterface $info_parser
    *   The info parser to parse the theme.info.yml files.
+   * @param \Drupal\Core\Config\ConfigInstallerInterface $config_installer
+   *   (optional) The config installer to install configuration. This optional
+   *   to allow the theme handler to work before Drupal is installed and has a
+   *   database.
    * @param \Drupal\Core\Routing\RouteBuilder $route_builder
    *   (optional) The route builder to rebuild the routes if a theme is enabled.
    * @param \Drupal\Core\SystemListingInfo $system_list_info
    *   (optional) The system listing info.
    */
-  public function __construct(ConfigFactory $config_factory, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, InfoParserInterface $info_parser, RouteBuilder $route_builder = NULL, SystemListingInfo $system_list_info = NULL) {
+  public function __construct(ConfigFactory $config_factory, ModuleHandlerInterface $module_handler, CacheBackendInterface $cache_backend, InfoParserInterface $info_parser, ConfigInstallerInterface $config_installer = NULL, RouteBuilder $route_builder = NULL, SystemListingInfo $system_list_info = NULL) {
     $this->configFactory = $config_factory;
     $this->moduleHandler = $module_handler;
     $this->cacheBackend = $cache_backend;
     $this->infoParser = $info_parser;
+    $this->configInstaller = $config_installer;
     $this->routeBuilder = $route_builder;
     $this->systemListingInfo = $system_list_info;
   }
@@ -129,11 +142,11 @@ public function enable(array $theme_list) {
       $theme_config->set("enabled.$key", 0)->save();
       $disabled_themes->clear($key)->save();
 
-      // Refresh the theme list as config_install_default_config() needs an
-      // updated list to work.
+      // Refresh the theme list as installation of default configuration needs
+      // an updated list to work.
       $this->reset();
       // Install default configuration of the theme.
-      $this->configInstallDefaultConfig($key);
+      $this->configInstaller->installDefaultConfig('theme', $key);
     }
 
     $this->resetSystem();
@@ -442,16 +455,6 @@ protected function getSystemListingInfo() {
   }
 
   /**
-   * Installs the default theme config.
-   *
-   * @param string $theme
-   *   The theme to install config for.
-   */
-  protected function configInstallDefaultConfig($theme) {
-    config_install_default_config('theme', $theme);
-  }
-
-  /**
    * Resets some other systems like rebuilding the route information or caches.
    */
   protected function resetSystem() {
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php
index e4e821f..66a384f 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Tests/CKEditorTest.php
@@ -317,7 +317,7 @@ function testStylesComboGetConfig() {
   function testLanguages() {
     // Get CKEditor supported language codes and spot-check.
     $this->enableModules(array('language'));
-    config_install_default_config('module', 'language');
+    $this->installConfig(array('language'));
     $langcodes = $this->ckeditor->getLangcodes();
 
     // Language codes transformed with browser mappings.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
index 09f126b..5ffe662 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigDiffTest.php
@@ -47,7 +47,7 @@ function testDiff() {
     );
 
     // Install the default config.
-    config_install_default_config('module', 'config_test');
+    $this->installConfig(array('config_test'));
 
     // Change a configuration value in staging.
     $staging_data = $original_data;
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
index 59ea550..aa51ec4 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigImporterTest.php
@@ -44,7 +44,7 @@ function setUp() {
 
     $this->installSchema('system', 'config_snapshot');
 
-    config_install_default_config('module', 'config_test');
+    $this->installConfig(array('config_test'));
     // Installing config_test's default configuration pollutes the global
     // variable being used for recording hook invocations by this test already,
     // so it has to be cleared out manually.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
index 24edb76..0f49a37 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigLocaleOverride.php
@@ -33,8 +33,7 @@ public static function getInfo() {
 
   public function setUp() {
     parent::setUp();
-    config_install_default_config('module', 'config_test');
-    config_install_default_config('module', 'locale');
+    $this->installConfig(array('config_test', 'locale'));
   }
 
   /**
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
index a6016c3..5df6d31 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigOverrideTest.php
@@ -51,7 +51,7 @@ function testConfOverride() {
     $conf['config_test.system']['baz'] = 'injected';
     $conf['config_test.system']['404'] = 'derp';
 
-    config_install_default_config('module', 'config_test');
+    $this->installConfig(array('config_test'));
 
     // Verify that the original configuration data exists. Have to read storage
     // directly otherwise overrides will apply.
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
index 663b456..5d8f259 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php
@@ -33,9 +33,7 @@ public static function getInfo() {
 
   public function setUp() {
     parent::setUp();
-    config_install_default_config('module', 'system');
-    config_install_default_config('module', 'image');
-    config_install_default_config('module', 'config_test');
+    $this->installConfig(array('system', 'image', 'config_test'));
   }
 
   /**
diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php
index d9504b2..0e8063e 100644
--- a/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php
+++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSnapshotTest.php
@@ -54,7 +54,7 @@ function testSnapshot() {
     $this->assertFalse($active_snapshot_comparer->createChangelist()->hasChanges());
 
     // Install the default config.
-    config_install_default_config('module', 'config_test');
+    $this->installConfig(array('config_test'));
     // Although we have imported config this has not affected the snapshot.
     $this->assertTrue($active_snapshot_comparer->reset()->hasChanges());
 
diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
index 64b9722..fb31a49 100644
--- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
+++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php
@@ -37,7 +37,7 @@ public static function getInfo() {
 
   protected function setUp() {
     parent::setUp();
-    config_install_default_config('module', 'system');
+    $this->installConfig(array('system'));
 
     $manager = $this->container->get('plugin.manager.filter');
     $bag = new FilterBag($manager, array());
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index 879ca80..c103e2e 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -209,7 +209,7 @@ protected function installConfig(array $modules) {
           '@module' => $module,
         )));
       }
-      config_install_default_config('module', $module);
+      \Drupal::service('config.installer')->installDefaultConfig('module', $module);
     }
     $this->pass(format_string('Installed default config: %modules.', array(
       '%modules' => implode(', ', $modules),
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php
index 6621358..bcafe30 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php
@@ -20,7 +20,7 @@ class XssUnitTest extends DrupalUnitTestBase {
    *
    * @var array
    */
-  public static $modules = array('filter');
+  public static $modules = array('filter', 'system');
 
   public static function getInfo() {
     return array(
@@ -32,7 +32,7 @@ public static function getInfo() {
 
   protected function setUp() {
     parent::setUp();
-    config_install_default_config('module', 'system');
+    $this->installConfig(array('system'));
   }
 
   /**
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 14153a0..83f0998 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -557,7 +557,7 @@ function system_requirements($phase) {
 function system_install() {
   // Enable and set the default theme. Can't use theme_enable() this early in
   // installation.
-  config_install_default_config('theme', 'stark');
+  \Drupal::service('config.installer')->installDefaultConfig('theme', 'stark');
   \Drupal::config('system.theme')
     ->set('default', 'stark')
     ->save();
diff --git a/core/modules/tour/lib/Drupal/tour/Tests/TourPluginTest.php b/core/modules/tour/lib/Drupal/tour/Tests/TourPluginTest.php
index 460e497..58e3e3b 100644
--- a/core/modules/tour/lib/Drupal/tour/Tests/TourPluginTest.php
+++ b/core/modules/tour/lib/Drupal/tour/Tests/TourPluginTest.php
@@ -39,7 +39,7 @@ public static function getInfo() {
   protected function setUp() {
     parent::setUp();
 
-    config_install_default_config('module', 'tour');
+    $this->installConfig(array('tour'));
     $this->pluginManager = $this->container->get('plugin.manager.tour.tip');
   }
 
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
index 20550f5..1375b23 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\Core\Extension\InfoParser;
 use Drupal\Core\Extension\ThemeHandler;
+use Drupal\Core\Config\ConfigInstaller;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -57,6 +58,13 @@ class ThemeHandlerTest extends UnitTestCase {
   protected $moduleHandler;
 
   /**
+   * The mocked config installer.
+   *
+   * @var \Drupal\Core\Config\ConfigInstaller|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $configInstaller;
+
+  /**
    * The system listing info.
    *
    * @var \Drupal\Core\SystemListingInfo|\PHPUnit_Framework_MockObject_MockObject
@@ -89,14 +97,14 @@ protected function setUp() {
     $this->moduleHandler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
     $this->cacheBackend = $this->getMock('Drupal\Core\Cache\CacheBackendInterface');
     $this->infoParser = $this->getMock('Drupal\Core\Extension\InfoParserInterface');
+    $this->configInstaller = $this->getMock('Drupal\Core\Config\ConfigInstallerInterface');
     $this->routeBuilder = $this->getMockBuilder('Drupal\Core\Routing\RouteBuilder')
       ->disableOriginalConstructor()
       ->getMock();
     $this->systemListingInfo = $this->getMockBuilder('Drupal\Core\SystemListingInfo')
       ->disableOriginalConstructor()
       ->getMock();
-
-    $this->themeHandler = new TestThemeHandler($this->configFactory, $this->moduleHandler, $this->cacheBackend, $this->infoParser, $this->routeBuilder, $this->systemListingInfo);
+    $this->themeHandler = new TestThemeHandler($this->configFactory, $this->moduleHandler, $this->cacheBackend, $this->infoParser, $this->configInstaller, $this->routeBuilder, $this->systemListingInfo);
   }
 
   /**
@@ -149,11 +157,15 @@ public function testEnableSingleTheme() {
       ->method('invokeAll')
       ->with('themes_enabled', array($theme_list));
 
+    // Ensure the config installer will be called.
+    $this->configInstaller->expects($this->once())
+      ->method('installDefaultConfig')
+      ->with('theme', $theme_list[0]);
+
     $this->themeHandler->enable($theme_list);
 
     $this->assertTrue($this->themeHandler->clearedCssCache);
     $this->assertTrue($this->themeHandler->registryRebuild);
-    $this->assertTrue($this->themeHandler->installedDefaultConfig['theme_test']);
   }
 
   /**
@@ -395,13 +407,6 @@ protected function themeRegistryRebuild() {
   /**
    * {@inheritdoc}
    */
-  protected function configInstallDefaultConfig($theme) {
-    $this->installedDefaultConfig[$theme] = TRUE;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   protected function systemThemeList() {
     return $this->systemList;
   }
