diff --git a/core/authorize.php b/core/authorize.php
index ba71c5dd5a05c088359fab594ddb3f9ec0afbc12..8715fb04be5737b572e4d53f211744825f904ee3 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -65,9 +65,8 @@ function authorize_access_allowed() {
 
 // We have to enable the user and system modules, even to check access and
 // display errors via the maintenance theme.
-$module_list['system'] = 'core/modules/system/system.module';
-$module_list['user'] = 'core/modules/user/user.module';
-\Drupal::moduleHandler()->setModuleList($module_list);
+\Drupal::moduleHandler()->addModule('system', 'core/modules/system');
+\Drupal::moduleHandler()->addModule('user', 'core/modules/user');
 \Drupal::moduleHandler()->load('system');
 \Drupal::moduleHandler()->load('user');
 
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 796201563667d5a7e14093023afeca3ef594fb77..9e5c50fbe0f98c4e3a770383d43a0d83d8dbf516 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -552,9 +552,9 @@ function _drupal_request_initialize() {
  * configuration. For example, a module 'foo' may legally be located
  * in any of these three places:
  *
- * core/modules/foo/foo.module
- * modules/foo/foo.module
- * sites/example.com/modules/foo/foo.module
+ * core/modules/foo/foo.info.yml
+ * modules/foo/foo.info.yml
+ * sites/example.com/modules/foo/foo.info.yml
  *
  * Calling drupal_get_filename('module', 'foo') will give you one of
  * the above, depending on where the module is located.
@@ -594,7 +594,9 @@ function drupal_get_filename($type, $name, $filename = NULL) {
     // providers first.
     // Retrieve the current module list (derived from the service container).
     if ($type == 'module' && \Drupal::hasService('module_handler')) {
-      $files[$type] += \Drupal::moduleHandler()->getModuleList();
+      foreach (\Drupal::moduleHandler()->getModuleList() as $module_name => $module) {
+        $files[$type][$module_name] = $module->getPathname();
+      }
     }
     // If still unknown, retrieve the file list prepared in state by
     // system_rebuild_module_data() and system_rebuild_theme_data().
@@ -609,7 +611,7 @@ function drupal_get_filename($type, $name, $filename = NULL) {
         $listing->setProfileDirectories(array());
       }
       foreach ($listing->scan($original_type) as $extension_name => $file) {
-        $files[$type][$extension_name] = $file->uri;
+        $files[$type][$extension_name] = $file->getPathname();
       }
     }
   }
diff --git a/core/includes/common.inc b/core/includes/common.inc
index af96028595567df2c0608d818eae11ab536916be..6d91783d0e40697f83d8b7fd4b5e76851c519211 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -4944,9 +4944,9 @@ function drupal_flush_all_caches() {
   // sufficient, since the list of enabled modules might have been adjusted
   // above due to changed code.
   $files = array();
-  foreach ($module_data as $module => $data) {
-    if (isset($data->uri) && $data->status) {
-      $files[$module] = $data->uri;
+  foreach ($module_data as $name => $extension) {
+    if ($extension->status) {
+      $files[$name] = $extension;
     }
   }
   \Drupal::service('kernel')->updateModules($module_handler->getModuleList(), $files);
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index 8d27e08d6766628fb01777bae69690db940cffd3..e534003b35ff6283f5000c764763b76736c38866 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -386,7 +386,7 @@ function install_begin_request(&$install_state) {
 
   // Prime drupal_get_filename()'s static cache.
   foreach ($install_state['profiles'] as $name => $profile) {
-    drupal_get_filename('profile', $name, $profile->uri);
+    drupal_get_filename('profile', $name, $profile->getPathname());
   }
 
   if ($profile = _install_select_profile($install_state)) {
@@ -399,14 +399,12 @@ function install_begin_request(&$install_state) {
 
   // Override the module list with a minimal set of modules.
   $module_handler = \Drupal::moduleHandler();
-  $module_list = $module_handler->getModuleList();
   if (!$module_handler->moduleExists('system')) {
-    $module_list['system'] = 'core/modules/system/system.module';
+    $module_handler->addModule('system', 'core/modules/system');
   }
   if ($profile && !$module_handler->moduleExists($profile)) {
-    $module_list[$profile] = $install_state['profiles'][$profile]->uri;
+    $module_handler->addProfile($profile, $install_state['profiles'][$profile]->getPath());
   }
-  $module_handler->setModuleList($module_list);
   // After setting up a custom and finite module list in a custom low-level
   // bootstrap like here, ensure to use ModuleHandler::loadAll() so that
   // ModuleHandler::isLoaded() returns TRUE, since that is a condition being
@@ -734,9 +732,7 @@ function install_tasks($install_state) {
   // Allow the installation profile to modify the full list of tasks.
   if (!empty($install_state['parameters']['profile'])) {
     $profile = $install_state['parameters']['profile'];
-    $profile_file = $install_state['profiles'][$profile]->uri;
-    if (file_exists($profile_file)) {
-      include_once DRUPAL_ROOT . '/' .  $profile_file;
+    if ($install_state['profiles'][$profile]->load()) {
       $function = $install_state['parameters']['profile'] . '_install_tasks_alter';
       if (function_exists($function)) {
         $function($tasks, $install_state);
@@ -1765,19 +1761,12 @@ function _install_get_version_info($version) {
  *
  * @param $install_state
  *   An array of information about the current installation state. The loaded
- *   profile information will be added here, or an exception will be thrown if
- *   the profile cannot be loaded.
+ *   profile information will be added here.
  */
 function install_load_profile(&$install_state) {
   $profile = $install_state['parameters']['profile'];
-  $profile_file = $install_state['profiles'][$profile]->uri;
-  if (file_exists($profile_file)) {
-    include_once DRUPAL_ROOT . '/' . $profile_file;
-    $install_state['profile_info'] = install_profile_info($install_state['parameters']['profile'], isset($install_state['parameters']['langcode']) ? $install_state['parameters']['langcode'] : 'en');
-  }
-  else {
-    throw new InstallerException(t('Sorry, the profile you have chosen cannot be loaded.'));
-  }
+  $install_state['profiles'][$profile]->load();
+  $install_state['profile_info'] = install_profile_info($profile, isset($install_state['parameters']['langcode']) ? $install_state['parameters']['langcode'] : 'en');
 }
 
 /**
diff --git a/core/includes/install.inc b/core/includes/install.inc
index 4b5466d43ed08024d2261219ffba4699944f8910..5c757741b06833f554563954c2967977ee09e984 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -659,8 +659,9 @@ function drupal_install_system($install_state) {
     ->save();
 
   // Update the module list to include it. Reboot the kernel too.
-  \Drupal::moduleHandler()->setModuleList(array('system' => $system_path . '/system.module'));
-  $kernel->updateModules(array('system' => $system_path . '/system.module'));
+  \Drupal::moduleHandler()->addModule('system', 'core/modules/system');
+  $module_list = \Drupal::moduleHandler()->getModuleList();
+  $kernel->updateModules($module_list);
 
   \Drupal::service('config.installer')->installDefaultConfig('module', 'system');
 
diff --git a/core/includes/theme.maintenance.inc b/core/includes/theme.maintenance.inc
index 429b9329e8841f4d297dbbc6befb45ff7691bb1f..d49338d51cfdff2bd70499e8771f0f5a44325ed5 100644
--- a/core/includes/theme.maintenance.inc
+++ b/core/includes/theme.maintenance.inc
@@ -72,9 +72,8 @@ function _drupal_maintenance_theme() {
 
   // Ensure that system.module is loaded.
   if (!function_exists('_system_rebuild_theme_data')) {
-    $module_list['system'] = 'core/modules/system/system.module';
     $module_handler = \Drupal::moduleHandler();
-    $module_handler->setModuleList($module_list);
+    $module_handler->addModule('system', 'core/modules/system');
     $module_handler->load('system');
   }
 
diff --git a/core/lib/Drupal/Core/DrupalKernel.php b/core/lib/Drupal/Core/DrupalKernel.php
index 4d57e65af4b02e3b1fb4d5840885c5d2f7805a8b..8172b480da207b567cf413362a933004da90ef90 100644
--- a/core/lib/Drupal/Core/DrupalKernel.php
+++ b/core/lib/Drupal/Core/DrupalKernel.php
@@ -82,12 +82,9 @@ class DrupalKernel implements DrupalKernelInterface, TerminableInterface {
   protected $newModuleList;
 
   /**
-   * An array of module data objects.
+   * List of available modules and installation profiles.
    *
-   * The data objects have the same data structure as returned by
-   * ExtensionDiscovery but only the uri property is used.
-   *
-   * @var array
+   * @var \Drupal\Core\Extension\Extension[]
    */
   protected $moduleData = array();
 
@@ -330,8 +327,8 @@ protected function moduleData($module) {
    */
   public function updateModules(array $module_list, array $module_filenames = array()) {
     $this->newModuleList = $module_list;
-    foreach ($module_filenames as $module => $filename) {
-      $this->moduleData[$module] = (object) array('uri' => $filename);
+    foreach ($module_filenames as $name => $extension) {
+      $this->moduleData[$name] = $extension;
     }
     // If we haven't yet booted, we don't need to do anything: the new module
     // list will take effect when boot() is called. If we have already booted,
@@ -413,7 +410,7 @@ protected function initializeContainer() {
       // from the container.
       $container_modules = $this->container->getParameter('container.modules');
       $namespaces_before = $this->classLoader->getPrefixes();
-      $this->registerNamespaces($this->getModuleNamespaces($container_modules));
+      $this->registerNamespaces($this->container->getParameter('container.namespaces'));
 
       // If 'container.modules' is wrong, the container must be rebuilt.
       if (!isset($this->moduleList)) {
@@ -501,7 +498,7 @@ protected function buildContainer() {
     $container = $this->getContainerBuilder();
     $container->set('kernel', $this);
     $container->setParameter('container.service_providers', $this->serviceProviderClasses);
-    $container->setParameter('container.modules', $this->getModuleFileNames());
+    $container->setParameter('container.modules', $this->getModulesParameter());
 
     // Get a list of namespaces and put it onto the container.
     $namespaces = $this->getModuleNamespaces($this->getModuleFileNames());
@@ -664,6 +661,25 @@ protected function getConfigStorage() {
     return $this->configStorage;
   }
 
+  /**
+   * Returns an array of Extension class parameters for all enabled modules.
+   *
+   * @return array
+   */
+  protected function getModulesParameter() {
+    $extensions = array();
+    foreach ($this->moduleList as $name => $weight) {
+      if ($data = $this->moduleData($name)) {
+        $extensions[$name] = array(
+          'type' => $data->getType(),
+          'pathname' => $data->getPathname(),
+          'filename' => $data->getExtensionFilename(),
+        );
+      }
+    }
+    return $extensions;
+  }
+
   /**
    * Returns the file name for each enabled module.
    */
@@ -671,7 +687,7 @@ protected function getModuleFileNames() {
     $filenames = array();
     foreach ($this->moduleList as $module => $weight) {
       if ($data = $this->moduleData($module)) {
-        $filenames[$module] = $data->uri;
+        $filenames[$module] = $data->getPathname();
       }
     }
     return $filenames;
diff --git a/core/lib/Drupal/Core/Extension/Extension.php b/core/lib/Drupal/Core/Extension/Extension.php
index 936151fa8eb6cc7100b1f246b9f02f3c3a6109a3..d7a51c5a48d5a6ea28b15a9c8af63915efd15b2d 100644
--- a/core/lib/Drupal/Core/Extension/Extension.php
+++ b/core/lib/Drupal/Core/Extension/Extension.php
@@ -61,7 +61,7 @@ class Extension implements \Serializable {
    *
    * @todo Rename to $filename once external test dependencies are resolved.
    *
-   * @var string
+   * @var string|null
    */
   protected $_filename;
 
@@ -83,9 +83,9 @@ class Extension implements \Serializable {
    *   The relative path and filename of the extension's info file; e.g.,
    *   'core/modules/node/node.info.yml'.
    * @param string $filename
-   *   The filename of the main extension file; e.g., 'node.module'.
+   *   (optional) The filename of the main extension file; e.g., 'node.module'.
    */
-  public function __construct($type, $pathname, $filename) {
+  public function __construct($type, $pathname, $filename = NULL) {
     $this->type = $type;
     $this->pathname = $pathname;
     $this->_filename = $filename;
@@ -140,6 +140,40 @@ public function getFilename() {
     return basename($this->pathname);
   }
 
+  /**
+   * Returns the relative path of the main extension file, if any.
+   *
+   * @return string|null
+   */
+  public function getExtensionPathname() {
+    if ($this->_filename) {
+      return $this->getPath() . '/' . $this->_filename;
+    }
+  }
+
+  /**
+   * Returns the name of the main extension file, if any.
+   *
+   * @return string|null
+   */
+  public function getExtensionFilename() {
+    return $this->_filename;
+  }
+
+  /**
+   * Loads the main extension file, if any.
+   *
+   * @return bool
+   *   TRUE if this extension has a main extension file, FALSE otherwise.
+   */
+  public function load() {
+    if ($this->_filename) {
+      include_once DRUPAL_ROOT . '/' . $this->getPath() . '/' . $this->_filename;
+      return TRUE;
+    }
+    return FALSE;
+  }
+
   /**
    * Re-routes method calls to SplFileInfo.
    *
diff --git a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
index aba0c2fbb9e15bbb6ae3ccb2a3cd29e20ab5f405..e9cfefabab9525652495910e1c28dbb3a675978f 100644
--- a/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
+++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
@@ -375,6 +375,9 @@ protected function scanDirectory($dir, $include_tests) {
       else {
         $filename = $name . '.' . $type;
       }
+      if (!file_exists(dirname($pathname) . '/' . $filename)) {
+        $filename = NULL;
+      }
 
       $extension = new Extension($type, $pathname, $filename);
       // Inject the existing RecursiveDirectoryIterator object to avoid
diff --git a/core/lib/Drupal/Core/Extension/ModuleHandler.php b/core/lib/Drupal/Core/Extension/ModuleHandler.php
index 127072b8a5f31482e10ad38d04a7e085901778b7..425ed585e97030f7c4320b5dab9720b7afe87d73 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandler.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandler.php
@@ -30,9 +30,7 @@ class ModuleHandler implements ModuleHandlerInterface {
   /**
    * List of installed modules.
    *
-   * @var array
-   *   An associative array whose keys are the names of the modules and whose
-   *   values are the module filenames.
+   * @var \Drupal\Core\Extension\Extension[]
    */
   protected $moduleList;
 
@@ -69,14 +67,17 @@ class ModuleHandler implements ModuleHandlerInterface {
    *
    * @param array $module_list
    *   An associative array whose keys are the names of installed modules and
-   *   whose values are the module filenames. This is normally the
+   *   whose values are Extension class parameters. This is normally the
    *   %container.modules% parameter being set up by DrupalKernel.
    *
    * @see \Drupal\Core\DrupalKernel
    * @see \Drupal\Core\CoreServiceProvider
    */
   public function __construct(array $module_list = array()) {
-    $this->moduleList = $module_list;
+    $this->moduleList = array();
+    foreach ($module_list as $name => $module) {
+      $this->moduleList[$name] = new Extension($module['type'], $module['pathname'], $module['filename']);
+    }
   }
 
   /**
@@ -88,8 +89,7 @@ public function load($name) {
     }
 
     if (isset($this->moduleList[$name])) {
-      $filename = $this->moduleList[$name];
-      include_once DRUPAL_ROOT . '/' . $filename;
+      $this->moduleList[$name]->load();
       $this->loadedFiles[$name] = TRUE;
       return TRUE;
     }
@@ -101,8 +101,8 @@ public function load($name) {
    */
   public function loadAll() {
     if (!$this->loaded) {
-      foreach ($this->moduleList as $module => $filename) {
-        $this->load($module);
+      foreach ($this->moduleList as $name => $module) {
+        $this->load($name);
       }
       $this->loaded = TRUE;
     }
@@ -140,6 +140,37 @@ public function setModuleList(array $module_list = array()) {
     $this->resetImplementations();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function addModule($name, $path) {
+    $this->add('module', $name, $path);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function addProfile($name, $path) {
+    $this->add('profile', $name, $path);
+  }
+
+  /**
+   * Adds a module or profile to the list of currently active modules.
+   *
+   * @param string $type
+   *   The extension type; either 'module' or 'profile'.
+   * @param string $name
+   *   The module name; e.g., 'node'.
+   * @param string $path
+   *   The module path; e.g., 'core/modules/node'.
+   */
+  protected function add($type, $name, $path) {
+    $pathname = "$path/$name.info.yml";
+    $filename = file_exists("$path/$name.$type") ? "$name.$type" : NULL;
+    $this->moduleList[$name] = new Extension($type, $pathname, $filename);
+    $this->resetImplementations();
+  }
+
   /**
    * Implements \Drupal\Core\Extension\ModuleHandlerInterface::buildModuleDependencies().
    */
@@ -190,7 +221,7 @@ public function loadInclude($module, $type, $name = NULL) {
 
     $name = $name ?: $module;
     if (isset($this->moduleList[$module])) {
-      $file = DRUPAL_ROOT . '/' . dirname($this->moduleList[$module]) . "/$name.$type";
+      $file = DRUPAL_ROOT . '/' . $this->moduleList[$module]->getPath() . "/$name.$type";
       if (is_file($file)) {
         require_once $file;
         return $file;
@@ -586,7 +617,10 @@ public function install(array $module_list, $enable_dependencies = TRUE) {
             $module_filenames[$name] = $current_module_filenames[$name];
           }
           else {
-            $module_filenames[$name] = drupal_get_filename('module', $name);
+            $module_path = drupal_get_path('module', $name);
+            $pathname = "$module_path/$name.info.yml";
+            $filename = file_exists($module_path . "/$name.module") ? "$name.module" : NULL;
+            $module_filenames[$name] = new Extension('module', $pathname, $filename);
           }
         }
 
@@ -818,8 +852,8 @@ protected function removeCacheBins($module) {
    */
   public function getModuleDirectories() {
     $dirs = array();
-    foreach ($this->getModuleList() as $module => $filename) {
-      $dirs[$module] = DRUPAL_ROOT . '/' . dirname($filename);
+    foreach ($this->getModuleList() as $name => $module) {
+      $dirs[$name] = DRUPAL_ROOT . '/' . $module->getPath();
     }
     return $dirs;
   }
diff --git a/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php
index 3012627bb0eea492ed5ba8776cb28768ab73ee97..2b6d1dfc6eb79a8d1d9253ed94ca7324e92a07b5 100644
--- a/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php
+++ b/core/lib/Drupal/Core/Extension/ModuleHandlerInterface.php
@@ -49,23 +49,43 @@ public function isLoaded();
   public function reload();
 
   /**
-   * Returns a list of currently active modules.
+   * Returns the list of currently active modules.
    *
-   * @return array
+   * @return \Drupal\Core\Extension\Extension[]
    *   An associative array whose keys are the names of the modules and whose
-   *   values are the module filenames.
+   *   values are Extension objects.
    */
   public function getModuleList();
 
   /**
-   * Explicitly sets the moduleList property to the passed in array of modules.
+   * Sets an explicit list of currently active modules.
    *
-   * @param array $module_list
+   * @param \Drupal\Core\Extension\Extension[] $module_list
    *   An associative array whose keys are the names of the modules and whose
-   *   values are the module filenames.
+   *   values are Extension objects.
    */
   public function setModuleList(array $module_list = array());
 
+  /**
+   * Adds a module to the list of currently active modules.
+   *
+   * @param string $name
+   *   The module name; e.g., 'node'.
+   * @param string $path
+   *   The module path; e.g., 'core/modules/node'.
+   */
+  public function addModule($name, $path);
+
+  /**
+   * Adds an installation profile to the list of currently active modules.
+   *
+   * @param string $name
+   *   The profile name; e.g., 'standard'.
+   * @param string $path
+   *   The profile path; e.g., 'core/profiles/standard'.
+   */
+  public function addProfile($name, $path);
+
   /**
    * Determines which modules require and are required by each module.
    *
diff --git a/core/lib/Drupal/Core/Extension/ThemeHandler.php b/core/lib/Drupal/Core/Extension/ThemeHandler.php
index 060d796b29fda4f1f882a2b61c19116223ea6e92..db22e5f536fcbbfb8ecdb59a53010e623db3ecc7 100644
--- a/core/lib/Drupal/Core/Extension/ThemeHandler.php
+++ b/core/lib/Drupal/Core/Extension/ThemeHandler.php
@@ -290,7 +290,7 @@ public function rebuildThemeData() {
       // Defaults to 'twig' (see $defaults above).
       $engine = $theme->info['engine'];
       if (isset($engines[$engine])) {
-        $theme->owner = $engines[$engine]->uri;
+        $theme->owner = $engines[$engine]->getExtensionPathname();
         $theme->prefix = $engines[$engine]->getName();
       }
 
diff --git a/core/lib/Drupal/Core/Template/TwigEnvironment.php b/core/lib/Drupal/Core/Template/TwigEnvironment.php
index 06a8dcc1bb56fd63f0feaca95a965f8eb6a06a08..2fed4e4624ac9c5f3008cdf00a7a6c2734ea5155 100644
--- a/core/lib/Drupal/Core/Template/TwigEnvironment.php
+++ b/core/lib/Drupal/Core/Template/TwigEnvironment.php
@@ -40,8 +40,8 @@ public function __construct(\Twig_LoaderInterface $loader = NULL, $options = arr
 
     // Set twig path namespace for themes and modules.
     $namespaces = array();
-    foreach ($module_handler->getModuleList() as $name => $filename) {
-      $namespaces[$name] = dirname($filename);
+    foreach ($module_handler->getModuleList() as $name => $extension) {
+      $namespaces[$name] = $extension->getPath();
     }
     foreach ($theme_handler->listInfo() as $name => $extension) {
       $namespaces[$name] = $extension->getPath();
diff --git a/core/modules/action/tests/action_bulk_test/action_bulk_test.module b/core/modules/action/tests/action_bulk_test/action_bulk_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/action/tests/action_bulk_test/action_bulk_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.module b/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/aggregator/tests/modules/aggregator_test/aggregator_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.module b/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/aggregator/tests/modules/aggregator_test_views/aggregator_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/block/tests/modules/block_test_views/block_test_views.module b/core/modules/block/tests/modules/block_test_views/block_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/block/tests/modules/block_test_views/block_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/comment/tests/modules/comment_test_views/comment_test_views.module b/core/modules/comment/tests/modules/comment_test_views/comment_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/comment/tests/modules/comment_test_views/comment_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/config/tests/config_events_test/config_events_test.module b/core/modules/config/tests/config_events_test/config_events_test.module
deleted file mode 100644
index aa5247540fdcf11660f8187e77c3346a8667a9ea..0000000000000000000000000000000000000000
--- a/core/modules/config/tests/config_events_test/config_events_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides Config event listeners for testing purposes.
- */
diff --git a/core/modules/config/tests/config_integration_test/config_integration_test.module b/core/modules/config/tests/config_integration_test/config_integration_test.module
deleted file mode 100644
index 9c9269637831214c75988f7227b06091431bf582..0000000000000000000000000000000000000000
--- a/core/modules/config/tests/config_integration_test/config_integration_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * ConfigTest entity integration test module.
- */
diff --git a/core/modules/config/tests/config_other_module_config/config_other_module_config.module b/core/modules/config/tests/config_other_module_config/config_other_module_config.module
deleted file mode 100644
index 3d68fc09ee7a8c546bc74a399da191251a6c331f..0000000000000000000000000000000000000000
--- a/core/modules/config/tests/config_other_module_config/config_other_module_config.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Test module which supplies a configuration entity owned by another module.
- */
diff --git a/core/modules/config/tests/config_override/config_override.module b/core/modules/config/tests/config_override/config_override.module
deleted file mode 100644
index 0261055e6e3ef36752431454fd6adbc532f8c720..0000000000000000000000000000000000000000
--- a/core/modules/config/tests/config_override/config_override.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides Config module for testing overrides.
- */
diff --git a/core/modules/config/tests/config_test_invalid_name/config_test_invalid_name.module b/core/modules/config/tests/config_test_invalid_name/config_test_invalid_name.module
deleted file mode 100644
index 890776d97c555846486b6df26369a22ffdc39f25..0000000000000000000000000000000000000000
--- a/core/modules/config/tests/config_test_invalid_name/config_test_invalid_name.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Test module containing a configuration file with an invalid name.
- */
diff --git a/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperManager.php b/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperManager.php
index 122738207b10bcd0985df78aaefbd6983d7370aa..bdfbe5555d193857155380493a7004c41b2ab785 100644
--- a/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperManager.php
+++ b/core/modules/config_translation/lib/Drupal/config_translation/ConfigMapperManager.php
@@ -68,8 +68,8 @@ public function __construct(CacheBackendInterface $cache_backend, LanguageManage
 
     // Look at all themes and modules.
     $directories = array();
-    foreach ($module_handler->getModuleList() as $module => $filename) {
-      $directories[$module] = dirname($filename);
+    foreach ($module_handler->getModuleList() as $name => $module) {
+      $directories[$name] = $module->getPath();
     }
     foreach ($theme_handler->listInfo() as $theme) {
       $directories[$theme->getName()] = $theme->getPath();
diff --git a/core/modules/contact/tests/modules/contact_test_views/contact_test_views.module b/core/modules/contact/tests/modules/contact_test_views/contact_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/contact/tests/modules/contact_test_views/contact_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.module b/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/content_translation/tests/modules/content_translation_test_views/content_translation_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.module b/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/dblog/tests/modules/dblog_test_views/dblog_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.module b/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.module
deleted file mode 100644
index 37dc0508afa71fb30f9bff3e2e272859f644cbaa..0000000000000000000000000000000000000000
--- a/core/modules/entity_reference/tests/modules/entity_reference_test/entity_reference_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Helper module for the Entity Reference tests.
- */
diff --git a/core/modules/field/tests/modules/field_test_config/field_test_config.module b/core/modules/field/tests/modules/field_test_config/field_test_config.module
deleted file mode 100644
index 3d7730d08e1f02181444f171199e6cbcd9de07af..0000000000000000000000000000000000000000
--- a/core/modules/field/tests/modules/field_test_config/field_test_config.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Helper module for the Field API configuration tests.
- */
diff --git a/core/modules/field/tests/modules/field_test_views/field_test_views.module b/core/modules/field/tests/modules/field_test_views/field_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/field/tests/modules/field_test_views/field_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module b/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module
deleted file mode 100644
index dae31c6da32489777912db097a8922bda514bf5f..0000000000000000000000000000000000000000
--- a/core/modules/field_ui/tests/modules/field_ui_test/field_ui_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Field UI test module.
- */
diff --git a/core/modules/file/tests/modules/file_test_views/file_test_views.module b/core/modules/file/tests/modules/file_test_views/file_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/file/tests/modules/file_test_views/file_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/forum/tests/modules/forum_test_views/forum_test_views.module b/core/modules/forum/tests/modules/forum_test_views/forum_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/forum/tests/modules/forum_test_views/forum_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/migrate/migrate.module b/core/modules/migrate/migrate.module
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/core/modules/migrate_drupal/migrate_drupal.module b/core/modules/migrate_drupal/migrate_drupal.module
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/core/modules/node/tests/modules/node_test_config/node_test_config.module b/core/modules/node/tests/modules/node_test_config/node_test_config.module
deleted file mode 100644
index 00522b535f9581e9d665137f71cd3cccf90500d6..0000000000000000000000000000000000000000
--- a/core/modules/node/tests/modules/node_test_config/node_test_config.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Helper module for node configuration tests.
- */
diff --git a/core/modules/node/tests/modules/node_test_views/node_test_views.module b/core/modules/node/tests/modules/node_test_views/node_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/node/tests/modules/node_test_views/node_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/rest/tests/modules/rest_test_views/rest_test_views.module b/core/modules/rest/tests/modules/rest_test_views/rest_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/rest/tests/modules/rest_test_views/rest_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/search/tests/modules/search_extra_type/search_extra_type.module b/core/modules/search/tests/modules/search_extra_type/search_extra_type.module
deleted file mode 100644
index 46007088df4bd4ac46221e1a74d4b7d5034a2277..0000000000000000000000000000000000000000
--- a/core/modules/search/tests/modules/search_extra_type/search_extra_type.module
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-/**
- * @file
- * Dummy module implementing a search type for search module testing.
- */
-
diff --git a/core/modules/serialization/tests/serialization_test/serialization_test.module b/core/modules/serialization/tests/serialization_test/serialization_test.module
deleted file mode 100644
index c4e35c788467111848e5243bc0ba1d7da5073ef5..0000000000000000000000000000000000000000
--- a/core/modules/serialization/tests/serialization_test/serialization_test.module
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-/**
- * @file
- * Helper module for serialization tests. This file is empty, because all
- * implementation is in autoloaded classes.
- */
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
index 19754668bc4d03308a668ba392c8abf32c549e1d..e3c916d9c440cb4be9213589413869162943676d 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/DrupalUnitTestBase.php
@@ -345,20 +345,21 @@ protected function installSchema($module, $tables) {
   protected function enableModules(array $modules) {
     // Set the list of modules in the extension handler.
     $module_handler = $this->container->get('module_handler');
-    $module_filenames = $module_handler->getModuleList();
+
     // Write directly to active storage to avoid early instantiation of
     // the event dispatcher which can prevent modules from registering events.
     $active_storage =  \Drupal::service('config.storage');
     $system_config = $active_storage->read('system.module');
+
     foreach ($modules as $module) {
-      $module_filenames[$module] = drupal_get_filename('module', $module);
+      $module_handler->addModule($module, drupal_get_path('module', $module));
       // Maintain the list of enabled modules in configuration.
       $system_config['enabled'][$module] = 0;
     }
     $active_storage->write('system.module', $system_config);
-    $module_handler->setModuleList($module_filenames);
-    $module_handler->resetImplementations();
+
     // Update the kernel to make their services available.
+    $module_filenames = $module_handler->getModuleList();
     $this->kernel->updateModules($module_filenames, $module_filenames);
 
     // Ensure isLoaded() is TRUE in order to make _theme() work.
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 44c6ce1639c04afbd64ee678f6145f5e56d02f11..4138f607cd579d7894122733c6bdfc0bfea6b0f5 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -564,7 +564,7 @@ function simpletest_classloader_register() {
     $extensions = array();
     foreach ($types as $type) {
       foreach ($listing->scan($type, TRUE) as $name => $file) {
-        $extensions[$type][$name] = $file->uri;
+        $extensions[$type][$name] = $file->getPathname();
       }
     }
     \Drupal::cache()->set($cid, $extensions);
diff --git a/core/modules/statistics/tests/modules/statistics_test_views/statistics_test_views.module b/core/modules/statistics/tests/modules/statistics_test_views/statistics_test_views.module
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php
index e412ee0415df0a23c6dbe7ef6e609dac61df4769..c78a111cf5a39c92d361a5f000aaa5215be30d9b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/GetFilenameUnitTest.php
@@ -35,17 +35,17 @@ function testDrupalGetFilename() {
     // does not exist.
     $this->assertFalse(\Drupal::hasService('keyvalue'), 'The container has no keyvalue service.');
     // Retrieving the location of a module.
-    $this->assertIdentical(drupal_get_filename('module', 'xmlrpc'), 'core/modules/xmlrpc/xmlrpc.module');
+    $this->assertIdentical(drupal_get_filename('module', 'xmlrpc'), 'core/modules/xmlrpc/xmlrpc.info.yml');
 
     // Retrieving the location of a theme.
-    $this->assertIdentical(drupal_get_filename('theme', 'stark'), 'core/themes/stark/stark.theme');
+    $this->assertIdentical(drupal_get_filename('theme', 'stark'), 'core/themes/stark/stark.info.yml');
 
     // Retrieving the location of a theme engine.
-    $this->assertIdentical(drupal_get_filename('theme_engine', 'phptemplate'), 'core/themes/engines/phptemplate/phptemplate.engine');
+    $this->assertIdentical(drupal_get_filename('theme_engine', 'phptemplate'), 'core/themes/engines/phptemplate/phptemplate.info.yml');
 
     // Retrieving the location of a profile. Profiles are a special case with
     // a fixed location and naming.
-    $this->assertIdentical(drupal_get_filename('profile', 'standard'), 'core/profiles/standard/standard.profile');
+    $this->assertIdentical(drupal_get_filename('profile', 'standard'), 'core/profiles/standard/standard.info.yml');
 
     // Searching for an item that does not exist returns NULL.
     $this->assertNull(drupal_get_filename('module', uniqid("", TRUE)), 'Searching for an item that does not exist returns NULL.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
index 26b1b76607482d0e342f3cb8899494cc928e1afa..a7336f919f310a39468d5680fcdefc0b972f2983 100644
--- a/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/DrupalKernel/DrupalKernelTest.php
@@ -114,7 +114,11 @@ function testCompileDIC() {
     $this->assertTrue($refClass->hasMethod('loadClass'), 'Container has a classloader');
     // Check that the location of the new module is registered.
     $modules = $container->getParameter('container.modules');
-    $this->assertEqual($modules['service_provider_test'], drupal_get_filename('module', 'service_provider_test'));
+    $this->assertEqual($modules['service_provider_test'], array(
+      'type' => 'module',
+      'pathname' => drupal_get_filename('module', 'service_provider_test'),
+      'filename' => NULL,
+    ));
   }
 
 }
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 65a8796c9969f66704ba91fc3e87f85ffe5cb808..9227c8a211c7a6ff81aed9bea5337feae78e5a10 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -1478,7 +1478,7 @@ function system_rebuild_module_data() {
       $module->weight = isset($installed_modules[$name]) ? $installed_modules[$name] : 0;
       $module->status = (int) isset($installed_modules[$name]);
       $module->schema_version = SCHEMA_UNINSTALLED;
-      $files[$name] = $module->uri;
+      $files[$name] = $module->getPathname();
     }
     $modules = \Drupal::moduleHandler()->buildModuleDependencies($modules);
     $modules_cache = $modules;
@@ -1525,7 +1525,7 @@ function system_rebuild_theme_data() {
   $files = array();
   foreach ($themes as $name => $theme) {
     $theme->status = (int) isset($enabled_themes[$name]);
-    $files[$name] = $theme->uri;
+    $files[$name] = $theme->getPathname();
   }
   // Replace last known theme data state.
   // @todo Obsolete with proper installation status for themes.
diff --git a/core/modules/system/tests/modules/action_test/action_test.module b/core/modules/system/tests/modules/action_test/action_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/action_test/action_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/cache_test/cache_test.module b/core/modules/system/tests/modules/cache_test/cache_test.module
deleted file mode 100644
index 3d2e68d683db14e29b7b56d83d82f6753ed2420d..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/cache_test/cache_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Support module for testing the cache system.
- */
diff --git a/core/modules/system/tests/modules/condition_test/condition_test.module b/core/modules/system/tests/modules/condition_test/condition_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/condition_test/condition_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module b/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module b/core/modules/system/tests/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/error_test/error_test.module b/core/modules/system/tests/modules/error_test/error_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/error_test/error_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/image_test/image_test.module b/core/modules/system/tests/modules/image_test/image_test.module
deleted file mode 100644
index 92f1ca277bc699d987246b714cd8b37b21bf0cc9..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/image_test/image_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Helper module for the image tests.
- */
diff --git a/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.module b/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.module
deleted file mode 100644
index d0dc04994ee8aa7542bdb0c320f1821548e7d425..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/invalid_module_name_over_the_maximum_allowed_character_length/invalid_module_name_over_the_maximum_allowed_character_length.module
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-
-/**
- * @file
- * Module with a module name over the maximum allowed number of characters.
- *
- * @see DRUPAL_MODULE_NAME_MAX_LENGTH
- */
diff --git a/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.module b/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.module
deleted file mode 100644
index a4abe2dafcb3fabac023b6d4630c24fed41379c0..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/module_autoload_test/module_autoload_test.module
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-
diff --git a/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.module b/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.module
deleted file mode 100644
index c37a9e2fec22886636b29e768d9859a97604066d..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/paramconverter_test/paramconverter_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Intentionally blank file.
- */
diff --git a/core/modules/system/tests/modules/requirements1_test/requirements1_test.module b/core/modules/system/tests/modules/requirements1_test/requirements1_test.module
deleted file mode 100644
index e52266b2ec72e2ffe49014b251cce8cd38034b1f..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/requirements1_test/requirements1_test.module
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-/**
- * @file
- * Tests that a module is not installed when it fails
- * hook_requirements('install').
- */
diff --git a/core/modules/system/tests/modules/requirements2_test/requirements2_test.module b/core/modules/system/tests/modules/requirements2_test/requirements2_test.module
deleted file mode 100644
index a4f43051557fecd112b318980c43f6490ac6251c..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/requirements2_test/requirements2_test.module
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-/**
- * @file
- * Tests that a module is not installed when the one it depends on fails
- * hook_requirements('install').
- */
diff --git a/core/modules/system/tests/modules/service_provider_test/service_provider_test.module b/core/modules/system/tests/modules/service_provider_test/service_provider_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/service_provider_test/service_provider_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.module b/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/system_dependencies_test/system_dependencies_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.module b/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/system_incompatible_core_version_dependencies_test/system_incompatible_core_version_dependencies_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.module b/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/system_incompatible_core_version_test/system_incompatible_core_version_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.module b/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/system_incompatible_module_version_dependencies_test/system_incompatible_module_version_dependencies_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.module b/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/system_incompatible_module_version_test/system_incompatible_module_version_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.module b/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.module
deleted file mode 100644
index 6acb6c40cacc5ff0bf1e53b1708eeaedee696c6d..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/system_mail_failure_test/system_mail_failure_test.module
+++ /dev/null
@@ -1,7 +0,0 @@
-<?php
-
-/**
- * @file
- * Disables the email function for testing purposes.
- */
-
diff --git a/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.module b/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.module
deleted file mode 100644
index 37a5536ad9bca6cc1f451e51922e0b3664445352..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_a/twig_namespace_a.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * twig_namespace_a.module
- */
diff --git a/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.module b/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.module
deleted file mode 100644
index 03d8ef7845c962c9bbe61bc375a28e6b99387395..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/twig_theme_test/modules/twig_namespace_b/twig_namespace_b.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * twig_namespace_b.module
- */
diff --git a/core/modules/system/tests/modules/update_test_0/update_test_0.module b/core/modules/system/tests/modules/update_test_0/update_test_0.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/update_test_0/update_test_0.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/update_test_1/update_test_1.module b/core/modules/system/tests/modules/update_test_1/update_test_1.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/update_test_1/update_test_1.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/update_test_2/update_test_2.module b/core/modules/system/tests/modules/update_test_2/update_test_2.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/update_test_2/update_test_2.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/update_test_3/update_test_3.module b/core/modules/system/tests/modules/update_test_3/update_test_3.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/update_test_3/update_test_3.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.module b/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/update_test_invalid_hook/update_test_invalid_hook.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.module b/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/update_test_with_7x/update_test_with_7x.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/system/tests/modules/url_alter_test/url_alter_test.module b/core/modules/system/tests/modules/url_alter_test/url_alter_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/system/tests/modules/url_alter_test/url_alter_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.module b/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/taxonomy/tests/modules/taxonomy_test_views/taxonomy_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.module b/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/tracker/tests/modules/tracker_test_views/tracker_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/update/tests/aaa_update_test/aaa_update_test.module b/core/modules/update/tests/aaa_update_test/aaa_update_test.module
deleted file mode 100644
index 4d67b8e40fcbe7e287f4289a43ceda4b44f3048d..0000000000000000000000000000000000000000
--- a/core/modules/update/tests/aaa_update_test/aaa_update_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Dummy module for testing Update status.
- */
diff --git a/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.module b/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.module
deleted file mode 100644
index 4d67b8e40fcbe7e287f4289a43ceda4b44f3048d..0000000000000000000000000000000000000000
--- a/core/modules/update/tests/modules/aaa_update_test/aaa_update_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Dummy module for testing Update status.
- */
diff --git a/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.module b/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.module
deleted file mode 100644
index 4d67b8e40fcbe7e287f4289a43ceda4b44f3048d..0000000000000000000000000000000000000000
--- a/core/modules/update/tests/modules/bbb_update_test/bbb_update_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Dummy module for testing Update status.
- */
diff --git a/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.module b/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.module
deleted file mode 100644
index 4d67b8e40fcbe7e287f4289a43ceda4b44f3048d..0000000000000000000000000000000000000000
--- a/core/modules/update/tests/modules/ccc_update_test/ccc_update_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Dummy module for testing Update status.
- */
diff --git a/core/modules/user/tests/modules/user_custom_phpass_params_test/user_custom_phpass_params_test.module b/core/modules/user/tests/modules/user_custom_phpass_params_test/user_custom_phpass_params_test.module
deleted file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000
diff --git a/core/modules/user/tests/modules/user_form_test/user_form_test.module b/core/modules/user/tests/modules/user_form_test/user_form_test.module
deleted file mode 100644
index aefc9d3538f64f8f5a1636b9bd1c59d8fe7463e9..0000000000000000000000000000000000000000
--- a/core/modules/user/tests/modules/user_form_test/user_form_test.module
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-
-/**
- * @file
- * Dummy module implementing a form to test user password validation
- */
diff --git a/core/modules/user/tests/modules/user_test_views/user_test_views.module b/core/modules/user/tests/modules/user_test_views/user_test_views.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/user/tests/modules/user_test_views/user_test_views.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/modules/views/tests/modules/views_test_config/views_test_config.module b/core/modules/views/tests/modules/views_test_config/views_test_config.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/modules/views/tests/modules/views_test_config/views_test_config.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module b/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/profiles/testing/modules/drupal_system_listing_compatible_test/drupal_system_listing_compatible_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module b/core/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
deleted file mode 100644
index b3d9bbc7f3711e882119cd6b3af051245d859d04..0000000000000000000000000000000000000000
--- a/core/profiles/testing/modules/drupal_system_listing_incompatible_test/drupal_system_listing_incompatible_test.module
+++ /dev/null
@@ -1 +0,0 @@
-<?php
diff --git a/core/profiles/testing/testing.profile b/core/profiles/testing/testing.profile
deleted file mode 100644
index 3df8aa22f51a1d7ab546e25ccfc2e953290850e9..0000000000000000000000000000000000000000
--- a/core/profiles/testing/testing.profile
+++ /dev/null
@@ -1,5 +0,0 @@
-<?php
-/**
- * @file
- * Installation profile for tests.
- */
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 4f2d27bba754a72181e2adda1906cf15377ec660..25a6933088eff5be3853dbd503bedda2c513129a 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -394,11 +394,11 @@ function simpletest_script_bootstrap() {
   // @todo Remove System module. Only needed because \Drupal\Core\Datetime\Date
   //   has a (needless) dependency on the 'date_format' entity, so calls to
   //   format_date()/format_interval() cause a plugin not found exception.
-  $module_list['system'] = 'core/modules/system/system.module';
-  $module_list['simpletest'] = 'core/modules/simpletest/simpletest.module';
-  $module_handler->setModuleList($module_list);
+  $module_handler->addModule('system', 'core/modules/system');
+  $module_handler->addModule('simpletest', 'core/modules/simpletest');
   $module_handler->loadAll();
-  $kernel->updateModules($module_list, $module_list);
+  $module_filenames = $module_handler->getModuleList();
+  $kernel->updateModules($module_filenames, $module_filenames);
 
   simpletest_classloader_register();
 }
diff --git a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
index bae3c9a33aade99ce7649004c6d3dc9eaed42520..94df7412881ce21c4a95557ab737ea7e7b762bc2 100644
--- a/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Extension/ThemeHandlerTest.php
@@ -269,7 +269,7 @@ public function testRebuildThemeData() {
     $this->assertInstanceOf('Drupal\Core\Extension\Extension', $info);
     $this->assertEquals('seven', $info->getName());
     $this->assertEquals(DRUPAL_ROOT . '/core/themes/seven/seven.info.yml', $info->getPathname());
-    $this->assertEquals(DRUPAL_ROOT . '/core/themes/seven/seven.theme', $info->uri);
+    $this->assertEquals(DRUPAL_ROOT . '/core/themes/seven/seven.theme', $info->getExtensionPathname());
     $this->assertEquals(DRUPAL_ROOT . '/core/themes/engines/twig/twig.engine', $info->owner);
     $this->assertEquals('twig', $info->prefix);
 
diff --git a/core/themes/engines/phptemplate/phptemplate.engine b/core/themes/engines/phptemplate/phptemplate.engine
index cab86fd67739557a0ae5e7849d3bb02da2372ec0..0521092eb4434797e40a8214efc1ffa7c61da2bf 100644
--- a/core/themes/engines/phptemplate/phptemplate.engine
+++ b/core/themes/engines/phptemplate/phptemplate.engine
@@ -11,9 +11,7 @@
  * Implements hook_init().
  */
 function phptemplate_init(Extension $theme) {
-  if (file_exists($theme->uri)) {
-    include_once DRUPAL_ROOT . '/' . $theme->uri;
-  }
+  $theme->load();
 }
 
 /**
diff --git a/core/themes/engines/twig/twig.engine b/core/themes/engines/twig/twig.engine
index 05fda30aacb3c65528cf7bee62d7c4303807ea92..aab2c16a5a937f3e8f5f7322f466026d61623f91 100644
--- a/core/themes/engines/twig/twig.engine
+++ b/core/themes/engines/twig/twig.engine
@@ -27,9 +27,7 @@ function twig_extension() {
  * Implements hook_init().
  */
 function twig_init(Extension $theme) {
-  if (file_exists($theme->uri)) {
-    include_once DRUPAL_ROOT . '/' . $theme->uri;
-  }
+  $theme->load();
 }
 
 /**
diff --git a/core/update.php b/core/update.php
index c94b4c5459314a2d57803cbfd18cf9542823e830..a2de6fcd547f6d7bbc3fd2be25a020a6ac2489fa 100644
--- a/core/update.php
+++ b/core/update.php
@@ -263,10 +263,9 @@ function update_access_allowed() {
   // so we fall back on requiring that the user be logged in as user #1.
   try {
     $module_handler = \Drupal::moduleHandler();
-    $module_filenames = $module_handler->getModuleList();
-    $module_filenames['user'] = 'core/modules/user/user.module';
-    $module_handler->setModuleList($module_filenames);
+    $module_handler->addModule('user', 'core/modules/user');
     $module_handler->reload();
+    $module_filenames = $module_handler->getModuleList();
     \Drupal::service('kernel')->updateModules($module_filenames, $module_filenames);
     return user_access('administer software updates');
   }