diff --git includes/theme.inc includes/theme.inc
index baceb73..9e41273 100644
--- includes/theme.inc
+++ includes/theme.inc
@@ -67,14 +67,23 @@ function _drupal_theme_access($theme) {
 
 /**
  * Initialize the theme system by loading the theme.
+ * Use $force_theme to load a specific theme
  */
-function drupal_theme_initialize() {
+function drupal_theme_initialize($force_theme = '') {
   global $theme, $user, $theme_key;
 
   // If $theme is already set, assume the others are set, too, and do nothing
-  if (isset($theme)) {
+  if (isset($theme) && $force_theme == '') {
     return;
   }
+  elseif($force_theme != ''){
+    drupal_static_reset('theme_switch_theme');
+    drupal_static_reset('theme_switch_theme_get_registry');
+    drupal_static_reset('theme_switch__theme_registry_callback');
+    drupal_static_reset('drupal_add_css');
+    drupal_static_reset('drupal_add_js');
+    drupal_theme_rebuild();
+  }
 
   drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);
   $themes = list_themes();
@@ -86,7 +95,7 @@ function drupal_theme_initialize() {
   // Allow modules to override the theme. Validation has already been performed
   // inside menu_get_custom_theme(), so we do not need to check it again here.
   $custom_theme = menu_get_custom_theme();
-  $theme = !empty($custom_theme) ? $custom_theme : $theme;
+  $theme = !empty($force_theme) ? $force_theme : (!empty($custom_theme) ? $custom_theme : $theme);
 
   // Store the identifier for retrieving theme settings with.
   $theme_key = $theme;
@@ -242,7 +251,7 @@ function _drupal_theme_initialize($theme, $base_theme = array(), $registry_callb
  *   The theme registry array if it has been stored in memory, NULL otherwise.
  */
 function theme_get_registry() {
-  static $theme_registry = NULL;
+  $theme_registry = &drupal_static('theme_switch_theme_get_registry');
 
   if (!isset($theme_registry)) {
     list($callback, $arguments) = _theme_registry_callback();
@@ -261,7 +270,8 @@ function theme_get_registry() {
  *   The arguments to pass to the function.
  */
 function _theme_registry_callback($callback = NULL, array $arguments = array()) {
-  static $stored;
+  $stored = &drupal_static('theme_switch__theme_registry_callback');
+  // static $stored;
   if (isset($callback)) {
     $stored = array($callback, $arguments);
   }
@@ -736,7 +746,12 @@ function list_themes($refresh = FALSE) {
  *   An HTML string representing the themed output.
  */
 function theme($hook, $variables = array()) {
-  static $hooks = NULL;
+  // Use the advanced drupal_static() pattern, since this is called very often.
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast)) {
+    $drupal_static_fast['theme'] = &drupal_static('theme_switch_theme');
+  }
+  $hooks = &$drupal_static_fast['theme'];
 
   // If called before all modules are loaded, we do not necessarily have a full
   // theme registry to work with, and therefore cannot process the theme
