diff --git a/drupal_reset.drush.inc b/drupal_reset.drush.inc
new file mode 100644
index 0000000..938798f
--- /dev/null
+++ b/drupal_reset.drush.inc
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Define the site-reset Drush command.
+ */
+
+/**
+ * Implements hook_drush_help().
+ */
+function drupal_reset_drush_help($command) {
+  switch ($command) {
+    case 'drush:site-reset':
+      return dt('  Reset the site installation, start fresh.
+  Drops all database tables and deletes all the files.');
+  }
+}
+
+/**
+ * Implements hook_drush_command().
+ */
+function drupal_reset_drush_command() {
+  $items = array();
+  $items['site-reset'] = array(
+    'description' => dt('Reset the site installation, start fresh.'),
+    'bootstrap' => DRUSH_BOOTSTRAP_DRUPAL_SITE,
+    'arguments' => array(),
+    'examples' => array(),
+    'aliases' => array(),
+  );
+  return $items;
+}
+
+/**
+ * Callback function for drush site-reset.
+ *
+ * @param $arg1
+ *   An optional argument
+ */
+function drush_drupal_reset_site_reset($arg1 = NULL) {
+  if (!drush_confirm(dt('You are about to drop all database tables and delete all the files for this site. Do you want to continue?'))) {
+    return drush_user_abort();
+  }
+
+  require_once( dirname(__FILE__) . '/drupal_reset.lib.inc');
+
+  if (!_drupal_reset_is_supported_database_configuration()) {
+    drush_set_error('DRUPAL_RESET_DATABASE_CONFIGURATION_NOT_SUPPORTED', 'Your database configuration is not supported by the Drupal reset module.
+There must be one database (no master/slave) and the table prefix must be set to a string (not an array); use the empty string if you do not want a prefix. 
+See your settings.php file.');
+  }
+
+  _drupal_reset_delete_files();
+  drush_log('Deleting the files', 'ok');
+
+  _drupal_reset_drop_database();
+  drush_log('Dropping the database', 'ok');
+}
\ No newline at end of file
diff --git a/drupal_reset.info b/drupal_reset.info
index 09722a6..a9a30e9 100644
--- a/drupal_reset.info
+++ b/drupal_reset.info
@@ -2,3 +2,5 @@ name = Drupal reset
 description = Deletes all database tables and contents of the files directory for the current site, and redirects back to install.php so that Drupal can be reinstalled.
 core = 7.x
 package = Development
+
+files[] = drupal_reset.lib.inc
diff --git a/drupal_reset.lib.inc b/drupal_reset.lib.inc
new file mode 100644
index 0000000..0dd4bd8
--- /dev/null
+++ b/drupal_reset.lib.inc
@@ -0,0 +1,66 @@
+<?php
+/**
+ * @file
+ * The actual functionality for the Drupal Reset module.
+ * 
+ * Provides the functions which delete the files and drop the database tables.
+ */
+
+/**
+ * Delete everything from the 'files' directory.
+ */
+function _drupal_reset_delete_files() {
+  _drupal_reset_rrmdir(conf_path() . '/files');
+}
+
+/**
+ * Delete all database tables.
+ *
+ * @global array $databases 
+ */
+function _drupal_reset_drop_database() {
+  global $databases;
+
+  $tables = db_find_tables($databases['default']['default']['prefix'] . '%');
+
+  foreach ($tables as $table) {
+    db_drop_table($table);
+  }
+}
+
+/**
+ * Recursive directory deletion.
+ */
+function _drupal_reset_rrmdir($dir) {
+  if (!empty($dir) && is_dir($dir)) {
+    $objects = scandir($dir);
+    foreach ($objects as $object) {
+      if ($object !== '.' && $object !== '..') {
+        $this_object = $dir . '/' . $object;
+        if (filetype($this_object) === 'dir') {
+          _drupal_reset_rrmdir($this_object);
+        }
+        else {
+          unlink($this_object);
+        }
+      }
+    }
+    rmdir($dir);
+  }
+}
+
+/**
+ * Check if the installation uses a single-database and a simple prefix.
+ */
+function _drupal_reset_is_supported_database_configuration() {
+  global $databases;
+  if (isset($databases['default']['default'])
+    && count($databases['default']) === 1
+    && isset($databases['default']['default']['prefix'])
+    && is_string($databases['default']['default']['prefix'])) {
+    return TRUE;
+  }
+  else {
+    return FALSE;
+  }
+}
\ No newline at end of file
diff --git a/drupal_reset.module b/drupal_reset.module
index 2c7d357..668c3dd 100644
--- a/drupal_reset.module
+++ b/drupal_reset.module
@@ -1,6 +1,16 @@
 <?php
 
 /**
+ * @file
+ * The Drupal Reset module.
+ * 
+ * Deletes all database tables and contents of the files directory for the 
+ * current site, and redirects back to install.php so that Drupal can 
+ * be reinstalled.
+ */
+require_once ( dirname(__FILE__) . '/drupal_reset.lib.inc');
+
+/**
  * Implements hook_menu().
  */
 function drupal_reset_menu() {
@@ -33,7 +43,7 @@ function drupal_reset_permission() {
  * Implements hook_form().
  */
 function drupal_reset_admin_settings() {
-  if (drupal_reset_is_supported_database_configuration()) {
+  if (_drupal_reset_is_supported_database_configuration()) {
     $form['drupal_reset_agree'] = array(
       '#type' => 'checkbox',
       '#title' => t('Delete all database tables and files'),
@@ -70,50 +80,12 @@ function drupal_reset_admin_settings_validate($form, &$form_state) {
  * Submit handler for admin form.
  */
 function drupal_reset_admin_settings_submit($form, &$form_state) {
-  // Delete everything from the files directory.
-  drupal_reset_rrmdir(conf_path() . '/files');
+  // Delete the files.
+  _drupal_reset_delete_files();
 
-  // Delete all database tables.
-  global $databases;
-  $tables = db_find_tables($databases['default']['default']['prefix'] . '%');
-  foreach ($tables as $table) {
-    db_drop_table($table);
-  }
+  // Drop the database
+  _drupal_reset_drop_database();
 
   // Redirect to install page.
   drupal_goto('install.php');
-}
-
-/**
- * Recursive directory deletion.
- */
-function drupal_reset_rrmdir($dir) {
-  if (!empty($dir) && is_dir($dir)) {
-    $objects = scandir($dir);
-    foreach ($objects as $object) {
-      if ($object !== '.' && $object !== '..') {
-        $this_object = $dir . '/' . $object;
-        if (filetype($this_object) === 'dir') {
-          drupal_reset_rrmdir($this_object);
-        }
-        else {
-          unlink($this_object);
-        }
-      }
-    }
-    rmdir($dir);
-  }
-}
-
-/**
- * Check if the installation uses a single-database and a simple prefix.
- */
-function drupal_reset_is_supported_database_configuration() {
-  global $databases;
-  if (isset($databases['default']['default']) && count($databases['default']) === 1 && isset($databases['default']['default']['prefix']) && is_string($databases['default']['default']['prefix'])) {
-    return TRUE;
-  }
-  else {
-    return FALSE;
-  }
-}
+}
\ No newline at end of file
