diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index d6e6aee..657be36 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -11,6 +11,8 @@
 use Drupal\Component\Utility\Timer;
 use Drupal\Component\Utility\Unicode;
 use Drupal\Component\Utility\UrlHelper;
+use Drupal\Component\Utility\UrlValidator;
+use Drupal\Core\Bootstrap\Bootstrap;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Database\Database;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
@@ -159,13 +161,6 @@
 const DRUPAL_AUTHENTICATED_RID = 'authenticated';
 
 /**
- * The number of bytes in a kilobyte.
- *
- * For more information, visit http://en.wikipedia.org/wiki/Kilobyte.
- */
-const DRUPAL_KILOBYTE = 1024;
-
-/**
  * The maximum number of characters in a module or theme name.
  */
 const DRUPAL_EXTENSION_NAME_MAX_LENGTH = 50;
@@ -336,7 +331,7 @@ function config_get_config_directory($type = CONFIG_ACTIVE_DIRECTORY) {
   if (!empty($config_directories[$type])) {
     return $config_directories[$type];
   }
-  throw new \Exception(format_string('The configuration directory type %type does not exist.', array('%type' => $type)));
+  throw new Exception(format_string('The configuration directory type %type does not exist.', array('%type' => $type)));
 }
 
 /**
@@ -2370,31 +2365,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 107e515..4c7a8c1 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -11,6 +11,7 @@
 use Drupal\Component\Serialization\Json;
 use Drupal\Component\Serialization\Yaml;
 use Drupal\Component\Serialization\Exception\InvalidDataTypeException;
+use Drupal\Component\Utility\Bytes;
 use Drupal\Component\Utility\Crypt;
 use Drupal\Component\Utility\Number;
 use Drupal\Component\Utility\Settings;
@@ -807,17 +808,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\Component\Utility\Bytes::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 Bytes::parseSize($size);
 }
 
 /**
@@ -833,11 +829,11 @@ function parse_size($size) {
  *   A translated string representation of the size.
  */
 function format_size($size, $langcode = NULL) {
-  if ($size < DRUPAL_KILOBYTE) {
+  if ($size < Bytes::KILOBYTE) {
     return format_plural($size, '1 byte', '@count bytes', array(), array('langcode' => $langcode));
   }
   else {
-    $size = $size / DRUPAL_KILOBYTE; // Convert bytes to kilobytes.
+    $size = $size / Bytes::KILOBYTE; // Convert bytes to kilobytes.
     $units = array(
       t('@size KB', array(), array('langcode' => $langcode)),
       t('@size MB', array(), array('langcode' => $langcode)),
@@ -849,8 +845,8 @@ function format_size($size, $langcode = NULL) {
       t('@size YB', array(), array('langcode' => $langcode)),
     );
     foreach ($units as $unit) {
-      if (round($size, 2) >= DRUPAL_KILOBYTE) {
-        $size = $size / DRUPAL_KILOBYTE;
+      if (round($size, 2) >= Bytes::KILOBYTE) {
+        $size = $size / Bytes::KILOBYTE;
       }
       else {
         break;
diff --git a/core/includes/file.inc b/core/includes/file.inc
index c0cefa5..5b2760a 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -11,6 +11,10 @@
 use Drupal\Component\Utility\Settings;
 use Drupal\Component\Utility\String;
 use Drupal\Core\StreamWrapper\PublicStream;
+use Drupal\Component\Utility\Bytes;
+use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\HttpFoundation\BinaryFileResponse;
 
 /**
  * Stream wrapper bit flags that are the basis for composite types.
@@ -1271,11 +1275,11 @@ function file_upload_max_size() {
 
   if ($max_size < 0) {
     // Start with post_max_size.
-    $max_size = parse_size(ini_get('post_max_size'));
+    $max_size = Bytes::parseSize(ini_get('post_max_size'));
 
     // If upload_max_size is less, then reduce. Except if upload_max_size is
     // zero, which indicates no limit.
-    $upload_max = parse_size(ini_get('upload_max_filesize'));
+    $upload_max = Bytes::parseSize(ini_get('upload_max_filesize'));
     if ($upload_max > 0 && $upload_max < $max_size) {
       $max_size = $upload_max;
     }
diff --git a/core/lib/Drupal/Component/Utility/Bytes.php b/core/lib/Drupal/Component/Utility/Bytes.php
new file mode 100644
index 0000000..ee53a7b
--- /dev/null
+++ b/core/lib/Drupal/Component/Utility/Bytes.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Component\Utility\Bytes.
+ */
+namespace Drupal\Component\Utility;
+
+/**
+ * Provides helper methods for manipulating byte conversions.
+ */
+class Bytes {
+
+  /**
+   * The number of bytes in a kilobyte.
+   *
+   * For more information, visit http://en.wikipedia.org/wiki/Kilobyte.
+   */
+  const KILOBYTE = 1024;
+
+  /**
+   * Parses a given byte count.
+   *
+   * @param mixed $size
+   *   An integer or string 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 int
+   *   An integer representation of the size in bytes.
+   */
+  public static 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::KILOBYTE, stripos('bkmgtpezy', $unit[0])));
+    }
+    else {
+      return round($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..05c4706
--- /dev/null
+++ b/core/lib/Drupal/Core/Bootstrap/Bootstrap.php
@@ -0,0 +1,46 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Bootstrap\Bootstrap.
+ */
+namespace Drupal\Core\Bootstrap;
+
+use Drupal\Component\Utility\Bytes;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Provides helper methods for bootstrapping Drupal.
+ */
+class Bootstrap {
+
+  /**
+   * Compares the memory required for an operation to the available memory.
+   *
+   * @param string $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 bool
+   *   TRUE if there is sufficient memory to allow the operation, or FALSE
+   *   otherwise.
+   */
+  public static 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) || (Bytes::parseSize($memory_limit) >= Bytes::parseSize($required)));
+  }
+}
diff --git a/core/modules/color/color.module b/core/modules/color/color.module
index 7809f5f..3a50471 100644
--- a/core/modules/color/color.module
+++ b/core/modules/color/color.module
@@ -4,8 +4,9 @@
  * Allows users to change the color scheme of themes.
  */
 
-use Drupal\Core\Asset\CssOptimizer;
+use Drupal\Component\Utility\Bytes;
 use Drupal\Component\Utility\String;
+use Drupal\Core\Asset\CssOptimizer;
 
 /**
  * Implements hook_help().
@@ -377,7 +378,7 @@ function color_scheme_form_submit($form, &$form_state) {
     // scheme change based on a faulty memory calculation.
     $usage = memory_get_usage(TRUE);
     $memory_limit = ini_get('memory_limit');
-    $size = parse_size($memory_limit);
+    $size = Bytes::parseSize($memory_limit);
     if (!drupal_check_memory_limit($usage + $required, $memory_limit)) {
       drupal_set_message(t('There is not enough memory available to PHP to change this theme\'s color scheme. You need at least %size more. Check the <a href="@url">PHP documentation</a> for more information.', array('%size' => format_size($usage + $required - $size), '@url' => 'http://www.php.net/manual/ini.core.php#ini.sect.resource-limits')), 'error');
       return;
diff --git a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php
index 16ada1e..92a7ddc 100644
--- a/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php
+++ b/core/modules/file/lib/Drupal/file/Plugin/Field/FieldType/FileItem.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\file\Plugin\Field\FieldType;
 
+use Drupal\Component\Utility\Bytes;
+use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem;
 use Drupal\Core\TypedData\DataDefinition;
@@ -240,13 +242,13 @@ class FileItem extends EntityReferenceItem {
    * Form API callback.
    *
    * Ensures that a size has been entered and that it can be parsed by
-   * parse_size().
+   * \Drupal\Component\Utility\Bytes::parseSize().
    *
    * This function is assigned as an #element_validate callback in
    * instanceSettingsForm().
    */
   public static function validateMaxFilesize($element, &$form_state) {
-    if (!empty($element['#value']) && !is_numeric(parse_size($element['#value']))) {
+    if (!empty($element['#value']) && !is_numeric(Bytes::parseSize($element['#value']))) {
       form_error($element, $form_state, t('The "!name" option must contain a valid value. You may either leave the text field empty or enter a string like "512" (bytes), "80 KB" (kilobytes) or "50 MB" (megabytes).', array('!name' => t($element['title']))));
     }
   }
@@ -284,9 +286,9 @@ class FileItem extends EntityReferenceItem {
     $settings = $this->getSettings();
 
     // Cap the upload size according to the PHP limit.
-    $max_filesize = parse_size(file_upload_max_size());
+    $max_filesize = Bytes::parseSize(file_upload_max_size());
     if (!empty($settings['max_filesize'])) {
-      $max_filesize = min($max_filesize, parse_size($settings['max_filesize']));
+      $max_filesize = min($max_filesize, Bytes::parseSize($settings['max_filesize']));
     }
 
     // There is always a file size limit due to the PHP server limit.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php
deleted file mode 100644
index f94c419..0000000
--- a/core/modules/system/lib/Drupal/system/Tests/Bootstrap/MiscUnitTest.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/**
- * @file
- * Definition of Drupal\system\Tests\Bootstrap\MiscUnitTest.
- */
-
-namespace Drupal\system\Tests\Bootstrap;
-
-use Drupal\simpletest\UnitTestBase;
-
-/**
- * Tests miscellaneous functions in bootstrap.inc.
- */
-class MiscUnitTest extends UnitTestBase {
-
-  public static function getInfo() {
-    return array(
-      'name' => 'Miscellaneous bootstrap unit tests',
-      'description' => 'Test miscellaneous functions in bootstrap.inc.',
-      'group' => 'Bootstrap',
-    );
-  }
-
-  /**
-   * Tests that the drupal_check_memory_limit() function 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.');
-
-    // 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');
-
-    // 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.');
-
-    // 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.');
-  }
-}
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php
index a8a2662..64dd14f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/SizeUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Common;
 
+use Drupal\Component\Utility\Bytes;
 use Drupal\simpletest\UnitTestBase;
 
 /**
@@ -25,7 +26,7 @@ class SizeUnitTest extends UnitTestBase {
   }
 
   function setUp() {
-    $kb = DRUPAL_KILOBYTE;
+    $kb = Bytes::KILOBYTE;
     $this->exact_test_cases = array(
       '1 byte' => 1,
       '1 KB'   => $kb,
@@ -63,12 +64,12 @@ function testCommonFormatSize() {
   }
 
   /**
-   * Checks that parse_size() returns the proper byte sizes.
+   * Checks that Bytes::parseSize() returns the proper byte sizes.
    */
   function testCommonParseSize() {
     foreach ($this->exact_test_cases as $string => $size) {
       $this->assertEqual(
-        $parsed_size = parse_size($string),
+        $parsed_size = Bytes::parseSize($string),
         $size,
         $size . ' == ' . $parsed_size . ' (' . $string . ')'
       );
@@ -77,32 +78,32 @@ function testCommonParseSize() {
     // Some custom parsing tests
     $string = '23476892 bytes';
     $this->assertEqual(
-      ($parsed_size = parse_size($string)),
+      ($parsed_size = Bytes::parseSize($string)),
       $size = 23476892,
       $string . ' == ' . $parsed_size . ' bytes'
     );
     $string = '76MRandomStringThatShouldBeIgnoredByParseSize.'; // 76 MB
     $this->assertEqual(
-      $parsed_size = parse_size($string),
+      $parsed_size = Bytes::parseSize($string),
       $size = 79691776,
       $string . ' == ' . $parsed_size . ' bytes'
     );
     $string = '76.24 Giggabyte'; // Misspeld text -> 76.24 GB
     $this->assertEqual(
-      $parsed_size = parse_size($string),
+      $parsed_size = Bytes::parseSize($string),
       $size = 81862076662,
       $string . ' == ' . $parsed_size . ' bytes'
     );
   }
 
   /**
-   * Cross-tests parse_size() and format_size().
+   * Cross-tests Bytes::parseSize() and format_size().
    */
   function testCommonParseSizeFormatSize() {
     foreach ($this->exact_test_cases as $size) {
       $this->assertEqual(
         $size,
-        ($parsed_size = parse_size($string = format_size($size, NULL))),
+        ($parsed_size = Bytes::parseSize($string = format_size($size, NULL))),
         $size . ' == ' . $parsed_size . ' (' . $string . ')'
       );
     }
diff --git a/core/tests/Drupal/Tests/Core/Bootstrap/BootstrapTest.php b/core/tests/Drupal/Tests/Core/Bootstrap/BootstrapTest.php
new file mode 100644
index 0000000..2d1df42
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Bootstrap/BootstrapTest.php
@@ -0,0 +1,83 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Tests\Bootstrap\BootstrapTest.
+ */
+
+namespace Drupal\Tests\Core\Bootstrap;
+
+use Drupal\Core\Bootstrap\Bootstrap;
+use Drupal\Core\Controller\ControllerResolver;
+use Drupal\Tests\UnitTestCase;
+use Symfony\Component\HttpFoundation\Request;
+
+/**
+ * Tests for various bootstrap operations.
+ *
+ * @see \Drupal\Core\Bootstrap\Bootstrap
+ *
+ * @group Drupal
+ * @group Bootstrap
+ */
+class BootstrapTest extends UnitTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Overriding server variables',
+      'description' => 'Test that drupal_override_server_variables() works correctly.',
+      'group' => 'Bootstrap',
+    );
+  }
+
+  /**
+   * Tests that the Bootstrap::checkMemoryLimit() method works as expected.
+   *
+   * @param string $required
+   *   The required memory limit argument for Bootstrap::checkMemoryLimit().
+   * @param string $memory_limit
+   *   The memory limit argument for Bootstrap::checkMemoryLimit().
+   * @param boolean $expected
+   *   The expected return value from Bootstrap::checkMemoryLimit().
+   * @param string $message
+   *   The message to print on test failure.
+   *
+   * @dataProvider providerTestCheckMemoryLimit
+   */
+  public function testCheckMemoryLimit($required, $memory_limit, $expected, $message) {
+    $return = Bootstrap::checkMemoryLimit($required, $memory_limit);
+    $this->assertEquals($return, $expected, $message);
+  }
+
+  /**
+   * Data provider for self::testCheckMemoryLimit().
+   *
+   * @return array
+   *   An array of arrays, each containing:
+   *   - 'required' - The required memory limit argument for Bootstrap::checkMemoryLimit().
+   *   - 'memory_limit` - The memory limit argument for Bootstrap::checkMemoryLimit().
+   *   - 'expected' - The expected return value from Bootstrap::checkMemoryLimit().
+   *   - 'message' - The message to print on test failure.
+   */
+  public function providerTestCheckMemoryLimit() {
+    $memory_limit = ini_get('memory_limit');
+    $twice_avail_memory = ($memory_limit * 2) . 'MB';
+
+    return array(
+      // Test that a very reasonable amount of memory is available.
+      array('30MB', NULL, TRUE, '30MB of memory tested not available.'),
+
+      // Get the available memory and multiply it by two to make it unreasonably
+      // high.
+      array($twice_avail_memory, -1, TRUE, 'Bootstrap::checkMemoryLimit() failed to return 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.
+      array('30MB', '16MB', FALSE, 'Bootstrap::checkMemoryLimit() failed to return FALSE with a 16MB upper limit on a 30MB requirement.'),
+
+      // Test that an equal amount of memory to the amount requested returns TRUE.
+      array('30MB', '30MB', TRUE, 'Bootstrap::checkMemoryLimit() failed to return TRUE when requesting 30MB on a 30MB requirement.'),
+    );
+  }
+
+}
