diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 1768a76..be11e2f 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -13,6 +13,7 @@
 use Drupal\Core\Language\Language;
 use Drupal\Core\Extension\ExtensionNameLengthException;
 use Drupal\Core\Template\Attribute;
+use Drupal\Core\Template\RenderWrapper;
 use Drupal\Core\Utility\ThemeRegistry;
 use Drupal\Core\Theme\ThemeSettings;
 use Drupal\Component\Utility\NestedArray;
@@ -2656,6 +2657,24 @@ function template_preprocess_html(&$variables) {
   if ($suggestions = theme_get_suggestions(arg(), 'html')) {
     $variables['theme_hook_suggestions'] = $suggestions;
   }
+
+  drupal_add_library('system', 'html5shiv', TRUE);
+  // Render page_top and page_bottom into top level variables.
+  $variables['page_top'] = isset($variables['page']['page_top']) ? drupal_render($variables['page']['page_top']) : '';
+  $variables['page_bottom'] = array();
+  $variables['page_bottom'][] = isset($variables['page']['page_bottom']) ? drupal_render($variables['page']['page_bottom']) : array();
+  // Add footer scripts as '#markup' so they can be rendered with other
+  // elements in page_bottom.
+  $footer_scripts = new RenderWrapper('drupal_get_js', array('footer'));
+  $variables['page_bottom'][] = array('#markup' => $footer_scripts);
+
+  // Wrap function calls in an object so they can be called when printed.
+  $variables['head'] = new RenderWrapper('drupal_get_html_head');
+  $variables['styles'] = new RenderWrapper('drupal_get_css');
+  $variables['scripts'] = new RenderWrapper('drupal_get_js');
+
+  // Place the rendered HTML for the page body into a top level variable.
+  $variables['page'] = drupal_render($variables['page']);
 }
 
 /**
@@ -2710,6 +2729,7 @@ function template_preprocess_page(&$variables) {
   $variables['site_name']         = (theme_get_setting('features.name') ? check_plain($site_config->get('name')) : '');
   $variables['site_slogan']       = (theme_get_setting('features.slogan') ? filter_xss_admin($site_config->get('slogan')) : '');
   $variables['tabs']              = menu_local_tabs();
+  $variables['title'] = new RenderWrapper('drupal_get_title');
 
   // Pass the main menu and secondary menu to the template as render arrays.
   if (!empty($variables['main_menu'])) {
@@ -2770,9 +2790,6 @@ function template_process_page(&$variables) {
       '#breadcrumb' => \Drupal::service('breadcrumb')->build(\Drupal::service('request')->attributes->all()),
     );
   }
-  if (!isset($variables['title'])) {
-    $variables['title'] = drupal_get_title();
-  }
 
   // Generate messages last in order to capture as many as possible for the
   // current page.
@@ -2782,30 +2799,6 @@ function template_process_page(&$variables) {
 }
 
 /**
- * Processes variables for html.html.twig.
- *
- * Perform final addition and modification of variables before passing into
- * the template. To customize these variables, call drupal_render() on elements
- * in $variables['page'] during THEME_preprocess_page().
- *
- * @see template_preprocess_html()
- */
-function template_process_html(&$variables) {
-  drupal_add_library('system', 'html5shiv', TRUE);
-  // Render page_top and page_bottom into top level variables.
-  $variables['page_top'] = isset($variables['page']['page_top']) ? drupal_render($variables['page']['page_top']) : '';
-  $variables['page_bottom'] = isset($variables['page']['page_bottom']) ? drupal_render($variables['page']['page_bottom']) : '';
-  // Place the rendered HTML for the page body into a top level variable.
-  $variables['page'] = $variables['page']['#children'];
-  $variables['page_bottom'] .= drupal_get_js('footer');
-
-  $variables['head']    = drupal_get_html_head();
-  $variables['css']     = drupal_add_css();
-  $variables['styles']  = drupal_get_css();
-  $variables['scripts'] = drupal_get_js();
-}
-
-/**
  * Generate an array of suggestions from path arguments.
  *
  * This is typically called for adding to the 'theme_hook_suggestions' or
@@ -2978,28 +2971,18 @@ function template_preprocess_maintenance_page(&$variables) {
   if (isset($variables['db_is_active']) && !$variables['db_is_active']) {
     $variables['theme_hook_suggestion'] = 'maintenance_page__offline';
   }
-}
 
-/**
- * Theme process function for theme_maintenance_field().
- *
- * The variables array generated here is a mirror of template_process_html().
- * This processor will run its course when theme_maintenance_page() is invoked.
- *
- * @see maintenance-page.html.twig
- * @see template_process_html()
- */
-function template_process_maintenance_page(&$variables) {
   $variables['head'] = drupal_get_html_head();
 
   // While this code is used in the installer, the language module may not be
   // enabled yet (even maybe no database set up yet), but an RTL language
   // selected should result in RTL stylesheets loaded properly already.
-  $variables['css'] = $css = drupal_add_css();
+  $css = drupal_add_css();
   include_once DRUPAL_ROOT . '/core/modules/language/language.module';
-  $variables['styles'] = drupal_get_css($css);
-
-  $variables['scripts'] = drupal_get_js();
+  // Wrapping drupal_get_css() and drupal_get_js() in an object so they can
+  // be called when printed.
+  $variables['styles'] = new RenderWrapper('drupal_get_css', array($css));
+  $variables['scripts'] = new RenderWrapper('drupal_get_js');
 }
 
 /**
@@ -3026,17 +3009,6 @@ function template_preprocess_install_page(&$variables) {
 }
 
 /**
- * Preprocess variables for install-page.html.twig.
- *
- * @see install-page.html.twig
- * @see template_process_html()
- *
- */
-function template_process_install_page(&$variables) {
-  template_process_maintenance_page($variables);
-}
-
-/**
  * Preprocess variables for region.tpl.php
  *
  * Prepares the values passed to the theme_region function to be passed into a
diff --git a/core/lib/Drupal/Core/Template/RenderWrapper.php b/core/lib/Drupal/Core/Template/RenderWrapper.php
new file mode 100644
index 0000000..f27c88c
--- /dev/null
+++ b/core/lib/Drupal/Core/Template/RenderWrapper.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Template\RenderWrapper.
+ */
+
+namespace Drupal\Core\Template;
+
+/**
+ * A class that wraps functions to call them while printing in a template.
+ *
+ * To use, one may pass in the function name as a string followed by an array of
+ * arguments to the constructor.
+ * @code
+ * $variables['scripts'] = new RenderWrapper('drupal_get_js', array('footer'));
+ * @endcode
+ *
+ */
+class RenderWrapper {
+
+  /**
+   * Stores the callback function to be called when rendered.
+   *
+   * @var string
+   */
+  public $callback = NULL;
+
+  /**
+   * Stores the callback's arguments.
+   *
+   * @var array
+   */
+  public $args = array();
+
+  /**
+   * Constructs a RenderWrapper object.
+   *
+   * @param string $callback
+   *   The callback function name.
+   * @param array $args
+   *   The arguments to pass to the callback function.
+   */
+  public function __construct($callback = NULL, $args = array()) {
+    $this->callback = $callback;
+    $this->args = $args;
+  }
+
+  /**
+   * Implements the magic __toString() method.
+   */
+  public function __toString() {
+    return $this->render();
+  }
+
+  /**
+   * Returns a string provided by the callback function.
+   *
+   * @return string
+   *   The results of the callback function.
+   */
+  public function render() {
+    if (!empty($this->callback) && is_callable($this->callback)) {
+      return call_user_func_array($this->callback, $this->args);
+    }
+  }
+
+}
diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme
index 1e4a6b8..d3f6567 100644
--- a/core/themes/seven/seven.theme
+++ b/core/themes/seven/seven.theme
@@ -144,6 +144,8 @@ function seven_tablesort_indicator($variables) {
 function seven_preprocess_install_page(&$variables) {
   drupal_add_js(drupal_get_path('theme', 'seven') . '/js/mobile.install.js');
   drupal_add_css(drupal_get_path('theme', 'seven') . '/install-page.css', array('group' => CSS_AGGREGATE_THEME));
+  $variables['styles'] = drupal_get_css();
+  $variables['scripts'] = drupal_get_js();
 }
 
 /**
