diff --git a/core/includes/ajax.inc b/core/includes/ajax.inc
index d8eb913..7d1e5be 100644
--- a/core/includes/ajax.inc
+++ b/core/includes/ajax.inc
@@ -244,7 +244,7 @@ function ajax_render($commands = array()) {
     else {
       $function = 'drupal_add_' . $type;
       $items[$type] = $function();
-      drupal_alter($type, $items[$type]);
+      drupal_container()->get('module_handler')->alter($type, $items[$type]);
       // @todo Inline CSS and JS items are indexed numerically. These can't be
       //   reliably diffed with array_diff_key(), since the number can change
       //   due to factors unrelated to the inline content, so for now, we strip
@@ -294,7 +294,7 @@ function ajax_render($commands = array()) {
   }
 
   // Allow modules to alter any Ajax response.
-  drupal_alter('ajax_render', $commands);
+  drupal_container()->get('module_handler')->alter('ajax_render', $commands);
 
   return drupal_json_encode($commands);
 }
diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 3e3853a..5994252 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -1780,7 +1780,7 @@ function watchdog($type, $message, array $variables = NULL, $severity = WATCHDOG
     );
 
     // Call the logging hooks to log/process the message
-    foreach (module_implements('watchdog') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('watchdog') as $module) {
       $function = $module . '_watchdog';
       $function($log_entry);
     }
@@ -2795,7 +2795,7 @@ function language_list($flags = LANGUAGE_CONFIGURABLE) {
 
     // Fill in master language list based on current configuration.
     $default = language_default();
-    if (language_multilingual() || module_exists('language')) {
+    if (language_multilingual() || drupal_container()->get('module_handler')->moduleExists('language')) {
       // Use language module configuration if available.
       $languages = db_query('SELECT * FROM {language} ORDER BY weight ASC, name ASC')->fetchAllAssoc('langcode', PDO::FETCH_ASSOC);
 
diff --git a/core/includes/common.inc b/core/includes/common.inc
index c9077d7..3b43cef 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -358,7 +358,7 @@ function _drupal_default_html_head() {
  */
 function drupal_get_html_head() {
   $elements = drupal_add_html_head();
-  drupal_alter('html_head', $elements);
+  drupal_container()->get('module_handler')->alter('html_head', $elements);
   return drupal_render($elements);
 }
 
@@ -697,7 +697,7 @@ function drupal_goto($path = '', array $options = array(), $http_response_code =
     $options['fragment'] = $destination['fragment'];
   }
 
-  drupal_alter('drupal_goto', $path, $options, $http_response_code);
+  drupal_container()->get('module_handler')->alter('drupal_goto', $path, $options, $http_response_code);
 
   // The 'Location' HTTP header must be absolute.
   $options['absolute'] = TRUE;
@@ -2067,7 +2067,7 @@ function url($path = NULL, array $options = array()) {
   $original_path = $path;
 
   // Allow other modules to alter the outbound URL and options.
-  drupal_alter('url_outbound', $path, $options, $original_path);
+  drupal_container()->get('module_handler')->alter('url_outbound', $path, $options, $original_path);
 
   if (isset($options['fragment']) && $options['fragment'] !== '') {
     $options['fragment'] = '#' . $options['fragment'];
@@ -2652,7 +2652,7 @@ function drupal_get_css($css = NULL, $skip_alter = FALSE) {
 
   // Allow modules and themes to alter the CSS items.
   if (!$skip_alter) {
-    drupal_alter('css', $css);
+    drupal_container()->get('module_handler')->alter('css', $css);
   }
 
   // Sort CSS items, so that they appear in the correct order.
@@ -3822,7 +3822,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALS
 
   // Allow modules to alter the JavaScript.
   if (!$skip_alter) {
-    drupal_alter('js', $javascript);
+    drupal_container()->get('module_handler')->alter('js', $javascript);
   }
 
   // Filter out elements of the given scope.
@@ -4529,7 +4529,7 @@ function drupal_get_library($module, $name = NULL) {
       $module_libraries = array();
     }
     // Allow modules to alter the module's registered libraries.
-    drupal_alter('library_info', $module_libraries, $module);
+    drupal_container()->get('module_handler')->alter('library_info', $module_libraries, $module);
 
     foreach ($module_libraries as $key => $data) {
       if (is_array($data)) {
@@ -4997,7 +4997,7 @@ function drupal_cron_run() {
   $return = FALSE;
   // Grab the defined cron queues.
   $queues = module_invoke_all('queue_info');
-  drupal_alter('queue_info', $queues);
+  drupal_container()->get('module_handler')->alter('queue_info', $queues);
 
   // Try to acquire cron lock.
   if (!lock()->acquire('cron', 240.0)) {
@@ -5014,7 +5014,7 @@ function drupal_cron_run() {
     }
 
     // Iterate through the modules calling their cron handlers (if any):
-    foreach (module_implements('cron') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('cron') as $module) {
       // Do not let an exception thrown by one module disturb another.
       try {
         module_invoke($module, 'cron');
@@ -5364,13 +5364,13 @@ function drupal_render_page($page) {
   }
 
   // Modules can add elements to $page as needed in hook_page_build().
-  foreach (module_implements('page_build') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('page_build') as $module) {
     $function = $module . '_page_build';
     $function($page);
   }
   // Modules alter the $page as needed. Blocks are populated into regions like
   // 'sidebar_first', 'footer', etc.
-  drupal_alter('page', $page);
+  drupal_container()->get('module_handler')->alter('page', $page);
 
   // If no module has taken care of the main content, add it to the page now.
   // This allows the site to still be usable even if no modules that
@@ -5976,7 +5976,7 @@ function element_info($type) {
       $cache[$element_type]['#type'] = $element_type;
     }
     // Allow modules to alter the element type defaults.
-    drupal_alter('element_info', $cache);
+    drupal_container()->get('module_handler')->alter('element_info', $cache);
   }
 
   return isset($cache[$type]) ? $cache[$type] : array();
@@ -6574,7 +6574,7 @@ function archiver_get_info() {
     if ($cache === FALSE) {
       // Rebuild the cache and save it.
       $archiver_info = module_invoke_all('archiver_info');
-      drupal_alter('archiver_info', $archiver_info);
+      drupal_container()->get('module_handler')->alter('archiver_info', $archiver_info);
       uasort($archiver_info, 'drupal_sort_weight');
       cache()->set('archiver_info', $archiver_info);
     }
@@ -6659,7 +6659,7 @@ function drupal_get_updaters() {
   $updaters = &drupal_static(__FUNCTION__);
   if (!isset($updaters)) {
     $updaters = module_invoke_all('updater_info');
-    drupal_alter('updater_info', $updaters);
+    drupal_container()->get('module_handler')->alter('updater_info', $updaters);
     uasort($updaters, 'drupal_sort_weight');
   }
   return $updaters;
@@ -6679,7 +6679,7 @@ function drupal_get_filetransfer_info() {
   $info = &drupal_static(__FUNCTION__);
   if (!isset($info)) {
     $info = module_invoke_all('filetransfer_info');
-    drupal_alter('filetransfer_info', $info);
+    drupal_container()->get('module_handler')->alter('filetransfer_info', $info);
     uasort($info, 'drupal_sort_weight');
   }
   return $info;
diff --git a/core/includes/entity.inc b/core/includes/entity.inc
index 37fb310..531907c 100644
--- a/core/includes/entity.inc
+++ b/core/includes/entity.inc
@@ -70,7 +70,7 @@ function entity_get_bundles($entity_type = NULL) {
           $bundles[$type][$type]['label'] = $entity_info['label'];
         }
       }
-      drupal_alter('entity_bundle_info', $bundles);
+      drupal_container()->get('module_handler')->alter('entity_bundle_info', $bundles);
       cache()->set("entity_bundle_info:$langcode", $bundles, CacheBackendInterface::CACHE_PERMANENT, array('entity_info' => TRUE));
     }
   }
@@ -111,7 +111,7 @@ function entity_get_view_modes($entity_type = NULL) {
           );
         }
       }
-      drupal_alter('entity_view_mode_info', $view_modes);
+      drupal_container()->get('module_handler')->alter('entity_view_mode_info', $view_modes);
       cache()->set("entity_view_mode_info:$langcode", $view_modes, CacheBackendInterface::CACHE_PERMANENT, array('entity_info' => TRUE));
     }
   }
diff --git a/core/includes/file.inc b/core/includes/file.inc
index 534d211..3505fe8 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -197,7 +197,7 @@ function file_get_stream_wrappers($filter = STREAM_WRAPPERS_ALL) {
       // Add defaults.
       $wrappers[$scheme] += array('type' => STREAM_WRAPPERS_NORMAL);
     }
-    drupal_alter('stream_wrappers', $wrappers);
+    drupal_container()->get('module_handler')->alter('stream_wrappers', $wrappers);
     $existing = stream_get_wrappers();
     foreach ($wrappers as $scheme => $info) {
       // We only register classes that implement our interface.
@@ -436,7 +436,7 @@ function file_stream_wrapper_get_instance_by_scheme($scheme) {
 function file_create_url($uri) {
   // Allow the URI to be altered, e.g. to serve a file from a CDN or static
   // file server.
-  drupal_alter('file_url', $uri);
+  drupal_container()->get('module_handler')->alter('file_url', $uri);
 
   $scheme = file_uri_scheme($uri);
 
diff --git a/core/includes/file.mimetypes.inc b/core/includes/file.mimetypes.inc
index 7468a60..bd8e56c 100644
--- a/core/includes/file.mimetypes.inc
+++ b/core/includes/file.mimetypes.inc
@@ -20,7 +20,7 @@ function file_mimetype_mapping() {
   if (!isset($mapping)) {
     $mapping = file_default_mimetype_mapping();
     // Allow modules to alter the default mapping.
-    drupal_alter('file_mimetype_mapping', $mapping);
+    drupal_container()->get('module_handler')->alter('file_mimetype_mapping', $mapping);
   }
   return $mapping;
 }
diff --git a/core/includes/form.inc b/core/includes/form.inc
index bba0000..82c766f 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -1126,7 +1126,7 @@ function drupal_prepare_form($form_id, &$form, &$form_state) {
     $hooks[] = 'form_' . $form_state['build_info']['base_form_id'];
   }
   $hooks[] = 'form_' . $form_id;
-  drupal_alter($hooks, $form, $form_state, $form_id);
+  drupal_container()->get('module_handler')->alter($hooks, $form, $form_state, $form_id);
 }
 
 
@@ -5085,7 +5085,7 @@ function batch_process($redirect = NULL, $url = 'batch', $redirect_callback = 'd
     // The batch is now completely built. Allow other modules to make changes
     // to the batch so that it is easier to reuse batch processes in other
     // environments.
-    drupal_alter('batch', $batch);
+    drupal_container()->get('module_handler')->alter('batch', $batch);
 
     // Assign an arbitrary id: don't rely on a serial column in the 'batch'
     // table, since non-progressive batches skip database storage completely.
diff --git a/core/includes/install.inc b/core/includes/install.inc
index d33bb0a..dd0e98e 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -844,7 +844,7 @@ function drupal_requirements_severity(&$requirements) {
  */
 function drupal_check_module($module) {
   module_load_install($module);
-  if (module_hook($module, 'requirements')) {
+  if (drupal_container()->get('module_handler')->implementsHook($module, 'requirements')) {
     // Check requirements
     $requirements = module_invoke($module, 'requirements', 'install');
     if (is_array($requirements) && drupal_requirements_severity($requirements) == REQUIREMENT_ERROR) {
diff --git a/core/includes/language.inc b/core/includes/language.inc
index 74d5752..583ba98 100644
--- a/core/includes/language.inc
+++ b/core/includes/language.inc
@@ -152,7 +152,7 @@ function language_types_info() {
   if (!isset($language_types)) {
     $language_types = module_invoke_all('language_types_info');
     // Let other modules alter the list of language types.
-    drupal_alter('language_types_info', $language_types);
+    drupal_container()->get('module_handler')->alter('language_types_info', $language_types);
   }
 
   return $language_types;
@@ -318,7 +318,7 @@ function language_negotiation_get_switch_links($type, $path) {
 
       if (!empty($result)) {
         // Allow modules to provide translations for specific links.
-        drupal_alter('language_switch_links', $result, $type, $path);
+        drupal_container()->get('module_handler')->alter('language_switch_links', $result, $type, $path);
         $links = (object) array('links' => $result, 'method_id' => $method_id);
         break;
       }
@@ -420,7 +420,7 @@ function language_negotiation_info() {
     );
 
      // Let other modules alter the list of language negotiation methods.
-     drupal_alter('language_negotiation_info', $negotiation_info);
+     drupal_container()->get('module_handler')->alter('language_negotiation_info', $negotiation_info);
   }
 
   return $negotiation_info;
@@ -542,7 +542,7 @@ function language_fallback_get_candidates($type = LANGUAGE_TYPE_CONTENT) {
     $fallback_candidates[] = LANGUAGE_NOT_SPECIFIED;
 
     // Let other modules hook in and add/change candidates.
-    drupal_alter('language_fallback_candidates', $fallback_candidates);
+    drupal_container()->get('module_handler')->alter('language_fallback_candidates', $fallback_candidates);
   }
 
   return $fallback_candidates;
diff --git a/core/includes/mail.inc b/core/includes/mail.inc
index c4ba356..d68d867 100644
--- a/core/includes/mail.inc
+++ b/core/includes/mail.inc
@@ -167,7 +167,7 @@ function drupal_mail($module, $key, $to, $langcode, $params = array(), $from = N
   }
 
   // Invoke hook_mail_alter() to allow all modules to alter the resulting e-mail.
-  drupal_alter('mail', $message);
+  drupal_container()->get('module_handler')->alter('mail', $message);
 
   // Retrieve the responsible implementation for this message.
   $system = drupal_mail_system($module, $key);
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index 006730e..433bb7b 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -471,7 +471,7 @@ function menu_get_item($path = NULL, $router_item = NULL) {
     if ($router_item) {
       // Allow modules to alter the router item before it is translated and
       // checked for access.
-      drupal_alter('menu_get_item', $router_item, $path, $original_map);
+      drupal_container()->get('module_handler')->alter('menu_get_item', $router_item, $path, $original_map);
 
       $map = _menu_translate($router_item, $original_map);
       $router_item['original_map'] = $original_map;
@@ -913,7 +913,7 @@ function _menu_link_translate(&$item, $translate = FALSE) {
   // options array. For performance reasons we only invoke this hook if the link
   // has the 'alter' flag set in the options array.
   if (!empty($item['options']['alter'])) {
-    drupal_alter('translated_menu_link', $item, $map);
+    drupal_container()->get('module_handler')->alter('translated_menu_link', $item, $map);
   }
 
   return $map;
@@ -1668,7 +1668,7 @@ function menu_get_active_help() {
 
   $arg = drupal_help_arg(arg(NULL));
 
-  foreach (module_implements('help') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('help') as $module) {
     $function = $module . '_help';
     // Lookup help for this path.
     if ($help = $function($router_path, $arg)) {
@@ -1741,7 +1741,7 @@ function menu_list_system_menus() {
  */
 function menu_main_menu() {
   $config = config('menu.settings');
-  $menu_enabled = module_exists('menu');
+  $menu_enabled = drupal_container()->get('module_handler')->moduleExists('menu');
   // When menu module is not enabled, we need a hardcoded default value.
   $main_links_source = $menu_enabled ? $config->get('main_links') : 'main';
   return menu_navigation_links($main_links_source);
@@ -1752,7 +1752,7 @@ function menu_main_menu() {
  */
 function menu_secondary_menu() {
   $config = config('menu.settings');
-  $menu_enabled = module_exists('menu');
+  $menu_enabled = drupal_container()->get('module_handler')->moduleExists('menu');
   // When menu module is not enabled, we need a hardcoded default value.
   $main_links_source = $menu_enabled ? $config->get('main_links') : 'main';
   $secondary_links_source = $menu_enabled ? $config->get('secondary_links') : 'account';
@@ -2152,7 +2152,7 @@ function menu_contextual_links($module, $parent_path, $args) {
   }
 
   // Allow modules to alter contextual links.
-  drupal_alter('menu_contextual_links', $links, $router_item, $root_path);
+  drupal_container()->get('module_handler')->alter('menu_contextual_links', $links, $router_item, $root_path);
 
   // Performance: If the current user does not have access to any links for this
   // router path and no other module added further links, we assign FALSE here
@@ -2512,7 +2512,7 @@ function menu_get_active_breadcrumb() {
 
     // Allow modules to alter the breadcrumb, if possible, as that is much
     // faster than rebuilding an entirely new active trail.
-    drupal_alter('menu_breadcrumb', $active_trail, $item);
+    drupal_container()->get('module_handler')->alter('menu_breadcrumb', $active_trail, $item);
 
     // Don't show a link to the current page in the breadcrumb trail.
     $end = end($active_trail);
@@ -2638,7 +2638,7 @@ function menu_router_build() {
   // We need to manually call each module so that we can know which module
   // a given item came from.
   $callbacks = array();
-  foreach (module_implements('menu') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('menu') as $module) {
     $router_items = call_user_func($module . '_menu');
     if (isset($router_items) && is_array($router_items)) {
       foreach (array_keys($router_items) as $path) {
@@ -2648,7 +2648,7 @@ function menu_router_build() {
     }
   }
   // Alter the menu as defined in modules, keys are like user/%user.
-  drupal_alter('menu', $callbacks);
+  drupal_container()->get('module_handler')->alter('menu', $callbacks);
   list($menu, $masks) = _menu_router_build($callbacks);
   _menu_router_cache($menu);
 
@@ -2685,7 +2685,7 @@ function menu_get_router() {
  * @todo This function should be removed/refactored.
  */
 function _menu_navigation_links_rebuild($menu) {
-  if (module_exists('menu_link')) {
+  if (drupal_container()->get('module_handler')->moduleExists('menu_link')) {
     $menu_link_controller = drupal_container()->get('plugin.manager.entity')
       ->getStorageController('menu_link');
   }
diff --git a/core/includes/path.inc b/core/includes/path.inc
index 6e2c19e..4c8ca5c 100644
--- a/core/includes/path.inc
+++ b/core/includes/path.inc
@@ -161,7 +161,7 @@ function path_get_admin_paths() {
   $patterns = &drupal_static(__FUNCTION__);
   if (!isset($patterns)) {
     $paths = module_invoke_all('admin_paths');
-    drupal_alter('admin_paths', $paths);
+    drupal_container()->get('module_handler')->alter('admin_paths', $paths);
     // Combine all admin paths into one array, and likewise for non-admin paths,
     // for easier handling.
     $patterns = array();
diff --git a/core/includes/schema.inc b/core/includes/schema.inc
index e599923..c233ccc 100644
--- a/core/includes/schema.inc
+++ b/core/includes/schema.inc
@@ -81,7 +81,7 @@ function drupal_get_complete_schema($rebuild = FALSE) {
 
       require_once DRUPAL_ROOT . '/core/includes/common.inc';
       // Invoke hook_schema for all modules.
-      foreach (module_implements('schema') as $module) {
+      foreach (drupal_container()->get('module_handler')->getImplementations('schema') as $module) {
         // Cast the result of hook_schema() to an array, as a NULL return value
         // would cause array_merge() to set the $schema variable to NULL as well.
         // That would break modules which use $schema further down the line.
@@ -91,7 +91,7 @@ function drupal_get_complete_schema($rebuild = FALSE) {
         _drupal_schema_initialize($current, $module);
         $schema = array_merge($schema, $current);
       }
-      drupal_alter('schema', $schema);
+      drupal_container()->get('module_handler')->alter('schema', $schema);
 
       if ($rebuild) {
         cache()->deleteTags(array('schema' => TRUE));
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 8172073..87275a4 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -639,7 +639,7 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) {
     $cache = $cached->data;
   }
   else {
-    foreach (module_implements('theme') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('theme') as $module) {
       _theme_process_registry($cache, $module, 'module', $module, drupal_get_path('module', $module));
     }
     // Only cache this registry if all modules are loaded.
@@ -667,7 +667,7 @@ function _theme_build_registry($theme, $base_theme, $theme_engine) {
   _theme_process_registry($cache, $theme->name, 'theme', $theme->name, dirname($theme->filename));
 
   // Let modules alter the registry.
-  drupal_alter('theme_registry', $cache);
+  drupal_container()->get('module_handler')->alter('theme_registry', $cache);
 
   // Optimize the registry to not have empty arrays for functions.
   foreach ($cache as $hook => $info) {
@@ -2668,7 +2668,7 @@ function _template_preprocess_default_variables() {
   }
 
   // Give modules a chance to alter the default template variables.
-  drupal_alter('template_preprocess_default_variables', $variables);
+  drupal_container()->get('module_handler')->alter('template_preprocess_default_variables', $variables);
 
   return $variables;
 }
diff --git a/core/includes/token.inc b/core/includes/token.inc
index b1dd717..9d0ebcc 100644
--- a/core/includes/token.inc
+++ b/core/includes/token.inc
@@ -185,7 +185,7 @@ function token_generate($type, array $tokens, array $data = array(), array $opti
     'data' => $data,
     'options' => $options,
   );
-  drupal_alter('tokens', $replacements, $context);
+  drupal_container()->get('module_handler')->alter('tokens', $replacements, $context);
 
   return $replacements;
 }
@@ -259,7 +259,7 @@ function token_info() {
   $data = &drupal_static(__FUNCTION__);
   if (!isset($data)) {
     $data = module_invoke_all('token_info');
-    drupal_alter('token_info', $data);
+    drupal_container()->get('module_handler')->alter('token_info', $data);
   }
   return $data;
 }
diff --git a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
index d7fc8d6..8b78f84 100644
--- a/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
+++ b/core/lib/Drupal/Component/Plugin/Discovery/DerivativeDiscoveryDecorator.php
@@ -66,7 +66,7 @@ protected function getDerivatives(array $base_plugin_definitions) {
     $plugin_definitions = array();
     foreach ($base_plugin_definitions as $base_plugin_id => $plugin_definition) {
       // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
-      if (isset($plugin_definition['module']) && !module_exists($plugin_definition['module'])) {
+      if (isset($plugin_definition['module']) && !drupal_container()->get('module_handler')->moduleExists($plugin_definition['module'])) {
         continue;
       }
 
diff --git a/core/lib/Drupal/Core/Ajax/AjaxResponse.php b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
index 83124e8..2069e2d 100644
--- a/core/lib/Drupal/Core/Ajax/AjaxResponse.php
+++ b/core/lib/Drupal/Core/Ajax/AjaxResponse.php
@@ -86,7 +86,7 @@ protected function ajaxRender(Request $request) {
       else {
         $function = 'drupal_add_' . $type;
         $items[$type] = $function();
-        drupal_alter($type, $items[$type]);
+        drupal_container()->get('module_handler')->alter($type, $items[$type]);
         // @todo Inline CSS and JS items are indexed numerically. These can't be
         //   reliably diffed with array_diff_key(), since the number can change
         //   due to factors unrelated to the inline content, so for now, we
@@ -137,7 +137,7 @@ protected function ajaxRender(Request $request) {
     }
 
     $commands = $this->commands;
-    drupal_alter('ajax_render', $commands);
+    drupal_container()->get('module_handler')->alter('ajax_render', $commands);
 
     return $commands;
   }
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
index a957e4d..3b6f195 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
@@ -256,7 +256,7 @@ protected function buildQuery($ids, $revision_id = FALSE) {
    */
   protected function attachLoad(&$queried_entities, $revision_id = FALSE) {
     // Call hook_entity_load().
-    foreach (module_implements('entity_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('entity_load') as $module) {
       $function = $module . '_entity_load';
       $function($queried_entities, $this->entityType);
     }
@@ -264,7 +264,7 @@ protected function attachLoad(&$queried_entities, $revision_id = FALSE) {
     // always the queried entities, followed by additional arguments set in
     // $this->hookLoadArguments.
     $args = array_merge(array($queried_entities), $this->hookLoadArguments);
-    foreach (module_implements($this->entityType . '_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations($this->entityType . '_load') as $module) {
       call_user_func_array($module . '_' . $this->entityType . '_load', $args);
     }
   }
diff --git a/core/lib/Drupal/Core/Database/Query/Select.php b/core/lib/Drupal/Core/Database/Query/Select.php
index 1bfe9a0..6a92a91 100644
--- a/core/lib/Drupal/Core/Database/Query/Select.php
+++ b/core/lib/Drupal/Core/Database/Query/Select.php
@@ -391,7 +391,7 @@ public function preExecute(SelectInterface $query = NULL) {
       foreach ($this->alterTags as $tag => $value) {
         $hooks[] = 'query_' . $tag;
       }
-      drupal_alter($hooks, $query);
+      drupal_container()->get('module_handler')->alter($hooks, $query);
     }
 
     $this->prepared = TRUE;
diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php
index 9092a13..e28ebc9 100644
--- a/core/lib/Drupal/Core/Entity/DatabaseStorageController.php
+++ b/core/lib/Drupal/Core/Entity/DatabaseStorageController.php
@@ -396,7 +396,7 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
     }
 
     // Call hook_entity_load().
-    foreach (module_implements('entity_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('entity_load') as $module) {
       $function = $module . '_entity_load';
       $function($queried_entities, $this->entityType);
     }
@@ -404,7 +404,7 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
     // always the queried entities, followed by additional arguments set in
     // $this->hookLoadArguments.
     $args = array_merge(array($queried_entities), $this->hookLoadArguments);
-    foreach (module_implements($this->entityType . '_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations($this->entityType . '_load') as $module) {
       call_user_func_array($module . '_' . $this->entityType . '_load', $args);
     }
   }
@@ -687,7 +687,7 @@ public function getFieldDefinitions(array $constraints) {
       $this->entityFieldInfo = NestedArray::mergeDeep($this->entityFieldInfo, $result);
 
       $hooks = array('entity_field_info', $this->entityType . '_property_info');
-      drupal_alter($hooks, $this->entityFieldInfo, $this->entityType);
+      drupal_container()->get('module_handler')->alter($hooks, $this->entityFieldInfo, $this->entityType);
 
       // Enforce fields to be multiple by default.
       foreach ($this->entityFieldInfo['definitions'] as &$definition) {
diff --git a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php
index e8998f8..92158ea 100644
--- a/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php
+++ b/core/lib/Drupal/Core/Entity/DatabaseStorageControllerNG.php
@@ -171,7 +171,7 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
     }
 
     // Call hook_entity_load().
-    foreach (module_implements('entity_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('entity_load') as $module) {
       $function = $module . '_entity_load';
       $function($queried_entities, $this->entityType);
     }
@@ -179,7 +179,7 @@ protected function attachLoad(&$queried_entities, $load_revision = FALSE) {
     // always the queried entities, followed by additional arguments set in
     // $this->hookLoadArguments.
     $args = array_merge(array($queried_entities), $this->hookLoadArguments);
-    foreach (module_implements($this->entityType . '_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations($this->entityType . '_load') as $module) {
       call_user_func_array($module . '_' . $this->entityType . '_load', $args);
     }
   }
diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php
index 566b2cc..53fbb13 100644
--- a/core/lib/Drupal/Core/Entity/EntityManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityManager.php
@@ -187,7 +187,7 @@ public function processDefinition(&$definition, $plugin_id) {
     parent::processDefinition($definition, $plugin_id);
 
     // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
-    if (!module_exists($definition['module'])) {
+    if (!drupal_container()->get('module_handler')->moduleExists($definition['module'])) {
       $definition = NULL;
       return;
     }
diff --git a/core/lib/Drupal/Core/Entity/EntityRenderController.php b/core/lib/Drupal/Core/Entity/EntityRenderController.php
index 53457aa..4a1e001 100644
--- a/core/lib/Drupal/Core/Entity/EntityRenderController.php
+++ b/core/lib/Drupal/Core/Entity/EntityRenderController.php
@@ -106,7 +106,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
 
       // Allow modules to change the view mode.
       $entity_view_mode = $view_mode;
-      drupal_alter('entity_view_mode', $entity_view_mode, $entity, $context);
+      drupal_container()->get('module_handler')->alter('entity_view_mode', $entity_view_mode, $entity, $context);
       // Store entities for rendering by view_mode.
       $view_modes[$entity_view_mode][$entity->id()] = $entity;
 
@@ -121,7 +121,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
           'bundle' => $bundle,
           'view_mode' => $entity_view_mode,
         );
-        drupal_alter('entity_display', $display, $display_context);
+        drupal_container()->get('module_handler')->alter('entity_display', $display, $display_context);
 
         $displays[$entity_view_mode][$bundle] = $display;
       }
@@ -157,7 +157,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
       $build[$key]['#weight'] = $weight++;
 
       // Allow modules to modify the render array.
-      drupal_alter(array($view_hook, 'entity_view'), $build[$key], $entity, $display);
+      drupal_container()->get('module_handler')->alter(array($view_hook, 'entity_view'), $build[$key], $entity, $display);
     }
 
     return $build;
diff --git a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
index 885db53..7833273 100644
--- a/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/MaintenanceModeSubscriber.php
@@ -30,7 +30,7 @@ public function onKernelRequestMaintenanceModeCheck(GetResponseEvent $event) {
     // Allow other modules to change the site status but not the path. The path
     // can be changed using a request listener.
     $read_only_path = $event->getRequest()->attributes->get('system_path');
-    drupal_alter('menu_site_status', $status, $read_only_path);
+    drupal_container()->get('module_handler')->alter('menu_site_status', $status, $read_only_path);
 
     // Only continue if the site is online.
     if ($status != MENU_SITE_ONLINE) {
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/AlterDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/AlterDecorator.php
index 8bcee3f..5dde333 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/AlterDecorator.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/AlterDecorator.php
@@ -56,7 +56,7 @@ public function getDefinition($plugin_id) {
    */
   public function getDefinitions() {
     $definitions = $this->decorated->getDefinitions();
-    drupal_alter($this->hook, $definitions);
+    drupal_container()->get('module_handler')->alter($this->hook, $definitions);
     return $definitions;
   }
 
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php b/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php
index 0c77a2f..b0aea70 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/HookDiscovery.php
@@ -45,7 +45,7 @@ public function getDefinition($plugin_id) {
    */
   public function getDefinitions() {
     $definitions = array();
-    foreach (module_implements($this->hook) as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations($this->hook) as $module) {
       $function = $module . '_' . $this->hook;
       foreach ($function() as $plugin_id => $definition) {
         $definition['module'] = $module;
diff --git a/core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php b/core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php
index 7ba8913..ecfe541 100644
--- a/core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php
+++ b/core/lib/Drupal/Core/Plugin/Discovery/InfoHookDecorator.php
@@ -54,7 +54,7 @@ public function getDefinition($plugin_id) {
    */
   public function getDefinitions() {
     $definitions = $this->decorated->getDefinitions();
-    foreach (module_implements($this->hook) as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations($this->hook) as $module) {
       $function = $module . '_' . $this->hook;
       $function($definitions);
     }
diff --git a/core/lib/Drupal/Core/Transliteration/PHPTransliteration.php b/core/lib/Drupal/Core/Transliteration/PHPTransliteration.php
index 6af4708..5b691d6 100644
--- a/core/lib/Drupal/Core/Transliteration/PHPTransliteration.php
+++ b/core/lib/Drupal/Core/Transliteration/PHPTransliteration.php
@@ -27,7 +27,7 @@ protected function readLanguageOverrides($langcode) {
     parent::readLanguageOverrides($langcode);
 
     // Let modules alter the language-specific overrides.
-    drupal_alter('transliteration_overrides', $this->languageOverrides[$langcode], $langcode);
+    drupal_container()->get('module_handler')->alter('transliteration_overrides', $this->languageOverrides[$langcode], $langcode);
   }
 
 }
diff --git a/core/modules/action/action.module b/core/modules/action/action.module
index 6396caf..ba705ef 100644
--- a/core/modules/action/action.module
+++ b/core/modules/action/action.module
@@ -244,7 +244,7 @@ function action_list($reset = FALSE) {
   $actions = &drupal_static(__FUNCTION__);
   if (!isset($actions) || $reset) {
     $actions = module_invoke_all('action_info');
-    drupal_alter('action_info', $actions);
+    drupal_container()->get('module_handler')->alter('action_info', $actions);
   }
 
   // See module_implements() for an explanation of this cast.
diff --git a/core/modules/action/tests/action_loop_test/action_loop_test.module b/core/modules/action/tests/action_loop_test/action_loop_test.module
index 8c3b98d..6d23742 100644
--- a/core/modules/action/tests/action_loop_test/action_loop_test.module
+++ b/core/modules/action/tests/action_loop_test/action_loop_test.module
@@ -74,7 +74,7 @@ function watchdog_skip_semaphore($type, $message, $variables = array(), $severit
   );
 
   // Call the logging hooks to log/process the message
-  foreach (module_implements('watchdog') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('watchdog') as $module) {
     module_invoke($module, 'watchdog', $log_entry);
   }
 }
diff --git a/core/modules/aggregator/aggregator.admin.inc b/core/modules/aggregator/aggregator.admin.inc
index 62cfe83..2a0a5df 100644
--- a/core/modules/aggregator/aggregator.admin.inc
+++ b/core/modules/aggregator/aggregator.admin.inc
@@ -354,7 +354,7 @@ function aggregator_admin_form($form, $form_state) {
   }
 
   // Get all available parsers.
-  $parsers = module_implements('aggregator_parse');
+  $parsers = drupal_container()->get('module_handler')->getImplementations('aggregator_parse');
   foreach ($parsers as $k => $module) {
     if ($info = module_invoke($module, 'aggregator_parse_info')) {
       $label = $info['title'] . ' <span class="description">' . $info['description'] . '</span>';
@@ -367,7 +367,7 @@ function aggregator_admin_form($form, $form_state) {
   }
 
   // Get all available processors.
-  $processors = module_implements('aggregator_process');
+  $processors = drupal_container()->get('module_handler')->getImplementations('aggregator_process');
   foreach ($processors as $k => $module) {
     if ($info = module_invoke($module, 'aggregator_process_info')) {
       $label = $info['title'] . ' <span class="description">' . $info['description'] . '</span>';
@@ -513,7 +513,7 @@ function aggregator_form_category_validate($form, &$form_state) {
 function aggregator_form_category_submit($form, &$form_state) {
   // @todo Replicate this cache invalidation when these ops are separated.
   // Invalidate the block cache to update aggregator category-based derivatives.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
   }
   if ($form_state['values']['op'] == t('Delete')) {
diff --git a/core/modules/aggregator/aggregator.module b/core/modules/aggregator/aggregator.module
index 7298e4c..23b68f3 100644
--- a/core/modules/aggregator/aggregator.module
+++ b/core/modules/aggregator/aggregator.module
@@ -367,7 +367,7 @@ function aggregator_save_category($edit) {
         ->condition('cid', $edit['cid'])
         ->execute();
       // Make sure there is no active block for this category.
-      if (module_exists('block')) {
+      if (drupal_container()->get('module_handler')->moduleExists('block')) {
         foreach (entity_load_multiple_by_properties('block', array('plugin' => 'aggregator_category_block:' . $edit['cid'])) as $block) {
           $block->delete();
         }
@@ -387,7 +387,7 @@ function aggregator_save_category($edit) {
       ->execute();
     $op = 'insert';
   }
-  if (isset($op) && module_exists('menu_link')) {
+  if (isset($op) && drupal_container()->get('module_handler')->moduleExists('menu_link')) {
     menu_link_maintain('aggregator', $op, $link_path, $edit['title']);
   }
 }
@@ -576,14 +576,14 @@ function aggregator_filter_xss($value) {
 function aggregator_sanitize_configuration() {
   $reset = FALSE;
   list($fetcher, $parser, $processors) = _aggregator_get_variables();
-  if (!module_exists($fetcher)) {
+  if (!drupal_container()->get('module_handler')->moduleExists($fetcher)) {
     $reset = TRUE;
   }
-  if (!module_exists($parser)) {
+  if (!drupal_container()->get('module_handler')->moduleExists($parser)) {
     $reset = TRUE;
   }
   foreach ($processors as $processor) {
-    if (!module_exists($processor)) {
+    if (!drupal_container()->get('module_handler')->moduleExists($processor)) {
       $reset = TRUE;
       break;
     }
diff --git a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
index d8c052c..d0b3f6c 100644
--- a/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
+++ b/core/modules/aggregator/lib/Drupal/aggregator/FeedStorageController.php
@@ -47,7 +47,7 @@ protected function preDelete($entities) {
     parent::preDelete($entities);
 
     // Invalidate the block cache to update aggregator feed-based derivatives.
-    if (module_exists('block')) {
+    if (drupal_container()->get('module_handler')->moduleExists('block')) {
       drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
     }
     foreach ($entities as $entity) {
@@ -83,7 +83,7 @@ protected function preSave(EntityInterface $entity) {
     parent::preSave($entity);
 
     // Invalidate the block cache to update aggregator feed-based derivatives.
-    if (module_exists('block')) {
+    if (drupal_container()->get('module_handler')->moduleExists('block')) {
       drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
     }
     // An existing feed is being modified, delete the category listings.
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 222d09a..234acb6 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -57,7 +57,7 @@ function block_help($path, $arg) {
       $output .= '<dd>' . t('When working with blocks, remember that all themes do <em>not</em> implement the same regions, or display regions in the same way. Blocks are positioned on a per-theme basis. Users with the <em>Administer blocks</em> permission can disable blocks. Disabled blocks are listed on the <a href="@blocks">Blocks administration page</a>, but are not displayed in any region.', array('@block' => 'http://drupal.org/documentation/modules/block', '@blocks' => url('admin/structure/block'))) . '</dd>';
       $output .= '<dt>' . t('Controlling visibility') . '</dt>';
       $output .= '<dd>' . t('Blocks can be configured to be visible only on certain pages, only to users of certain roles, or only on pages displaying certain <a href="@content-type">content types</a>. Some dynamic blocks, such as those generated by modules, will be displayed only on certain pages.', array('@content-type' => url('admin/structure/types'), '@user' => url('user'))) . '</dd>';
-      if (module_exists('custom_block')) {
+      if (drupal_container()->get('module_handler')->moduleExists('custom_block')) {
         $output .= '<dt>' . t('Creating custom blocks') . '</dt>';
         $output .= '<dd>' . t('Users with the <em>Administer blocks</em> permission can <a href="@block-add">add custom blocks</a>, which are then listed on the <a href="@blocks">Blocks administration page</a>. Once created, custom blocks behave just like default and module-generated blocks.', array('@blocks' => url('admin/structure/block'), '@block-add' => url('admin/structure/block/list/block_plugin_ui:' . variable_get('theme_default', 'stark') . '/add/custom_blocks'))) . '</dd>';
       }
@@ -308,7 +308,7 @@ function _block_get_renderable_region($list = array()) {
   // chances of having unwanted output get in the cache and later be served
   // to other users. We therefore exclude user 1 from block caching.
   $not_cacheable = $GLOBALS['user']->uid == 1 ||
-    count(module_implements('node_grants')) ||
+    count(drupal_container()->get('module_handler')->getImplementations('node_grants')) ||
     !in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD'));
 
   foreach ($list as $key => $block) {
diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module
index 83117c8..11e8b37 100644
--- a/core/modules/block/custom_block/custom_block.module
+++ b/core/modules/block/custom_block/custom_block.module
@@ -189,7 +189,7 @@ function custom_block_load($id) {
  */
 function custom_block_entity_info_alter(&$types) {
   // Add a translation handler for fields if the language module is enabled.
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $types['custom_block']['translation']['custom_block'] = TRUE;
   }
 }
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
index 77664e9..8d39512 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeFormController.php
@@ -52,7 +52,7 @@ public function form(array $form, array &$form_state, EntityInterface $block_typ
       '#description' => t('Create a new revision by default for this block type.')
     );
 
-    if (module_exists('translation_entity')) {
+    if (drupal_container()->get('module_handler')->moduleExists('translation_entity')) {
       $form['language'] = array(
         '#type' => 'details',
         '#title' => t('Language settings'),
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php
index 8ef270c..d3c0ba0 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/CustomBlockTypeListController.php
@@ -20,7 +20,7 @@ class CustomBlockTypeListController extends ConfigEntityListController {
    */
   public function getOperations(EntityInterface $entity) {
     $operations = parent::getOperations($entity);
-    if (module_exists('field_ui')) {
+    if (drupal_container()->get('module_handler')->moduleExists('field_ui')) {
       $uri = $entity->uri();
       $operations['manage-fields'] = array(
         'title' => t('Manage fields'),
diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlockBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlockBlock.php
index ce89a58..fca6161 100644
--- a/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlockBlock.php
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Plugin/block/block/CustomBlockBlock.php
@@ -67,7 +67,7 @@ public function blockForm($form, &$form_state) {
    */
   public function blockSubmit($form, &$form_state) {
     // Invalidate the block cache to update custom block-based derivatives.
-    if (module_exists('block')) {
+    if (drupal_container()->get('module_handler')->moduleExists('block')) {
       drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
     }
   }
diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php
index 9e5bf6c..724bd89 100644
--- a/core/modules/block/lib/Drupal/block/BlockBase.php
+++ b/core/modules/block/lib/Drupal/block/BlockBase.php
@@ -183,7 +183,7 @@ public function access() {
         // listed in $block->pages.
         $page_match = !($visibility['path']['visibility'] xor $page_match);
       }
-      elseif (module_exists('php')) {
+      elseif (drupal_container()->get('module_handler')->moduleExists('php')) {
         $page_match = php_eval($visibility['path']['pages']);
       }
 
@@ -202,7 +202,7 @@ public function access() {
     }
 
     // Check other modules for block access rules.
-    foreach (module_implements('block_access') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('block_access') as $module) {
       if (module_invoke($module, 'block_access', $this->entity) === FALSE) {
         return FALSE;
       }
@@ -306,7 +306,7 @@ public function form($form, &$form_state) {
       );
       $description = t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %user for the current user's page and %user-wildcard for every user page. %front is the front page.", array('%user' => 'user', '%user-wildcard' => 'user/*', '%front' => '<front>'));
 
-      if (module_exists('php') && $access) {
+      if (drupal_container()->get('module_handler')->moduleExists('php') && $access) {
         $options += array(BLOCK_VISIBILITY_PHP => t('Pages on which this PHP code returns <code>TRUE</code> (experts only)'));
         $title = t('Pages or PHP code');
         $description .= ' ' . t('If the PHP option is chosen, enter PHP code between %php. Note that executing incorrect PHP code can break your Drupal site.', array('%php' => '<?php ?>'));
@@ -329,7 +329,7 @@ public function form($form, &$form_state) {
     }
 
     // Configure the block visibility per language.
-    if (module_exists('language') && language_multilingual()) {
+    if (drupal_container()->get('module_handler')->moduleExists('language') && language_multilingual()) {
       $configurable_language_types = language_types_get_configurable();
 
       // Fetch languages.
diff --git a/core/modules/block/lib/Drupal/block/BlockRenderController.php b/core/modules/block/lib/Drupal/block/BlockRenderController.php
index e705310..25c6ec5 100644
--- a/core/modules/block/lib/Drupal/block/BlockRenderController.php
+++ b/core/modules/block/lib/Drupal/block/BlockRenderController.php
@@ -81,7 +81,7 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
       // All blocks, even when empty, should be available for altering.
       $id = str_replace(':', '__', $entity->get('plugin'));
       list(, $name) = $entity->id();
-      drupal_alter(array('block_view', "block_view_$id", "block_view_$name"), $build[$entity_id], $entity);
+      drupal_container()->get('module_handler')->alter(array('block_view', "block_view_$id", "block_view_$name"), $build[$entity_id], $entity);
 
     }
     return $build;
diff --git a/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php b/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php
index d2bf1a7..8dbe106 100644
--- a/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php
+++ b/core/modules/block/lib/Drupal/block/Plugin/Core/Entity/Block.php
@@ -129,7 +129,7 @@ public function getPlugin() {
       catch (PluginException $e) {
         // Ignore blocks belonging to disabled modules, but re-throw valid
         // exceptions when the module is enabled and the plugin is misconfigured.
-        if (empty($this->module) || module_exists($this->module)) {
+        if (empty($this->module) || drupal_container()->get('module_handler')->moduleExists($this->module)) {
           throw $e;
         }
       }
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index 27dbfa1..7cdedd8 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -341,7 +341,7 @@ function moveBlockToRegion(array $block, $region) {
    */
   function testBlockRehash() {
     module_enable(array('block_test'));
-    $this->assertTrue(module_exists('block_test'), 'Test block module enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('block_test'), 'Test block module enabled.');
 
     // Clear the block cache to load the block_test module's block definitions.
     $this->container->get('plugin.manager.block')->clearCachedDefinitions();
@@ -375,7 +375,7 @@ function testBlockRehash() {
    */
   function testBlockModuleDisable() {
     module_enable(array('block_test'));
-    $this->assertTrue(module_exists('block_test'), 'Test block module enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('block_test'), 'Test block module enabled.');
 
     // Clear the block cache to load the block_test module's block definitions.
     $manager = $this->container->get('plugin.manager.block');
@@ -394,7 +394,7 @@ function testBlockModuleDisable() {
 
     // Disable the block test module and refresh the definitions cache.
     module_disable(array('block_test'), FALSE);
-    $this->assertFalse(module_exists('block_test'), 'Test block module disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('block_test'), 'Test block module disabled.');
     $manager->clearCachedDefinitions();
 
     // Ensure that the block administration page still functions as expected.
@@ -439,7 +439,7 @@ function testBlockModuleDisable() {
 
     // Re-enable the module and refresh the definitions cache.
     module_enable(array('block_test'), FALSE);
-    $this->assertTrue(module_exists('block_test'), 'Test block module re-enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('block_test'), 'Test block module re-enabled.');
     $manager->clearCachedDefinitions();
 
     // Reload the admin page and confirm the block can again be configured.
diff --git a/core/modules/breakpoint/breakpoint.module b/core/modules/breakpoint/breakpoint.module
index b467011..b356d0f 100644
--- a/core/modules/breakpoint/breakpoint.module
+++ b/core/modules/breakpoint/breakpoint.module
@@ -277,7 +277,7 @@ function breakpoint_get_theme_media_queries($theme_key) {
  *   An array of breakpoints in the form $breakpoint['name'] = 'media query'.
  */
 function breakpoint_get_module_media_queries($module) {
-  if (!module_exists($module)) {
+  if (!drupal_container()->get('module_handler')->moduleExists($module)) {
     throw new \Exception('Illegal module name passed.');
   }
 
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php b/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php
index 57a3a4b..057a689 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/CKEditorPluginManager.php
@@ -149,7 +149,7 @@ public function processDefinition(&$definition, $plugin_id) {
     parent::processDefinition($definition, $plugin_id);
 
     // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
-    if (!module_exists($definition['module'])) {
+    if (!drupal_container()->get('module_handler')->moduleExists($definition['module'])) {
       $definition = NULL;
       return;
     }
diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/editor/editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/editor/editor/CKEditor.php
index e4c0948..8e73a0c 100644
--- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/editor/editor/CKEditor.php
+++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/editor/editor/CKEditor.php
@@ -190,7 +190,7 @@ public function buildContentsCssJSSetting(Editor $editor) {
       drupal_get_path('module', 'ckeditor') . '/css/ckeditor-iframe.css',
     );
     $css = array_merge($css, _ckeditor_theme_css());
-    drupal_alter('ckeditor_css', $css, $editor);
+    drupal_container()->get('module_handler')->alter('ckeditor_css', $css, $editor);
     $css = array_map('file_create_url', $css);
 
     return array_values($css);
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 9ee6f81..66cc996 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -975,7 +975,7 @@ function comment_links(Comment $comment, Node $node) {
   }
 
   // Add translations link for translation-enabled comment bundles.
-  if (module_exists('translation_entity') && translation_entity_translate_access($comment)) {
+  if (drupal_container()->get('module_handler')->moduleExists('translation_entity') && translation_entity_translate_access($comment)) {
     $links['comment-translations'] = array(
       'title' => t('translations'),
       'href' => 'comment/' . $comment->id() . '/translations',
@@ -1080,7 +1080,7 @@ function comment_form_node_type_form_alter(&$form, $form_state) {
       ),
     );
     // @todo Remove this check once language settings are generalized.
-    if (module_exists('translation_entity')) {
+    if (drupal_container()->get('module_handler')->moduleExists('translation_entity')) {
       $comment_form = $form;
       $comment_form_state['translation_entity']['key'] = 'language_configuration';
       $form['comment'] += translation_entity_enable_widget('comment', 'comment_node_' . $form['#node_type']->type, $comment_form, $comment_form_state);
@@ -1439,7 +1439,7 @@ function comment_load($cid, $reset = FALSE) {
 function comment_num_new($nid, $timestamp = 0) {
   global $user;
 
-  if ($user->uid && module_exists('history')) {
+  if ($user->uid && drupal_container()->get('module_handler')->moduleExists('history')) {
     // Retrieve the timestamp at which the current user last viewed this node.
     if (!$timestamp) {
       $timestamp = history_read($nid);
diff --git a/core/modules/comment/comment.views.inc b/core/modules/comment/comment.views.inc
index 9886c67..135de01 100644
--- a/core/modules/comment/comment.views.inc
+++ b/core/modules/comment/comment.views.inc
@@ -150,7 +150,7 @@ function comment_views_data() {
   );
 
   // Langcode field
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $data['comment']['langcode'] = array(
       'title' => t('Language'),
       'help' => t('The language the comment is in.'),
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/entity_reference/selection/CommentSelection.php b/core/modules/comment/lib/Drupal/comment/Plugin/entity_reference/selection/CommentSelection.php
index b038860..1c8a24b 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/entity_reference/selection/CommentSelection.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/entity_reference/selection/CommentSelection.php
@@ -74,7 +74,7 @@ public function entityQueryAlter(SelectInterface $query) {
     // Passing the query to node_query_node_access_alter() is sadly
     // insufficient for nodes.
     // @see SelectionEntityTypeNode::entityQueryAlter()
-    if (!user_access('bypass node access') && !count(module_implements('node_grants'))) {
+    if (!user_access('bypass node access') && !count(drupal_container()->get('module_handler')->getImplementations('node_grants'))) {
       $query->condition($node_alias . '.status', 1);
     }
   }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
index a29db8c..695b353 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentFieldsTest.php
@@ -73,7 +73,7 @@ function testCommentEnable() {
     $edit['modules[Core][comment][enable]'] = FALSE;
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->rebuildContainer();
-    $this->assertFalse(module_exists('comment'), 'Comment module disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('comment'), 'Comment module disabled.');
 
     // Enable core content type module (book).
     $edit = array();
@@ -85,7 +85,7 @@ function testCommentEnable() {
     $edit['modules[Core][comment][enable]'] = 'comment';
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->rebuildContainer();
-    $this->assertTrue(module_exists('comment'), 'Comment module enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('comment'), 'Comment module enabled.');
 
     // Create nodes of each type.
     $book_node = $this->drupalCreateNode(array('type' => 'book'));
diff --git a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php
index 7e54e1c..547489e 100644
--- a/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php
+++ b/core/modules/config/tests/config_test/lib/Drupal/config_test/ConfigTestFormController.php
@@ -42,7 +42,7 @@ public function form(array $form, array &$form_state, EntityInterface $entity) {
       '#default_value' => $entity->get('style'),
       '#access' => FALSE,
     );
-    if (module_exists('image')) {
+    if (drupal_container()->get('module_handler')->moduleExists('image')) {
       $form['style']['#access'] = TRUE;
       $form['style']['#options'] = image_style_options();
     }
diff --git a/core/modules/contact/lib/Drupal/contact/CategoryListController.php b/core/modules/contact/lib/Drupal/contact/CategoryListController.php
index a3ec886..17030b5 100644
--- a/core/modules/contact/lib/Drupal/contact/CategoryListController.php
+++ b/core/modules/contact/lib/Drupal/contact/CategoryListController.php
@@ -19,7 +19,7 @@ class CategoryListController extends ConfigEntityListController {
    */
   public function getOperations(EntityInterface $entity) {
     $operations = parent::getOperations($entity);
-    if (module_exists('field_ui')) {
+    if (drupal_container()->get('module_handler')->moduleExists('field_ui')) {
       $uri = $entity->uri();
       $operations['manage-fields'] = array(
         'title' => t('Manage fields'),
diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module
index 76e39ba..1d81625 100644
--- a/core/modules/contextual/contextual.module
+++ b/core/modules/contextual/contextual.module
@@ -214,7 +214,7 @@ function contextual_pre_render_links($element) {
   $element['#links'] = $links;
 
   // Allow modules to alter the renderable contextual links element.
-  drupal_alter('contextual_links_view', $element, $items);
+  drupal_container()->get('module_handler')->alter('contextual_links_view', $element, $items);
 
   // If there are no links, tell drupal_render() to abort rendering.
   if (empty($element['#links'])) {
diff --git a/core/modules/dblog/dblog.module b/core/modules/dblog/dblog.module
index a0afcd4..5cbe8b0 100644
--- a/core/modules/dblog/dblog.module
+++ b/core/modules/dblog/dblog.module
@@ -71,7 +71,7 @@ function dblog_menu() {
     'file' => 'dblog.admin.inc',
   );
 
-  if (module_exists('search')) {
+  if (drupal_container()->get('module_handler')->moduleExists('search')) {
     $items['admin/reports/search'] = array(
       'title' => 'Top search phrases',
       'description' => 'View most popular search phrases.',
diff --git a/core/modules/edit/lib/Drupal/edit/Plugin/EditorManager.php b/core/modules/edit/lib/Drupal/edit/Plugin/EditorManager.php
index 66876a6..f46cdf4 100644
--- a/core/modules/edit/lib/Drupal/edit/Plugin/EditorManager.php
+++ b/core/modules/edit/lib/Drupal/edit/Plugin/EditorManager.php
@@ -39,7 +39,7 @@ public function processDefinition(&$definition, $plugin_id) {
     parent::processDefinition($definition, $plugin_id);
 
     // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
-    if (!module_exists($definition['module'])) {
+    if (!drupal_container()->get('module_handler')->moduleExists($definition['module'])) {
       $definition = NULL;
       return;
     }
diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
index 5f4279d..7535d32 100644
--- a/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
+++ b/core/modules/editor/lib/Drupal/editor/Plugin/Core/Entity/Editor.php
@@ -77,7 +77,7 @@ public function __construct(array $values, $entity_type) {
     // Initialize settings, merging module-provided defaults.
     $default_settings = $plugin->getDefaultSettings();
     $default_settings += module_invoke_all('editor_default_settings', $this->editor);
-    drupal_alter('editor_default_settings', $default_settings, $this->editor);
+    drupal_container()->get('module_handler')->alter('editor_default_settings', $default_settings, $this->editor);
     $this->settings += $default_settings;
   }
 
diff --git a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php
index 74a5eab..5060147 100644
--- a/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php
+++ b/core/modules/editor/lib/Drupal/editor/Plugin/EditorManager.php
@@ -78,7 +78,7 @@ public function getAttachments(array $format_ids) {
     }
 
     // We have all JavaScript settings, allow other modules to alter them.
-    drupal_alter('editor_js_settings', $settings);
+    drupal_container()->get('module_handler')->alter('editor_js_settings', $settings);
 
     if (empty($attachments['library']) && empty($settings)) {
       return array();
@@ -99,7 +99,7 @@ public function processDefinition(&$definition, $plugin_id) {
     parent::processDefinition($definition, $plugin_id);
 
     // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
-    if (!module_exists($definition['module'])) {
+    if (!drupal_container()->get('module_handler')->moduleExists($definition['module'])) {
       $definition = NULL;
       return;
     }
diff --git a/core/modules/email/email.module b/core/modules/email/email.module
index 73e427e..8f81560 100644
--- a/core/modules/email/email.module
+++ b/core/modules/email/email.module
@@ -37,7 +37,7 @@ function email_field_info() {
  * Implements hook_field_info_alter().
  */
 function email_field_info_alter(&$info) {
-  if (module_exists('text')) {
+  if (drupal_container()->get('module_handler')->moduleExists('text')) {
     $info['email']['default_formatter'] = 'text_plain';
   }
 }
diff --git a/core/modules/entity_reference/entity_reference.module b/core/modules/entity_reference/entity_reference.module
index fd51ff6..cf93cf2 100644
--- a/core/modules/entity_reference/entity_reference.module
+++ b/core/modules/entity_reference/entity_reference.module
@@ -19,7 +19,7 @@ function entity_reference_field_info() {
     'description' => t('This field references another entity.'),
     'settings' => array(
       // Default to a primary entity type (i.e. node or user).
-      'target_type' => module_exists('node') ? 'node' : 'user',
+      'target_type' => drupal_container()->get('module_handler')->moduleExists('node') ? 'node' : 'user',
     ),
     'instance_settings' => array(
       // The selection handler for this instance.
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
index 205df06..a8c76bd 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Plugin/entity_reference/selection/SelectionBase.php
@@ -314,7 +314,7 @@ protected function reAlterQuery(AlterableInterface $query, $tag, $base_table) {
 
     $query->alterTags = array($tag => TRUE);
     $query->alterMetaData['base_table'] = $base_table;
-    drupal_alter(array('query', 'query_' . $tag), $query);
+    drupal_container()->get('module_handler')->alter(array('query', 'query_' . $tag), $query);
 
     // Restore the tags and metadata.
     $query->alterTags = $old_tags;
diff --git a/core/modules/field/field.api.php b/core/modules/field/field.api.php
index 29112ef..04d4486 100644
--- a/core/modules/field/field.api.php
+++ b/core/modules/field/field.api.php
@@ -38,7 +38,7 @@
  */
 function hook_field_extra_fields() {
   $extra = array();
-  $module_language_enabled = module_exists('language');
+  $module_language_enabled = drupal_container()->get('module_handler')->moduleExists('language');
   $description = t('Node module element');
 
   foreach (node_type_get_types() as $bundle) {
diff --git a/core/modules/field/field.attach.inc b/core/modules/field/field.attach.inc
index 69102f4..0ee3b58 100644
--- a/core/modules/field/field.attach.inc
+++ b/core/modules/field/field.attach.inc
@@ -835,7 +835,7 @@ function field_attach_form(EntityInterface $entity, &$form, &$form_state, $langc
 
   // Let other modules make changes to the form.
   // Avoid module_invoke_all() to let parameters be taken by reference.
-  foreach (module_implements('field_attach_form') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_attach_form') as $module) {
     $function = $module . '_field_attach_form';
     $function($entity, $form, $form_state, $langcode);
   }
@@ -928,7 +928,7 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
     // Invoke hook_field_storage_pre_load(): let any module load field
     // data before the storage engine, accumulating along the way.
     $skip_fields = array();
-    foreach (module_implements('field_storage_pre_load') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('field_storage_pre_load') as $module) {
       $function = $module . '_field_storage_pre_load';
       $function($entity_type, $queried_entities, $age, $skip_fields, $options);
     }
@@ -1037,7 +1037,7 @@ function field_attach_validate(EntityInterface $entity, array $options = array()
 
   // Let other modules validate the entity.
   // Avoid module_invoke_all() to let $errors be taken by reference.
-  foreach (module_implements('field_attach_validate') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_attach_validate') as $module) {
     $function = $module . '_field_attach_validate';
     $function($entity, $errors);
   }
@@ -1119,7 +1119,7 @@ function field_attach_extract_form_values(EntityInterface $entity, $form, &$form
 
   // Let other modules act on submitting the entity.
   // Avoid module_invoke_all() to let $form_state be taken by reference.
-  foreach (module_implements('field_attach_extract_form_values') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_attach_extract_form_values') as $module) {
     $function = $module . 'field_attach_extract_form_values';
     $function($entity, $form, $form_state);
   }
@@ -1161,7 +1161,7 @@ function field_attach_insert(EntityInterface $entity) {
   // Let any module insert field data before the storage engine, accumulating
   // saved fields along the way.
   $skip_fields = array();
-  foreach (module_implements('field_storage_pre_insert') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_storage_pre_insert') as $module) {
     $function = $module . '_field_storage_pre_insert';
     $function($entity, $skip_fields);
   }
@@ -1202,7 +1202,7 @@ function field_attach_update(EntityInterface $entity) {
   // Let any module update field data before the storage engine, accumulating
   // saved fields along the way.
   $skip_fields = array();
-  foreach (module_implements('field_storage_pre_update') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_storage_pre_update') as $module) {
     $function = $module . '_field_storage_pre_update';
     $function($entity, $skip_fields);
   }
@@ -1438,7 +1438,7 @@ function field_attach_view(EntityInterface $entity, EntityDisplay $display, $lan
     'display_options' => $view_mode,
     'langcode' => $langcode,
   );
-  drupal_alter('field_attach_view', $output, $context);
+  drupal_container()->get('module_handler')->alter('field_attach_view', $output, $context);
 
   // Reset the _field_view_prepared flag set in field_attach_prepare_view(),
   // in case the same entity is displayed with different settings later in
@@ -1480,7 +1480,7 @@ function field_attach_preprocess(EntityInterface $entity, $element, &$variables)
     'entity' => $entity,
     'element' => $element,
   );
-  drupal_alter('field_attach_preprocess', $variables, $context);
+  drupal_container()->get('module_handler')->alter('field_attach_preprocess', $variables, $context);
 }
 
 /**
@@ -1516,7 +1516,7 @@ function field_attach_prepare_translation(EntityInterface $entity, $langcode, En
     'source_entity' => $source_entity,
     'source_langcode' => $source_langcode,
   );
-  drupal_alter('field_attach_prepare_translation', $entity, $context);
+  drupal_container()->get('module_handler')->alter('field_attach_prepare_translation', $entity, $context);
 }
 
 /**
diff --git a/core/modules/field/field.crud.inc b/core/modules/field/field.crud.inc
index f6ee8a2..5998dcd 100644
--- a/core/modules/field/field.crud.inc
+++ b/core/modules/field/field.crud.inc
@@ -263,7 +263,7 @@ function field_update_field($field) {
   $has_data = field_has_data($field);
 
   // See if any module forbids the update by throwing an exception.
-  foreach (module_implements('field_update_forbid') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_update_forbid') as $module) {
     $function = $module . '_field_update_forbid';
     $function($field, $prior_field, $has_data);
   }
@@ -930,7 +930,7 @@ function field_purge_data(EntityInterface $entity, $field, $instance) {
   module_invoke($field['storage']['module'], 'field_storage_purge', $entity, $field, $instance);
 
   // Let other modules act on purging the data.
-  foreach (module_implements('field_attach_purge') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_attach_purge') as $module) {
     $function = $module . '_field_attach_purge';
     $function($entity, $field, $instance);
   }
diff --git a/core/modules/field/field.info.inc b/core/modules/field/field.info.inc
index b422b47..b499c5f 100644
--- a/core/modules/field/field.info.inc
+++ b/core/modules/field/field.info.inc
@@ -106,7 +106,7 @@ function _field_info_collate_types() {
       );
 
       // Populate field types.
-      foreach (module_implements('field_info') as $module) {
+      foreach (drupal_container()->get('module_handler')->getImplementations('field_info') as $module) {
         $field_types = (array) module_invoke($module, 'field_info');
         foreach ($field_types as $name => $field_info) {
           // Provide defaults.
@@ -118,10 +118,10 @@ function _field_info_collate_types() {
           $info['field types'][$name]['module'] = $module;
         }
       }
-      drupal_alter('field_info', $info['field types']);
+      drupal_container()->get('module_handler')->alter('field_info', $info['field types']);
 
       // Populate storage types.
-      foreach (module_implements('field_storage_info') as $module) {
+      foreach (drupal_container()->get('module_handler')->getImplementations('field_storage_info') as $module) {
         $storage_types = (array) module_invoke($module, 'field_storage_info');
         foreach ($storage_types as $name => $storage_info) {
           // Provide defaults.
@@ -132,7 +132,7 @@ function _field_info_collate_types() {
           $info['storage types'][$name]['module'] = $module;
         }
       }
-      drupal_alter('field_storage_info', $info['storage types']);
+      drupal_container()->get('module_handler')->alter('field_storage_info', $info['storage types']);
 
       cache('field')->set("field_info_types:$langcode", $info, CacheBackendInterface::CACHE_PERMANENT, array('field_info_types' => TRUE));
     }
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index a52d917..eedd596 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -281,12 +281,12 @@ function field_help($path, $arg) {
       // order by displayed module name (module names are not translated).
       $items = array();
       $info = system_get_info('module');
-      $modules = array_merge(module_implements('field_info'), module_implements('field_widget_info'));
+      $modules = array_merge(drupal_container()->get('module_handler')->getImplementations('field_info'), drupal_container()->get('module_handler')->getImplementations('field_widget_info'));
       $modules = array_unique($modules);
       sort($modules);
       foreach ($modules as $module) {
         $display = $info[$module]['name'];
-        if (module_hook($module, 'help')) {
+        if (drupal_container()->get('module_handler')->implementsHook($module, 'help')) {
           $items['items'][] = l($display, 'admin/help/' . $module);
         }
         else {
@@ -334,7 +334,7 @@ function field_cron() {
  * required if there are any active fields of that type.
  */
 function field_system_info_alter(&$info, $file, $type) {
-  if ($type == 'module' && module_hook($file->name, 'field_info')) {
+  if ($type == 'module' && drupal_container()->get('module_handler')->implementsHook($file->name, 'field_info')) {
     $fields = field_read_fields(array('module' => $file->name), array('include_deleted' => TRUE));
     if ($fields) {
       $info['required'] = TRUE;
@@ -349,7 +349,7 @@ function field_system_info_alter(&$info, $file, $type) {
         }
       }
       if ($non_deleted) {
-        if (module_exists('field_ui')) {
+        if (drupal_container()->get('module_handler')->moduleExists('field_ui')) {
           $explanation = t('Field type(s) in use - see <a href="@fields-page">Field list</a>', array('@fields-page' => url('admin/reports/fields')));
         }
         else {
@@ -971,7 +971,7 @@ function field_view_field(EntityInterface $entity, $field_name, $display_options
       'view_mode' => $view_mode,
       'display_options' => $display_options,
     );
-    drupal_alter('field_attach_view', $result, $context);
+    drupal_container()->get('module_handler')->alter('field_attach_view', $result, $context);
 
     if (isset($result[$field_name])) {
       $output = $result[$field_name];
@@ -1066,7 +1066,7 @@ function field_access($op, $field, $entity_type, $entity = NULL, $account = NULL
     $account = $user;
   }
 
-  foreach (module_implements('field_access') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('field_access') as $module) {
     $function = $module . '_field_access';
     $access = $function($op, $field, $entity_type, $entity, $account);
     if ($access === FALSE) {
diff --git a/core/modules/field/field.multilingual.inc b/core/modules/field/field.multilingual.inc
index a9b33ac..2dce6e9 100644
--- a/core/modules/field/field.multilingual.inc
+++ b/core/modules/field/field.multilingual.inc
@@ -138,7 +138,7 @@ function field_available_languages($entity_type, $field) {
       $langcodes = field_content_languages();
       // Let other modules alter the available languages.
       $context = array('entity_type' => $entity_type, 'field' => $field);
-      drupal_alter('field_available_languages', $langcodes, $context);
+      drupal_container()->get('module_handler')->alter('field_available_languages', $langcodes, $context);
       $field_langcodes[$entity_type][$field_name] = $langcodes;
     }
     else {
@@ -339,7 +339,7 @@ function field_language(EntityInterface $entity, $field_name = NULL, $langcode =
       if (variable_get('field_language_fallback', FALSE) && field_has_translation_handler($entity_type)) {
         field_language_fallback($display_langcode, $context['entity'], $context['langcode']);
       }
-      drupal_alter('field_language', $display_langcode, $context);
+      drupal_container()->get('module_handler')->alter('field_language', $display_langcode, $context);
     }
 
     $display_langcodes[$entity_type][$id][$langcode] = $display_langcode;
diff --git a/core/modules/field/field.views.inc b/core/modules/field/field.views.inc
index 6c769cd..45bff46 100644
--- a/core/modules/field/field.views.inc
+++ b/core/modules/field/field.views.inc
@@ -28,7 +28,7 @@ function field_views_data() {
     if (empty($result)) {
       $result = field_views_field_default_views_data($field);
     }
-    drupal_alter('field_views_data', $result, $field, $module);
+    drupal_container()->get('module_handler')->alter('field_views_data', $result, $field, $module);
 
     if (is_array($result)) {
       $data = NestedArray::mergeDeep($result, $data);
diff --git a/core/modules/field/lib/Drupal/field/FieldInfo.php b/core/modules/field/lib/Drupal/field/FieldInfo.php
index 7ff6850..9968178 100644
--- a/core/modules/field/lib/Drupal/field/FieldInfo.php
+++ b/core/modules/field/lib/Drupal/field/FieldInfo.php
@@ -453,7 +453,7 @@ public function getBundleExtraFields($entity_type, $bundle) {
     // all bundles.
     $info = array();
     $extra = module_invoke_all('field_extra_fields');
-    drupal_alter('field_extra_fields', $extra);
+    drupal_container()->get('module_handler')->alter('field_extra_fields', $extra);
     // Merge in saved settings.
     if (isset($extra[$entity_type][$bundle])) {
       $info = $this->prepareExtraFields($extra[$entity_type][$bundle], $entity_type, $bundle);
@@ -482,7 +482,7 @@ public function prepareField($field) {
 
     // Add storage details.
     $details = (array) module_invoke($field['storage']['module'], 'field_storage_details', $field);
-    drupal_alter('field_storage_details', $details, $field);
+    drupal_container()->get('module_handler')->alter('field_storage_details', $details, $field);
     $field['storage']['details'] = $details;
 
     // Populate the list of bundles using the field.
diff --git a/core/modules/field/lib/Drupal/field/FieldInstance.php b/core/modules/field/lib/Drupal/field/FieldInstance.php
index ba6ea44..e3a88d1 100644
--- a/core/modules/field/lib/Drupal/field/FieldInstance.php
+++ b/core/modules/field/lib/Drupal/field/FieldInstance.php
@@ -53,7 +53,7 @@ public function getWidget() {
         'field' => field_info_field($this->definition['field_name']),
         'instance' => $this,
       );
-      drupal_alter(array('field_widget_properties', 'field_widget_properties_' . $this->definition['entity_type']), $widget_properties, $context);
+      drupal_container()->get('module_handler')->alter(array('field_widget_properties', 'field_widget_properties_' . $this->definition['entity_type']), $widget_properties, $context);
 
       $options = array(
         'instance' => $this,
diff --git a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php
index 12118f8..131c815 100644
--- a/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php
+++ b/core/modules/field/lib/Drupal/field/Plugin/Type/Widget/WidgetBase.php
@@ -299,7 +299,7 @@ protected function formSingleElement(EntityInterface $entity, array $items, $del
         'delta' => $delta,
         'default' => !empty($entity->field_ui_default_value),
       );
-      drupal_alter(array('field_widget_form', 'field_widget_' . $this->getPluginId() . '_form'), $element, $form_state, $context);
+      drupal_container()->get('module_handler')->alter(array('field_widget_form', 'field_widget_' . $this->getPluginId() . '_form'), $element, $form_state, $context);
     }
 
     return $element;
diff --git a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
index 7ee40f4..916fe5b 100644
--- a/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
+++ b/core/modules/field_ui/lib/Drupal/field_ui/DisplayOverview.php
@@ -209,7 +209,7 @@ public function buildForm(array $form, array &$form_state) {
             'view_mode' => $this->view_mode,
             'form' => $form,
           );
-          drupal_alter('field_formatter_settings_form', $settings_form, $form_state, $context);
+          drupal_container()->get('module_handler')->alter('field_formatter_settings_form', $settings_form, $form_state, $context);
 
           if ($settings_form) {
             $table[$name]['format']['#cell_attributes'] = array('colspan' => 3);
@@ -260,7 +260,7 @@ public function buildForm(array $form, array &$form_state) {
             'instance' => $instance,
             'view_mode' => $this->view_mode,
           );
-          drupal_alter('field_formatter_settings_summary', $summary, $context);
+          drupal_container()->get('module_handler')->alter('field_formatter_settings_summary', $summary, $context);
 
           if ($summary) {
             $table[$name]['settings_summary'] = array(
diff --git a/core/modules/file/file.module b/core/modules/file/file.module
index 69fcbf3..475ba14 100644
--- a/core/modules/file/file.module
+++ b/core/modules/file/file.module
@@ -673,7 +673,7 @@ function file_file_download($uri, $field_type = 'file') {
         // Invoke hook and collect grants/denies for download access.
         // Default to FALSE and let entities overrule this ruling.
         $grants = array('system' => FALSE);
-        foreach (module_implements('file_download_access') as $module) {
+        foreach (drupal_container()->get('module_handler')->getImplementations('file_download_access') as $module) {
           $grants = array_merge($grants, array($module => module_invoke($module, 'file_download_access', $field, $entity, $file)));
         }
         // Allow other modules to alter the returned grants/denies.
@@ -682,7 +682,7 @@ function file_file_download($uri, $field_type = 'file') {
           'field' => $field,
           'file' => $file,
         );
-        drupal_alter('file_download_access', $grants, $context);
+        drupal_container()->get('module_handler')->alter('file_download_access', $grants, $context);
 
         if (in_array(TRUE, $grants)) {
           // If TRUE is returned, access is granted and no further checks are
diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module
index 8ee1871..2fcbbe8 100644
--- a/core/modules/filter/filter.module
+++ b/core/modules/filter/filter.module
@@ -554,7 +554,7 @@ function filter_get_filters() {
   $filters = &drupal_static(__FUNCTION__, array());
 
   if (empty($filters)) {
-    foreach (module_implements('filter_info') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('filter_info') as $module) {
       $info = module_invoke($module, 'filter_info');
       if (isset($info) && is_array($info)) {
         // Assign the name of the module implementing the filters and ensure
@@ -571,7 +571,7 @@ function filter_get_filters() {
       }
     }
     // Allow modules to alter filter definitions.
-    drupal_alter('filter_info', $filters);
+    drupal_container()->get('module_handler')->alter('filter_info', $filters);
 
     uasort($filters, '_filter_list_cmp');
   }
diff --git a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
index 5070396..842e0f8 100644
--- a/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
+++ b/core/modules/forum/lib/Drupal/forum/Tests/ForumTest.php
@@ -117,7 +117,7 @@ function testEnableForumField() {
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
     $this->rebuildContainer();
-    $this->assertFalse(module_exists('forum'), 'Forum module is not enabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('forum'), 'Forum module is not enabled.');
 
     // Attempt to re-enable the Forum module and ensure it does not try to
     // recreate the taxonomy_forums field.
@@ -126,7 +126,7 @@ function testEnableForumField() {
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
     $this->rebuildContainer();
-    $this->assertTrue(module_exists('forum'), 'Forum module is enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('forum'), 'Forum module is enabled.');
   }
 
   /**
diff --git a/core/modules/help/help.admin.inc b/core/modules/help/help.admin.inc
index a3bea9e..d15ac1f 100644
--- a/core/modules/help/help.admin.inc
+++ b/core/modules/help/help.admin.inc
@@ -27,7 +27,7 @@ function help_main() {
  */
 function help_page($name) {
   $output = '';
-  if (module_hook($name, 'help')) {
+  if (drupal_container()->get('module_handler')->implementsHook($name, 'help')) {
     $info = system_get_info('module');
     drupal_set_title($info[$name]['name']);
 
@@ -64,7 +64,7 @@ function help_links_as_list() {
   $module_info = system_rebuild_module_data();
 
   $modules = array();
-  foreach (module_implements('help') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('help') as $module) {
     if (module_invoke($module, 'help', "admin/help#$module", $empty_arg)) {
       $modules[$module] = $module_info[$module]->info['name'];
     }
diff --git a/core/modules/help/help.module b/core/modules/help/help.module
index aac8636..ced8248 100644
--- a/core/modules/help/help.module
+++ b/core/modules/help/help.module
@@ -18,7 +18,7 @@ function help_menu() {
     'file' => 'help.admin.inc',
   );
 
-  $modules = module_implements('help');
+  $modules = drupal_container()->get('module_handler')->getImplementations('help');
   ksort($modules);
   foreach ($modules as $module) {
     $items['admin/help/' . $module] = array(
@@ -46,7 +46,7 @@ function help_help($path, $arg) {
       $output .= '<li>' . t('<strong>Enable additional functionality</strong> Next, visit the <a href="@modules">module list</a> and enable features which suit your specific needs. You can find additional modules in the <a href="@download_modules">Drupal modules download section</a>.', array('@modules' => url('admin/modules'), '@download_modules' => 'http://drupal.org/project/modules')) . '</li>';
       $output .= '<li>' . t('<strong>Customize your website design</strong> To change the "look and feel" of your website, visit the <a href="@themes">themes section</a>. You may choose from one of the included themes or download additional themes from the <a href="@download_themes">Drupal themes download section</a>.', array('@themes' => url('admin/appearance'), '@download_themes' => 'http://drupal.org/project/themes')) . '</li>';
       // Display a link to the create content page if Node module is enabled.
-      if (module_exists('node')) {
+      if (drupal_container()->get('module_handler')->moduleExists('node')) {
         $output .= '<li>' . t('<strong>Start posting content</strong> Finally, you can <a href="@content">add new content</a> for your website.', array('@content' => url('node/add'))) . '</li>';
       }
       $output .= '</ol>';
diff --git a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
index 54b955f..83fc9e2 100644
--- a/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
+++ b/core/modules/help/lib/Drupal/help/Tests/HelpTest.php
@@ -108,7 +108,7 @@ protected function verifyHelp($response = 200) {
   protected function getModuleList() {
     $modules = array();
     $module_data = system_rebuild_module_data();
-    foreach (module_implements('help') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('help') as $module) {
       $modules[$module] = $module_data[$module]->info['name'];
     }
     return $modules;
diff --git a/core/modules/history/lib/Drupal/history/Plugin/views/field/HistoryUserTimestamp.php b/core/modules/history/lib/Drupal/history/Plugin/views/field/HistoryUserTimestamp.php
index 32456fa..3759ab3 100644
--- a/core/modules/history/lib/Drupal/history/Plugin/views/field/HistoryUserTimestamp.php
+++ b/core/modules/history/lib/Drupal/history/Plugin/views/field/HistoryUserTimestamp.php
@@ -37,7 +37,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     if ($user->uid) {
       $this->additional_fields['created'] = array('table' => 'node', 'field' => 'created');
       $this->additional_fields['changed'] = array('table' => 'node', 'field' => 'changed');
-      if (module_exists('comment') && !empty($this->options['comments'])) {
+      if (drupal_container()->get('module_handler')->moduleExists('comment') && !empty($this->options['comments'])) {
         $this->additional_fields['last_comment'] = array('table' => 'node_comment_statistics', 'field' => 'last_comment_timestamp');
       }
     }
@@ -53,7 +53,7 @@ protected function defineOptions() {
 
   public function buildOptionsForm(&$form, &$form_state) {
     parent::buildOptionsForm($form, $form_state);
-    if (module_exists('comment')) {
+    if (drupal_container()->get('module_handler')->moduleExists('comment')) {
       $form['comments'] = array(
         '#type' => 'checkbox',
         '#title' => t('Check for new comments as well'),
@@ -82,7 +82,7 @@ function render($values) {
       $last_read = $this->get_value($values);
       $changed = $this->get_value($values, 'changed');
 
-      $last_comment = module_exists('comment') && !empty($this->options['comments']) ?  $this->get_value($values, 'last_comment') : 0;
+      $last_comment = drupal_container()->get('module_handler')->moduleExists('comment') && !empty($this->options['comments']) ?  $this->get_value($values, 'last_comment') : 0;
 
       if (!$last_read && $changed > HISTORY_READ_LIMIT) {
         $mark = MARK_NEW;
diff --git a/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php b/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php
index 6a05921..a052550 100644
--- a/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php
+++ b/core/modules/history/lib/Drupal/history/Plugin/views/filter/HistoryUserTimestamp.php
@@ -78,7 +78,7 @@ public function query() {
 
     $clause = '';
     $clause2 = '';
-    if (module_exists('comment')) {
+    if (drupal_container()->get('module_handler')->moduleExists('comment')) {
       $ncs = $this->query->ensure_table('node_comment_statistics', $this->relationship);
       $clause = ("OR $ncs.last_comment_timestamp > (***CURRENT_TIME*** - $limit)");
       $clause2 = "OR $field < $ncs.last_comment_timestamp";
diff --git a/core/modules/image/image.module b/core/modules/image/image.module
index d7b02d0..7b219e3 100644
--- a/core/modules/image/image.module
+++ b/core/modules/image/image.module
@@ -764,7 +764,7 @@ function image_style_flush($style) {
   drupal_theme_rebuild();
 
   // Clear page caches when flushing.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     cache('block')->deleteAll();
   }
   cache('page')->deleteAll();
@@ -850,7 +850,7 @@ function image_effect_definitions() {
     else {
       $effects = array();
       include_once DRUPAL_ROOT . '/core/modules/image/image.effects.inc';
-      foreach (module_implements('image_effect_info') as $module) {
+      foreach (drupal_container()->get('module_handler')->getImplementations('image_effect_info') as $module) {
         foreach (module_invoke($module, 'image_effect_info') as $name => $effect) {
           // Ensure the current toolkit supports the effect.
           $effect['module'] = $module;
@@ -860,7 +860,7 @@ function image_effect_definitions() {
         }
       }
       uasort($effects, '_image_effect_definitions_sort');
-      drupal_alter('image_effect_info', $effects);
+      drupal_container()->get('module_handler')->alter('image_effect_info', $effects);
       cache()->set("image_effects:$langcode", $effects);
     }
   }
diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc
index 6755b9b..e63db78 100644
--- a/core/modules/locale/locale.batch.inc
+++ b/core/modules/locale/locale.batch.inc
@@ -173,7 +173,7 @@ function locale_translation_batch_status_finished($success, $results) {
   $t = get_t();
   if ($success) {
     if (isset($results['failed_files'])) {
-        if (module_exists('dblog')) {
+        if (drupal_container()->get('module_handler')->moduleExists('dblog')) {
           $message = format_plural(count($results['failed_files']), 'One translation file could not be checked. <a href="@url">See the log</a> for details.', '@count translation files could not be checked. <a href="@url">See the log</a> for details.', array('@url' => url('admin/reports/dblog')));
         }
         else {
diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc
index 6a452d8..5322ac1 100644
--- a/core/modules/locale/locale.bulk.inc
+++ b/core/modules/locale/locale.bulk.inc
@@ -544,7 +544,7 @@ function locale_translate_batch_finished($success, $results) {
     $additions = $updates = $deletes = $skips = 0;
     $langcodes = array();
     if (isset($results['failed_files'])) {
-        if (module_exists('dblog')) {
+        if (drupal_container()->get('module_handler')->moduleExists('dblog')) {
           $message = format_plural(count($results['failed_files']), 'One translation file could not be imported. <a href="@url">See the log</a> for details.', '@count translation files could not be imported. <a href="@url">See the log</a> for details.', array('@url' => url('admin/reports/dblog')));
         }
         else {
@@ -577,7 +577,7 @@ function locale_translate_batch_finished($success, $results) {
       watchdog('locale', 'Translations imported: %number added, %update updated, %delete removed.', array('%number' => $additions, '%update' => $updates, '%delete' => $deletes));
 
       if ($skips) {
-        if (module_exists('dblog')) {
+        if (drupal_container()->get('module_handler')->moduleExists('dblog')) {
           $message = format_plural($skips, 'One translation string was skipped because of disallowed or malformed HTML. <a href="@url">See the log</a> for details.', '@count translation strings were skipped because of disallowed or malformed HTML. <a href="@url">See the log</a> for details.', array('@url' => url('admin/reports/dblog')));
         }
         else {
diff --git a/core/modules/locale/locale.compare.inc b/core/modules/locale/locale.compare.inc
index 267cd9d..c89ca7d 100644
--- a/core/modules/locale/locale.compare.inc
+++ b/core/modules/locale/locale.compare.inc
@@ -46,7 +46,7 @@ function locale_translation_flush_projects() {
  */
 function locale_translation_build_projects() {
   // This function depends on Update module. We degrade gracefully.
-  if (!module_exists('update')) {
+  if (!drupal_container()->get('module_handler')->moduleExists('update')) {
     return array();
   }
 
@@ -132,7 +132,7 @@ function locale_translation_build_projects() {
  */
 function locale_translation_project_list() {
   // This function depends on Update module. We degrade gracefully.
-  if (!module_exists('update')) {
+  if (!drupal_container()->get('module_handler')->moduleExists('update')) {
     return array();
   }
 
@@ -156,7 +156,7 @@ function locale_translation_project_list() {
     }
 
     // Allow other modules to alter projects before fetching and comparing.
-    drupal_alter('locale_translation_projects', $projects);
+    drupal_container()->get('module_handler')->alter('locale_translation_projects', $projects);
   }
   return $projects;
 }
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index fb72927..f50e7b4 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -376,7 +376,7 @@ function locale($string = NULL, $context = NULL, $langcode = NULL) {
   // cannot be unloaded, this is typically the case in the environment that
   // is executing a test.
   if (!isset($locale_exists)) {
-    $locale_exists = function_exists('module_exists') && module_exists('locale');
+    $locale_exists = function_exists('module_exists') && drupal_container()->get('module_handler')->moduleExists('locale');
   }
   if (!$locale_exists) {
     return $string;
diff --git a/core/modules/locale/locale.translation.inc b/core/modules/locale/locale.translation.inc
index e4ee67a..15913c3 100644
--- a/core/modules/locale/locale.translation.inc
+++ b/core/modules/locale/locale.translation.inc
@@ -58,7 +58,7 @@ function locale_translation_get_projects($project_names = array()) {
 
     // http://drupal.org/node/1777106 is a follow-up issue to make the check for
     // possible out-of-date project information more robust.
-    if ($result->rowCount() == 0 && module_exists('update')) {
+    if ($result->rowCount() == 0 && drupal_container()->get('module_handler')->moduleExists('update')) {
       module_load_include('compare.inc', 'locale');
       // At least the core project should be in the database, so we build the
       // data if none are found.
diff --git a/core/modules/menu/menu.module b/core/modules/menu/menu.module
index c300ed6..b95d375 100644
--- a/core/modules/menu/menu.module
+++ b/core/modules/menu/menu.module
@@ -45,7 +45,7 @@ function menu_help($path, $arg) {
     case 'admin/structure/menu/add':
       return '<p>' . t('You can enable the newly-created block for this menu on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</p>';
   }
-  if ($path == 'admin/structure/menu' && module_exists('block')) {
+  if ($path == 'admin/structure/menu' && drupal_container()->get('module_handler')->moduleExists('block')) {
     return '<p>' . t('Each menu has a corresponding block that is managed on the <a href="@blocks">Blocks administration page</a>.', array('@blocks' => url('admin/structure/block'))) . '</p>';
   }
 }
@@ -241,7 +241,7 @@ function menu_load($menu_name) {
 function menu_menu_insert(Menu $menu) {
   menu_cache_clear_all();
   // Invalidate the block cache to update menu-based derivatives.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
   }
   // Make sure the menu is present in the active menus variable so that its
@@ -264,7 +264,7 @@ function menu_menu_insert(Menu $menu) {
 function menu_menu_update(Menu $menu) {
   menu_cache_clear_all();
   // Invalidate the block cache to update menu-based derivatives.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
   }
 }
@@ -293,7 +293,7 @@ function menu_menu_delete(Menu $menu) {
   menu_cache_clear_all();
 
   // Invalidate the block cache to update menu-based derivatives.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
   }
 }
diff --git a/core/modules/node/content_types.inc b/core/modules/node/content_types.inc
index e838460..85cd92d 100644
--- a/core/modules/node/content_types.inc
+++ b/core/modules/node/content_types.inc
@@ -16,7 +16,7 @@
 function node_overview_types() {
   $types = node_type_get_types();
   $names = node_type_get_names();
-  $field_ui = module_exists('field_ui');
+  $field_ui = drupal_container()->get('module_handler')->moduleExists('field_ui');
   $header = array(t('Name'), t('Operations'));
   $rows = array();
 
@@ -206,7 +206,7 @@ function node_type_form($form, &$form_state, $type = NULL) {
     ),
     '#description' => t('Users with the <em>Administer content</em> permission will be able to override these options.'),
   );
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $form['language'] = array(
       '#type' => 'details',
       '#title' => t('Language settings'),
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 63b4189..dd9c0df 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -342,7 +342,7 @@ public function validate(array $form, array &$form_state) {
     if ($function = node_hook($node->type, 'validate')) {
       $function($node, $form, $form_state);
     }
-    foreach (module_implements('node_validate') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('node_validate') as $module) {
       $function = $module . '_node_validate';
       $function($node, $form, $form_state);
     }
@@ -369,7 +369,7 @@ public function submit(array $form, array &$form_state) {
     }
 
     node_submit($node);
-    foreach (module_implements('node_submit') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('node_submit') as $module) {
       $function = $module . '_node_submit';
       $function($node, $form, $form_state);
     }
diff --git a/core/modules/node/lib/Drupal/node/NodeStorageController.php b/core/modules/node/lib/Drupal/node/NodeStorageController.php
index d855384..9e50451 100644
--- a/core/modules/node/lib/Drupal/node/NodeStorageController.php
+++ b/core/modules/node/lib/Drupal/node/NodeStorageController.php
@@ -145,7 +145,7 @@ function postSave(EntityInterface $node, $update) {
    * Overrides Drupal\Core\Entity\DatabaseStorageController::preDelete().
    */
   function preDelete($entities) {
-    if (module_exists('search')) {
+    if (drupal_container()->get('module_handler')->moduleExists('search')) {
       foreach ($entities as $id => $entity) {
         search_reindex($entity->nid, 'node');
       }
diff --git a/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php b/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php
index 7798994..a50f2f3 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/entity_reference/selection/NodeSelection.php
@@ -36,7 +36,7 @@ public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
     // 'unpublished'. We need to do that as long as there are no access control
     // modules in use on the site. As long as one access control module is there,
     // it is supposed to handle this check.
-    if (!user_access('bypass node access') && !count(module_implements('node_grants'))) {
+    if (!user_access('bypass node access') && !count(drupal_container()->get('module_handler')->getImplementations('node_grants'))) {
       $query->condition('status', NODE_PUBLISHED);
     }
     return $query;
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php
index f2044dc..2bc3420 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php
@@ -35,7 +35,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     // Don't add the additional fields to groupby
     if (!empty($this->options['link_to_node'])) {
       $this->additional_fields['nid'] = array('table' => 'node', 'field' => 'nid');
-      if (module_exists('translation')) {
+      if (drupal_container()->get('module_handler')->moduleExists('translation')) {
         $this->additional_fields['langcode'] = array('table' => 'node', 'field' => 'langcode');
       }
     }
diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php
index d3b24cc..5216885 100644
--- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php
+++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php
@@ -33,7 +33,7 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     if (!empty($this->options['link_to_node_revision'])) {
       $this->additional_fields['vid'] = 'vid';
       $this->additional_fields['nid'] = 'nid';
-      if (module_exists('translation')) {
+      if (drupal_container()->get('module_handler')->moduleExists('translation')) {
         $this->additional_fields['langcode'] = array('table' => 'node', 'field' => 'langcode');
       }
     }
@@ -68,7 +68,7 @@ function render_link($data, $values) {
       $nid = $this->get_value($values, 'nid');
       $vid = $this->get_value($values, 'vid');
       $this->options['alter']['path'] = "node/" . $nid . '/revisions/' . $vid . '/view';
-      if (module_exists('translation')) {
+      if (drupal_container()->get('module_handler')->moduleExists('translation')) {
         $langcode = $this->get_value($values, 'langcode');
         $languages = language_list();
         if (isset($languages[$langcode])) {
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
index e2b4c07..7fdbac6 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeAccessRecordsTest.php
@@ -79,7 +79,7 @@ function testNodeAccessRecords() {
     foreach ($operations as $op) {
       $grants = node_test_node_grants($op, $web_user);
       $altered_grants = $grants;
-      drupal_alter('node_grants', $altered_grants, $web_user, $op);
+      drupal_container()->get('module_handler')->alter('node_grants', $altered_grants, $web_user, $op);
       $this->assertNotEqual($grants, $altered_grants, format_string('Altered the %op grant for a user.', array('%op' => $op)));
     }
 
diff --git a/core/modules/node/node.admin.inc b/core/modules/node/node.admin.inc
index 139b2d2..2a99a85 100644
--- a/core/modules/node/node.admin.inc
+++ b/core/modules/node/node.admin.inc
@@ -94,7 +94,7 @@ function node_filters() {
     ),
   );
   // Include translation states if we have this module enabled
-  if (module_exists('translation')) {
+  if (drupal_container()->get('module_handler')->moduleExists('translation')) {
     $filters['status']['options'] += array(
       'translate-0' => t('Up to date translation'),
       'translate-1' => t('Outdated translation'),
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index ad79f6d..2632520 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -184,7 +184,7 @@ function node_theme() {
  */
 function node_entity_info_alter(&$info) {
   // Add a translation handler for fields if the language module is enabled.
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $info['node']['translation']['node'] = TRUE;
   }
 }
@@ -205,7 +205,7 @@ function node_entity_view_mode_info() {
   );
   // Search integration is provided by node.module, so search-related
   // view modes for nodes are defined here and not in search.module.
-  if (module_exists('search')) {
+  if (drupal_container()->get('module_handler')->moduleExists('search')) {
     $view_modes['node']['search_index'] = array(
       'label' => t('Search index'),
     );
@@ -329,7 +329,7 @@ function node_mark($nid, $timestamp) {
   global $user;
   $cache = &drupal_static(__FUNCTION__, array());
 
-  if (!$user->uid || !module_exists('history')) {
+  if (!$user->uid || !drupal_container()->get('module_handler')->moduleExists('history')) {
     return MARK_READ;
   }
   if (!isset($cache[$nid])) {
@@ -616,7 +616,7 @@ function node_add_body_field($type, $label = 'Body') {
  */
 function node_field_extra_fields() {
   $extra = array();
-  $module_language_enabled = module_exists('language');
+  $module_language_enabled = drupal_container()->get('module_handler')->moduleExists('language');
   $description = t('Node module element');
 
   foreach (node_type_get_types() as $bundle) {
@@ -730,7 +730,7 @@ function _node_types_build($rebuild = FALSE) {
 
   $_node_types = (object) array('types' => array(), 'names' => array());
 
-  foreach (module_implements('node_info') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('node_info') as $module) {
     $info_array = module_invoke($module, 'node_info');
     foreach ($info_array as $type => $info) {
       $info['type'] = $type;
@@ -906,7 +906,7 @@ function node_rdf_mapping() {
  */
 function node_hook($type, $hook) {
   $base = node_type_get_base($type);
-  return module_hook($base, $hook) ? $base . '_' . $hook : FALSE;
+  return drupal_container()->get('module_handler')->implementsHook($base, $hook) ? $base . '_' . $hook : FALSE;
 }
 
 /**
@@ -1085,7 +1085,7 @@ function node_show(Node $node, $message = FALSE) {
   $nodes = array('nodes' => node_view_multiple(array($node->nid => $node), 'full'));
 
   // Update the history table, stating that this user viewed this node.
-  if (module_exists('history')) {
+  if (drupal_container()->get('module_handler')->moduleExists('history')) {
     history_write($node->nid);
   }
 
@@ -2640,7 +2640,7 @@ function node_access($op, $node, $account = NULL, $langcode = NULL) {
   // If the module did not override the access rights, use those set in the
   // node_access table.
   if ($op != 'create' && $node->nid) {
-    if (module_implements('node_grants')) {
+    if (drupal_container()->get('module_handler')->getImplementations('node_grants')) {
       $query = db_select('node_access');
       $query->addExpression('1');
       $query->condition('grant_' . $op, 1, '>=');
@@ -2804,7 +2804,7 @@ function node_access_grants($op, $account = NULL) {
   // Fetch node access grants from other modules.
   $grants = module_invoke_all('node_grants', $account, $op);
   // Allow modules to alter the assigned grants.
-  drupal_alter('node_grants', $grants, $account, $op);
+  drupal_container()->get('module_handler')->alter('node_grants', $grants, $account, $op);
 
   return array_merge(array('all' => array(0)), $grants);
 }
@@ -2844,7 +2844,7 @@ function node_access_view_all_nodes($account = NULL) {
   }
 
   // If no modules implement the node access system, access is always TRUE.
-  if (!module_implements('node_grants')) {
+  if (!drupal_container()->get('module_handler')->getImplementations('node_grants')) {
     $access[$account->uid] = TRUE;
   }
   else {
@@ -2908,7 +2908,7 @@ function node_query_node_access_alter(AlterableInterface $query) {
   if (user_access('bypass node access', $account)) {
     return;
   }
-  if (!count(module_implements('node_grants'))) {
+  if (!count(drupal_container()->get('module_handler')->getImplementations('node_grants'))) {
     return;
   }
   if ($op == 'view' && node_access_view_all_nodes($account)) {
@@ -2992,7 +2992,7 @@ function node_query_node_access_alter(AlterableInterface $query) {
 function node_access_acquire_grants(Node $node, $delete = TRUE) {
   $grants = module_invoke_all('node_access_records', $node);
   // Let modules alter the grants.
-  drupal_alter('node_access_records', $grants, $node);
+  drupal_container()->get('module_handler')->alter('node_access_records', $grants, $node);
   // If no grants are set and the node is published, then use the default grant.
   if (empty($grants) && !empty($node->status)) {
     $grants[] = array('realm' => 'all', 'gid' => 0, 'grant_view' => 1, 'grant_update' => 0, 'grant_delete' => 0);
@@ -3039,7 +3039,7 @@ function _node_access_write_grants(Node $node, $grants, $realm = NULL, $delete =
   }
 
   // Only perform work when node_access modules are active.
-  if (!empty($grants) && count(module_implements('node_grants'))) {
+  if (!empty($grants) && count(drupal_container()->get('module_handler')->getImplementations('node_grants'))) {
     $query = db_insert('node_access')->fields(array('nid', 'realm', 'gid', 'grant_view', 'grant_update', 'grant_delete'));
     foreach ($grants as $grant) {
       if ($realm && $realm != $grant['realm']) {
@@ -3112,7 +3112,7 @@ function node_access_needs_rebuild($rebuild = NULL) {
 function node_access_rebuild($batch_mode = FALSE) {
   db_delete('node_access')->execute();
   // Only recalculate if the site is using a node_access module.
-  if (count(module_implements('node_grants'))) {
+  if (count(drupal_container()->get('module_handler')->getImplementations('node_grants'))) {
     if ($batch_mode) {
       $batch = array(
         'title' => t('Rebuilding content access permissions'),
@@ -3592,7 +3592,7 @@ function node_requirements($phase) {
     // in the {node_access} table, or if there are modules that
     // implement hook_node_grants().
     $grant_count = db_query('SELECT COUNT(*) FROM {node_access}')->fetchField();
-    if ($grant_count != 1 || count(module_implements('node_grants')) > 0) {
+    if ($grant_count != 1 || count(drupal_container()->get('module_handler')->getImplementations('node_grants')) > 0) {
       $value = format_plural($grant_count, 'One permission in use', '@count permissions in use', array('@count' => $grant_count));
     }
     else {
@@ -3615,7 +3615,7 @@ function node_requirements($phase) {
 function node_modules_enabled($modules) {
   // Check if any of the newly enabled modules require the node_access table to
   // be rebuilt.
-  if (!node_access_needs_rebuild() && array_intersect($modules, module_implements('node_grants'))) {
+  if (!node_access_needs_rebuild() && array_intersect($modules, drupal_container()->get('module_handler')->getImplementations('node_grants'))) {
     node_access_needs_rebuild(TRUE);
   }
 }
@@ -3630,14 +3630,14 @@ function node_modules_disabled($modules) {
     // At this point, the module is already disabled, but its code is still
     // loaded in memory. Module functions must no longer be called. We only
     // check whether a hook implementation function exists and do not invoke it.
-    if (!node_access_needs_rebuild() && module_hook($module, 'node_grants')) {
+    if (!node_access_needs_rebuild() && drupal_container()->get('module_handler')->implementsHook($module, 'node_grants')) {
       node_access_needs_rebuild(TRUE);
     }
   }
 
   // If there remains no more node_access module, rebuilding will be
   // straightforward, we can do it right now.
-  if (node_access_needs_rebuild() && count(module_implements('node_grants')) == 0) {
+  if (node_access_needs_rebuild() && count(drupal_container()->get('module_handler')->getImplementations('node_grants')) == 0) {
     node_access_rebuild();
   }
 }
@@ -3718,6 +3718,6 @@ function node_library_info() {
  */
 function node_system_info_alter(&$info, $file, $type) {
   if ($type == 'module' && $file->name == 'translation') {
-    $info['hidden'] = !module_exists('translation') && config('system.module.disabled')->get('translation') === NULL;
+    $info['hidden'] = !drupal_container()->get('module_handler')->moduleExists('translation') && config('system.module.disabled')->get('translation') === NULL;
   }
 }
diff --git a/core/modules/node/node.views.inc b/core/modules/node/node.views.inc
index cd6575e..88d455e 100644
--- a/core/modules/node/node.views.inc
+++ b/core/modules/node/node.views.inc
@@ -207,7 +207,7 @@ function node_views_data() {
   );
 
   // Language field
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $data['node']['langcode'] = array(
       'title' => t('Language'),
       'help' => t('The language the content is in.'),
@@ -729,7 +729,7 @@ function node_views_analyze(ViewExecutable $view) {
  */
 function node_views_wizard() {
   // @todo: figure this piece out.
-  if (module_exists('statistics')) {
+  if (drupal_container()->get('module_handler')->moduleExists('statistics')) {
     $plugins['node']['available_sorts']['node_counter-totalcount:DESC'] = t('Number of hits');
   }
 
diff --git a/core/modules/openid/openid.inc b/core/modules/openid/openid.inc
index 8d5aae9..8f6fe44 100644
--- a/core/modules/openid/openid.inc
+++ b/core/modules/openid/openid.inc
@@ -265,7 +265,7 @@ function _openid_is_xri($identifier) {
  */
 function openid_normalize($identifier) {
   $methods = module_invoke_all('openid_normalization_method_info');
-  drupal_alter('openid_normalization_method_info', $methods);
+  drupal_container()->get('module_handler')->alter('openid_normalization_method_info', $methods);
 
   // Execute each method in turn, stopping after the first method accepted
   // the identifier.
diff --git a/core/modules/openid/openid.module b/core/modules/openid/openid.module
index 6d31124..ec71aa2 100644
--- a/core/modules/openid/openid.module
+++ b/core/modules/openid/openid.module
@@ -513,7 +513,7 @@ function openid_discovery($claimed_id) {
   module_load_include('inc', 'openid');
 
   $methods = module_invoke_all('openid_discovery_method_info');
-  drupal_alter('openid_discovery_method_info', $methods);
+  drupal_container()->get('module_handler')->alter('openid_discovery_method_info', $methods);
 
   // Execute each method in turn and return first successful discovery.
   foreach ($methods as $method) {
@@ -888,7 +888,7 @@ function openid_authentication_request($claimed_id, $identity, $return_to = '',
     $request['openid.ax.type.language_son'] = 'http://openid.net/schema/language/pref';
   }
 
-  drupal_alter('openid_request', $request, $service);
+  drupal_container()->get('module_handler')->alter('openid_request', $request, $service);
 
   return $request;
 }
diff --git a/core/modules/overlay/overlay.module b/core/modules/overlay/overlay.module
index cc29255..8ab6b8f 100644
--- a/core/modules/overlay/overlay.module
+++ b/core/modules/overlay/overlay.module
@@ -704,7 +704,7 @@ function overlay_overlay_parent_initialize() {
   }
   drupal_add_js(array('overlay' => array('paths' => $paths)), 'setting');
   $path_prefixes = array();
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     language_negotiation_include();
     if (config('language.negotiation')->get('url.source') == LANGUAGE_NEGOTIATION_URL_PREFIX) {
       // Skip the empty string indicating the default language. We always accept
diff --git a/core/modules/path/path.admin.inc b/core/modules/path/path.admin.inc
index 0535454..533c136 100644
--- a/core/modules/path/path.admin.inc
+++ b/core/modules/path/path.admin.inc
@@ -17,7 +17,7 @@ function path_admin_overview($keys = NULL) {
   // Enable language column if language.module is enabled or if we have any
   // alias with a language.
   $alias_exists = (bool) db_query_range('SELECT 1 FROM {url_alias} WHERE langcode <> :langcode', 0, 1, array(':langcode' => LANGUAGE_NOT_SPECIFIED))->fetchField();
-  $multilanguage = (module_exists('language') || $alias_exists);
+  $multilanguage = (drupal_container()->get('module_handler')->moduleExists('language') || $alias_exists);
 
   $header = array();
   $header[] = array('data' => t('Alias'), 'field' => 'alias', 'sort' => 'asc');
@@ -150,7 +150,7 @@ function path_admin_form($form, &$form_state, $path = array('source' => '', 'ali
   );
 
   // A hidden value unless language.module is enabled.
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $languages = language_list();
     foreach ($languages as $langcode => $language) {
       $language_options[$langcode] = $language->name;
diff --git a/core/modules/rdf/rdf.install b/core/modules/rdf/rdf.install
index 10d3f8d..b7c9413 100644
--- a/core/modules/rdf/rdf.install
+++ b/core/modules/rdf/rdf.install
@@ -44,6 +44,6 @@ function rdf_schema() {
 function rdf_install() {
   // Collect any RDF mappings that were declared by modules installed before
   // this one.
-  $modules = module_implements('rdf_mapping');
+  $modules = drupal_container()->get('module_handler')->getImplementations('rdf_mapping');
   rdf_modules_installed($modules);
 }
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 89494eb..77b113e 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -103,7 +103,7 @@ function rdf_get_namespaces() {
   $namespaces = array();
   // In order to resolve duplicate namespaces by using the earliest defined
   // namespace, do not use module_invoke_all().
-  foreach (module_implements('rdf_namespaces') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('rdf_namespaces') as $module) {
     $function = $module . '_rdf_namespaces';
     if (function_exists($function)) {
       $namespaces = NestedArray::mergeDeep($function(), $namespaces);
@@ -156,7 +156,7 @@ function _rdf_get_default_mapping($type) {
 
   if (!isset($default_mappings)) {
     // Get all of the modules that implement hook_rdf_mapping().
-    $modules = module_implements('rdf_mapping');
+    $modules = drupal_container()->get('module_handler')->getImplementations('rdf_mapping');
 
     // Only consider the default entity mapping definitions.
     foreach ($modules as $module) {
diff --git a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php
index cc06e1a..137b17d 100644
--- a/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php
+++ b/core/modules/rest/lib/Drupal/rest/Plugin/rest/resource/DBLogResource.php
@@ -29,7 +29,7 @@ class DBLogResource extends ResourceBase {
    */
   public function routes() {
     // Only expose routes if the dblog module is enabled.
-    if (module_exists('dblog')) {
+    if (drupal_container()->get('module_handler')->moduleExists('dblog')) {
       return parent::routes();
     }
     return new RouteCollection();
diff --git a/core/modules/search/search.module b/core/modules/search/search.module
index 375c43f..49c4113 100644
--- a/core/modules/search/search.module
+++ b/core/modules/search/search.module
@@ -242,7 +242,7 @@ function search_get_info($all = FALSE) {
   $search_hooks = &drupal_static(__FUNCTION__);
 
   if (!isset($search_hooks)) {
-    foreach (module_implements('search_info') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('search_info') as $module) {
       $search_hooks[$module] = call_user_func($module . '_search_info');
       // Use module name as the default value.
       $search_hooks[$module] += array('title' => $module, 'path' => $module);
@@ -541,7 +541,7 @@ function _search_index_truncate(&$text) {
  * Invokes hook_search_preprocess() in modules.
  */
 function search_invoke_preprocess(&$text, $langcode = NULL) {
-  foreach (module_implements('search_preprocess') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('search_preprocess') as $module) {
     $text = module_invoke($module, 'search_preprocess', $text, $langcode);
   }
 }
@@ -1074,9 +1074,9 @@ function search_box_form_submit($form, &$form_state) {
  *   supplied or if the given search module is not active.
  */
 function search_data($keys, $module, $conditions = NULL) {
-  if (module_hook($module, 'search_execute')) {
+  if (drupal_container()->get('module_handler')->implementsHook($module, 'search_execute')) {
     $results = module_invoke($module, 'search_execute', $keys, $conditions);
-    if (module_hook($module, 'search_page')) {
+    if (drupal_container()->get('module_handler')->implementsHook($module, 'search_page')) {
       return module_invoke($module, 'search_page', $results);
     }
     else {
diff --git a/core/modules/shortcut/shortcut.admin.inc b/core/modules/shortcut/shortcut.admin.inc
index c173154..01b6a5a 100644
--- a/core/modules/shortcut/shortcut.admin.inc
+++ b/core/modules/shortcut/shortcut.admin.inc
@@ -506,7 +506,7 @@ function shortcut_set_delete_form($form, &$form_state, $shortcut_set) {
 
   // Also, if a module implements hook_shortcut_default_set(), it's possible
   // that this set is being used as a default set. Add a message about that too.
-  if (count(module_implements('shortcut_default_set')) > 0) {
+  if (count(drupal_container()->get('module_handler')->getImplementations('shortcut_default_set')) > 0) {
     $info .= '<p>' . t('If you have chosen this shortcut set as the default for some or all users, they may also be affected by deleting it.') . '</p>';
   }
 
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
index 3aeab60..6ca58b7 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/Tests/DrupalUnitTestBaseTest.php
@@ -40,7 +40,7 @@ function testSetUp() {
     $this->assertTrue(function_exists('entity_test_permission'), "$module.module was loaded.");
     // Verify that there is a fixed module list.
     $this->assertIdentical(array_keys(drupal_container()->get('module_handler')->getModuleList()), array($module));
-    $this->assertIdentical(module_implements('permission'), array($module));
+    $this->assertIdentical(drupal_container()->get('module_handler')->getImplementations('permission'), array($module));
 
     // Verify that no modules have been installed.
     $this->assertFalse(db_table_exists($table), "'$table' database table not found.");
@@ -53,20 +53,20 @@ function testEnableModulesLoad() {
     $module = 'field_test';
 
     // Verify that the module does not exist yet.
-    $this->assertFalse(module_exists($module), "$module module not found.");
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists($module), "$module module not found.");
     $list = array_keys(drupal_container()->get('module_handler')->getModuleList());
     $this->assertFalse(in_array($module, $list), "$module module not found in the extension handler's module list.");
-    $list = module_implements('permission');
+    $list = drupal_container()->get('module_handler')->getImplementations('permission');
     $this->assertFalse(in_array($module, $list), "{$module}_permission() in module_implements() not found.");
 
     // Enable the module.
     $this->enableModules(array($module));
 
     // Verify that the module exists.
-    $this->assertTrue(module_exists($module), "$module module found.");
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists($module), "$module module found.");
     $list = array_keys(drupal_container()->get('module_handler')->getModuleList());
     $this->assertTrue(in_array($module, $list), "$module module found in the extension handler's module list.");
-    $list = module_implements('permission');
+    $list = drupal_container()->get('module_handler')->getImplementations('permission');
     $this->assertTrue(in_array($module, $list), "{$module}_permission() in module_implements() found.");
   }
 
@@ -78,10 +78,10 @@ function testEnableModulesInstall() {
     $table = 'node';
 
     // Verify that the module does not exist yet.
-    $this->assertFalse(module_exists($module), "$module module not found.");
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists($module), "$module module not found.");
     $list = array_keys(drupal_container()->get('module_handler')->getModuleList());
     $this->assertFalse(in_array($module, $list), "$module module not found in the extension handler's module list.");
-    $list = module_implements('permission');
+    $list = drupal_container()->get('module_handler')->getImplementations('permission');
     $this->assertFalse(in_array($module, $list), "{$module}_permission() in module_implements() not found.");
 
     $this->assertFalse(db_table_exists($table), "'$table' database table not found.");
@@ -92,10 +92,10 @@ function testEnableModulesInstall() {
     module_enable(array($module));
 
     // Verify that the enabled module exists.
-    $this->assertTrue(module_exists($module), "$module module found.");
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists($module), "$module module found.");
     $list = array_keys(drupal_container()->get('module_handler')->getModuleList());
     $this->assertTrue(in_array($module, $list), "$module module found in the extension handler's module list.");
-    $list = module_implements('permission');
+    $list = drupal_container()->get('module_handler')->getImplementations('permission');
     $this->assertTrue(in_array($module, $list), "{$module}_permission() in module_implements() found.");
 
     $this->assertTrue(db_table_exists($table), "'$table' database table found.");
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index dce2ceb..6ed8cf7 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -241,7 +241,7 @@ protected function drupalCreateNode(array $settings = array()) {
     );
 
     // Add in comment settings for nodes.
-    if (module_exists('comment')) {
+    if (drupal_container()->get('module_handler')->moduleExists('comment')) {
       $settings += array(
         'comment' => COMMENT_NODE_OPEN,
       );
diff --git a/core/modules/simpletest/simpletest.module b/core/modules/simpletest/simpletest.module
index 760947f..7b7062c 100644
--- a/core/modules/simpletest/simpletest.module
+++ b/core/modules/simpletest/simpletest.module
@@ -376,7 +376,7 @@ function simpletest_test_get_all() {
       }
 
       // Allow modules extending core tests to disable originals.
-      drupal_alter('simpletest', $groups);
+      drupal_container()->get('module_handler')->alter('simpletest', $groups);
       cache()->set('simpletest', $groups);
     }
   }
diff --git a/core/modules/statistics/statistics.admin.inc b/core/modules/statistics/statistics.admin.inc
index d454321c..d3d14fc 100644
--- a/core/modules/statistics/statistics.admin.inc
+++ b/core/modules/statistics/statistics.admin.inc
@@ -40,7 +40,7 @@ function statistics_settings_form_submit($form, &$form_state) {
     ->save();
   // The popular statistics block is dependent on these settings, so clear the
   // block plugin definitions cache.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
   }
 }
diff --git a/core/modules/syslog/syslog.module b/core/modules/syslog/syslog.module
index 8af77c1..3282b2b 100644
--- a/core/modules/syslog/syslog.module
+++ b/core/modules/syslog/syslog.module
@@ -46,7 +46,7 @@ function syslog_help($path, $arg) {
  */
 function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
   $config = config('syslog.settings');
-  $help = module_exists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL;
+  $help = drupal_container()->get('module_handler')->moduleExists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL;
   $form['syslog_identity'] = array(
     '#type'          => 'textfield',
     '#title'         => t('Syslog identity'),
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php
index c2f1595..3901c20 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/AlterTest.php
@@ -47,13 +47,13 @@ function testDrupalAlter() {
     // Verify alteration of a single argument.
     $array_copy = $array;
     $array_expected = array('foo' => 'Drupal theme');
-    drupal_alter('drupal_alter', $array_copy);
+    drupal_container()->get('module_handler')->alter('drupal_alter', $array_copy);
     $this->assertEqual($array_copy, $array_expected, 'Single array was altered.');
 
     $entity_copy = clone $entity;
     $entity_expected = clone $entity;
     $entity_expected->foo = 'Drupal theme';
-    drupal_alter('drupal_alter', $entity_copy);
+    drupal_container()->get('module_handler')->alter('drupal_alter', $entity_copy);
     $this->assertEqual($entity_copy, $entity_expected, 'Single object was altered.');
 
     // Verify alteration of multiple arguments.
@@ -64,7 +64,7 @@ function testDrupalAlter() {
     $entity_expected->foo = 'Drupal theme';
     $array2_copy = $array;
     $array2_expected = array('foo' => 'Drupal theme');
-    drupal_alter('drupal_alter', $array_copy, $entity_copy, $array2_copy);
+    drupal_container()->get('module_handler')->alter('drupal_alter', $array_copy, $entity_copy, $array2_copy);
     $this->assertEqual($array_copy, $array_expected, 'First argument to drupal_alter() was altered.');
     $this->assertEqual($entity_copy, $entity_expected, 'Second argument to drupal_alter() was altered.');
     $this->assertEqual($array2_copy, $array2_expected, 'Third argument to drupal_alter() was altered.');
@@ -74,7 +74,7 @@ function testDrupalAlter() {
     // other modules.
     $array_copy = $array;
     $array_expected = array('foo' => 'Drupal block theme');
-    drupal_alter(array('drupal_alter', 'drupal_alter_foo'), $array_copy);
+    drupal_container()->get('module_handler')->alter(array('drupal_alter', 'drupal_alter_foo'), $array_copy);
     $this->assertEqual($array_copy, $array_expected, 'hook_TYPE_alter() implementations ran in correct order.');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
index 75ce7cd..a1fe05f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
@@ -149,10 +149,10 @@ function testDependencyResolution() {
     // are not already enabled. (If they were, the tests below would not work
     // correctly.)
     module_enable(array('module_test'), FALSE);
-    $this->assertTrue(module_exists('module_test'), 'Test module is enabled.');
-    $this->assertFalse(module_exists('forum'), 'Forum module is disabled.');
-    $this->assertFalse(module_exists('ban'), 'Ban module is disabled.');
-    $this->assertFalse(module_exists('php'), 'PHP module is disabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('module_test'), 'Test module is enabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('forum'), 'Forum module is disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('ban'), 'Ban module is disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('php'), 'PHP module is disabled.');
 
     // First, create a fake missing dependency. Forum depends on ban, which
     // depends on a made-up module, foo. Nothing should be installed.
@@ -160,7 +160,7 @@ function testDependencyResolution() {
     drupal_static_reset('system_rebuild_module_data');
     $result = module_enable(array('forum'));
     $this->assertFalse($result, 'module_enable() returns FALSE if dependencies are missing.');
-    $this->assertFalse(module_exists('forum'), 'module_enable() aborts if dependencies are missing.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('forum'), 'module_enable() aborts if dependencies are missing.');
 
     // Now, fix the missing dependency. Forum module depends on ban, but ban
     // depends on the PHP module. module_enable() should work.
@@ -169,9 +169,16 @@ function testDependencyResolution() {
     $result = module_enable(array('forum'));
     $this->assertTrue($result, 'module_enable() returns the correct value.');
     // Verify that the fake dependency chain was installed.
-    $this->assertTrue(module_exists('ban') && module_exists('php'), 'Dependency chain was installed by module_enable().');
+    $this->assertTrue(
+      drupal_container()->get('module_handler')->moduleExists('ban') &&
+      drupal_container()->get('module_handler')->moduleExists('php'),
+      'Dependency chain was installed by module_enable().'
+    );
     // Verify that the original module was installed.
-    $this->assertTrue(module_exists('forum'), 'Module installation with unlisted dependencies succeeded.');
+    $this->assertTrue(
+      drupal_container()->get('module_handler')->moduleExists('forum'),
+      'Module installation with unlisted dependencies succeeded.'
+    );
     // Finally, verify that the modules were enabled in the correct order.
     $module_order = state()->get('system_test.module_enable_order') ?: array();
     $this->assertEqual($module_order, array('php', 'ban', 'forum'), 'Modules were enabled in the correct order by module_enable().');
@@ -179,8 +186,9 @@ function testDependencyResolution() {
     // Now, disable the PHP module. Both forum and ban should be disabled as
     // well, in the correct order.
     module_disable(array('php'));
-    $this->assertTrue(!module_exists('forum') && !module_exists('ban'), 'Depedency chain was disabled by module_disable().');
-    $this->assertFalse(module_exists('php'), 'Disabling a module with unlisted dependents succeeded.');
+    $this->assertTrue(!drupal_container()->get('module_handler')->moduleExists('forum') &&
+      !drupal_container()->get('module_handler')->moduleExists('ban'), 'Depedency chain was disabled by module_disable().');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('php'), 'Disabling a module with unlisted dependents succeeded.');
     $disabled_modules = state()->get('module_test.disable_order') ?: array();
     $this->assertEqual($disabled_modules, array('forum', 'ban', 'php'), 'Modules were disabled in the correct order by module_disable().');
 
@@ -190,9 +198,9 @@ function testDependencyResolution() {
     $profile = drupal_get_profile();
     $info = install_profile_info($profile);
     $this->assertTrue(in_array('comment', $info['dependencies']), 'Comment module is listed as a dependency of the installation profile.');
-    $this->assertTrue(module_exists('comment'), 'Comment module is enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('comment'), 'Comment module is enabled.');
     module_disable(array('comment'));
-    $this->assertFalse(module_exists('comment'), 'Comment module was disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('comment'), 'Comment module was disabled.');
     $disabled_modules = state()->get('module_test.disable_order') ?: array();
     $this->assertTrue(in_array('comment', $disabled_modules), 'Comment module is in the list of disabled modules.');
     $this->assertFalse(in_array($profile, $disabled_modules), 'The installation profile is not in the list of disabled modules.');
@@ -235,9 +243,13 @@ function testDependencyResolution() {
     $result = module_enable(array('forum'));
     $this->assertTrue($result, 'module_enable() returns the correct value.');
     // Verify that the fake dependency chain was installed.
-    $this->assertTrue(module_exists('ban') && module_exists('php'), 'Dependency chain was installed by module_enable().');
+    $this->assertTrue(
+      drupal_container()->get('module_handler')->moduleExists('ban') &&
+      drupal_container()->get('module_handler')->moduleExists('php'),
+      'Dependency chain was installed by module_enable().'
+    );
     // Verify that the original module was installed.
-    $this->assertTrue(module_exists('forum'), 'Module installation with version dependencies succeeded.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('forum'), 'Module installation with version dependencies succeeded.');
     // Finally, verify that the modules were enabled in the correct order.
     $enable_order = state()->get('system_test.module_enable_order') ?: array();
     $php_position = array_search('php', $enable_order);
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php b/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php
index 670f869..33e11a1 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/InfoAlterTest.php
@@ -32,7 +32,7 @@ function testSystemInfoAlter() {
     // Enable seven and the test module.
     theme_enable(array('seven'));
     module_enable(array('module_test'), FALSE);
-    $this->assertTrue(module_exists('module_test'), 'Test module is enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('module_test'), 'Test module is enabled.');
 
     // Verify that the rebuilt and altered theme info is returned.
     $info = system_get_info('theme', 'seven');
@@ -47,7 +47,7 @@ function testSystemInfoAlter() {
 
     // Disable the module and verify that rebuilt .info does not contain it.
     module_disable(array('module_test'), FALSE);
-    $this->assertFalse(module_exists('module_test'), 'Test module is disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('module_test'), 'Test module is disabled.');
 
     $info = system_get_info('theme', 'seven');
     $this->assertFalse(isset($info['regions']['test_region']), 'Altered theme info was not returned by system_get_info().');
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php
index 4e79ae9..44ca963 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/MainContentFallbackTest.php
@@ -57,7 +57,7 @@ function testMainContentFallback() {
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
     $this->rebuildContainer();
-    $this->assertFalse(module_exists('block'), 'Block module disabled.');
+    $this->assertFalse(drupal_container()->get('module_handler')->moduleExists('block'), 'Block module disabled.');
 
     // At this point, no region is filled and fallback should be triggered.
     $this->drupalGet('admin/config/system/site-information');
@@ -91,6 +91,6 @@ function testMainContentFallback() {
     $this->drupalPost('admin/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), 'Modules status has been updated.');
     $this->rebuildContainer();
-    $this->assertTrue(module_exists('block'), 'Block module re-enabled.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('block'), 'Block module re-enabled.');
   }
 }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
index 6e9b383..8464dbf 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTest.php
@@ -205,7 +205,7 @@ public function testFindThemeTemplates() {
     $cache = array();
 
     // Prime the theme cache.
-    foreach (module_implements('theme') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('theme') as $module) {
       _theme_process_registry($cache, $module, 'module', $module, drupal_get_path('module', $module));
     }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php
index 13b649c..be49994 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/ThemeTestTwig.php
@@ -51,7 +51,7 @@ function testFindThemeTemplates() {
     $cache = array();
 
     // Prime the theme cache
-    foreach (module_implements('theme') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('theme') as $module) {
       _theme_process_registry($cache, $module, 'module', $module, drupal_get_path('module', $module));
     }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php
index 401e021..decc22a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Theme/TwigDebugMarkupTest.php
@@ -43,7 +43,7 @@ function testTwigDebugMarkup() {
 
     $cache = array();
     // Prime the theme cache.
-    foreach (module_implements('theme') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('theme') as $module) {
       _theme_process_registry($cache, $module, 'module', $module, drupal_get_path('module', $module));
     }
     // Create array of Twig templates.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
index d2cde1f..749790d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php
@@ -158,7 +158,7 @@ public function testVariableUpgrade() {
   public function testFrontpageUpgrade() {
     $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
 
-    $this->assertTrue(module_exists('views'), 'Views is enabled after the upgrade.');
+    $this->assertTrue(drupal_container()->get('module_handler')->moduleExists('views'), 'Views is enabled after the upgrade.');
   }
 
 }
diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc
index b483e7e..66b825a 100644
--- a/core/modules/system/system.admin.inc
+++ b/core/modules/system/system.admin.inc
@@ -240,7 +240,7 @@ function system_themes_page() {
   }
 
   uasort($theme_groups['enabled'], 'system_sort_themes');
-  drupal_alter('system_themes_page', $theme_groups);
+  drupal_container()->get('module_handler')->alter('system_themes_page', $theme_groups);
 
   $admin_form = drupal_get_form('system_themes_admin_form', $admin_theme_options);
   return theme('system_themes_page', array('theme_groups' => $theme_groups, 'theme_group_titles' => $theme_group_titles)) . drupal_render($admin_form);
@@ -420,7 +420,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
     $disabled['toggle_node_user_picture'] = TRUE;
     $disabled['toggle_comment_user_picture'] = TRUE;
   }
-  if (!module_exists('comment')) {
+  if (!drupal_container()->get('module_handler')->moduleExists('comment')) {
     $disabled['toggle_comment_user_picture'] = TRUE;
     $disabled['toggle_comment_user_verification'] = TRUE;
   }
@@ -447,7 +447,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
   }
 
   // Logo settings, only available when file.module is enabled.
-  if ((!$key) || in_array('logo', $features) && module_exists('file')) {
+  if ((!$key) || in_array('logo', $features) && drupal_container()->get('module_handler')->moduleExists('file')) {
     $form['logo'] = array(
       '#type' => 'details',
       '#title' => t('Logo image settings'),
@@ -481,7 +481,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
     );
   }
 
-  if ((!$key) || in_array('favicon', $features) && module_exists('file')) {
+  if ((!$key) || in_array('favicon', $features) && drupal_container()->get('module_handler')->moduleExists('file')) {
     $form['favicon'] = array(
       '#type' => 'details',
       '#title' => t('Shortcut icon settings'),
@@ -610,7 +610,7 @@ function system_theme_settings($form, &$form_state, $key = '') {
  * Validator for the system_theme_settings() form.
  */
 function system_theme_settings_validate($form, &$form_state) {
-  if (module_exists('file')) {
+  if (drupal_container()->get('module_handler')->moduleExists('file')) {
     // Handle file uploads.
     $validators = array('file_validate_is_image' => array());
 
@@ -709,7 +709,7 @@ function system_theme_settings_submit($form, &$form_state) {
 
   // If the user uploaded a new logo or favicon, save it to a permanent location
   // and use it in place of the default theme-provided file.
-  if (module_exists('file')) {
+  if (drupal_container()->get('module_handler')->moduleExists('file')) {
     if ($file = $values['logo_upload']) {
       unset($values['logo_upload']);
       $filename = file_unmanaged_copy($file->uri);
@@ -839,7 +839,7 @@ function system_modules($form, $form_state = array()) {
   $form['modules'] = array('#tree' => TRUE);
 
   // Used when checking if module implements a help page.
-  $help_arg = module_exists('help') ? drupal_help_arg() : FALSE;
+  $help_arg = drupal_container()->get('module_handler')->moduleExists('help') ? drupal_help_arg() : FALSE;
 
   // Used when displaying modules that are required by the installation profile.
   require_once DRUPAL_ROOT . '/core/includes/install.inc';
@@ -888,7 +888,7 @@ function system_modules($form, $form_state = array()) {
       }
     }
     // Generate link for module's help page, if there is one.
-    if ($help_arg && $module->status && in_array($filename, module_implements('help'))) {
+    if ($help_arg && $module->status && in_array($filename, drupal_container()->get('module_handler')->getImplementations('help'))) {
       if (module_invoke($filename, 'help', "admin/help#$filename", $help_arg)) {
         $extra['links']['help'] = array(
           '#type' => 'link',
@@ -899,7 +899,7 @@ function system_modules($form, $form_state = array()) {
       }
     }
     // Generate link for module's permission, if the user has access to it.
-    if ($module->status && user_access('administer permissions') && in_array($filename, module_implements('permission'))) {
+    if ($module->status && user_access('administer permissions') && in_array($filename, drupal_container()->get('module_handler')->getImplementations('permission'))) {
       $extra['links']['permissions'] = array(
         '#type' => 'link',
         '#title' => t('Permissions'),
@@ -1218,11 +1218,11 @@ function system_modules_submit($form, &$form_state) {
         $actions['install'][] = $name;
         $actions['enable'][] = $name;
       }
-      elseif (!module_exists($name)) {
+      elseif (!drupal_container()->get('module_handler')->moduleExists($name)) {
         $actions['enable'][] = $name;
       }
     }
-    elseif (module_exists($name)) {
+    elseif (drupal_container()->get('module_handler')->moduleExists($name)) {
       $actions['disable'][] = $name;
     }
   }
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 7f621d4..9f1d25e 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -499,7 +499,7 @@ function system_requirements($phase) {
 
   if ($phase == 'runtime') {
     // Check for update status module.
-    if (!module_exists('update')) {
+    if (!drupal_container()->get('module_handler')->moduleExists('update')) {
       $requirements['update status'] = array(
         'value' => $t('Not enabled'),
         'severity' => REQUIREMENT_WARNING,
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 1a659c5..125edd9 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -98,7 +98,7 @@ function system_help($path, $arg) {
       return '<p>' . t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') . '</p>';
     case 'admin/modules':
       $output = '<p>' . t('Download additional <a href="@modules">contributed modules</a> to extend Drupal\'s functionality.', array('@modules' => 'http://drupal.org/project/modules')) . '</p>';
-      if (module_exists('update')) {
+      if (drupal_container()->get('module_handler')->moduleExists('update')) {
         if (update_manager_access()) {
           $output .= '<p>' . t('Regularly review and install <a href="@updates">available updates</a> to maintain a secure and current site. Always run the <a href="@update-php">update script</a> each time a module is updated.', array('@update-php' => $base_url . '/core/update.php', '@updates' => url('admin/reports/updates'))) . '</p>';
         }
@@ -1044,7 +1044,7 @@ function system_menu() {
   );
 
   // Localize date formats.
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $items['admin/config/regional/date-time/locale'] = array(
       'title' => 'Localize',
       'description' => 'Configure date formats for each locale',
@@ -2872,7 +2872,7 @@ function _system_rebuild_module_data() {
     // Invoke hook_system_info_alter() to give installed modules a chance to
     // modify the data in the .info files if necessary.
     $type = 'module';
-    drupal_alter('system_info', $modules[$key]->info, $modules[$key], $type);
+    drupal_container()->get('module_handler')->alter('system_info', $modules[$key]->info, $modules[$key], $type);
   }
 
   if (isset($modules[$profile])) {
@@ -2934,7 +2934,7 @@ function system_rebuild_module_data() {
 function _system_update_bootstrap_status() {
   $bootstrap_modules = array();
   foreach (bootstrap_hooks() as $hook) {
-    foreach (module_implements($hook) as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations($hook) as $module) {
       $bootstrap_modules[$module] = drupal_get_filename('module', $module);
     }
   }
@@ -3000,7 +3000,7 @@ function _system_rebuild_theme_data() {
     // Invoke hook_system_info_alter() to give installed modules a chance to
     // modify the data in the .info files if necessary.
     $type = 'theme';
-    drupal_alter('system_info', $themes[$key]->info, $themes[$key], $type);
+    drupal_container()->get('module_handler')->alter('system_info', $themes[$key]->info, $themes[$key], $type);
 
     if (!empty($themes[$key]->info['base theme'])) {
       $sub_themes[] = $key;
@@ -3499,7 +3499,7 @@ function system_get_module_admin_tasks($module, $info) {
   }
 
   // Append link for permissions.
-  if (module_hook($module, 'permission')) {
+  if (drupal_container()->get('module_handler')->implementsHook($module, 'permission')) {
     $item = menu_get_item('admin/people/permissions');
     if (!empty($item['access'])) {
       $item['link_path'] = $item['href'];
@@ -3964,6 +3964,6 @@ function country_get_list() {
   include_once DRUPAL_ROOT . '/core/includes/standard.inc';
   $countries = standard_country_list();
   // Allow other modules to modify the country list.
-  drupal_alter('countries', $countries);
+  drupal_container()->get('module_handler')->alter('countries', $countries);
   return $countries;
 }
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.views.inc b/core/modules/system/tests/modules/entity_test/entity_test.views.inc
index 4e348b0..58538e3 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.views.inc
+++ b/core/modules/system/tests/modules/entity_test/entity_test.views.inc
@@ -55,7 +55,7 @@ function entity_test_views_data() {
     ),
   );
 
-  if (module_exists('langcode')) {
+  if (drupal_container()->get('module_handler')->moduleExists('langcode')) {
     $data['entity_test']['langcode'] = array(
       'title' => t('Language'),
       'help' => t('The {language}.langcode of the original variant of this test entity.'),
@@ -96,7 +96,7 @@ function entity_test_views_data() {
     ),
   );
 
-  if (module_exists('langcode')) {
+  if (drupal_container()->get('module_handler')->moduleExists('langcode')) {
     $data['entity_test_property_data']['langcode'] = array(
       'title' => t('Language'),
       'help' => t('The {language}.langcode of this variant of this test entity.'),
diff --git a/core/modules/system/tests/modules/form_test/form_test.module b/core/modules/system/tests/modules/form_test/form_test.module
index f85fd6d..02867d0 100644
--- a/core/modules/system/tests/modules/form_test/form_test.module
+++ b/core/modules/system/tests/modules/form_test/form_test.module
@@ -273,7 +273,7 @@ function form_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
-  if (module_exists('node')) {
+  if (drupal_container()->get('module_handler')->moduleExists('node')) {
     $items['form-test/two-instances-of-same-form'] = array(
       'title' => 'AJAX test with two form instances',
       'page callback' => 'form_test_two_instances',
diff --git a/core/modules/system/tests/modules/theme_test/theme_test.module b/core/modules/system/tests/modules/theme_test/theme_test.module
index 73ff44b..50b5745 100644
--- a/core/modules/system/tests/modules/theme_test/theme_test.module
+++ b/core/modules/system/tests/modules/theme_test/theme_test.module
@@ -146,7 +146,7 @@ function _theme_custom_theme() {
  */
 function _theme_test_alter() {
   $data = 'foo';
-  drupal_alter('theme_test_alter', $data);
+  drupal_container()->get('module_handler')->alter('theme_test_alter', $data);
   return "The altered data is $data.";
 }
 
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php
index 6785335..988d384 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyFormController.php
@@ -56,7 +56,7 @@ public function form(array $form, array &$form_state, EntityInterface $vocabular
       '#languages' => LANGUAGE_ALL,
       '#default_value' => $vocabulary->langcode,
     );
-    if (module_exists('language')) {
+    if (drupal_container()->get('module_handler')->moduleExists('language')) {
       $form['default_terms_language'] = array(
         '#type' => 'details',
         '#title' => t('Terms language'),
@@ -90,14 +90,14 @@ protected function actions(array $form, array &$form_state) {
       array_unshift($actions['delete']['#submit'], array($this, 'submit'));
       // Add the language configuration submit handler. This is needed because
       // the submit button has custom submit handlers.
-      if (module_exists('language')) {
+      if (drupal_container()->get('module_handler')->moduleExists('language')) {
         array_unshift($actions['submit']['#submit'],'language_configuration_element_submit');
         array_unshift($actions['submit']['#submit'], array($this, 'languageConfigurationSubmit'));
       }
       // We cannot leverage the regular submit handler definition because we
       // have button-specific ones here. Hence we need to explicitly set it for
       // the submit action, otherwise it would be ignored.
-      if (module_exists('translation_entity')) {
+      if (drupal_container()->get('module_handler')->moduleExists('translation_entity')) {
         array_unshift($actions['submit']['#submit'], 'translation_entity_language_configuration_element_submit');
       }
       return $actions;
diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc
index 6305e48..984b2cc 100644
--- a/core/modules/taxonomy/taxonomy.admin.inc
+++ b/core/modules/taxonomy/taxonomy.admin.inc
@@ -541,7 +541,7 @@ function theme_taxonomy_overview_terms($variables) {
  */
 function taxonomy_term_add($vocabulary) {
   $term = entity_create('taxonomy_term', array('vid' => $vocabulary->id()));
-  if (module_exists('language')) {
+  if (drupal_container()->get('module_handler')->moduleExists('language')) {
     $term->langcode = language_get_default_langcode('taxonomy_term', $vocabulary->id());
   }
   return entity_get_form($term);
diff --git a/core/modules/telephone/telephone.module b/core/modules/telephone/telephone.module
index 61a39f4..6548627 100644
--- a/core/modules/telephone/telephone.module
+++ b/core/modules/telephone/telephone.module
@@ -24,7 +24,7 @@ function telephone_field_info() {
  * Implements hook_field_info_alter().
  */
 function telephone_field_info_alter(&$info) {
-  if (module_exists('text')) {
+  if (drupal_container()->get('module_handler')->moduleExists('text')) {
     $info['telephone']['default_formatter'] = 'text_plain';
   }
 }
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index e4996bc..7ce0ea9 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -234,7 +234,7 @@ function ($object) {
   // Get toolbar items from all modules that implement hook_toolbar().
   $items = module_invoke_all('toolbar');
   // Allow for altering of hook_toolbar().
-  drupal_alter('toolbar', $items);
+  drupal_container()->get('module_handler')->alter('toolbar', $items);
   // Sort the children.
   uasort($items, 'element_sort');
 
diff --git a/core/modules/tour/lib/Drupal/tour/TourManager.php b/core/modules/tour/lib/Drupal/tour/TourManager.php
index ee44c9b..9dff92e 100644
--- a/core/modules/tour/lib/Drupal/tour/TourManager.php
+++ b/core/modules/tour/lib/Drupal/tour/TourManager.php
@@ -45,7 +45,7 @@ public function processDefinition(&$definition, $plugin_id) {
     parent::processDefinition($definition, $plugin_id);
 
     // @todo Remove this check once http://drupal.org/node/1780396 is resolved.
-    if (!module_exists($definition['module'])) {
+    if (!drupal_container()->get('module_handler')->moduleExists($definition['module'])) {
       $definition = NULL;
       return;
     }
diff --git a/core/modules/translation_entity/translation_entity.pages.inc b/core/modules/translation_entity/translation_entity.pages.inc
index f0c3027..2954b72 100644
--- a/core/modules/translation_entity/translation_entity.pages.inc
+++ b/core/modules/translation_entity/translation_entity.pages.inc
@@ -20,7 +20,7 @@ function translation_entity_overview(EntityInterface $entity) {
   $languages = language_list();
   $original = $entity->language()->langcode;
   $translations = $entity->getTranslationLanguages();
-  $field_ui = module_exists('field_ui') && user_access('administer ' . $entity->entityType() . ' fields');
+  $field_ui = drupal_container()->get('module_handler')->moduleExists('field_ui') && user_access('administer ' . $entity->entityType() . ' fields');
 
   $path = $controller->getViewPath($entity);
   $base_path = $controller->getBasePath($entity);
@@ -290,7 +290,7 @@ function translation_entity_delete_confirm_submit(array $form, array &$form_stat
 
   // Remove any existing path alias for the removed translation.
   // @todo This should be taken care of by the Path module.
-  if (module_exists('path')) {
+  if (drupal_container()->get('module_handler')->moduleExists('path')) {
     $conditions = array('source' => $controller->getViewPath($entity), 'langcode' => $language->langcode);
     drupal_container()->get('path.crud')->delete($conditions);
   }
diff --git a/core/modules/update/update.compare.inc b/core/modules/update/update.compare.inc
index 199f641..9a29d27 100644
--- a/core/modules/update/update.compare.inc
+++ b/core/modules/update/update.compare.inc
@@ -69,7 +69,7 @@ function update_get_projects() {
         update_process_info_list($projects, $theme_data, 'theme', FALSE);
       }
       // Allow other modules to alter projects before fetching and comparing.
-      drupal_alter('update_projects', $projects);
+      drupal_container()->get('module_handler')->alter('update_projects', $projects);
       // Cache the site's project data for at most 1 hour.
       _update_cache_set('update_project_projects', $projects, REQUEST_TIME + 3600);
     }
@@ -359,7 +359,7 @@ function update_calculate_project_data($available) {
   // Give other modules a chance to alter the status (for example, to allow a
   // contrib module to provide fine-grained settings to ignore specific
   // projects or releases).
-  drupal_alter('update_status', $projects);
+  drupal_container()->get('module_handler')->alter('update_status', $projects);
 
   // Cache the site's update status for at most 1 hour.
   _update_cache_set('update_project_data', $projects, REQUEST_TIME + 3600);
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php b/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
index 571a255..c2efbb2 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
@@ -60,7 +60,7 @@ public function buildOptionsForm(&$form, &$form_state) {
     $module_info = system_get_info('module');
 
     // Get list of permissions
-    foreach (module_implements('permission') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('permission') as $module) {
       $permissions = module_invoke($module, 'permission');
       foreach ($permissions as $name => $perm) {
         $perms[$module_info[$module]['name']][$name] = strip_tags($perm['title']);
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php
index 10f0c5e..e2ca39a 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Permissions.php
@@ -51,7 +51,7 @@ function pre_render(&$values) {
       // display name.
       $module_info = system_get_info('module');
       $modules = array();
-      foreach (module_implements('permission') as $module) {
+      foreach (drupal_container()->get('module_handler')->getImplementations('permission') as $module) {
         $modules[$module] = $module_info[$module]['name'];
       }
       asort($modules);
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Permissions.php b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Permissions.php
index 7f26db9..49afe6d 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/filter/Permissions.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/filter/Permissions.php
@@ -28,7 +28,7 @@ function get_value_options() {
     // Get a list of all the modules implementing a hook_permission() and sort by
     // display name.
     $modules = array();
-    foreach (module_implements('permission') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('permission') as $module) {
       $modules[$module] = $module_info[$module]['name'];
     }
     asort($modules);
diff --git a/core/modules/user/user.admin.inc b/core/modules/user/user.admin.inc
index f04c97d..29a86da 100644
--- a/core/modules/user/user.admin.inc
+++ b/core/modules/user/user.admin.inc
@@ -330,7 +330,7 @@ function user_admin_settings($form, &$form_state) {
   );
 
   // @todo Remove this check once language settings are generalized.
-  if (module_exists('translation_entity')) {
+  if (drupal_container()->get('module_handler')->moduleExists('translation_entity')) {
     $form['language'] = array(
       '#type' => 'details',
       '#title' => t('Language settings'),
@@ -706,7 +706,7 @@ function user_admin_permissions($form, $form_state, $rid = NULL) {
   // Get a list of all the modules implementing a hook_permission() and sort by
   // display name.
   $modules = array();
-  foreach (module_implements('permission') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('permission') as $module) {
     $modules[$module] = $module_info[$module]['name'];
   }
   asort($modules);
diff --git a/core/modules/user/user.install b/core/modules/user/user.install
index 10e429c..a3a833b 100644
--- a/core/modules/user/user.install
+++ b/core/modules/user/user.install
@@ -657,7 +657,7 @@ function user_update_8011() {
 
   // User pictures can only be migrated to the new user picture image field
   // if Image module is installed.
-  if (!module_exists('image')) {
+  if (!drupal_container()->get('module_handler')->moduleExists('image')) {
     // Install image.module with schema version 8002 as a previous version
     // would have to create tables that would be removed again.
     $old_schema = update_module_enable(array('image'), 8002);
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 5635e16..804dc0e 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -705,7 +705,7 @@ function user_preprocess_block(&$variables) {
  */
 function user_format_name($account) {
   $name = !empty($account->name) ? $account->name : config('user.settings')->get('anonymous');
-  drupal_alter('user_format_name', $name, $account);
+  drupal_container()->get('module_handler')->alter('user_format_name', $name, $account);
   return $name;
 }
 
@@ -1906,7 +1906,7 @@ function user_role_delete_access($role) {
  */
 function user_permission_get_modules() {
   $permissions = array();
-  foreach (module_implements('permission') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('permission') as $module) {
     $perms = module_invoke($module, 'permission');
     foreach ($perms as $key => $value) {
       $permissions[$key] = $module;
@@ -2260,7 +2260,7 @@ function user_filters() {
   }
 
   $options = array();
-  foreach (module_implements('permission') as $module) {
+  foreach (drupal_container()->get('module_handler')->getImplementations('permission') as $module) {
     $function = $module . '_permission';
     if ($permissions = $function()) {
       asort($permissions);
diff --git a/core/modules/user/user.pages.inc b/core/modules/user/user.pages.inc
index 6559313..8f0d9eb 100644
--- a/core/modules/user/user.pages.inc
+++ b/core/modules/user/user.pages.inc
@@ -338,7 +338,7 @@ function user_cancel_methods() {
     ),
   );
   // Allow modules to customize account cancellation methods.
-  drupal_alter('user_cancel_methods', $methods);
+  drupal_container()->get('module_handler')->alter('user_cancel_methods', $methods);
 
   // Turn all methods into real form elements.
   $default_method = config('user.settings')->get('cancel_method');
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
index 943090f..4b82c4a 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
@@ -295,7 +295,7 @@ public function buildOptionsForm(&$form, &$form_state) {
       '#weight' => 150,
     );
     // Allow to alter the default values brought into the form.
-    drupal_alter('views_handler_options', $this->options, $view);
+    drupal_container()->get('module_handler')->alter('views_handler_options', $this->options, $view);
   }
 
   /**
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
index bb3fbdf..71459aa 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
@@ -1203,7 +1203,7 @@ public function optionsSummary(&$categories, &$options) {
         '***DEFAULT_LANGUAGE***' => t("Default site language"),
         LANGUAGE_NOT_SPECIFIED => t('Language neutral'),
     );
-    if (module_exists('language')) {
+    if (drupal_container()->get('module_handler')->moduleExists('language')) {
       $languages = array_merge($languages, language_list());
     }
     $options['field_langcode'] = array(
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php b/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
index f2846c3..88cd43c 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
@@ -205,7 +205,7 @@ public function buildOptionsForm(&$form, &$form_state) {
         );
 
         // Only display the menu selector if menu module is enabled.
-        if (module_exists('menu')) {
+        if (drupal_container()->get('module_handler')->moduleExists('menu')) {
           $form['menu']['name'] = array(
             '#title' => t('Menu'),
             '#type' => 'select',
@@ -322,7 +322,7 @@ public function buildOptionsForm(&$form, &$form_state) {
           ),
         );
         // Only display the menu selector if menu module is enabled.
-        if (module_exists('menu')) {
+        if (drupal_container()->get('module_handler')->moduleExists('menu')) {
           $form['tab_options']['name'] = array(
             '#title' => t('Menu'),
             '#type' => 'select',
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
index 55785d2..faf1afb 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
@@ -1401,7 +1401,7 @@ function get_where_args() {
    * Let modules modify the query just prior to finalizing it.
    */
   function alter(ViewExecutable $view) {
-    foreach (module_implements('views_query_alter') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_query_alter') as $module) {
       $function = $module . '_views_query_alter';
       $function($view, $this);
     }
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
index 50013dc..0d552ab 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
@@ -290,7 +290,7 @@ function build_form(array $form, array &$form_state) {
       '#prefix' => '<div id="edit-page-link-properties-wrapper">',
       '#suffix' => '</div>',
     );
-    if (module_exists('menu')) {
+    if (drupal_container()->get('module_handler')->moduleExists('menu')) {
       $menu_options = menu_get_menus();
     }
     else {
@@ -348,7 +348,7 @@ function build_form(array $form, array &$form_state) {
       );
     }
 
-    if (!module_exists('block')) {
+    if (!drupal_container()->get('module_handler')->moduleExists('block')) {
       return $form;
     }
 
diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php b/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php
index 232a847..0ac40a3 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php
+++ b/core/modules/views/lib/Drupal/views/Tests/ViewTestData.php
@@ -47,7 +47,7 @@ public static function importTestViews($class, $modules = array()) {
       );
       foreach ($modules as $module) {
         $config_dir = drupal_get_path('module', $module) . '/test_views';
-        if (!is_dir($config_dir) || !module_exists($module)) {
+        if (!is_dir($config_dir) || !drupal_container()->get('module_handler')->moduleExists($module)) {
           continue;
         }
 
diff --git a/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php b/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php
index 745a28c..10bb5a5 100644
--- a/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php
+++ b/core/modules/views/lib/Drupal/views/Tests/ViewsHooksTest.php
@@ -46,7 +46,7 @@ public function testHooks() {
     );
 
     foreach ($views_hooks as $hook) {
-      $implementations = module_implements($hook);
+      $implementations = drupal_container()->get('module_handler')->getImplementations($hook);
       $this->assertTrue(in_array('views_test_data', $implementations), format_string('The hook @hook was registered.', array('@hook' => $hook)));
 
       // Reset the module implements cache, so we ensure that the .views.inc
diff --git a/core/modules/views/lib/Drupal/views/ViewExecutable.php b/core/modules/views/lib/Drupal/views/ViewExecutable.php
index 898503f..bff9ae2 100644
--- a/core/modules/views/lib/Drupal/views/ViewExecutable.php
+++ b/core/modules/views/lib/Drupal/views/ViewExecutable.php
@@ -978,7 +978,7 @@ public function build($display_id = NULL) {
     }
 
     // Let modules modify the view just prior to building it.
-    foreach (module_implements('views_pre_build') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_pre_build') as $module) {
       $function = $module . '_views_pre_build';
       $function($this);
     }
@@ -1102,7 +1102,7 @@ public function build($display_id = NULL) {
     $this->attachDisplays();
 
     // Let modules modify the view just after building it.
-    foreach (module_implements('views_post_build') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_post_build') as $module) {
       $function = $module . '_views_post_build';
       $function($this);
     }
@@ -1180,7 +1180,7 @@ public function execute($display_id = NULL) {
     }
 
     // Let modules modify the view just prior to executing it.
-    foreach (module_implements('views_pre_execute') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_pre_execute') as $module) {
       $function = $module . '_views_pre_execute';
       $function($this);
     }
@@ -1208,7 +1208,7 @@ public function execute($display_id = NULL) {
     }
 
     // Let modules modify the view just after executing it.
-    foreach (module_implements('views_post_execute') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_post_execute') as $module) {
       $function = $module . '_views_post_execute';
       $function($this);
     }
@@ -1292,7 +1292,7 @@ public function render($display_id = NULL) {
       }
 
       // Let modules modify the view just prior to rendering it.
-      foreach (module_implements('views_pre_render') as $module) {
+      foreach (drupal_container()->get('module_handler')->getImplementations('views_pre_render') as $module) {
         $function = $module . '_views_pre_render';
         $function($this);
       }
@@ -1322,7 +1322,7 @@ public function render($display_id = NULL) {
     }
 
     // Let modules modify the view output after it is rendered.
-    foreach (module_implements('views_post_render') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_post_render') as $module) {
       $function = $module . '_views_post_render';
       $function($this, $this->display_handler->output, $cache);
     }
@@ -1414,7 +1414,7 @@ public function preExecute($args = array()) {
     }
 
     // Let modules modify the view just prior to executing it.
-    foreach (module_implements('views_pre_view') as $module) {
+    foreach (drupal_container()->get('module_handler')->getImplementations('views_pre_view') as $module) {
       $function = $module . '_views_pre_view';
       $function($this, $display_id, $this->args);
     }
diff --git a/core/modules/views/lib/Drupal/views/ViewStorageController.php b/core/modules/views/lib/Drupal/views/ViewStorageController.php
index 8a5f87a..8bc4839 100644
--- a/core/modules/views/lib/Drupal/views/ViewStorageController.php
+++ b/core/modules/views/lib/Drupal/views/ViewStorageController.php
@@ -23,7 +23,7 @@ public function load(array $ids = NULL) {
 
     // Only return views for enabled modules.
     return array_filter($entities, function ($entity) {
-      if (module_exists($entity->get('module'))) {
+      if (drupal_container()->get('module_handler')->moduleExists($entity->get('module'))) {
         return TRUE;
       }
       return FALSE;
diff --git a/core/modules/views/lib/Drupal/views/ViewsDataCache.php b/core/modules/views/lib/Drupal/views/ViewsDataCache.php
index e8d4747..ad6238e 100644
--- a/core/modules/views/lib/Drupal/views/ViewsDataCache.php
+++ b/core/modules/views/lib/Drupal/views/ViewsDataCache.php
@@ -170,7 +170,7 @@ protected function cacheGet($cid) {
    */
   protected function getData() {
     $data = module_invoke_all('views_data');
-    drupal_alter('views_data', $data);
+    drupal_container()->get('module_handler')->alter('views_data', $data);
 
     $this->processEntityTypes($data);
 
diff --git a/core/modules/views/views.module b/core/modules/views/views.module
index 8dc5f5a..d424c0f 100644
--- a/core/modules/views/views.module
+++ b/core/modules/views/views.module
@@ -696,7 +696,7 @@ function views_invalidate_cache() {
   state()->set('menu_rebuild_needed', TRUE);
 
   // Invalidate the block cache to update views block derivatives.
-  if (module_exists('block')) {
+  if (drupal_container()->get('module_handler')->moduleExists('block')) {
     drupal_container()->get('plugin.manager.block')->clearCachedDefinitions();
   }
 
@@ -952,7 +952,7 @@ function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
     }
     // @todo While Views is providing on behalf of core modules, check to see
     //   if they are enabled or not.
-    if (isset($plugin['module']) && !module_exists($plugin['module'])) {
+    if (isset($plugin['module']) && !drupal_container()->get('module_handler')->moduleExists($plugin['module'])) {
       continue;
     }
 
diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
index ca6478d..1c976fb 100644
--- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
+++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
@@ -99,7 +99,7 @@ public function form(array $form, array &$form_state, EntityInterface $view) {
       '#options' => $options,
     );
     $show_form = &$form['displays']['show'];
-    $default_value = module_exists('node') ? 'node' : 'users';
+    $default_value = drupal_container()->get('module_handler')->moduleExists('node') ? 'node' : 'users';
     $show_form['wizard_key']['#default_value'] = WizardPluginBase::getSelected($form_state, array('show', 'wizard_key'), $default_value, $show_form['wizard_key']);
     // Changing this dropdown updates the entire content of $form['displays'] via
     // AJAX.
diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
index 80d1b7c..6c96666 100644
--- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
+++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
@@ -333,7 +333,7 @@ public function getDisplayTab($view) {
     }
     // In AJAX context, ViewUI::rebuildCurrentTab() returns this outside of form
     // context, so hook_form_views_ui_edit_form_alter() is insufficient.
-    drupal_alter('views_ui_display_tab', $build, $view, $display_id);
+    drupal_container()->get('module_handler')->alter('views_ui_display_tab', $build, $view, $display_id);
     return $build;
   }
 
@@ -674,7 +674,7 @@ public function renderDisplayTop(ViewUI $view) {
     );
 
     // Let other modules add additional links here.
-    drupal_alter('views_ui_display_top_links', $element['extra_actions']['#links'], $view, $display_id);
+    drupal_container()->get('module_handler')->alter('views_ui_display_top_links', $element['extra_actions']['#links'], $view, $display_id);
 
     if (isset($view->type) && $view->type != t('Default')) {
       if ($view->type == t('Overridden')) {
diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
index f05f0de..fa1f13a 100644
--- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
+++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
@@ -82,7 +82,7 @@ public static function getAdminCSS() {
     $list[$module_path . '/css/views-admin.css'] = array();
     $list[$module_path . '/css/views-admin.theme.css'] = array();
 
-    if (module_exists('contextual')) {
+    if (drupal_container()->get('module_handler')->moduleExists('contextual')) {
       $list[$module_path . '/css/views-admin.contextual.css'] = array();
     }
 
diff --git a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php
index 8a26695..77a69dd 100644
--- a/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php
+++ b/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php
@@ -799,7 +799,7 @@ public function renderPreview($display_id, $args = array()) {
             $rows['statistics'][] = array('<strong>' . t('View render time') . '</strong>', t('@time ms', array('@time' => intval($this->executable->render_time * 100000) / 100)));
 
           }
-          drupal_alter('views_preview_info', $rows, $this);
+          drupal_container()->get('module_handler')->alter('views_preview_info', $rows, $this);
         }
         else {
           // No query was run. Display that information in place of either the
diff --git a/core/modules/views/views_ui/views_ui.module b/core/modules/views/views_ui/views_ui.module
index 9d89fdf..fdeb3c9 100644
--- a/core/modules/views/views_ui/views_ui.module
+++ b/core/modules/views/views_ui/views_ui.module
@@ -248,7 +248,7 @@ function views_ui_cache_set(ViewUI $view) {
  */
 function views_ui_preprocess_views_view(&$vars) {
   $view = $vars['view'];
-  if (!empty($view->live_preview) && module_exists('contextual')) {
+  if (!empty($view->live_preview) && drupal_container()->get('module_handler')->moduleExists('contextual')) {
     $view->hide_admin_links = TRUE;
     foreach (array('title', 'header', 'exposed', 'rows', 'pager', 'more', 'footer', 'empty', 'attachment_after', 'attachment_before') as $section) {
       if (!empty($vars[$section])) {
diff --git a/core/modules/xmlrpc/xmlrpc.server.inc b/core/modules/xmlrpc/xmlrpc.server.inc
index e1c160b..6d0a5e8 100644
--- a/core/modules/xmlrpc/xmlrpc.server.inc
+++ b/core/modules/xmlrpc/xmlrpc.server.inc
@@ -53,7 +53,7 @@ function xmlrpc_server($callbacks) {
   // with those defined by modules implementing the _xmlrpc hook.
   // Built-in methods are overridable.
   $callbacks = array_merge($defaults, (array) $callbacks);
-  drupal_alter('xmlrpc', $callbacks);
+  drupal_container()->get('module_handler')->alter('xmlrpc', $callbacks);
   foreach ($callbacks as $key => $callback) {
     // we could check for is_array($callback)
     if (is_int($key)) {
diff --git a/core/scripts/generate-d7-content.sh b/core/scripts/generate-d7-content.sh
index a19d329..eddfbe4 100644
--- a/core/scripts/generate-d7-content.sh
+++ b/core/scripts/generate-d7-content.sh
@@ -171,7 +171,7 @@
   else if ($i < 24) {
     $node->type = 'story';
   }
-  else if (module_exists('blog')) {
+  else if (drupal_container()->get('module_handler')->moduleExists('blog')) {
     $node->type = 'blog';
   }
   $node->sticky = 0;
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 3609bd7..c4bd37f 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -29,7 +29,7 @@
 
 // Bootstrap to perform initial validation or other operations.
 drupal_bootstrap(DRUPAL_BOOTSTRAP_CODE);
-if (!module_exists('simpletest')) {
+if (!drupal_container()->get('module_handler')->moduleExists('simpletest')) {
   simpletest_script_print_error("The simpletest module must be enabled before this script can run.");
   exit;
 }
diff --git a/core/themes/bartik/template.php b/core/themes/bartik/template.php
index 9a6c8a9..224ffee 100644
--- a/core/themes/bartik/template.php
+++ b/core/themes/bartik/template.php
@@ -34,7 +34,7 @@ function bartik_preprocess_html(&$variables) {
  */
 function bartik_process_html(&$variables) {
   // Hook into color.module.
-  if (module_exists('color')) {
+  if (drupal_container()->get('module_handler')->moduleExists('color')) {
     _color_html_alter($variables);
   }
 }
@@ -45,7 +45,7 @@ function bartik_process_html(&$variables) {
 function bartik_process_page(&$variables) {
   $site_config = config('system.site');
   // Hook into color.module.
-  if (module_exists('color')) {
+  if (drupal_container()->get('module_handler')->moduleExists('color')) {
     _color_page_alter($variables);
   }
   // Always print the site name and slogan, but if they are toggled off, we'll
diff --git a/core/update.php b/core/update.php
index 46d933b..a93f616 100644
--- a/core/update.php
+++ b/core/update.php
@@ -188,7 +188,7 @@ function update_results_page() {
 
   update_task_list();
   // Report end result.
-  if (module_exists('dblog') && user_access('access site reports')) {
+  if (drupal_container()->get('module_handler')->moduleExists('dblog') && user_access('access site reports')) {
     $log_message = ' All errors have been <a href="' . base_path() . '?q=admin/reports/dblog">logged</a>.';
   }
   else {
@@ -202,7 +202,7 @@ function update_results_page() {
     $last = reset($_SESSION['updates_remaining']);
     list($module, $version) = array_pop($last);
     $output = '<p class="error">The update process was aborted prematurely while running <strong>update #' . $version . ' in ' . $module . '.module</strong>.' . $log_message;
-    if (module_exists('dblog')) {
+    if (drupal_container()->get('module_handler')->moduleExists('dblog')) {
       $output .= ' You may need to check the <code>watchdog</code> database table manually.';
     }
     $output .= '</p>';
