diff --git a/core/authorize.php b/core/authorize.php
index 1544aa9..c073f70 100644
--- a/core/authorize.php
+++ b/core/authorize.php
@@ -90,6 +90,16 @@ function authorize_access_allowed() {
 // Initialize the maintenance theme for this administrative script.
 drupal_maintenance_theme();
 
+$container = drupal_container();
+$container->register('css_asset_manager', 'Drupal\Core\Asset\CssAssetManager')
+  ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+  ->setFactoryMethod('get')
+  ->addArgument('css');
+$container->register('js_asset_manager', 'Drupal\Core\Asset\JsAssetManager')
+  ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+  ->setFactoryMethod('get')
+  ->addArgument('js');
+
 $output = '';
 $show_messages = TRUE;
 
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 0f252ca..536324f 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -2689,42 +2689,17 @@ function drupal_add_css($data = NULL, $options = NULL) {
  * @see drupal_add_css()
  */
 function drupal_get_css($css = NULL, $skip_alter = FALSE) {
-  if (!isset($css)) {
-    $css = drupal_add_css();
-  }
+  $styles = drupal_container()->get('css_asset_manager');
+  $styles->set($css);
 
   // Allow modules and themes to alter the CSS items.
   if (!$skip_alter) {
-    drupal_alter('css', $css);
-  }
-
-  // Sort CSS items, so that they appear in the correct order.
-  uasort($css, 'drupal_sort_css_js');
-
-  // Remove the overridden CSS files. Later CSS files override former ones.
-  $previous_item = array();
-  foreach ($css as $key => $item) {
-    if ($item['type'] == 'file') {
-      // If defined, force a unique basename for this file.
-      $basename = isset($item['basename']) ? $item['basename'] : drupal_basename($item['data']);
-      if (isset($previous_item[$basename])) {
-        // Remove the previous item that shared the same base name.
-        unset($css[$previous_item[$basename]]);
-      }
-      $previous_item[$basename] = $key;
-    }
+    drupal_alter('css', $styles->assets);
   }
 
-  // Render the HTML needed to load the CSS.
-  $styles = array(
-    '#type' => 'styles',
-    '#items' => $css,
-  );
-  if (!empty($setting)) {
-    $styles['#attached']['js'][] = array('type' => 'setting', 'data' => $setting);
-  }
+  $styles->sort();
 
-  return drupal_render($styles);
+  return $styles->render();
 }
 
 /**
@@ -3873,81 +3848,19 @@ function drupal_js_defaults($data = NULL) {
  * @see locale_js_alter()
  * @see drupal_js_defaults()
  */
-function drupal_get_js($scope = 'header', $javascript = NULL, $skip_alter = FALSE) {
-  if (!isset($javascript)) {
-    $javascript = drupal_add_js();
-  }
-  if (empty($javascript)) {
-    return '';
-  }
+function drupal_get_js($scope = 'header', $js = NULL, $skip_alter = FALSE) {
+  $javascript = drupal_container()->get('js_asset_manager');
+  return;
+  $javascript->set($js);
 
   // Allow modules to alter the JavaScript.
   if (!$skip_alter) {
-    drupal_alter('js', $javascript);
+    drupal_alter('js', $javascript->assets);
   }
 
-  // Filter out elements of the given scope.
-  $items = array();
-  foreach ($javascript as $key => $item) {
-    if ($item['scope'] == $scope) {
-      $items[$key] = $item;
-    }
-  }
-
-  if (!empty($items)) {
-    // Sort the JavaScript files so that they appear in the correct order.
-    uasort($items, 'drupal_sort_css_js');
-    // Don't add settings if there is no other JavaScript on the page, unless
-    // this is an AJAX request.
-    // @todo Clean up container call.
-    $container = drupal_container();
-    if ($container->has('request') && $container->has('content_negotiation')) {
-      $type = $container->get('content_negotiation')->getContentType($container->get('request'));
-    }
-    if (!empty($items['settings']) || (!empty($type) && $type == 'ajax')) {
-      global $theme_key;
-      // Provide the page with information about the theme that's used, so that
-      // a later AJAX request can be rendered using the same theme.
-      // @see ajax_base_page_theme()
-      $setting['ajaxPageState']['theme'] = $theme_key;
-      // Checks that the DB is available before filling theme_token.
-      if (!defined('MAINTENANCE_MODE')) {
-        $setting['ajaxPageState']['theme_token'] = drupal_get_token($theme_key);
-      }
-
-      // Provide the page with information about the individual JavaScript files
-      // used, information not otherwise available when aggregation is enabled.
-      $setting['ajaxPageState']['js'] = array_fill_keys(array_keys($items), 1);
-      unset($setting['ajaxPageState']['js']['settings']);
-
-      // Provide the page with information about the individual CSS files used,
-      // information not otherwise available when CSS aggregation is enabled.
-      // The setting is attached later in this function, but is set here, so
-      // that CSS files removed in drupal_process_attached() are still
-      // considered "used" and prevented from being added in a later AJAX
-      // request.
-      // Skip if no files were added to the page otherwise jQuery.extend() will
-      // overwrite the Drupal.settings.ajaxPageState.css object with an empty
-      // array.
-      $css = drupal_add_css();
-      if (!empty($css)) {
-        // Cast the array to an object to be on the safe side even if not empty.
-        $setting['ajaxPageState']['css'] = (object) array_fill_keys(array_keys($css), 1);
-      }
-
-      drupal_add_js($setting, 'setting');
-
-      // If we're outputting the header scope, then this might be the final time
-      // that drupal_get_js() is running, so add the settings to this output as well
-      // as to the drupal_add_js() cache. If $items['settings'] doesn't exist, it's
-      // because drupal_get_js() was intentionally passed a $javascript argument
-      // stripped of settings, potentially in order to override how settings get
-      // output, so in this case, do not add the setting to this output.
-      if ($scope == 'header' && isset($items['settings'])) {
-        $items['settings']['data'][] = $setting;
-      }
-    }
-  }
+  $javascript->filter($scope);
+  $javascript->sort();
+  $javascript->prerender($scope);
 
   // Render the HTML needed to load the JavaScript.
   $elements = array(
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index da39097..842573f 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -322,6 +322,14 @@ function install_begin_request(&$install_state) {
     $container->register('config.factory', 'Drupal\Core\Config\ConfigFactory')
       ->addArgument(new Reference('config.storage'))
       ->addArgument(new Reference('dispatcher'));
+    $container->register('css_asset_manager', 'Drupal\Core\Asset\CssAssetManager')
+      ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+      ->setFactoryMethod('get')
+      ->addArgument('css');
+    $container->register('js_asset_manager', 'Drupal\Core\Asset\JsAssetManager')
+      ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+      ->setFactoryMethod('get')
+      ->addArgument('js');
     drupal_container($container);
   }
 
diff --git a/core/lib/Drupal/Core/Asset/AssetManager.php b/core/lib/Drupal/Core/Asset/AssetManager.php
new file mode 100644
index 0000000..f5f6cfd
--- /dev/null
+++ b/core/lib/Drupal/Core/Asset/AssetManager.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Assets\AssetInterface.
+ */
+
+namespace Drupal\Core\Asset;
+
+/**
+ * Defines an interface for asset collections.
+ *
+ * @see assets()
+ */
+abstract class AssetManager {
+
+  /**
+   * Returns array of assets.
+   *
+   * @param $group
+   *   The group of assets to return.
+   *
+   * @return
+   *   Array of assets as returned by drupal_add_css() or drupal_add_js().
+   */
+  abstract function get($group = NULL);
+
+  /**
+   * Renders the assets into the appropriate HTML.
+   *
+   * @return
+   *   HTML string.
+   */
+  abstract function render();
+
+  /**
+   * Defines the current assets.
+   *
+   * @param array $data
+   *   Array of assets as returned by drupal_add_css() or drupal_add_js()..
+   */
+  function set($data = NULL) {
+
+  }
+  /**
+   * Process the assets, applying filters provided by plugins.
+   */
+  function process() {
+
+  }
+
+  /**
+   * Sorts the assets.
+   */
+  function sort() {
+
+  }
+}
diff --git a/core/lib/Drupal/Core/Asset/AssetManagerFactory.php b/core/lib/Drupal/Core/Asset/AssetManagerFactory.php
new file mode 100644
index 0000000..9323b6f
--- /dev/null
+++ b/core/lib/Drupal/Core/Asset/AssetManagerFactory.php
@@ -0,0 +1,55 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\Core\Asset\AssetFactory.
+ */
+
+namespace Drupal\Core\Asset;
+
+/**
+ * Defines the asset factory.
+ */
+class AssetManagerFactory {
+
+  /**
+   * Instantiates an asset class for a given asset type.
+   *
+   * Classes implementing Drupal\Core\Assets\AssetInterface can register
+   * themselves for specific types.
+   *
+   * @param string $type
+   *   The type for which an asset object should be returned.
+   *
+   * @return Drupal\Core\Assets\AssetInterface
+   *   The asset object associated with the specified type.
+   */
+  public static function get($type) {
+    // Check whether there is a custom class defined for the requested type or
+    // use the default 'type' definition otherwise.
+    $asset_types = self::getTypes();
+    $class = $asset_types[$type];
+    return new $class($type);
+  }
+
+  /**
+   * Returns a list of asset types for this site.
+   *
+   * @return array
+   *   An associative array with types as keys, and asset class names as
+   *   value.
+   */
+  public static function getTypes() {
+    // @todo Just copying CacheFactory here, but really should use config.
+    // See _aggregator_get_variables().
+    // Perhaps store in system module config.
+    // Need to return other config, too, bundler and packager variables for each type. 
+    global $conf;
+    $asset_types = isset($conf['asset_classes']) ? $conf['asset_classes'] : array();
+    // Ensure there is a default 'generic' definition.
+    $asset_types += array('css' => 'Drupal\Core\Asset\CssAssetManager');
+    $asset_types += array('js' => 'Drupal\Core\Asset\JsAssetManager');
+    return $asset_types;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Asset/CssAssetManager.php b/core/lib/Drupal/Core/Asset/CssAssetManager.php
new file mode 100644
index 0000000..f3f7c3b
--- /dev/null
+++ b/core/lib/Drupal/Core/Asset/CssAssetManager.php
@@ -0,0 +1,79 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\Core\Asset\CssAssetManager.
+ */
+
+namespace Drupal\Core\Asset;
+
+/**
+ * Defines a default Asset implementation.
+ *
+ * This is Drupal's default CSS Asset implementation.
+ */
+class CssAssetManager extends AssetManager {
+
+  public $assets = array();
+
+  /**
+   * Implements Drupal\Core\Assets\AssetCollectionInterface::get().
+   */
+  function get($group = NULL) {
+    $assets = array();
+    if ($group === NULL) {
+      $assets = $this->assets;
+    }
+    foreach ($this->assets as $file) {
+      if (isset($file['group']) && $file['group'] == $group) {
+        $assets[] = $file;
+      }
+    }
+    return $assets;
+  }
+
+  /**
+   * Implements Drupal\Core\Assets\AssetCollectionInterface::set().
+   */
+  function set($css = NULL) {
+    if (!isset($css)) {
+      $css = drupal_add_css();
+    }
+    $this->assets = $css;
+  }
+
+  /**
+   * Implements Drupal\Core\Assets\AssetCollectionInterface::set().
+   */
+  function sort() {
+    // Sort CSS items, so that they appear in the correct order.
+    uasort($this->assets, 'drupal_sort_css_js');
+
+    // Remove the overridden CSS files. Later CSS files override former ones.
+    $previous_item = array();
+    foreach ($this->assets as $key => $item) {
+      if ($item['type'] == 'file') {
+        // If defined, force a unique basename for this file.
+        $basename = isset($item['basename']) ? $item['basename'] : drupal_basename($item['data']);
+        if (isset($previous_item[$basename])) {
+          // Remove the previous item that shared the same base name.
+          unset($this->assets[$previous_item[$basename]]);
+        }
+        $previous_item[$basename] = $key;
+      }
+    }
+  }
+
+  /**
+   * Implements Drupal\Core\Assets\AssetCollectionInterface::set().
+   */
+  function render() {
+    // Render the HTML needed to load the CSS.
+    $styles = array(
+      '#type' => 'styles',
+      '#items' => $this->assets,
+    );
+    return drupal_render($styles);
+  }
+
+}
diff --git a/core/lib/Drupal/Core/CoreBundle.php b/core/lib/Drupal/Core/CoreBundle.php
index f1e43d6..83f4935 100644
--- a/core/lib/Drupal/Core/CoreBundle.php
+++ b/core/lib/Drupal/Core/CoreBundle.php
@@ -54,6 +54,14 @@ public function build(ContainerBuilder $container) {
       ->setFactoryClass('Drupal\Core\Database\Database')
       ->setFactoryMethod('getConnection')
       ->addArgument('slave');
+    $container->register('css_asset_manager', 'Drupal\Core\Asset\CssAssetManager')
+      ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+      ->setFactoryMethod('get')
+      ->addArgument('css');
+    $container->register('js_asset_manager', 'Drupal\Core\Assets\JsAssetManager')
+      ->setFactoryClass('Drupal\Core\Assets\AssetManagerFactory')
+      ->setFactoryMethod('get')
+      ->addArgument('js');
     $container->register('typed_data', 'Drupal\Core\TypedData\TypedDataManager');
     // Add the user's storage for temporary, non-cache data.
     $container->register('lock', 'Drupal\Core\Lock\DatabaseLockBackend');
diff --git a/core/update.php b/core/update.php
index 2273b40..25ce655 100644
--- a/core/update.php
+++ b/core/update.php
@@ -456,7 +456,14 @@ function update_check_requirements($skip_warnings = FALSE) {
   ->addArgument(new Reference('database'));
 $container->register('router.builder', 'Drupal\Core\Routing\RouteBuilder')
   ->addArgument(new Reference('router.dumper'));
-
+$container->register('css_asset_manager', 'Drupal\Core\Asset\CssAssetManager')
+  ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+  ->setFactoryMethod('get')
+  ->addArgument('css');
+$container->register('js_asset_manager', 'Drupal\Core\Asset\JsAssetManager')
+  ->setFactoryClass('Drupal\Core\Asset\AssetManagerFactory')
+  ->setFactoryMethod('get')
+  ->addArgument('js');
 // Turn error reporting back on. From now on, only fatal errors (which are
 // not passed through the error handler) will cause a message to be printed.
 ini_set('display_errors', TRUE);
