diff --git a/.gitignore b/.gitignore
index 1423dc8..4434db2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,8 @@
-lib/*
 tests/phpunit.xml
+
+# Ignore Composer's generated lock file and vendor directory.
+composer.lock
+vendor
+
+# Patch files can be ignored.
+*.patch
diff --git a/commands/runserver/runserver.drush.inc b/commands/runserver/runserver.drush.inc
index 711412f..c81ba0c 100644
--- a/commands/runserver/runserver.drush.inc
+++ b/commands/runserver/runserver.drush.inc
@@ -10,21 +10,6 @@
  */
 
 /**
- * Supported version of httpserver. This is displayed in the manual install help.
- */
-define('DRUSH_HTTPSERVER_VERSION', '41dd2b7160b8cbd25d7b5383e3ffc6d8a9a59478');
-
-/**
- * Directory name for httpserver. This is displayed in the manual install help.
- */
-define('DRUSH_HTTPSERVER_DIR_BASE', 'youngj-httpserver-');
-
-/**
- * Base URL for automatic download of supported version of httpserver.
- */
-define('DRUSH_HTTPSERVER_BASE_URL', 'https://github.com/youngj/httpserver/tarball/');
-
-/**
  * Implementation of hook_drush_help().
  */
 function runserver_drush_help($section) {
@@ -106,22 +91,6 @@ function drush_core_runserver_validate() {
     return drush_set_error('RUNSERVER_PHP_CGI', dt('The runserver command with the "builtin" server requires php 5.4 (or higher), which could not be found.'));
   }
 
-  // Update with detected configuration.
-  $server = drush_get_option('server', FALSE);
-  if ($server == 'cgi') {
-    // Fetch httpserver cgi based server to our /lib directory, if needed.
-    $lib = drush_get_option('lib', DRUSH_BASE_PATH . '/lib');
-    $httpserverfile = $lib . '/' . DRUSH_HTTPSERVER_DIR_BASE . substr(DRUSH_HTTPSERVER_VERSION, 0, 7) . '/httpserver.php';
-    if (!drush_file_not_empty($httpserverfile)) {
-      // Download and extract httpserver, and confirm success.
-      drush_lib_fetch(DRUSH_HTTPSERVER_BASE_URL . DRUSH_HTTPSERVER_VERSION);
-      if (!drush_file_not_empty($httpserverfile)) {
-        // Something went wrong - the library is still not present.
-        return drush_set_error('RUNSERVER_HTTPSERVER_LIB_NOT_FOUND', dt("The runserver command needs a copy of the httpserver library in order to function, and the attempt to download this file automatically failed. To continue you will need to download the package from !url, extract it into the !lib directory, such that httpserver.php exists at !httpserverfile.", array('!version' => DRUSH_HTTPSERVER_VERSION, '!url' => DRUSH_HTTPSERVER_BASE_URL . DRUSH_HTTPSERVER_VERSION, '!httpserverfile' => $httpserverfile, '!lib' => $lib)));
-      }
-    }
-  }
-
   // Check we have a valid server.
   if (!in_array($server, array('cgi', 'builtin'))) {
     return drush_set_error('RUNSERVER_INVALID', dt('Invalid server specified.'));
@@ -223,10 +192,7 @@ function drush_core_runserver($uri = NULL) {
     drush_shell_exec_interactive($php . ' -S ' . $addr . ':' . $uri['port'] . ' --define auto_prepend_file="' . DRUSH_BASE_PATH . '/commands/runserver/runserver-prepend.php"');
   }
   else {
-    // Include the library and our class that extends it.
-    $lib = drush_get_option('lib', DRUSH_BASE_PATH . '/lib');
-    $httpserverfile = $lib . '/' . DRUSH_HTTPSERVER_DIR_BASE . substr(DRUSH_HTTPSERVER_VERSION, 0, 7) . '/httpserver.php';
-    require_once $httpserverfile;
+    // Include the Drush class that uses the autoloaded HTTPServer.
     require_once 'runserver-drupal.inc';
     // Create a new httpserver instance and start it running.
     $server = new DrupalServer(array(
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..0523033
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,43 @@
+{
+  "name": "drupal/drush",
+  "description": "Drush is a command line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.",
+  "keywords": [],
+  "homepage": "http://drupal.org/project/drush",
+  "license": "GPLv3",
+  "authors": [
+    { "name": "Moshe Weitzman", "email": "weitzman@tejasa.com" },
+    { "name": "Owen Barton", "email": "drupal@owenbarton.com" },
+    { "name": "Mark Sonnabaum", "email": "marksonnabaum@gmail.com" },
+    { "name": "Antoine Beaupré", "email": "anarcat@koumbit.org" },
+    { "name": "Greg Anderson", "email": "greg.1.anderson@greenknowe.org" },
+    { "name": "Jonathan Araña Cruz", "email": "jonhattan@faita.net" },
+    { "name": "Jonathan Hedstrom", "email": "jhedstrom@gmail.com" }
+  ],
+  "repositories": [
+    {
+      "type": "package",
+      "package": {
+        "name": "youngj/httpserver",
+        "version": "1.0.0",
+        "source": {
+          "url": "https://github.com/youngj/httpserver",
+          "type": "git",
+          "reference": "41dd2b7160b8cbd25d7b5383e3ffc6d8a9a59478"
+        },
+        "autoload": {
+          "classmap": { "HTTPServer": "" }
+        }
+      }
+    }
+  ],
+  "autoload": {
+    "psr-0": { "Drush": "lib/" }
+  },
+  "require": {
+    "php": ">=5.3.2",
+    "composer/composer": "1.0.*",
+    "symfony/yaml": "2.1.*",
+    "pear/Console_Table": "*",
+    "youngj/httpserver": "1.0.0"
+  }
+}
diff --git a/includes/.gitignore b/includes/.gitignore
deleted file mode 100644
index ed285c0..0000000
--- a/includes/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-table.inc
\ No newline at end of file
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index c13db27..de0386c 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -399,10 +399,6 @@ function _drush_bootstrap_drush_validate() {
     return FALSE;
   }
 
-  if (drush_environment_table_lib() === FALSE) {
-    return FALSE;
-  }
-
   return TRUE;
 }
 
@@ -977,6 +973,10 @@ function drush_bootstrap_value($context, $value = null) {
 function drush_bootstrap_prepare() {
   define('DRUSH_BASE_PATH', dirname(dirname(__FILE__)));
 
+  // Make sure the Drush dependencies are available via Composer.
+  require_once DRUSH_BASE_PATH . '/includes/composer.inc';
+  drush_bootstrap_composer();
+
   require_once DRUSH_BASE_PATH . '/includes/environment.inc';
   require_once DRUSH_BASE_PATH . '/includes/command.inc';
   require_once DRUSH_BASE_PATH . '/includes/drush.inc';
diff --git a/includes/composer.inc b/includes/composer.inc
new file mode 100644
index 0000000..d904eb1
--- /dev/null
+++ b/includes/composer.inc
@@ -0,0 +1,147 @@
+<?php
+
+/**
+ * @file
+ * Provides Drush bootstrap integration with Composer.
+ */
+
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Input\InputDefinition;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\ConsoleOutput;
+use Symfony\Component\Console\Helper\HelperSet;
+use Composer\IO\ConsoleIO;
+
+/**
+ * Make sure the Drush dependencies are available and up to date.
+ *
+ * @return Composer\Autoload\ClassLoader
+ *   The class loader object that was used to autoload all of the Drush
+ *   dependencies.
+ *
+ * @see drush_bootstrap_composer_update()
+ */
+function drush_bootstrap_composer() {
+  static $composer = NULL;
+
+  // We only have to load Drush's version of Composer once.
+  if (!isset($composer)) {
+    // Compare the hash of the currently installed dependencies to the hash of
+    // the currently existing composer.json. This will ensure that changes to
+    // composer.json will force an update to Drush's dependencies.
+    $hashFile = DRUSH_BASE_PATH . '/vendor/drush.md5.txt';
+    $hash = file_exists($hashFile) ? file_get_contents($hashFile) : FALSE;
+
+    // If drush.md5.txt exists, we compare it to the hash of composer.json.
+    $composerFile = DRUSH_BASE_PATH . '/composer.json';
+    $composerHash = $hash ? md5_file($composerFile) : TRUE;
+    if ($composerHash != $hash) {
+      // Since the hashes are different, we need to update the dependencies by
+      // running an installation through Composer.
+      if (drush_bootstrap_composer_update($composerFile, DRUSH_BASE_PATH)) {
+        // Composer was installed successfully, so save the composer.json hash.
+        file_put_contents($hashFile, md5_file($composerFile));
+      }
+    }
+
+    // Now that the dependencies are installed and up to date, we will initaite
+    // the Composer autoloader.
+    $composer = require_once(DRUSH_BASE_PATH . '/vendor/autoload.php');
+  }
+
+  return $composer;
+}
+
+/**
+ * Installs the given composer.json file into the given path.
+ *
+ * @param $composerFile
+ *   The Composer installation file to process. If not provided, will default to
+ *   the composer.json file in the current working directory.
+ * @param $path
+ *   The path to install the Composer dependencies. If not provided, will
+ *   default to the current working directory.
+ *
+ * @return
+ *   TRUE or FALSE whether or not composer.json was processed correctly.
+ *
+ * @see drush_bootstrap_composer()
+ */
+function drush_bootstrap_composer_update($composerFile = NULL, $path = NULL) {
+  drush_load_composer();
+
+  // The Composer application uses the current working directory, so we'll
+  // mock it as the path as the current working directory.
+  if (isset($path)) {
+    $originalPath = getcwd();
+    chdir($path);
+    $path = $originalPath;
+  }
+
+  // Create the Composer Console IO mappings.
+  $definition = new InputDefinition(array(
+    new InputOption('verbose'), // Run in verbose mode.
+  ));
+  $input = new ArrayInput(array(), $definition);
+  $io = new ConsoleIO($input, new ConsoleOutput(), new HelperSet());
+
+  // Create the Composer and Installer objects using the provided composer.json.
+  $composer = Composer\Factory::create($io, $composerFile);
+  $installer = Composer\Installer::create($io, $composer);
+
+  // Set up the installer to install and update any needed dependencies.
+  $installer
+    ->setDryRun(FALSE) // Actually perform actions.
+    ->setVerbose(TRUE) // Output messages more frequently.
+    ->setPreferSource(TRUE) // Use package sources when possible.
+    ->setUpdate(TRUE); // Update any dependencies during installation.
+
+  // Run the installation process, ignoring any PHP warnings that may pop up.
+  $installed = @$installer->run();
+
+  // Now that the dependencies have been installed, we can switch back to
+  // the original directory.
+  if (isset($path)) {
+    chdir($path);
+  }
+
+  return $installed;
+}
+
+/**
+ * Require the composer autoloader.
+ *
+ * @throws \RuntimeException
+ *   When the autoloader cannot be found and could not be installed by a
+ *   temporary version of composer.
+ */
+function drush_load_composer() {
+  // Load Composer from the .phar file.
+  $autoload_path = DRUSH_BASE_PATH . '/vendor/autoload.php';
+  if (file_exists($autoload_path) || (drush_composer_initial_install())) {
+    require_once($autoload_path);
+  }
+  else {
+    throw new \RuntimeException('Unable to download dependencies with composer!');
+  }
+}
+
+/**
+ * Downloads a temporary version of composer.phar to perform the initial
+ * installation of the composer sources and dependencies. This allows us to
+ * treat composer as a dependency without shipping it's source or phar with
+ * drush.
+ *
+ * @return bool
+ *   Whether or not the composer install command succeeded.
+ */
+function drush_composer_initial_install() {
+  $tmp_dir = sys_get_temp_dir();
+  $phar = file_get_contents("http://getcomposer.org/composer.phar");
+  $composer_file = $tmp_dir . "/composer.phar";
+  file_put_contents($composer_file, $phar);
+  exec("chmod +x " . $composer_file);
+  $command = "cd " . DRUSH_BASE_PATH . " && " . $composer_file . " install";
+  return (bool)system($command);
+}
+
diff --git a/includes/environment.inc b/includes/environment.inc
index c7ff6b0..103d517 100644
--- a/includes/environment.inc
+++ b/includes/environment.inc
@@ -131,34 +131,6 @@ function drush_environment_lib() {
   }
 }
 
-function drush_environment_table_lib() {
-  // Try using the PEAR installed version of Console_Table.
-  $tablefile = 'Console/Table.php';
-  if (@file_get_contents($tablefile, FILE_USE_INCLUDE_PATH) === FALSE) {
-    $lib = drush_get_option('lib', DRUSH_BASE_PATH . '/lib');
-    $tablefile = $lib . '/Console_Table-' . DRUSH_TABLE_VERSION . '/Table.php';
-    // If it is not already present, download Console Table.
-    if (!drush_file_not_empty($tablefile)) {
-      // Attempt to remove the old Console Table file, from the legacy location.
-      // TODO: Remove this (and associated .git.ignore) in Drush 6.x.
-      $tablefile_legacy = DRUSH_BASE_PATH . '/includes/table.inc';
-      if (drush_file_not_empty($tablefile_legacy)) {
-        drush_op('unlink', $tablefile_legacy);
-      }
-
-      // Download and extract Console_Table, and confirm success.
-      if (drush_lib_fetch(DRUSH_PEAR_BASE_URL . 'Console_Table-' . DRUSH_TABLE_VERSION . '.tgz')) {
-        // Remove unneccessary package.xml file which ends up in /lib.
-        drush_op('unlink', $lib . '/package.xml');
-      }
-      if (!drush_file_not_empty($tablefile)) {
-        return drush_bootstrap_error('DRUSH_TABLES_LIB_NOT_FOUND', dt("Drush needs a copy of the PEAR Console_Table library in order to function, and the attempt to download this file automatically failed. To continue you will need to download the !version package from http://pear.php.net/package/Console_Table, extract it into !lib directory, such that Table.php exists at !tablefile.", array('!version' => DRUSH_TABLE_VERSION, '!tablefile' => $tablefile, '!lib' => $lib)));
-      }
-    }
-  }
-  require_once $tablefile;
-}
-
 /**
  * Returns the current working directory.
  *
diff --git a/lib/README.txt b/lib/README.txt
index 6e828ad..2a21a26 100644
--- a/lib/README.txt
+++ b/lib/README.txt
@@ -1,6 +1,7 @@
-Drush adds external libraries here; examples include the Console Table
-and lightweight httpserver.
+The lib directory is for classes provided by Drush that are original to Drush.
+All Drush-originated code must follow the PSR-0 naming convention for classes
+and namespaces as documented here:
 
-This directory should be writable by the first user who runs Drush so
-that these dependencies can be downloaded.  It may be set to read-only
-after that.
+https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-0.md
+
+The PSR-0 namespace for Drush-originated code is "Drush".
