diff --git a/noderelationships.admin.inc b/noderelationships.admin.inc
index 0ba73a4..5552fbc 100644
--- a/noderelationships.admin.inc
+++ b/noderelationships.admin.inc
@@ -916,11 +916,21 @@ function _noderelationships_nodereference_settings_form_submit($form, &$form_sta
   $nodetype = $form_values['type_name'];
   $field_name = $form_values['field_name'];
   $referenceable_types = (!empty($form_values['referenceable_types']) ? array_filter($form_values['referenceable_types']) : array());
-  $back_references = noderelationships_settings_list("relation_type = 'backref' AND related_type = '%s' AND field_name = '%s'", $nodetype, $field_name);
+  $conditions = array(
+    'relation_type' => 'backref',
+    'related_type' => $nodetype,
+    'field_name' => $field_name,
+  );
+  $back_references = noderelationships_settings_list($conditions);
   $types_to_sync = array();
   foreach ($back_references as $back_reference) {
     if (!isset($referenceable_types[$back_reference->type_name])) {
-      noderelationships_settings_delete("relation_type = 'backref' AND type_name = '%s' AND field_name = '%s'", $back_reference->type_name, $field_name);
+      $conditions = array(
+        'relation_type' => 'backref',
+        'type_name' => $back_reference->type_name,
+        'field_name' => $back_reference->type_name,
+      );
+      noderelationships_settings_delete($conditions);
       if (!isset($types_to_sync[$back_reference->type_name])) {
         $types_to_sync[$back_reference->type_name] = $back_reference->type_name;
       }
diff --git a/noderelationships.inc b/noderelationships.inc
index 5fc6b1b..c747a43 100644
--- a/noderelationships.inc
+++ b/noderelationships.inc
@@ -21,23 +21,34 @@ function noderelationships_get_back_reference_regions() {
  *
  * @param $where
  *   Expression for the WHERE clause of the query.
- * @param $args
- *   A variable list of arguments for the query.
  */
-function noderelationships_settings_list($where) {
-  $args = func_get_args();
-  array_shift($args);
-  // Check for 'All arguments in one array' syntax.
-  if (isset($args[0]) && is_array($args[0])) {
-    $args = $args[0];
-  }
-  $result = db_query('SELECT type_name, relation_type, related_type, field_name, settings FROM {noderelationships_settings} WHERE '. $where, $args);
-  $rows = array();
-  while ($row = db_fetch_object($result)) {
-    $row->settings = (!empty($row->settings) ? (array)unserialize($row->settings) : array());
-    $rows[] = $row;
+function noderelationships_settings_list($args = array()) {
+  if (module_exists('ctools')) {
+     $settings =  ctools_export_load_object('noderelationships_settings', 'conditions', $args);
+  }
+  else {
+    $query = 'SELECT * FROM {noderelationships_settings}';
+    $schema = drupal_get_schema('noderelationships_settings');
+    foreach ($args as $key => $value) {
+       if (isset($schema['fields'][$key])) {
+        $conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']);
+        $query_args[] = $value;
+      }
+    }
+  
+    // Make a string out of the conditions.
+    if ($conditions) {
+      $query .= " WHERE " . implode(' AND ', $conditions);
+    }
+
+    $result = db_query($query, $query_args);
+    $settings = array();
+    while ($row = db_fetch_object($result)) {
+      $row->settings = (!empty($row->settings) ? (array)unserialize($row->settings) : array());
+      $settings[] = $row;
+    }
   }
-  return $rows;
+  return $settings;
 }
 
 /**
@@ -69,7 +80,7 @@ function noderelationships_settings_load($nodetype, $settings_group = 'all') {
 
   // Read settings from database.
   $regions = noderelationships_get_back_reference_regions();
-  foreach (noderelationships_settings_list("type_name = '%s'", $nodetype) as $row) {
+  foreach (noderelationships_settings_list(array('type_name' => $nodetype)) as $row) {
     $relation_key = $row->related_type .':'. $row->field_name;
 
     if ($row->relation_type == 'noderef') {
@@ -184,14 +195,23 @@ function noderelationships_settings_save($nodetype, $settings) {
  * @param $args
  *   A variable list of arguments for the delete query.
  */
-function noderelationships_settings_delete($where) {
-  $args = func_get_args();
-  array_shift($args);
-  // Check for 'All arguments in one array' syntax.
-  if (isset($args[0]) && is_array($args[0])) {
-    $args = $args[0];
-  }
-  db_query('DELETE FROM {noderelationships_settings} WHERE '. $where, $args);
+function noderelationships_settings_delete($args = array()) {
+  $query = 'DELETE FROM {noderelationships_settings}';
+  $conditions = array();
+  $schema = drupal_get_schema('noderelationships_settings');
+  $query_args = array();
+  foreach ($args as $key => $value) {
+    if (isset($schema['fields'][$key])) {
+      $conditions[] = "$key = " . db_type_placeholder($schema['fields'][$key]['type']);
+      $query_args[] = $value;
+    }
+  }
+
+  // Make a string out of the conditions.
+  if ($conditions) {
+    $query .= ' WHERE ' . implode(' AND ', $conditions);
+  }
+  db_query($query, $conditions);
 }
 
 /**
@@ -200,8 +220,8 @@ function noderelationships_settings_delete($where) {
 function noderelationships_settings_delete_nodereference($nodetype, $field_name) {
   // Prepare data to delete relations related to a CCK field instance.
   $args = array($nodetype, $field_name);
-  $noderef_conditions = "relation_type = 'noderef' AND type_name = '%s' AND field_name = '%s'";
-  $backref_conditions = "relation_type = 'backref' AND related_type = '%s' AND field_name = '%s'";
+  $noderef_conditions = array('relation_type' => 'noderef', 'type_name' => $nodetype, 'field_name' => $field_name);
+  $backref_conditions = array('relation_type' => 'backref', 'type_name' => $nodetype, 'field_name' => $field_name);;
 
   // Delete node reference extras settings.
   noderelationships_settings_delete($noderef_conditions, $args);
diff --git a/noderelationships.install b/noderelationships.install
index 25bf7bd..75548dc 100644
--- a/noderelationships.install
+++ b/noderelationships.install
@@ -108,6 +108,7 @@ function noderelationships_schema() {
         'size' => 'medium',
         'not null' => TRUE,
         'description' => 'Relation settings (serialized).',
+        'serialize' => TRUE,
       ),
     ),
     'primary key' => array('type_name', 'relation_type', 'related_type', 'field_name'),
@@ -116,6 +117,35 @@ function noderelationships_schema() {
       'related_field_relation' => array('related_type', 'field_name', 'relation_type'),
       'field_name' => array('field_name'),
     ),
+    // CTools export support.
+    'export' => array(
+      'key' => '__compound_key',
+      'key name' => 'Compound key',
+      'keys' => array(
+        'type_name',
+        'relation_type',
+        'related_type',
+        'field_name',
+      ),
+      'identifier' => 'noderelationship',
+      'default hook' => 'default_noderelationships',  // Function hook name.
+      'api' => array(
+        'owner' => 'noderelationships',
+        'api' => 'noderelationships',  // Base name for api include files.
+        'minimum_version' => 1,
+        'current_version' => 1,
+      ),
+      // Optional callbacks:
+      'list callback' => 'noderelationships_ctools_export_list',
+      'load callback' => 'noderelationships_ctools_export_load',
+      'load all callback' => 'noderelationships_ctools_export_load_all',
+      'to hook code callback' => 'noderelationships_ctools_export_to_hook_code',
+      'delete callback' => 'noderelationships_ctools_export_delete',
+      'export callback' => 'noderelationships_ctools_export_export',
+      // 'save callback' => 'noderelationships_ctools_export_save',
+      // 'create callback' => 'noderelationships_ctools_export_create',
+      // 'import callback' => 'noderelationships_ctools_export_import',
+    ),
   );
   return $schema;
 }
diff --git a/noderelationships.module b/noderelationships.module
index b0bf5ca..573a3c4 100644
--- a/noderelationships.module
+++ b/noderelationships.module
@@ -25,6 +25,11 @@ define('NODERELATIONSHIPS_NODEREF_VIEW_TAG', 'noderelationships_noderef');
 define('NODERELATIONSHIPS_VIEW_PATH_PREFIX', 'noderelationships');
 
 /**
+ * Exportables.
+ */
+define('NODERELATIONSHIPS_SEPARATOR', ':');
+
+/**
  * Implementation of hook_theme().
  */
 function noderelationships_theme() {
@@ -317,7 +322,8 @@ function noderelationships_node_type($op, $info) {
   }
   elseif ($op == 'delete') {
     // Delete relationship settings related to the content type being deleted.
-    noderelationships_settings_delete("type_name = '%s' OR related_type = '%s'", array($info->type, $info->type));
+    noderelationships_settings_delete(array('type_name' => $info->type));
+    noderelationships_settings_delete(array('related_type' => $info->type));
   }
 
   // Clear cached information about relationships (all operations).
@@ -480,3 +486,240 @@ function _noderelationships_child_node_form_submit_proxy($form, &$form_state) {
   module_load_include('inc', 'noderelationships', 'noderelationships.pages');
   _noderelationships_child_node_form_submit($form, $form_state);
 }
+
+/**
+ * CTools exportables 'list callback'.
+ */
+function noderelationships_ctools_export_list() {
+  $table = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($table);
+  $export = $schema['export'];
+  $list = array();
+  $field_names = implode(', ', array_keys($schema['fields']));
+
+  $query = db_query("SELECT $field_names FROM {" . $table . "}");
+  while ($object = db_fetch_object($query)) {
+    // Compile a compound key name.
+    $object->__keys = _noderelationships_ctools_export_primary_keys($object);
+    $object->__compound_key = implode(NODERELATIONSHIPS_SEPARATOR, $object->__keys);
+
+    $list[$object->__compound_key] = $object->__compound_key;
+  }
+
+  return $list;
+}
+
+/**
+ * CTools exportables 'export render'.
+ */
+function noderelationships_settings_features_export_render($module_name = '', $data) {
+  ctools_include('export');
+  $component = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($component);
+  $objects = ctools_export_load_object($component);
+
+  $code = array();
+  $code[] = '  $export = array();';
+  $code[] = '';
+  foreach ($data as $machine_name) {
+    // The object to be exported. */
+    if ($object = $objects[$machine_name]) {
+
+      $additions = array(
+          '__keys' => _noderelationships_ctools_export_primary_keys($object),
+          '__compound_key' => $machine_name,
+      );
+
+      $query = db_query("SELECT settings FROM {noderelationships_settings} WHERE type_name='%s' AND relation_type='%s' AND related_type='%s' AND field_name='%s'",
+        array($object->type_name, $object->relation_type, $object->related_type, $object->field_name));
+
+      while ($r = db_fetch_object($query)) {
+        $settings = unserialize($r->settings);
+      }
+
+      $object->settings = $settings;
+
+      // Code.
+      $identifier = $schema['export']['identifier'];
+      $code[] = ctools_export_object($component, $object, '  ', $identifier, $additions);
+      $code[] = '  $export[\''. $machine_name .'\'] = $'. $identifier .';';
+      $code[] = '';
+    }
+  }
+  $code[] = '  return $export;';
+  $code = implode("\n", $code);
+
+  $return = array($schema['export']['default hook'] => $code);
+  return $return;
+}
+
+/**
+* Implementation of hook_features_revert().
+*/
+function noderelationships_settings_features_revert($module_name = NULL) {
+  $table = 'noderelationships_settings';
+  $defaults = features_get_default($table, $module_name);
+  foreach ($defaults as $key => $object) {
+    $settings = serialize($object->settings);
+    $query = db_query("UPDATE {noderelationships_settings} SET settings='%s' WHERE type_name='%s' AND relation_type='%s' AND related_type='%s' AND field_name='%s'",
+      array($settings, $object->type_name, $object->relation_type, $object->related_type, $object->field_name));
+  }
+}
+
+/**
+ * CTools exportables 'load callback'.
+ */
+function noderelationships_ctools_export_load($name) {
+  $table = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($table);
+  $export = $schema['export'];
+  $field_names = implode(', ', array_keys($schema['fields']));
+
+  // Decrypt the $name.
+  $keys = explode(NODERELATIONSHIPS_SEPARATOR, $name);
+  $conditions = array();
+  $args = array();
+  foreach ($keys as $array_key => $value) {
+    $key = $schema['primary key'][$array_key];
+    $conditions[] = "{$key} = '%s'";
+    $args[] = $value;
+  }
+  $conditions = implode(' AND ', $conditions);
+  // Run the compiled query.
+  $query = db_query("SELECT " . $field_names . " FROM {" . $table . "} WHERE ". $conditions, $args);
+  $object = db_fetch_object($query);
+  if (!empty($object)) {
+    $object->settings = unserialize($object->settings);
+    $object->__keys = _noderelationships_ctools_export_primary_keys($object);
+    $object->__compound_key = implode(NODERELATIONSHIPS_SEPARATOR, $object->__keys);
+    $object->monkey = 'blah';
+  }
+
+  return $object;
+}
+
+/**
+ * CTools exportables 'load all callback'.
+ */
+function noderelationships_ctools_export_load_all($reset = FALSE) {
+  $table = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($table);
+  $export = $schema['export'];
+  $list = array();
+  $field_names = implode(', ', array_keys($schema['fields']));
+
+  if ($reset) {
+    ctools_export_load_object_reset($table);
+  }
+
+  $query = db_query("SELECT $field_names FROM {" . $table . "}");
+  while ($object = db_fetch_object($query)) {
+    // Compile a compound key name.
+    $object->__keys = _noderelationships_ctools_export_primary_keys($object);
+    $object->__compound_key = implode(NODERELATIONSHIPS_SEPARATOR, $object->__keys);
+    $object->table = $table;
+    $object->type = t('Normal');
+    $object->export_type = EXPORT_IN_DATABASE;
+    $object->disabled = FALSE;
+
+    $list[$object->__compound_key] = $object;
+  }
+
+  return $list;
+}
+
+/**
+ * CTools exportables 'to hook code callback'.
+ */
+function noderelationships_ctools_export_to_hook_code($names, $name) {
+  // Some redundant code, necessary to keep the customizations minimal for the
+  // rest of the function.
+  $table = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($table);
+  $export = $schema['export'];
+  $objects = array();
+  $output = '';
+
+  // Load each of the objects.
+  foreach ($names as $obj_name) {
+    $obj = noderelationships_ctools_export_load($obj_name);
+    if (!empty($obj)) {
+      $objects[] = $obj;
+    }
+  }
+
+  // Only proceed if objects were found.
+  if (!empty($objects)) {
+    // Function heading.
+    $output = "/**\n";
+    $output .= " * Implementation of hook_{$export['default hook']}()\n";
+    $output .= " */\n";
+    $output .= "function " . $name . "_{$export['default hook']}() {\n";
+    $output .= "  \${$export['identifier']}s = array();\n";
+    $output .= "\n";
+
+    // Output each object.
+    foreach ($objects as $object) {
+      $output .= ctools_export_crud_export($table, $object, '  ');
+      $output .= "  \${$export['identifier']}s['" . check_plain($object->__compound_key) . "'] = \${$export['identifier']};\n";
+      $output .= "\n";
+    }
+
+    // Close the function.
+    $output .= "  return \${$export['identifier']}s;\n";
+    $output .= "}\n";
+  }
+
+  return $output;
+}
+
+/**
+ * CTools exportables 'export callback'.
+ */
+function noderelationships_ctools_export_export($object, $indent) {
+  $table = 'noderelationships_settings';
+
+  // By default the $object will not have the __keys or __compound_key
+  // elements exported as they are not part of the schema, so pass them
+  // separately.  $additions prepends the output while $additions2
+  // appends it.
+  $additions = array(
+    '__keys' => $object->__keys,
+    '__compound_key' => $object->__compound_key,
+  );
+
+  return ctools_export_object($table, $object, $indent, NULL, $additions, array());
+}
+
+/**
+ * CTools exportables 'delete callback'.
+ */
+function noderelationships_ctools_export_delete($object) {
+  $table = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($table);
+  $conditions = array();
+
+  foreach ($schema['primary key'] as $export_key) {
+    $conditions[$export_key] = $object->$export_key;
+  }
+
+  module_load_include('inc', 'noderelationships');
+  noderelationships_settings_delete($conditions);
+}
+
+/**
+ * Create an associated array of the primary key values for a given object.
+ */
+function _noderelationships_ctools_export_primary_keys($object) {
+  $table = 'noderelationships_settings';
+  $schema = ctools_export_get_schema($table);
+  $export = $schema['export'];
+
+  // Build an array of the primary
+  $keys = array();
+  foreach ($schema['primary key'] as $export_key) {
+    $keys[$export_key] = $object->$export_key;
+  }
+
+  return $keys;
+}
