diff --git skinr.data.info.inc skinr.data.info.inc
new file mode 100644
index 0000000..e6c7809
--- /dev/null
+++ skinr.data.info.inc
@@ -0,0 +1,467 @@
+<?php
+// $Id$
+
+/**
+ * @file
+ * Handles all file import for .info files.
+ *
+ * @todo Figure out how to reduce external use of the below functions.
+ *
+ *  skinr_rebuild_skinset_data()
+ *    skinr_ui.admin.inc
+ *  
+ *  skinr_skinsets()
+ *    skinr.module         : skinr_skin_data()
+ *    skinr_ui.admin.inc   : skinr_ui_admin_skinsets_submit() | skinr_ui_admin_skinsets_settings()
+ *    skinr_ui.module      : skinr_ui_menu()
+ *
+ */
+
+/**
+ * Implementation of hook_flush_caches().
+ */
+function skinr_flush_caches() {
+  skinr_rebuild_skinset_data();
+  return array();
+}
+
+/**
+ * Rebuild, save, and return data about all currently available skinsets.
+ *
+ * @return
+ *   Array of all available skinsets and their data.
+ */
+function skinr_rebuild_skinset_data() {
+  $skinsets = _skinr_rebuild_skinset_data();
+  skinr_get_files_database($skinsets);
+  skinr_update_files_database($skinsets);
+  return $skinsets;
+}
+
+/**
+ * Helper function to scan and collect skin .info data.
+ *
+ * @return
+ *   An associative array of skins information.
+ */
+function _skinr_rebuild_skinset_data() {
+  // Find skins.
+  $mask = '/\.info$/';
+  $directory = 'skins';
+  $skinsets = drupal_system_listing($mask, $directory, 'name', 0);
+
+  // Find skins in theme folders.
+  $themes = list_themes();
+  foreach ($themes as $theme) {
+    $dir = dirname($theme->filename) . '/' . $directory;
+    $skinsets = array_merge($skinsets, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, 'name', 1));
+  }
+
+  // Set defaults for skinset info.
+  $defaults = skinr_skins_default();
+
+  foreach ($skinsets as $key => $skinset) {
+    $skinsets[$key]->filename = $skinset->uri;
+    $skinsets[$key]->info = drupal_parse_info_file($skinset->uri) + $defaults;
+
+    // Give the screenshot proper path information.
+    if (!empty($skinsets[$key]->info['screenshot'])) {
+      $skinsets[$key]->info['screenshot'] = dirname($skinsets[$key]->uri) . '/' . $skinsets[$key]->info['screenshot'];
+    }
+
+    // Invoke hook_skinr_info_alter() to give installed modules a chance to
+    // modify the data in the .info files if necessary.
+    $type = 'skinset';
+    drupal_alter('skinr_info', $skinsets[$key]->info, $skinsets[$key], $type);
+    
+    // @todo Give the stylesheets and scripts proper path information, or leave 'till later?
+  }
+
+  return $skinsets;
+}
+
+/**
+ * Retrieves the current status of an array of files in the skinr_skinsets table.
+ *
+ * @param $files
+ *   An array of files to check.
+ */
+function skinr_get_files_database(&$files) {
+  // Extract current files from database.
+  $result = db_query("SELECT filename, name, status FROM {skinr_skinsets}");
+  foreach ($result as $file) {
+    if (isset($files[$file->name]) && is_object($files[$file->name])) {
+      $file->uri = $file->filename;
+      foreach ($file as $key => $value) {
+        if (!isset($files[$file->name]) || !isset($files[$file->name]->$key)) {
+          $files[$file->name]->$key = $value;
+        }
+      }
+    }
+  }
+}
+
+/**
+ * Updates the records in the skinr_skinsets table based on the files array.
+ *
+ * @param $files
+ *   An array of files.
+ */
+function skinr_update_files_database(&$files) {
+  $result = db_query("SELECT * FROM {skinr_skinsets}");
+
+  // Add all files that need to be deleted to a DatabaseCondition.
+  $delete = db_or();
+  foreach ($result as $file) {
+    if (isset($files[$file->name]) && is_object($files[$file->name])) {
+      // Keep the old filename from the database in case the file has moved.
+      $old_filename = $file->filename;
+
+      $updated_fields = array();
+
+      // Handle info specially, compare the serialized value.
+      $serialized_info = serialize($files[$file->name]->info);
+      if ($serialized_info != $file->info) {
+        $updated_fields['info'] = $serialized_info;
+      }
+      unset($file->info);
+
+      // Scan remaining fields to find only the updated values.
+      foreach ($file as $key => $value) {
+        if (isset($files[$file->name]->$key) && $files[$file->name]->$key != $value) {
+          $updated_fields[$key] = $files[$file->name]->$key;
+        }
+      }
+
+      // Update the record.
+      if (count($updated_fields)) {
+        db_update('skinr_skinsets')
+          ->fields($updated_fields)
+          ->condition('filename', $old_filename)
+          ->execute();
+      }
+
+      // Indicate that the file exists already.
+      $files[$file->name]->exists = TRUE;
+    }
+    else {
+      // File is not found in file system, so delete record from the system table.
+      $delete->condition('filename', $file->filename);
+    }
+  }
+
+  if (count($delete) > 0) {
+    // Delete all missing files from the system table
+    db_delete('skinr_skinsets')
+      ->condition($delete)
+      ->execute();
+  }
+
+  // All remaining files are not in the system table, so we need to add them.
+  $query = db_insert('skinr_skinsets')->fields(array('filename', 'name', 'info'));
+  foreach($files as &$file) {
+    if (isset($file->exists)) {
+      unset($file->exists);
+    }
+    else {
+      $query->values(array(
+        'filename' => $file->uri,
+        'name' => $file->name,
+        'info' => serialize($file->info),
+      ));
+      $file->status = 0;
+    }
+  }
+  $query->execute();
+
+  // If any module or theme was moved to a new location, we need to reset the
+  // system_list() cache or we will continue to load the old copy, look for
+  // schema updates in the wrong place, etc.
+  drupal_static_reset('skinr_skin_data');
+  drupal_static_reset('skinr_skinsets');
+}
+
+
+
+
+
+
+
+
+
+
+/**
+ * Helper function to process an array of skins or themes .info files.
+ *
+ * @param $type
+ *   Either 'theme' or 'skinset'.
+ *
+ * @return
+ *    An array of skinsets.
+ */
+function skinr_skinsets($type) {
+  $skinsets = &drupal_static(__FUNCTION__, array('theme' => array(), 'skinset' => array()));
+  // @todo drupal_static_reset('skinr_skinsets');
+
+  if (empty($skinsets[$type])) {
+    $themes = list_themes();
+
+    if ($type == 'theme') {
+      foreach ($themes as $theme) {
+        $skinset = new StdClass();
+        $skinset->filename = $theme->filename;
+        $skinset->name = $theme->name;
+        $skinset->status = $theme->status ? 1 : 0;
+        $skinset->info = $theme->info;
+
+        $skinsets[$type][$skinset->name] = $skinset;
+      }
+    }
+    elseif ($type == 'skinset') {
+      $result = db_query("SELECT * FROM {skinr_skinsets}");
+      foreach ($result as $skinset) {
+        if (file_exists($skinset->filename)) {
+          $skinset->info = unserialize($skinset->info);
+
+          $skinsets[$type][$skinset->name] = $skinset;
+        }
+      }
+    }
+
+    $default_status = array();
+    foreach ($themes as $theme) {
+      $default_status[$theme->name] = $theme->name;
+    }
+
+    foreach ($skinsets[$type] as $key => $skinset) {
+      $skinset->type = $type;
+
+      $additional = _skinr_skinset($skinset);
+      $skinset->options = $additional['options'];
+      $skinset->skins = $additional['skins'];
+
+      $statuses = skinr_skinset_statuses($skinset->name);
+      foreach ($skinset->skins as $skin_name => $skin) {
+        $skinset->skins[$skin_name]['status'] = !empty($statuses[$skin_name]) ? $statuses[$skin_name] : $default_status;
+      }
+    }
+  }
+
+  return $skinsets[$type];
+}
+
+/**
+ * Helper function to process a skin or theme .info file.
+ *
+ * @return
+ *    A skinset.
+ */
+function _skinr_skinset($info) {
+  $skinset = array(
+    'options' => array('groups' => array()),
+    'skins' => array(),
+  );
+
+  if (!empty($info->info['skinr'])) {
+    $path_root = dirname($info->filename);
+
+    $skinr_info = (array)$info->info['skinr'];
+
+    // Store skinr options.
+    if (!empty($skinr_info['options'])) {
+      $skinset['options'] = $skinr_info['options'];
+      unset($skinr_info['options']);
+
+      if (!isset($skinset['options']['groups'])) {
+        $skinset['options']['groups'] = array();
+      }
+
+      $defaults = skinr_group_default();
+      foreach ($skinset['options']['groups'] as $id => $group) {
+        $skinset['options']['groups'][$id] = array_merge($defaults, $skinset['options']['groups'][$id]);
+        $skinset['options']['groups'][$id]['collapsible'] = (bool)$skinset['options']['groups'][$id]['collapsible'];
+        $skinset['options']['groups'][$id]['collapsed'] = (bool)$skinset['options']['groups'][$id]['collapsed'];
+        $skinset['options']['groups'][$id]['weight'] = $skinset['options']['groups'][$id]['weight'];
+      }
+    }
+
+    // Inherit skins from parent theme, if inherit_skins is set to true.
+    if (!empty($skinset['options']['inherit_skins'])) {
+      $skinr_info = array_merge(skinr_inherited_skins($info->name), $skinr_info);
+    }
+
+    $defaults = skinr_skin_default();
+
+    foreach ($skinr_info as $id => $skin) {
+      if (!is_array($skin)) {
+        continue;
+      }
+      $skinset['skins'][$id] = array(
+        'title' => isset($skin['title']) ? $skin['title'] : $defaults['title'],
+        'type' => isset($skin['type']) ? $skin['type'] : $defaults['type'],
+        'description' => isset($skin['description']) ? $skin['description'] : $defaults['description'],
+        'features' => isset($skin['features']) ? $skin['features'] : $defaults['features'],
+        'templates' => isset($skin['templates']) ? $skin['templates'] : $defaults['templates'],
+        'group' => !empty($skin['group']) && !empty($skinset['options']['groups'][$skin['group']]) ? $skin['group'] : $defaults['group'],
+        'options' => isset($skin['options']) ? $skin['options'] : $defaults['options'],
+        'stylesheets' => isset($skin['stylesheets']) ? $skin['stylesheets'] : $defaults['stylesheets'],
+        'scripts' => isset($skin['scripts']) ? $skin['scripts'] : $defaults['scripts'],
+        'weight' => isset($skin['weight']) ? $skin['weight'] : $defaults['weight'],
+      );
+
+      // Give the stylesheets proper path information.
+      $skinset['skins'][$id]['stylesheets'] = _skinr_add_path_to_files($skinset['skins'][$id]['stylesheets'], $path_root, 'css');
+
+      // Give the scripts proper path information.
+      $skinset['skins'][$id]['scripts'] = _skinr_add_path_to_files($skinset['skins'][$id]['scripts'], $path_root, 'js');
+
+      foreach ($skinset['skins'][$id]['options'] as $oid => $option) {
+        if (isset($option['stylesheets'])) {
+          $skinset['skins'][$id]['options'][$oid]['stylesheets'] = _skinr_add_path_to_files($option['stylesheets'], $path_root, 'css');
+        }
+        if (isset($option['scripts'])) {
+          $skinset['skins'][$id]['options'][$oid]['scripts'] = _skinr_add_path_to_files($option['scripts'], $path_root, 'js');
+        }
+      }
+    }
+  }
+
+  return $skinset;
+}
+
+/**
+ * Retrieves all the Skinr skins from theme parents. Theme skins
+ * will override any skins of the same name from its parents.
+ */
+function skinr_inherited_skins($theme) {
+  $themes = list_themes();
+
+  $all_skins = $skins = array();
+  $base_theme = (!empty($themes[$theme]->info['base theme'])) ? $themes[$theme]->info['base theme'] : '';
+  while ($base_theme) {
+    $all_skins[] = (!empty($themes[$base_theme]->info['skinr'])) ? (array)$themes[$base_theme]->info['skinr'] : array();
+    $base_theme = (!empty($themes[$base_theme]->info['base theme'])) ? $themes[$base_theme]->info['base theme'] : '';
+  }
+  array_reverse($all_skins);
+  foreach ($all_skins as $new_skin) {
+    $skins = array_merge($skins, $new_skin);
+  }
+  return $skins;
+}
+
+/**
+ * Helper function to prepend a path to an array of stylesheets or scripts in a .info file.
+ *
+ * @param $files
+ *   A an array of filenames that need the path prepended.
+ * @param $path
+ *   The path to prepend.
+ * @param $type
+ *   Either 'css' or 'js', depending on which files you wish to retrieve from
+ *   these skins.
+ *
+ * @return
+ *    An array of files with the root path added.
+ */
+function _skinr_add_path_to_files($files, $path, $type) {
+  if ($type == 'css') {
+    $pathed_stylesheets = array();
+    foreach ($files as $media => $stylesheets) {
+      foreach ($stylesheets as $stylesheet) {
+        $pathed_stylesheets[$media][$stylesheet] = $path . '/' . $stylesheet;
+      }
+    }
+    return $pathed_stylesheets;
+  }
+  elseif ($type == 'js') {
+    $pathed_scripts = array();
+    foreach ($files as $script) {
+      $pathed_scripts[$script] = $path . '/' . $script;
+    }
+    return $pathed_scripts;
+  }
+
+  return FALSE;
+}
+
+/**
+ * Return an array of statuses of each skin in a skinset for each theme.
+ *
+ * @param $skinset_name
+ *   The name of the skinset of which to load the statuses.
+ *
+ * @return
+ *   Array of statuses for individual skins in a skinset.
+ */
+function skinr_skinset_statuses($skinset_name) {
+  $statuses = &drupal_static(__FUNCTION__, array());
+
+  if (empty($statuses[$skinset_name])) {
+    $statuses[$skinset_name] = array();
+
+    $result = db_query("SELECT * FROM {skinr_skins} WHERE name = :name", array(':name' => $skinset_name));
+    foreach ($result as $skinr_skin) {
+      $statuses[$skinset_name][$skinr_skin->skin] = unserialize($skinr_skin->status);
+    }
+  }
+
+  return $statuses[$skinset_name];
+}
+
+
+
+
+
+
+
+/**
+ * Prepare defaults for skins.
+ *
+ * @return
+ *   An array of default skinset settings.
+ */
+function skinr_skins_default() {
+  return array(
+    'description' => '',
+    'screenshot' => 'screenshot.png',
+    'php' => DRUPAL_MINIMUM_PHP,
+    'skinr' => array(),
+  );
+}
+
+/**
+ * Prepare defaults for skinr options.
+ *
+ * @return
+ *   An array of default skinset options settings.
+ */
+function skinr_group_default() {
+  return array(
+    'title' => '',
+    'description' => '',
+    'collapsible' => TRUE,
+    'collapsed' => FALSE,
+    'weight' => NULL,
+  );
+}
+
+/**
+ * Prepare defaults for skins.
+ *
+ * @return
+ *   An array of default skins settings.
+ */
+function skinr_skin_default() {
+  return array(
+    'title' => '',
+    'type' => 'checkboxes',
+    'description' => '',
+    'features' => array('*'),
+    'templates' => array(),
+    'group' => '',
+    'options' => array(),
+    'stylesheets' => array(),
+    'scripts' => array(),
+    'weight' => NULL,
+  );
+}
diff --git skinr.info skinr.info
index 61c1424..f0b07bc 100644
--- skinr.info
+++ skinr.info
@@ -6,6 +6,7 @@ package = Skinr
 core = 7.x
 
 files[] = skinr.module
+files[] = skinr.data.info.inc
 files[] = skinr.handlers.inc
 files[] = modules/block.skinr.inc
 files[] = modules/comment.skinr.inc
diff --git skinr.module skinr.module
index cceb172..e5f379e 100644
--- skinr.module
+++ skinr.module
@@ -21,6 +21,7 @@ function skinr_help($path, $arg) {
  * Implementation of hook_init().
  */
 function skinr_init() {
+  module_load_include('inc', 'skinr', 'skinr.data.info');
   module_load_include('inc', 'skinr', 'skinr.handlers');
   skinr_module_include('skinr.inc');
 }
@@ -87,8 +88,6 @@ function skinr_skin_extract($module, $sids, $settings, $theme = NULL) {
     $theme = skinr_current_theme();
   }
 
-  $info = skinr_skin_data();
-
   $extracted = array(
     'module' => $module,
     'sids' => $sids,
@@ -583,440 +582,6 @@ function skinr_current_theme($exclude_admin_theme = FALSE) {
 }
 
 /**
- * Prepare defaults for skins.
- *
- * @return
- *   An array of default skinset settings.
- */
-function skinr_skins_default() {
-  return array(
-    'description' => '',
-    'screenshot' => 'screenshot.png',
-    'php' => DRUPAL_MINIMUM_PHP,
-    'skinr' => array(),
-  );
-}
-
-/**
- * Prepare defaults for skinr options.
- *
- * @return
- *   An array of default skinset options settings.
- */
-function skinr_group_default() {
-  return array(
-    'title' => '',
-    'description' => '',
-    'collapsible' => TRUE,
-    'collapsed' => FALSE,
-    'weight' => NULL,
-  );
-}
-
-/**
- * Prepare defaults for skins.
- *
- * @return
- *   An array of default skins settings.
- */
-function skinr_skin_default() {
-  return array(
-    'title' => '',
-    'type' => 'checkboxes',
-    'description' => '',
-    'features' => array('*'),
-    'templates' => array(),
-    'group' => '',
-    'options' => array(),
-    'stylesheets' => array(),
-    'scripts' => array(),
-    'weight' => NULL,
-  );
-}
-
-/**
- * Retrieves all the Skinr skins from theme parents. Theme skins
- * will override any skins of the same name from its parents.
- */
-function skinr_inherited_skins($theme) {
-  $themes = list_themes();
-
-  $all_skins = $skins = array();
-  $base_theme = (!empty($themes[$theme]->info['base theme'])) ? $themes[$theme]->info['base theme'] : '';
-  while ($base_theme) {
-    $all_skins[] = (!empty($themes[$base_theme]->info['skinr'])) ? (array)$themes[$base_theme]->info['skinr'] : array();
-    $base_theme = (!empty($themes[$base_theme]->info['base theme'])) ? $themes[$base_theme]->info['base theme'] : '';
-  }
-  array_reverse($all_skins);
-  foreach ($all_skins as $new_skin) {
-    $skins = array_merge($skins, $new_skin);
-  }
-  return $skins;
-}
-
-/**
- * Helper function to scan and collect skin .info data.
- *
- * @return
- *   An associative array of skins information.
- */
-function _skinr_rebuild_skinset_data() {
-  // Find skins.
-  $mask = '/\.info$/';
-  $directory = 'skins';
-  $skinsets = drupal_system_listing($mask, $directory, 'name', 0);
-
-  // Find skins in theme folders.
-  $themes = list_themes();
-  foreach ($themes as $theme) {
-    $dir = dirname($theme->filename) . '/' . $directory;
-    $skinsets = array_merge($skinsets, file_scan_directory($dir, $mask, array('.', '..', 'CVS'), 0, TRUE, 'name', 1));
-  }
-
-  // Set defaults for skinset info.
-  $defaults = skinr_skins_default();
-
-  foreach ($skinsets as $key => $skinset) {
-    $skinsets[$key]->filename = $skinset->uri;
-    $skinsets[$key]->info = drupal_parse_info_file($skinset->uri) + $defaults;
-
-    // Give the screenshot proper path information.
-    if (!empty($skinsets[$key]->info['screenshot'])) {
-      $skinsets[$key]->info['screenshot'] = dirname($skinsets[$key]->uri) . '/' . $skinsets[$key]->info['screenshot'];
-    }
-
-    // Invoke hook_skinr_info_alter() to give installed modules a chance to
-    // modify the data in the .info files if necessary.
-    $type = 'skinset';
-    drupal_alter('skinr_info', $skinsets[$key]->info, $skinsets[$key], $type);
-    
-    // @todo Give the stylesheets and scripts proper path information, or leave 'till later?
-  }
-
-  return $skinsets;
-}
-
-/**
- * Helper function to process a skin or theme .info file.
- *
- * @return
- *    A skinset.
- */
-function _skinr_skinset($info) {
-  $skinset = array(
-    'options' => array('groups' => array()),
-    'skins' => array(),
-  );
-
-  if (!empty($info->info['skinr'])) {
-    $path_root = dirname($info->filename);
-
-    $skinr_info = (array)$info->info['skinr'];
-
-    // Store skinr options.
-    if (!empty($skinr_info['options'])) {
-      $skinset['options'] = $skinr_info['options'];
-      unset($skinr_info['options']);
-
-      if (!isset($skinset['options']['groups'])) {
-        $skinset['options']['groups'] = array();
-      }
-
-      $defaults = skinr_group_default();
-      foreach ($skinset['options']['groups'] as $id => $group) {
-        $skinset['options']['groups'][$id] = array_merge($defaults, $skinset['options']['groups'][$id]);
-        $skinset['options']['groups'][$id]['collapsible'] = (bool)$skinset['options']['groups'][$id]['collapsible'];
-        $skinset['options']['groups'][$id]['collapsed'] = (bool)$skinset['options']['groups'][$id]['collapsed'];
-        $skinset['options']['groups'][$id]['weight'] = $skinset['options']['groups'][$id]['weight'];
-      }
-    }
-
-    // Inherit skins from parent theme, if inherit_skins is set to true.
-    if (!empty($skinset['options']['inherit_skins'])) {
-      $skinr_info = array_merge(skinr_inherited_skins($info->name), $skinr_info);
-    }
-
-    $defaults = skinr_skin_default();
-
-    foreach ($skinr_info as $id => $skin) {
-      if (!is_array($skin)) {
-        continue;
-      }
-      $skinset['skins'][$id] = array(
-        'title' => isset($skin['title']) ? $skin['title'] : $defaults['title'],
-        'type' => isset($skin['type']) ? $skin['type'] : $defaults['type'],
-        'description' => isset($skin['description']) ? $skin['description'] : $defaults['description'],
-        'features' => isset($skin['features']) ? $skin['features'] : $defaults['features'],
-        'templates' => isset($skin['templates']) ? $skin['templates'] : $defaults['templates'],
-        'group' => !empty($skin['group']) && !empty($skinset['options']['groups'][$skin['group']]) ? $skin['group'] : $defaults['group'],
-        'options' => isset($skin['options']) ? $skin['options'] : $defaults['options'],
-        'stylesheets' => isset($skin['stylesheets']) ? $skin['stylesheets'] : $defaults['stylesheets'],
-        'scripts' => isset($skin['scripts']) ? $skin['scripts'] : $defaults['scripts'],
-        'weight' => isset($skin['weight']) ? $skin['weight'] : $defaults['weight'],
-      );
-
-      // Give the stylesheets proper path information.
-      $skinset['skins'][$id]['stylesheets'] = _skinr_add_path_to_files($skinset['skins'][$id]['stylesheets'], $path_root, 'css');
-
-      // Give the scripts proper path information.
-      $skinset['skins'][$id]['scripts'] = _skinr_add_path_to_files($skinset['skins'][$id]['scripts'], $path_root, 'js');
-
-      foreach ($skinset['skins'][$id]['options'] as $oid => $option) {
-        if (isset($option['stylesheets'])) {
-          $skinset['skins'][$id]['options'][$oid]['stylesheets'] = _skinr_add_path_to_files($option['stylesheets'], $path_root, 'css');
-        }
-        if (isset($option['scripts'])) {
-          $skinset['skins'][$id]['options'][$oid]['scripts'] = _skinr_add_path_to_files($option['scripts'], $path_root, 'js');
-        }
-      }
-    }
-  }
-
-  return $skinset;
-}
-
-/**
- * Helper function to prepend a path to an array of stylesheets or scripts in a .info file.
- *
- * @param $files
- *   A an array of filenames that need the path prepended.
- * @param $path
- *   The path to prepend.
- * @param $type
- *   Either 'css' or 'js', depending on which files you wish to retrieve from
- *   these skins.
- *
- * @return
- *    An array of files with the root path added.
- */
-function _skinr_add_path_to_files($files, $path, $type) {
-  if ($type == 'css') {
-    $pathed_stylesheets = array();
-    foreach ($files as $media => $stylesheets) {
-      foreach ($stylesheets as $stylesheet) {
-        $pathed_stylesheets[$media][$stylesheet] = $path . '/' . $stylesheet;
-      }
-    }
-    return $pathed_stylesheets;
-  }
-  elseif ($type == 'js') {
-    $pathed_scripts = array();
-    foreach ($files as $script) {
-      $pathed_scripts[$script] = $path . '/' . $script;
-    }
-    return $pathed_scripts;
-  }
-
-  return FALSE;
-}
-
-/**
- * Helper function to process an array of skins or themes .info files.
- *
- * @param $type
- *   Either 'theme' or 'skinset'.
- *
- * @return
- *    An array of skinsets.
- */
-function skinr_skinsets($type) {
-  $skinsets = &drupal_static(__FUNCTION__, array('theme' => array(), 'skinset' => array()));
-  // @todo drupal_static_reset('skinr_skinsets');
-
-  if (empty($skinsets[$type])) {
-    $themes = list_themes();
-
-    if ($type == 'theme') {
-      foreach ($themes as $theme) {
-        $skinset = new StdClass();
-        $skinset->filename = $theme->filename;
-        $skinset->name = $theme->name;
-        $skinset->status = $theme->status ? 1 : 0;
-        $skinset->info = $theme->info;
-
-        $skinsets[$type][$skinset->name] = $skinset;
-      }
-    }
-    elseif ($type == 'skinset') {
-      $result = db_query("SELECT * FROM {skinr_skinsets}");
-      foreach ($result as $skinset) {
-        if (file_exists($skinset->filename)) {
-          $skinset->info = unserialize($skinset->info);
-
-          $skinsets[$type][$skinset->name] = $skinset;
-        }
-      }
-    }
-
-    $default_status = array();
-    foreach ($themes as $theme) {
-      $default_status[$theme->name] = $theme->name;
-    }
-
-    foreach ($skinsets[$type] as $key => $skinset) {
-      $skinset->type = $type;
-
-      $additional = _skinr_skinset($skinset);
-      $skinset->options = $additional['options'];
-      $skinset->skins = $additional['skins'];
-
-      $statuses = skinr_skinset_statuses($skinset->name);
-      foreach ($skinset->skins as $skin_name => $skin) {
-        $skinset->skins[$skin_name]['status'] = !empty($statuses[$skin_name]) ? $statuses[$skin_name] : $default_status;
-      }
-    }
-  }
-
-  return $skinsets[$type];
-}
-
-/**
- * Return an array of statuses of each skin in a skinset for each theme.
- *
- * @param $skinset_name
- *   The name of the skinset of which to load the statuses.
- *
- * @return
- *   Array of statuses for individual skins in a skinset.
- */
-function skinr_skinset_statuses($skinset_name) {
-  $statuses = &drupal_static(__FUNCTION__, array());
-
-  if (empty($statuses[$skinset_name])) {
-    $statuses[$skinset_name] = array();
-
-    $result = db_query("SELECT * FROM {skinr_skins} WHERE name = :name", array(':name' => $skinset_name));
-    foreach ($result as $skinr_skin) {
-      $statuses[$skinset_name][$skinr_skin->skin] = unserialize($skinr_skin->status);
-    }
-  }
-
-  return $statuses[$skinset_name];
-}
-
-/**
- * Rebuild, save, and return data about all currently available skinsets.
- *
- * @return
- *   Array of all available skinsets and their data.
- */
-function skinr_rebuild_skinset_data() {
-  $skinsets = _skinr_rebuild_skinset_data();
-  skinr_get_files_database($skinsets);
-  skinr_update_files_database($skinsets);
-  return $skinsets;
-}
-
-/**
- * Implementation of hook_flush_caches().
- */
-function skinr_flush_caches() {
-  skinr_rebuild_skinset_data();
-  return array();
-}
-
-/**
- * Retrieves the current status of an array of files in the skinr_skinsets table.
- *
- * @param $files
- *   An array of files to check.
- */
-function skinr_get_files_database(&$files) {
-  // Extract current files from database.
-  $result = db_query("SELECT filename, name, status FROM {skinr_skinsets}");
-  foreach ($result as $file) {
-    if (isset($files[$file->name]) && is_object($files[$file->name])) {
-      $file->uri = $file->filename;
-      foreach ($file as $key => $value) {
-        if (!isset($files[$file->name]) || !isset($files[$file->name]->$key)) {
-          $files[$file->name]->$key = $value;
-        }
-      }
-    }
-  }
-}
-
-/**
- * Updates the records in the skinr_skinsets table based on the files array.
- *
- * @param $files
- *   An array of files.
- */
-function skinr_update_files_database(&$files) {
-  $result = db_query("SELECT * FROM {skinr_skinsets}");
-
-  // Add all files that need to be deleted to a DatabaseCondition.
-  $delete = db_or();
-  foreach ($result as $file) {
-    if (isset($files[$file->name]) && is_object($files[$file->name])) {
-      // Keep the old filename from the database in case the file has moved.
-      $old_filename = $file->filename;
-
-      $updated_fields = array();
-
-      // Handle info specially, compare the serialized value.
-      $serialized_info = serialize($files[$file->name]->info);
-      if ($serialized_info != $file->info) {
-        $updated_fields['info'] = $serialized_info;
-      }
-      unset($file->info);
-
-      // Scan remaining fields to find only the updated values.
-      foreach ($file as $key => $value) {
-        if (isset($files[$file->name]->$key) && $files[$file->name]->$key != $value) {
-          $updated_fields[$key] = $files[$file->name]->$key;
-        }
-      }
-
-      // Update the record.
-      if (count($updated_fields)) {
-        db_update('skinr_skinsets')
-          ->fields($updated_fields)
-          ->condition('filename', $old_filename)
-          ->execute();
-      }
-
-      // Indicate that the file exists already.
-      $files[$file->name]->exists = TRUE;
-    }
-    else {
-      // File is not found in file system, so delete record from the system table.
-      $delete->condition('filename', $file->filename);
-    }
-  }
-
-  if (count($delete) > 0) {
-    // Delete all missing files from the system table
-    db_delete('skinr_skinsets')
-      ->condition($delete)
-      ->execute();
-  }
-
-  // All remaining files are not in the system table, so we need to add them.
-  $query = db_insert('skinr_skinsets')->fields(array('filename', 'name', 'info'));
-  foreach($files as &$file) {
-    if (isset($file->exists)) {
-      unset($file->exists);
-    }
-    else {
-      $query->values(array(
-        'filename' => $file->uri,
-        'name' => $file->name,
-        'info' => serialize($file->info),
-      ));
-      $file->status = 0;
-    }
-  }
-  $query->execute();
-
-  // If any module or theme was moved to a new location, we need to reset the
-  // system_list() cache or we will continue to load the old copy, look for
-  // schema updates in the wrong place, etc.
-  drupal_static_reset('skinr_skin_data');
-  drupal_static_reset('skinr_skinsets');
-}
-
-/**
  * Themes are allowed to set Skinr skins in their .info files.
  *
  * @return
@@ -1030,6 +595,7 @@ function skinr_skin_data() {
   if (is_null($cache)) {
     $skins_skinsets  = skinr_skinsets('skinset');
     $themes_skinsets = skinr_skinsets('theme');
+    dpm($skins_skinsets);
 
     // Need to merge all skins skinsets into a single list of skins.
     // Also merge in the groups information.
