diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index b3deb32..f88138d 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1220,19 +1220,6 @@ function template_preprocess_html(&$variables) {
     $variables['db_offline'] = TRUE;
   }
 
-  // Add a variable for the root path. This can be used to create a class and
-  // theme the page depending on the current path (e.g. node, admin, user) as
-  // well as more specific data like path-frontpage.
-  $is_front_page =  \Drupal::service('path.matcher')->isFrontPage();
-
-  if ($is_front_page) {
-    $variables['root_path'] = FALSE;
-  }
-  else {
-    $system_path = \Drupal::service('path.current')->getPath();
-    $variables['root_path'] = explode('/', $system_path)[1];
-  }
-
   $site_config = \Drupal::config('system.site');
   // Construct page title.
   if (isset($variables['page']['#title']) && is_array($variables['page']['#title'])) {
@@ -1306,22 +1293,11 @@ function template_preprocess_page(&$variables) {
   }
 
   $variables['base_path']         = base_path();
-  $variables['front_page']        = \Drupal::url('<front>');
   $variables['language']          = $language_interface;
   $variables['logo']              = theme_get_setting('logo.url');
   $variables['site_name']         = (theme_get_setting('features.name') ? $site_config->get('name') : '');
   $variables['site_slogan']['#markup'] = (theme_get_setting('features.slogan') ? $site_config->get('slogan') : '');
 
-  // An exception might be thrown.
-  try {
-    $variables['is_front'] = \Drupal::service('path.matcher')->isFrontPage();
-  }
-  catch (Exception $e) {
-    // If the database is not yet available, set default values for these
-    // variables.
-    $variables['is_front'] = FALSE;
-    $variables['db_is_active'] = FALSE;
-  }
   if (!defined('MAINTENANCE_MODE')) {
     $variables['action_links']   = menu_get_local_actions();
     $variables['tabs']           = menu_local_tabs();
@@ -1398,10 +1374,6 @@ function theme_get_suggestions($args, $base, $delimiter = '__') {
       $prefix .= $delimiter . $arg;
     }
   }
-  if (\Drupal::service('path.matcher')->isFrontPage()) {
-    // Front templates should be based on root only, not prefixed arguments.
-    $suggestions[] = $base . $delimiter . 'front';
-  }
 
   return $suggestions;
 }
diff --git a/core/lib/Drupal/Core/Extension/Extension.php b/core/lib/Drupal/Core/Extension/Extension.php
index 3c765fe..e1e9b3d 100644
--- a/core/lib/Drupal/Core/Extension/Extension.php
+++ b/core/lib/Drupal/Core/Extension/Extension.php
@@ -166,8 +166,9 @@ public function __call($method, array $args) {
    * Serializes the Extension object in the most optimized way.
    */
   public function serialize() {
+    // Don't serialize the app root, since this could change if the install is
+    // moved..
     $data = array(
-      'root' => $this->root,
       'type' => $this->type,
       'pathname' => $this->pathname,
       'filename' => $this->filename,
@@ -188,7 +189,8 @@ public function serialize() {
    */
   public function unserialize($data) {
     $data = unserialize($data);
-    $this->root = $data['root'];
+    // Get the app root from the container.
+    $this->root = DRUPAL_ROOT;
     $this->type = $data['type'];
     $this->pathname = $data['pathname'];
     $this->filename = $data['filename'];
diff --git a/core/lib/Drupal/Core/Routing/RouteProvider.php b/core/lib/Drupal/Core/Routing/RouteProvider.php
index 58b8320..55df9e8 100644
--- a/core/lib/Drupal/Core/Routing/RouteProvider.php
+++ b/core/lib/Drupal/Core/Routing/RouteProvider.php
@@ -226,6 +226,8 @@ public function preLoadRoutes($names) {
    * {@inheritdoc}
    */
   public function getRoutesByNames($names) {
+    $e = new \Exception();
+    file_put_contents('/tmp/trace.txt', $e->getTraceAsString() . "\n", FILE_APPEND);
     $this->preLoadRoutes($names);
 
     foreach ($names as $name) {
diff --git a/core/modules/system/src/Controller/DbUpdateController.php b/core/modules/system/src/Controller/DbUpdateController.php
index 28ab72b..45e21fe 100644
--- a/core/modules/system/src/Controller/DbUpdateController.php
+++ b/core/modules/system/src/Controller/DbUpdateController.php
@@ -210,9 +210,7 @@ protected function info(Request $request) {
     );
 
     $info[] = $this->t("<strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.");
-    $info[] = $this->t('Put your site into <a href="@url">maintenance mode</a>.', array(
-      '@url' => Url::fromRoute('system.site_maintenance_mode')->toString(TRUE)->getGeneratedUrl(),
-    ));
+    $info[] = $this->t('Put your site into maintenance mode.');
     $info[] = $this->t('<strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.');
     $info[] = $this->t('Install your new files in the appropriate location, as described in the handbook.');
     $build['info'] = array(
@@ -228,7 +226,7 @@ protected function info(Request $request) {
       '#type' => 'link',
       '#title' => $this->t('Continue'),
       '#attributes' => array('class' => array('button', 'button--primary')),
-      '#url' => Url::fromUri($request->getUriForPath('/selection')),
+      '#url' => Url::fromUri('base://selection'),
     );
     return $build;
   }
@@ -340,9 +338,7 @@ protected function selection(Request $request) {
       else {
         $build['start']['#title'] = $this->formatPlural($count, '1 pending update', '@count pending updates');
       }
-      // @todo Simplify with https://www.drupal.org/node/2548095
-      $base_url = str_replace('/update.php', '', $request->getBaseUrl());
-      $url = (new Url('system.db_update', array('op' => 'run')))->setOption('base_url', $base_url);
+      $url = Url::fromUri('base://run');
       $build['link'] = array(
         '#type' => 'link',
         '#title' => $this->t('Apply pending updates'),
@@ -484,7 +480,7 @@ protected function results(Request $request) {
    */
   public function requirements($severity, array $requirements, Request $request) {
     $options = $severity == REQUIREMENT_WARNING ? array('continue' => 1) : array();
-    $try_again_url = Url::fromUri($request->getUriForPath(''))->setOptions(['query' => $options])->toString(TRUE)->getGeneratedUrl();
+    $try_again_url = Url::fromUri('base://')->setOptions(['query' => $options])->toString(TRUE)->getGeneratedUrl();
 
     $build['status_report'] = array(
       '#theme' => 'status_report',
@@ -580,7 +576,7 @@ protected function triggerBatch(Request $request) {
     );
     batch_set($batch);
 
-    return batch_process(Url::fromUri($request->getUriForPath('/results')), Url::fromUri($request->getUriForPath('/start')));
+    return batch_process(Url::fromUri('base://results'), Url::fromUri('base://start'));
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
index d3d103d..a0c3f2d 100644
--- a/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
+++ b/core/modules/system/src/Tests/Update/UpdatePathTestBase.php
@@ -132,7 +132,7 @@ function __construct($test_id = NULL) {
     $this->zlibInstalled = function_exists('gzopen');
 
     // Set the update url.
-    $this->updateUrl = Url::fromRoute('system.db_update');
+    $this->updateUrl = Url::fromUri('base://update.php');
   }
 
   /**
@@ -173,9 +173,6 @@ protected function setUp() {
     // Add the config directories to settings.php.
     drupal_install_config_directories();
 
-    // Install any additional modules.
-    $this->installModulesFromClassProperty($container);
-
     // Restore the original Simpletest batch.
     $this->restoreBatch();
 
@@ -183,6 +180,7 @@ protected function setUp() {
     $this->rebuildAll();
 
     // Replace User 1 with the user created here.
+    // @todo: do this without saving the user account.
     /** @var \Drupal\user\UserInterface $account */
     $account = User::load(1);
     $account->setPassword($this->rootUser->pass_raw);
@@ -260,7 +258,9 @@ protected function rebuildAll() {
     // We know the rebuild causes notices, so don't exit on failure.
     $die_on_fail = $this->dieOnFail;
     $this->dieOnFail = FALSE;
-    parent::rebuildAll();
+
+    // Initialize the container. parent::rebuildall() is not safe to call here.
+    $this->container = \Drupal::getContainer();
 
     // Remove the notices we get due to the menu link rebuild prior to running
     // the system updates for the schema change.
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index 865e101..e7b9717 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -244,55 +244,6 @@ function system_hook_info() {
 /**
  * Implements hook_theme_suggestions_HOOK().
  */
-function system_theme_suggestions_html(array $variables) {
-  if (\Drupal::service('path.matcher')->isFrontPage()) {
-    $path_args = [''];
-  }
-  else {
-    $path_args = explode('/', Url::fromRoute('<current>')->getInternalPath());
-  }
-  return theme_get_suggestions($path_args, 'html');
-}
-
-/**
- * Implements hook_theme_suggestions_HOOK().
- */
-function system_theme_suggestions_page(array $variables) {
-  if (\Drupal::service('path.matcher')->isFrontPage()) {
-    $path_args = [''];
-  }
-  else {
-    $path_args = explode('/', Url::fromRoute('<current>')->getInternalPath());
-  }
-  return theme_get_suggestions($path_args, 'page');
-}
-
-/**
- * Implements hook_theme_suggestions_HOOK().
- */
-function system_theme_suggestions_maintenance_page(array $variables) {
-  $suggestions = array();
-
-  // Dead databases will show error messages so supplying this template will
-  // allow themers to override the page and the content completely.
-  $offline = defined('MAINTENANCE_MODE');
-  try {
-    \Drupal::service('path.matcher')->isFrontPage();
-  }
-  catch (Exception $e) {
-    // The database is not yet available.
-    $offline = TRUE;
-  }
-  if ($offline) {
-    $suggestions[] = 'maintenance_page__offline';
-  }
-
-  return $suggestions;
-}
-
-/**
- * Implements hook_theme_suggestions_HOOK().
- */
 function system_theme_suggestions_region(array $variables) {
   $suggestions = array();
   if (!empty($variables['elements']['#region'])) {
@@ -666,7 +617,6 @@ function system_js_settings_alter(&$settings, AttachedAssetsInterface $assets) {
     'pathPrefix' => $pathPrefix,
     'currentPath' => $current_path,
     'currentPathIsAdmin' => $current_path_is_admin,
-    'isFront' => \Drupal::service('path.matcher')->isFrontPage(),
     'currentLanguage' => \Drupal::languageManager()->getCurrentLanguage(LanguageInterface::TYPE_URL)->getId(),
   ];
   if (!empty($current_query)) {
