diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index a2fea5c..536c32f 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -7,6 +7,7 @@
 use Drupal\Component\Utility\Timer;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\UrlValidator;
+use Drupal\Core\Bootstrap\Bootstrap;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
@@ -448,64 +449,11 @@ function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) {
 /**
  * Sets appropriate server variables needed for command line scripts to work.
  *
- * This function can be called by command line scripts before bootstrapping
- * Drupal, to ensure that the page loads with the desired server parameters.
- * This is because many parts of Drupal assume that they are running in a web
- * browser and therefore use information from the global PHP $_SERVER variable
- * that does not get set when Drupal is run from the command line.
- *
- * In many cases, the default way in which this function populates the $_SERVER
- * variable is sufficient, and it can therefore be called without passing in
- * any input. However, command line scripts running on a multisite installation
- * (or on any installation that has settings.php stored somewhere other than
- * the sites/default folder) need to pass in the URL of the site to allow
- * Drupal to detect the correct location of the settings.php file. Passing in
- * the 'url' parameter is also required for functions like request_uri() to
- * return the expected values.
- *
- * Most other parameters do not need to be passed in, but may be necessary in
- * some cases; for example, if Drupal::request()->getClientIP()
- * needs to return anything but the standard localhost value ('127.0.0.1'),
- * the command line script should pass in the desired value via the
- * 'REMOTE_ADDR' key.
- *
- * @param $variables
- *   (optional) An associative array of variables within $_SERVER that should
- *   be replaced. If the special element 'url' is provided in this array, it
- *   will be used to populate some of the server defaults; it should be set to
- *   the URL of the current page request, excluding any $_GET request but
- *   including the script name (e.g., http://www.example.com/mysite/index.php).
- *
- * @see conf_path()
- * @see request_uri()
- * @see \Symfony\Component\HttpFoundation\Request::getClientIP()
+ * @deprecated as of Drupal 8.0. Use
+ *   Drupal\Core\Bootstrap\Bootstrap::overrideServerVariables() directly instead.
  */
 function drupal_override_server_variables($variables = array()) {
-  // Allow the provided URL to override any existing values in $_SERVER.
-  if (isset($variables['url'])) {
-    $url = parse_url($variables['url']);
-    if (isset($url['host'])) {
-      $_SERVER['HTTP_HOST'] = $url['host'];
-    }
-    if (isset($url['path'])) {
-      $_SERVER['SCRIPT_NAME'] = $url['path'];
-    }
-    unset($variables['url']);
-  }
-  // Define default values for $_SERVER keys. These will be used if $_SERVER
-  // does not already define them and no other values are passed in to this
-  // function.
-  $defaults = array(
-    'HTTP_HOST' => 'localhost',
-    'SCRIPT_NAME' => NULL,
-    'REMOTE_ADDR' => '127.0.0.1',
-    'REQUEST_METHOD' => 'GET',
-    'SERVER_NAME' => NULL,
-    'SERVER_SOFTWARE' => NULL,
-    'HTTP_USER_AGENT' => NULL,
-  );
-  // Replace elements of the $_SERVER array, as appropriate.
-  $_SERVER = $variables + $_SERVER + $defaults;
+  Bootstrap::overrideServerVariables($variables);
 }
 
 /**
@@ -3077,31 +3025,12 @@ function _drupal_shutdown_function() {
 /**
  * Compares the memory required for an operation to the available memory.
  *
- * @param $required
- *   The memory required for the operation, expressed as a number of bytes with
- *   optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8bytes,
- *   9mbytes).
- * @param $memory_limit
- *   (optional) The memory limit for the operation, expressed as a number of
- *   bytes with optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G,
- *   6GiB, 8bytes, 9mbytes). If no value is passed, the current PHP
- *   memory_limit will be used. Defaults to NULL.
- *
- * @return
- *   TRUE if there is sufficient memory to allow the operation, or FALSE
- *   otherwise.
+ * @deprecated as of Drupal 8.0.
+ *   Use Drupal\Core\Bootstrap\Bootstrap::checkMemoryLimit() directly
+ *   instead.
  */
 function drupal_check_memory_limit($required, $memory_limit = NULL) {
-  if (!isset($memory_limit)) {
-    $memory_limit = ini_get('memory_limit');
-  }
-
-  // There is sufficient memory if:
-  // - No memory limit is set.
-  // - The memory limit is set to unlimited (-1).
-  // - The memory limit is greater than or equal to the memory required for
-  //   the operation.
-  return ((!$memory_limit) || ($memory_limit == -1) || (parse_size($memory_limit) >= parse_size($required)));
+  return Bootstrap::checkMemoryLimit($required, $memory_limit);
 }
 
 /**
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 3215de9..825ffba 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -1151,17 +1151,12 @@ function format_plural($count, $singular, $plural, array $args = array(), array
  *
  * @return
  *   An integer representation of the size in bytes.
+ *
+ * @deprecated as of Drupal 8.0. Use
+ *   \Drupal\Core\Bootstrap\Bootstrap::parseSize() directly instead.
  */
 function parse_size($size) {
-  $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
-  $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
-  if ($unit) {
-    // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
-    return round($size * pow(DRUPAL_KILOBYTE, stripos('bkmgtpezy', $unit[0])));
-  }
-  else {
-    return round($size);
-  }
+  return Bootstrap::parseSize($size);
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Bootstrap/Bootstrap.php b/core/lib/Drupal/Core/Bootstrap/Bootstrap.php
new file mode 100644
index 0000000..f29ed75
--- /dev/null
+++ b/core/lib/Drupal/Core/Bootstrap/Bootstrap.php
@@ -0,0 +1,136 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Bootstrap\Bootstrap.
+ */
+namespace Drupal\Core\Bootstrap;
+
+/**
+ * Provides helper methods for bootstrapping Drupal.
+ */
+class Bootstrap {
+
+  /**
+   * The number of bytes in a kilobyte.
+   *
+   * For more information, visit http://en.wikipedia.org/wiki/Kilobyte.
+   */
+  const DRUPAL_KILOBYTE = 1024;
+
+  /**
+   * Compares the memory required for an operation to the available memory.
+   *
+   * @param $required
+   *   The memory required for the operation, expressed as a number of bytes with
+   *   optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8bytes,
+   *   9mbytes).
+   * @param $memory_limit
+   *   (optional) The memory limit for the operation, expressed as a number of
+   *   bytes with optional SI or IEC binary unit prefix (e.g. 2, 3K, 5MB, 10G,
+   *   6GiB, 8bytes, 9mbytes). If no value is passed, the current PHP
+   *   memory_limit will be used. Defaults to NULL.
+   *
+   * @return
+   *   TRUE if there is sufficient memory to allow the operation, or FALSE
+   *   otherwise.
+   */
+  function checkMemoryLimit($required, $memory_limit = NULL) {
+    if (!isset($memory_limit)) {
+      $memory_limit = ini_get('memory_limit');
+    }
+
+    // There is sufficient memory if:
+    // - No memory limit is set.
+    // - The memory limit is set to unlimited (-1).
+    // - The memory limit is greater than or equal to the memory required for
+    //   the operation.
+    return ((!$memory_limit) || ($memory_limit == -1) || (self::parseSize($memory_limit) >= self::parseSize($required)));
+  }
+
+  /**
+   * Sets appropriate server variables needed for command line scripts to work.
+   *
+   * This function can be called by command line scripts before bootstrapping
+   * Drupal, to ensure that the page loads with the desired server parameters.
+   * This is because many parts of Drupal assume that they are running in a web
+   * browser and therefore use information from the global PHP $_SERVER variable
+   * that does not get set when Drupal is run from the command line.
+   *
+   * In many cases, the default way in which this function populates the $_SERVER
+   * variable is sufficient, and it can therefore be called without passing in
+   * any input. However, command line scripts running on a multisite installation
+   * (or on any installation that has settings.php stored somewhere other than
+   * the sites/default folder) need to pass in the URL of the site to allow
+   * Drupal to detect the correct location of the settings.php file. Passing in
+   * the 'url' parameter is also required for functions like request_uri() to
+   * return the expected values.
+   *
+   * Most other parameters do not need to be passed in, but may be necessary in
+   * some cases; for example, if Drupal::request()->getClientIP()
+   * needs to return anything but the standard localhost value ('127.0.0.1'),
+   * the command line script should pass in the desired value via the
+   * 'REMOTE_ADDR' key.
+   *
+   * @param $variables
+   *   (optional) An associative array of variables within $_SERVER that should
+   *   be replaced. If the special element 'url' is provided in this array, it
+   *   will be used to populate some of the server defaults; it should be set to
+   *   the URL of the current page request, excluding any $_GET request but
+   *   including the script name (e.g., http://www.example.com/mysite/index.php).
+   *
+   * @see conf_path()
+   * @see request_uri()
+   * @see \Symfony\Component\HttpFoundation\Request::getClientIP()
+   */
+  function overrideServerVariables($variables = array()) {
+    // Allow the provided URL to override any existing values in $_SERVER.
+    if (isset($variables['url'])) {
+      $url = parse_url($variables['url']);
+      if (isset($url['host'])) {
+        $_SERVER['HTTP_HOST'] = $url['host'];
+      }
+      if (isset($url['path'])) {
+        $_SERVER['SCRIPT_NAME'] = $url['path'];
+      }
+      unset($variables['url']);
+    }
+    // Define default values for $_SERVER keys. These will be used if $_SERVER
+    // does not already define them and no other values are passed in to this
+    // function.
+    $defaults = array(
+      'HTTP_HOST' => 'localhost',
+      'SCRIPT_NAME' => NULL,
+      'REMOTE_ADDR' => '127.0.0.1',
+      'REQUEST_METHOD' => 'GET',
+      'SERVER_NAME' => NULL,
+      'SERVER_SOFTWARE' => NULL,
+      'HTTP_USER_AGENT' => NULL,
+    );
+    // Replace elements of the $_SERVER array, as appropriate.
+    $_SERVER = $variables + $_SERVER + $defaults;
+  }
+
+  /**
+   * Parses a given byte count.
+   *
+   * @param $size
+   *   A size expressed as a number of bytes with optional SI or IEC binary unit
+   *   prefix (e.g. 2, 3K, 5MB, 10G, 6GiB, 8 bytes, 9mbytes).
+   *
+   * @return
+   *   An integer representation of the size in bytes.
+   */
+  function parseSize($size) {
+    $unit = preg_replace('/[^bkmgtpezy]/i', '', $size); // Remove the non-unit characters from the size.
+    $size = preg_replace('/[^0-9\.]/', '', $size); // Remove the non-numeric characters from the size.
+    if ($unit) {
+      // Find the position of the unit in the ordered string which is the power of magnitude to multiply a kilobyte by.
+      return round($size * pow(self::DRUPAL_KILOBYTE, stripos('bkmgtpezy', $unit[0])));
+    }
+    else {
+      return round($size);
+    }
+  }
+
+}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php
deleted file mode 100644
index 0717b10..0000000
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/OverrideServerVariablesUnitTest.php
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of Drupal\system\Tests\Bootstrap\OverrideServerVariablesUnitTest.
- */
-
-namespace Drupal\system\Tests\Bootstrap;
-
-use Drupal\simpletest\UnitTestBase;
-
-/**
- * Tests for overriding server variables via the API.
- */
-class OverrideServerVariablesUnitTest extends UnitTestBase {
-  public static function getInfo() {
-    return array(
-      'name' => 'Overriding server variables',
-      'description' => 'Test that drupal_override_server_variables() works correctly.',
-      'group' => 'Bootstrap',
-    );
-  }
-
-  /**
-   * Tests providing a direct URL to to drupal_override_server_variables().
-   */
-  function testDrupalOverrideServerVariablesProvidedURL() {
-    $tests = array(
-      'http://example.com' => array(
-        'HTTP_HOST' => 'example.com',
-        'SCRIPT_NAME' => isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL,
-      ),
-      'http://example.com/index.php' => array(
-        'HTTP_HOST' => 'example.com',
-        'SCRIPT_NAME' => '/index.php',
-      ),
-      'http://example.com/subdirectory/index.php' => array(
-        'HTTP_HOST' => 'example.com',
-        'SCRIPT_NAME' => '/subdirectory/index.php',
-      ),
-    );
-    foreach ($tests as $url => $expected_server_values) {
-      // Remember the original value of $_SERVER, since the function call below
-      // will modify it.
-      $original_server = $_SERVER;
-      // Call drupal_override_server_variables() and ensure that all expected
-      // $_SERVER variables were modified correctly.
-      drupal_override_server_variables(array('url' => $url));
-      foreach ($expected_server_values as $key => $value) {
-        $this->assertIdentical($_SERVER[$key], $value);
-      }
-      // Restore the original value of $_SERVER.
-      $_SERVER = $original_server;
-    }
-  }
-}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php b/core/tests/Drupal/Tests/Core/Bootstrap/MiscUnitTest.php
similarity index 56%
rename from core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php
rename to core/tests/Drupal/Tests/Core/Bootstrap/MiscUnitTest.php
index f94c419..3518cd2 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php
+++ b/core/tests/Drupal/Tests/Core/Bootstrap/MiscUnitTest.php
@@ -5,14 +5,15 @@
  * Definition of Drupal\system\Tests\Bootstrap\MiscUnitTest.
  */
 
-namespace Drupal\system\Tests\Bootstrap;
+namespace Drupal\Tests\Core\Bootstrap;
 
-use Drupal\simpletest\UnitTestBase;
+use Drupal\Core\Bootstrap\Bootstrap;
+use Drupal\Tests\UnitTestCase;
 
 /**
  * Tests miscellaneous functions in bootstrap.inc.
  */
-class MiscUnitTest extends UnitTestBase {
+class MiscUnitTest extends UnitTestCase {
 
   public static function getInfo() {
     return array(
@@ -23,24 +24,24 @@ public static function getInfo() {
   }
 
   /**
-   * Tests that the drupal_check_memory_limit() function works as expected.
+   * Tests that the Bootstrap::checkMemoryLimit() method works as expected.
    */
   function testCheckMemoryLimit() {
     $memory_limit = ini_get('memory_limit');
     // Test that a very reasonable amount of memory is available.
-    $this->assertTrue(drupal_check_memory_limit('30MB'), '30MB of memory tested available.');
+    $this->assertTrue(Bootstrap::checkMemoryLimit('30MB'), '30MB of memory tested available.');
 
     // Get the available memory and multiply it by two to make it unreasonably
     // high.
     $twice_avail_memory = ($memory_limit * 2) . 'MB';
     // The function should always return true if the memory limit is set to -1.
-    $this->assertTrue(drupal_check_memory_limit($twice_avail_memory, -1), 'drupal_check_memory_limit() returns TRUE when a limit of -1 (none) is supplied');
+    $this->assertTrue(Bootstrap::checkMemoryLimit($twice_avail_memory, -1), 'Bootstrap::checkMemoryLimit() returns TRUE when a limit of -1 (none) is supplied');
 
     // Test that even though we have 30MB of memory available - the function
     // returns FALSE when given an upper limit for how much memory can be used.
-    $this->assertFalse(drupal_check_memory_limit('30MB', '16MB'), 'drupal_check_memory_limit() returns FALSE with a 16MB upper limit on a 30MB requirement.');
+    $this->assertFalse(Bootstrap::checkMemoryLimit('30MB', '16MB'), 'Bootstrap::checkMemoryLimit() returns FALSE with a 16MB upper limit on a 30MB requirement.');
 
     // Test that an equal amount of memory to the amount requested returns TRUE.
-    $this->assertTrue(drupal_check_memory_limit('30MB', '30MB'), 'drupal_check_memory_limit() returns TRUE when requesting 30MB on a 30MB requirement.');
+    $this->assertTrue(Bootstrap::checkMemoryLimit('30MB', '30MB'), 'Bootstrap::checkMemoryLimit() returns TRUE when requesting 30MB on a 30MB requirement.');
   }
 }
diff --git a/core/tests/Drupal/Tests/Core/Bootstrap/OverrideServerVariablesUnitTest.php b/core/tests/Drupal/Tests/Core/Bootstrap/OverrideServerVariablesUnitTest.php
new file mode 100644
index 0000000..7becbbc
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Bootstrap/OverrideServerVariablesUnitTest.php
@@ -0,0 +1,73 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\system\Tests\Bootstrap\OverrideServerVariablesUnitTest.
+ */
+
+namespace Drupal\Tests\Core\Bootstrap;
+
+use Drupal\Core\Bootstrap\Bootstrap;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * Tests for overriding server variables via the API.
+ */
+class OverrideServerVariablesUnitTest extends UnitTestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Overriding server variables',
+      'description' => 'Test that drupal_override_server_variables() works correctly.',
+      'group' => 'Bootstrap',
+    );
+  }
+
+  /**
+   * Tests providing a direct URL to to drupal_override_server_variables().
+   *
+   * @dataProvider provider
+   */
+  function testDrupalOverrideServerVariablesProvidedURL($url, $expected_server_values) {
+    // Remember the original value of $_SERVER, since the function call below
+    // will modify it.
+    $original_server = $_SERVER;
+    // Call drupal_override_server_variables() and ensure that all expected
+    // $_SERVER variables were modified correctly.
+    Bootstrap::overrideServerVariables(array('url' => $url));
+    foreach ($expected_server_values as $key => $value) {
+      $this->assertSame($_SERVER[$key], $value);
+    }
+    // Restore the original value of $_SERVER.
+    $_SERVER = $original_server;
+  }
+
+  /**
+   * Provide data for self::testDrupalOverrideServerVariablesProvideURL().
+   */
+  public function provider() {
+    return array(
+      // Array of the form array(uri, expected values).
+      array(
+        'http://example.com',
+        array(
+          'HTTP_HOST' => 'example.com',
+          'SCRIPT_NAME' => isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] : NULL,
+        ),
+      ),
+      array(
+        'http://example.com/index.php',
+        array(
+          'HTTP_HOST' => 'example.com',
+          'SCRIPT_NAME' => '/index.php',
+        ),
+      ),
+      array(
+        'http://example.com/subdirectory/index.php',
+        array(
+          'HTTP_HOST' => 'example.com',
+          'SCRIPT_NAME' => '/subdirectory/index.php',
+        ),
+      ),
+    );
+  }
+}
