diff --git a/includes/media.admin.inc b/includes/media.admin.inc
index 4104ff5..c0288a2 100644
--- a/includes/media.admin.inc
+++ b/includes/media.admin.inc
@@ -119,7 +119,8 @@ function media_import_batch_import_files($files, &$context) {
   $files =& $context['sandbox']['files'];
 
   // Take a cut of files.  Let's do 10 at a time.
-  $length = (count($files) > media_variable_get('import_batch_size')) ? media_variable_get('import_batch_size') : count($files);
+  $import_batch_size = variable_get('media__import_batch_size', 20);
+  $length = (count($files) > $import_batch_size) ? $import_batch_size : count($files);
   $to_process = array_splice($files, 0, $length);
   $image_in_message = '';
 
@@ -170,14 +171,14 @@ function media_admin_config_browser($form, &$form_state) {
     }
   }
 
-  $form[media_variable_name('dialog_theme')] = array(
+  $form['media__dialog_theme'] = array(
     '#type' => 'select',
     '#title' => t('Media browser theme'),
     '#options' => $theme_options,
     '#description' => t("This theme will be used for all media related dialogs.
       It can be different from your site's theme because many site themes do not
       work well in the small windows which media uses."),
-    '#default_value' => media_variable_get('dialog_theme'),
+    '#default_value' => variable_get('media__dialog_theme', ''),
   );
 
   // Additional configuration if the WYSIWYG module is enabled.
@@ -189,37 +190,37 @@ function media_admin_config_browser($form, &$form_state) {
     '#access' => module_exists('wysiwyg'),
   );
   $plugins = media_get_browser_plugin_info();
-  $form['wysiwyg'][media_variable_name('wysiwyg_browser_plugins')] = array(
+  $form['wysiwyg']['media__wysiwyg_browser_plugins'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Enabled browser plugins'),
     '#options' => array(),
     '#required' => FALSE,
-    '#default_value' => media_variable_get('wysiwyg_browser_plugins'),
+    '#default_value' => variable_get('media__wysiwyg_browser_plugins', array()),
     '#description' => t('If no plugins are selected, they will all be available.'),
   );
   foreach ($plugins as $key => $plugin) {
-    $form['wysiwyg'][media_variable_name('wysiwyg_browser_plugins')]['#options'][$key] = !empty($plugin['title']) ? $plugin['title'] : $key;
+    $form['wysiwyg']['media__wysiwyg_browser_plugins']['#options'][$key] = !empty($plugin['title']) ? $plugin['title'] : $key;
   }
-  $form['wysiwyg'][media_variable_name('wysiwyg_upload_directory')] = array(
+  $form['wysiwyg']['media__wysiwyg_upload_directory'] = array(
     '#type' => 'textfield',
     '#title' => t("File directory for uploaded media"),
-    '#default_value' => media_variable_get('wysiwyg_upload_directory'),
+    '#default_value' => variable_get('media__wysiwyg_upload_directory', ''),
     '#description' => t('Optional subdirectory within the upload destination where files will be stored. Do not include preceding or trailing slashes.'),
   );
 
   if (module_exists('token')) {
-    $form['wysiwyg'][media_variable_name('wysiwyg_upload_directory')]['#description'] .= t('This field supports tokens.');
+    $form['wysiwyg']['media__wysiwyg_upload_directory']['#description'] .= t('This field supports tokens.');
     $form['wysiwyg']['tokens'] = array(
       '#theme' => 'token_tree',
       '#dialog' => TRUE,
     );
   }
 
-  $form['wysiwyg'][media_variable_name('wysiwyg_allowed_types')] = array(
+  $form['wysiwyg']['media__wysiwyg_allowed_types'] = array(
     '#type' => 'checkboxes',
     '#title' => t('Allowed types in WYSIWYG'),
     '#options' => file_entity_type_get_names(),
-    '#default_value' => media_variable_get('wysiwyg_allowed_types'),
+    '#default_value' => variable_get('media__wysiwyg_allowed_types', array('audio', 'image', 'video', 'document')),
   );
   $form['array_filter'] = array('#type' => 'value', '#value' => TRUE);
 
@@ -231,13 +232,13 @@ function media_admin_config_browser($form, &$form_state) {
  * Manipulate values before form is submitted.
  */
 function media_admin_config_browser_pre_submit(&$form, &$form_state) {
-  if (!$form_state['values'][media_variable_name('dialog_theme')]) {
-    media_variable_del('dialog_theme');
-    unset($form_state['values'][media_variable_name('dialog_theme')]);
+  if (!$form_state['values']['media__dialog_theme']) {
+    variable_del('media__dialog_theme');
+    unset($form_state['values']['media__dialog_theme']);
   }
-  $wysiwyg_browser_plugins = array_unique(array_values($form_state['values'][media_variable_name('wysiwyg_browser_plugins')]));
+  $wysiwyg_browser_plugins = array_unique(array_values($form_state['values']['media__wysiwyg_browser_plugins']));
   if (empty($wysiwyg_browser_plugins[0])) {
-    media_variable_del('wysiwyg_browser_plugins');
-    unset($form_state['values'][media_variable_name('wysiwyg_browser_plugins')]);
+    variable_del('media__wysiwyg_browser_plugins');
+    unset($form_state['values']['media__wysiwyg_browser_plugins']);
   }
 }
diff --git a/includes/media.filter.inc b/includes/media.filter.inc
index 7a808e0..64b72a3 100644
--- a/includes/media.filter.inc
+++ b/includes/media.filter.inc
@@ -273,7 +273,7 @@ function media_token_to_markup($match, $wysiwyg = FALSE) {
 
     // Ensure a valid view mode is being requested.
     if (!isset($tag_info['view_mode'])) {
-      $tag_info['view_mode'] = media_variable_get('wysiwyg_default_view_mode');
+      $tag_info['view_mode'] = variable_get('media__wysiwyg_default_view_mode', 'full');
     }
     elseif ($tag_info['view_mode'] != 'default') {
       $file_entity_info = entity_get_info('file');
@@ -313,12 +313,12 @@ function media_token_to_markup($match, $wysiwyg = FALSE) {
     $fields = media_filter_field_parser($tag_info);
 
     $attributes = is_array($tag_info['attributes']) ? $tag_info['attributes'] : array();
-    $attribute_whitelist = media_variable_get('wysiwyg_allowed_attributes');
+    $attribute_whitelist = variable_get('media__wysiwyg_allowed_attributes', array('height', 'width', 'hspace', 'vspace', 'border', 'align', 'style', 'class', 'id', 'usemap', 'data-picture-group', 'data-picture-align'));
     $settings['attributes'] = array_intersect_key($attributes, array_flip($attribute_whitelist));
     $settings['fields'] = $fields;
 
     if (!empty($tag_info['attributes']) && is_array($tag_info['attributes'])) {
-      $attribute_whitelist = media_variable_get('wysiwyg_allowed_attributes');
+      $attribute_whitelist = variable_get('media__wysiwyg_allowed_attributes', array('height', 'width', 'hspace', 'vspace', 'border', 'align', 'style', 'class', 'id', 'usemap', 'data-picture-group', 'data-picture-align'));
       $settings['attributes'] = array_intersect_key($tag_info['attributes'], array_flip($attribute_whitelist));
       $settings['fields'] = $fields;
 
@@ -583,7 +583,7 @@ function media_format_form($form, $form_state, $file) {
   }
 
   // Allow for overrides to the display format.
-  $default_view_mode = is_array($query_fields) && isset($query_fields['format']) ? $query_fields['format'] : media_variable_get('wysiwyg_default_view_mode');
+  $default_view_mode = is_array($query_fields) && isset($query_fields['format']) ? $query_fields['format'] : variable_get('media__wysiwyg_default_view_mode', 'full');
   if (!isset($formats[$default_view_mode])) {
     $default_view_mode = key($formats);
   }
diff --git a/includes/media.theme.inc b/includes/media.theme.inc
index 1669817..204cedc 100644
--- a/includes/media.theme.inc
+++ b/includes/media.theme.inc
@@ -85,7 +85,7 @@ function template_preprocess_media_thumbnail(&$variables) {
  */
 function theme_media_formatter_large_icon($variables) {
   $file = $variables['file'];
-  $icon_dir = variable_get('media__icon_base_directory', 'public://media-icons') . '/' . media_variable_get('icon_set');
+  $icon_dir = variable_get('media__icon_base_directory', 'public://media-icons') . '/' . variable_get('media__icon_set', 'default');
   $icon = file_icon_path($file, $icon_dir);
   $variables['path'] = $icon;
 
diff --git a/includes/media.variables.inc b/includes/media.variables.inc
deleted file mode 100644
index b652505..0000000
--- a/includes/media.variables.inc
+++ /dev/null
@@ -1,173 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains the variables used by media and their defaults.
- */
-
-/* ***************************************** */
-/* CONSTANTS                                 */
-/* ***************************************** */
-
-/**
- * @TODO: iz_cruft?
- * @var unknown_type
- */
-define('MEDIA_RESOURCE_URI_DEFAULT', 'public://');
-define('MEDIA_TYPES_DEFAULT', '*');
-
-/**
- * Define constants.
- */
-define('MEDIA_VARIABLE_NAMESPACE', 'media__');
-
-/**
- * Wrapper for variable_get() that uses the Media variable registry.
- *
- * @param string $name
- *   The variable name to retrieve. Note that it will be namespaced by
- *   pre-pending MEDIA_VARIABLE_NAMESPACE, as to avoid variable collisions with
- *   other modules.
- * @param unknown $default
- *   An optional default variable to return if the variable hasn't been set
- *   yet. Note that within this module, all variables should already be set
- *   in the media_variable_default() function.
- *
- * @return string
- *   Returns the stored variable or its default.
- *
- *  @see media_variable_set()
- *  @see media_variable_del()
- *  @see media_variable_default()
- */
-function media_variable_get($name, $default = NULL) {
-  // Allow for an override of the default. Useful when a variable is required
-  // (like $path), but namespacing still desired.
-  if (!isset($default)) {
-    $default = media_variable_default($name);
-  }
-  // Namespace all variables.
-  $variable_name = MEDIA_VARIABLE_NAMESPACE . $name;
-  return variable_get($variable_name, $default);
-}
-
-/**
- * Wrapper for variable_set() that uses the Media variable registry.
- *
- * @param string $name
- *   The variable name to set. Note that it will be namespaced by
- *   pre-pending MEDIA_VARIABLE_NAMESPACE, as to avoid variable collisions with
- *   other modules.
- * @param unknown $value
- *   The value for which to set the variable.
- *
- * @return unknown
- *   Returns the stored variable after setting.
- *
- * @see media_variable_get()
- * @see media_variable_del()
- * @see media_variable_default()
- */
-function media_variable_set($name, $value) {
-  $variable_name = MEDIA_VARIABLE_NAMESPACE . $name;
-  return variable_set($variable_name, $value);
-}
-
-/**
- * Wrapper for variable_del() that uses the Media variable registry.
- *
- * @param string $name
- *   The variable name to delete. Note that it will be namespaced by
- *   pre-pending MEDIA_VARIABLE_NAMESPACE, as to avoid variable collisions with
- *   other modules.
- *
- * @see media_variable_get()
- * @see media_variable_set()
- * @see media_variable_default()
- */
-function media_variable_del($name) {
-  $variable_name = MEDIA_VARIABLE_NAMESPACE . $name;
-  variable_del($variable_name);
-}
-
-/**
- * Returns the final machine name of a Media namespaced variable.
- */
-function media_variable_name($name) {
-  return MEDIA_VARIABLE_NAMESPACE . $name;
-}
-
-/**
- * The default variables within the Media namespace.
- *
- * @param string $name
- *   Optional variable name to retrieve the default. Note that it has not yet
- *   been pre-pended with the MEDIA_VARIABLE_NAMESPACE namespace at this time.
- *
- * @return unknown
- *   The default value of this variable, if it's been set, or NULL, unless
- *   $name is NULL, in which case we return an array of all default values.
- *
- * @see media_variable_get()
- * @see media_variable_set()
- * @see media_variable_del()
- */
-function media_variable_default($name = NULL) {
-  static $defaults;
-
-  if (!isset($defaults)) {
-    $defaults = array(
-      'wysiwyg_title' => t('Media browser'),
-      'wysiwyg_icon_title' => t('Add media'),
-      // @todo: We should do this per type actually. For "other" it should be a
-      // link.
-      'wysiwyg_default_view_mode' => 'full',
-      // Directory to store media uploaded via WYSIWYG.
-      'wysiwyg_upload_directory' => '',
-      // Types which can be selected when embedding media vs wysiwyg.
-      'wysiwyg_allowed_types' => array('audio', 'image', 'video', 'document'),
-      // Attributes which can be modified via the wysiwyg and persist.
-      'wysiwyg_allowed_attributes' => array('height', 'width', 'hspace', 'vspace', 'border', 'align', 'style', 'class', 'id', 'usemap', 'data-picture-group', 'data-picture-align'),
-      // WYSIWYG browser plugins in WYSIWYG config page.
-      'wysiwyg_browser_plugins' => array(),
-
-      // Name of the theme to use in the media popup dialog, defaults to
-      // admin_theme.
-      'dialog_theme' => '',
-
-      'max_filesize' => '',
-      'debug' => FALSE,
-
-      'file_list_size' => 10,
-
-      // Used in media.xml.inc: how long to cache retrieved remote data.
-      'xml_cache_expire' => 3600,
-
-      'import_batch_size' => 20,
-      'fromurl_supported_schemes' => array('http', 'https', 'ftp', 'smb', 'ftps'),
-      'icon_base_directory' => file_default_scheme() . '://media-icons/',
-      'icon_set' => 'default',
-
-      // Whether to show the legacy Link and Original view modes. Set to TRUE
-      // in media_update_7203() to not break sites updating from 1.x.
-      'show_deprecated_view_modes' => FALSE,
-
-      // Deprecated variables no longer in use, but should still be uninstalled.
-      'show_file_type_rebuild_nag' => NULL,
-      'field_select_media_text' => NULL,
-      'field_remove_media_text' => NULL,
-      'browser_library_empty_message' => NULL,
-      'browser_pager_limit' => NULL,
-      'browser_viewtype_default' => NULL,
-      'display_types_migration_mess' => TRUE,
-    );
-  }
-
-  if (!isset($name)) {
-    return $defaults;
-  }
-
-  if (isset($defaults[$name])) {
-    return $defaults[$name];
-  }
-}
diff --git a/includes/media.xml.inc b/includes/media.xml.inc
index fdd6e04..b19da18 100644
--- a/includes/media.xml.inc
+++ b/includes/media.xml.inc
@@ -72,7 +72,7 @@ function _media_retrieve_xml($url, $display_errors = FALSE, $refresh = FALSE) {
     }
     else {
       $xmls[$url] = _media_unserialize_xml($xml);
-      cache_set('media:xml:' . $url, $xmls[$url], 'cache_media_xml', media_variable_get('xml_cache_expire', 3600));
+      cache_set('media:xml:' . $url, $xmls[$url], 'cache_media_xml', variable_get('media__xml_cache_expire', 3600));
     }
   }
 
diff --git a/media.install b/media.install
index 6c7fdd7..3f48dfb 100644
--- a/media.install
+++ b/media.install
@@ -87,10 +87,31 @@ function _media_install_copy_icons() {
  * Implements hook_uninstall().
  */
 function media_uninstall() {
-  drupal_load('module', 'media');
-  foreach (media_variable_default() as $name => $value) {
-    media_variable_del($name);
-  }
+  // Remove variables.
+  variable_del('media__wysiwyg_title');
+  variable_del('media__wysiwyg_icon_title');
+  variable_del('media__wysiwyg_default_view_mode');
+  variable_del('media__wysiwyg_upload_directory');
+  variable_del('media__wysiwyg_allowed_types');
+  variable_del('media__wysiwyg_allowed_attributes');
+  variable_del('media__wysiwyg_browser_plugins');
+  variable_del('media__dialog_theme');
+  variable_del('media__max_filesize');
+  variable_del('media__debug');
+  variable_del('media__file_list_size');
+  variable_del('media__xml_cache_expire');
+  variable_del('media__import_batch_size');
+  variable_del('media__fromurl_supported_schemes');
+  variable_del('media__icon_base_directory');
+  variable_del('media__icon_set');
+  variable_del('media__show_deprecated_view_modes');
+  variable_del('media__show_file_type_rebuild_nag');
+  variable_del('media__field_select_media_text');
+  variable_del('media__field_remove_media_text');
+  variable_del('media__browser_library_empty_message');
+  variable_del('media__browser_pager_limit');
+  variable_del('media__browser_viewtype_default');
+  variable_del('media__display_types_migration_mess');
 }
 
 /**
diff --git a/media.module b/media.module
index ade1169..fd0c341 100644
--- a/media.module
+++ b/media.module
@@ -12,9 +12,6 @@
 /* INCLUDES                                  */
 /* ***************************************** */
 
-// A registry of variable_get defaults.
-require_once dirname(__FILE__) . '/includes/media.variables.inc';
-
 // Code relating to using media as a field.
 require_once dirname(__FILE__) . '/includes/media.fields.inc';
 
@@ -74,7 +71,7 @@ function media_entity_info_alter(&$entity_info) {
   // For sites that updated from Media 1.x, continue to provide these deprecated
   // view modes.
   // @see http://drupal.org/node/1051090
-  if (media_variable_get('show_deprecated_view_modes')) {
+  if (variable_get('media__show_deprecated_view_modes', FALSE)) {
     $entity_info['file']['view modes'] += array(
       'media_link' => array(
         'label' => t('Link'),
@@ -247,7 +244,7 @@ function media_admin_paths() {
 
   // If the media browser theme is set to the admin theme, ensure it gets set
   // as an admin path as well.
-  $dialog_theme = media_variable_get('dialog_theme');
+  $dialog_theme = variable_get('media__dialog_theme', '');
   if (empty($dialog_theme) || $dialog_theme == variable_get('admin_theme')) {
     $paths['media/browser'] = TRUE;
     $paths['media/browser/*'] = TRUE;
@@ -351,7 +348,7 @@ function media_page_alter(&$page) {
   // Check if there are file types that need migration and display a message
   // to user if so.
   $menu = menu_get_item();
-  if (media_variable_get('display_types_migration_mess') && $menu['path'] == 'admin/structure/file-types') {
+  if (variable_get('media__display_types_migration_mess', TRUE) && $menu['path'] == 'admin/structure/file-types') {
     if ($migratable_types = _media_get_migratable_file_types()) {
       drupal_set_message(t('There are disabled/deleted file types that can be migrated to their new alternatives. Visit <a href="!url">migration page</a> to get more information.', array('!url' => url('admin/structure/file-types/upgrade'))));
     }
@@ -607,7 +604,7 @@ function media_file_list_element_process($element, $edit, $form_state, $form) {
   $element['list'] = array(
     '#type'     => 'select',
     '#options'  => $element['#options'],
-    '#size'     => media_variable_get('file_list_size'),
+    '#size'     => variable_get('media__file_list_size', 10),
   );
   return $element;
 }
@@ -679,7 +676,7 @@ function media_library() {
  * will default to the administration theme, unless set otherwise.
  */
 function media_dialog_get_theme_name() {
-  return media_variable_get('dialog_theme', variable_get('admin_theme'));
+  return variable_get('media__dialog_theme', variable_get('admin_theme'));
 }
 
 /**
diff --git a/modules/media_internet/media_internet.module b/modules/media_internet/media_internet.module
index c765bcc..15418e6 100644
--- a/modules/media_internet/media_internet.module
+++ b/modules/media_internet/media_internet.module
@@ -139,7 +139,7 @@ class MediaInternetFileHandler extends MediaInternetBaseHandler {
 
   public function claim($embedCode) {
     // Claim only valid URLs using a supported scheme.
-    if (!valid_url($embedCode, TRUE) || !in_array(file_uri_scheme($embedCode), media_variable_get('fromurl_supported_schemes'))) {
+    if (!valid_url($embedCode, TRUE) || !in_array(file_uri_scheme($embedCode), variable_get('media__fromurl_supported_schemes', array('http', 'https', 'ftp', 'smb', 'ftps')))) {
       return FALSE;
     }
 
diff --git a/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.module b/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.module
index a58ad71..bd9231d 100644
--- a/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.module
+++ b/modules/media_wysiwyg_view_mode/media_wysiwyg_view_mode.module
@@ -96,7 +96,7 @@ function media_wysiwyg_view_mode_form_alter(&$form, $form_state, $form_id)  {
     case 'media_format_form':
       $file = $form['#media'];
 
-      $default_view_mode = media_variable_get('wysiwyg_default_view_mode');
+      $default_view_mode = variable_get('media__wysiwyg_default_view_mode', 'full');
 
       $view_mode = !empty($form_state['values']['format']) ? $form_state['values']['format'] : $default_view_mode;
 
diff --git a/wysiwyg_plugins/media.inc b/wysiwyg_plugins/media.inc
index 56ad769..d90b79f 100644
--- a/wysiwyg_plugins/media.inc
+++ b/wysiwyg_plugins/media.inc
@@ -20,11 +20,11 @@ function media_media_plugin() {
 
   // Plugin definition.
   $plugins['media'] = array(
-    'title' => media_variable_get('wysiwyg_title'),
+    'title' => variable_get('media__wysiwyg_title', t('Media browser')),
     'vendor url' => 'http://drupal.org/project/media',
     'icon path' => drupal_get_path('module', 'media') . '/images',
     'icon file' => 'wysiwyg-media.gif',
-    'icon title' => media_variable_get('wysiwyg_icon_title'),
+    'icon title' => variable_get('media__wysiwyg_icon_title', t('Add media')),
     // @todo: move this to the plugin directory for the wysiwyg plugin.
     'js path' => drupal_get_path('module', 'media') . '/js',
     'js file' => 'wysiwyg-media.js',
@@ -32,9 +32,9 @@ function media_media_plugin() {
     'css path' => NULL,
     'settings' => array(
       'global' => array(
-        'enabledPlugins' => media_variable_get('wysiwyg_browser_plugins'),
-        'file_directory' => media_variable_get('wysiwyg_upload_directory'),
-        'types' => media_variable_get('wysiwyg_allowed_types'),
+        'enabledPlugins' => variable_get('media__wysiwyg_browser_plugins', array()),
+        'file_directory' => variable_get('media__wysiwyg_upload_directory', ''),
+        'types' => variable_get('media__wysiwyg_allowed_types', array('audio', 'image', 'video', 'document')),
         'id' => 'media_wysiwyg',
       ),
     ),
@@ -68,7 +68,7 @@ function media_include_browser_js() {
     }
   }
   // Add wysiwyg-specific settings.
-  $settings = array('wysiwyg_allowed_attributes' => media_variable_get('wysiwyg_allowed_attributes'));
+  $settings = array('wysiwyg_allowed_attributes' => variable_get('media__wysiwyg_allowed_attributes', array('height', 'width', 'hspace', 'vspace', 'border', 'align', 'style', 'class', 'id', 'usemap', 'data-picture-group', 'data-picture-align')));
   drupal_add_js(array('media' => $settings), 'setting');
 }
 
