diff --git a/advancedqueue.css b/advancedqueue.css
deleted file mode 100644
index d594125..0000000
--- a/advancedqueue.css
+++ /dev/null
@@ -1,31 +0,0 @@
-
-.advancedqueue-status-queued,
-.advancedqueue-status-processing,
-.advancedqueue-status-processed,
-.advancedqueue-status-failed {
-  display: inline-block;
-  height: 12px;
-  line-height: 12px;
-  padding-left: 16px;
-  width: 6em;
-
-  background-position: 0% 50%;
-  background-repeat: no-repeat;
-}
-
-.advancedqueue-status-queued {
-  background-image: url('images/queued.gif');
-}
-.advancedqueue-status-processing {
-  background-image: url('images/processing.gif');
-}
-.advancedqueue-status-processed {
-  background-image: url('images/processed.png');
-  color: #336633;
-  font-weight: bold;
-}
-.advancedqueue-status-failed {
-  background-image: url('images/failed.png');
-  color: #ff0000;
-  font-weight: bold;
-}
diff --git a/advancedqueue.drush.inc b/advancedqueue.drush.inc
deleted file mode 100644
index ba269d5..0000000
--- a/advancedqueue.drush.inc
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-
-/**
- * @file
- * Drush worker for Advanced queues.
- */
-
-/**
- * Implementation of hook_drush_command().
- */
-function advancedqueue_drush_command() {
-  $items = array();
-  $items['advancedqueue-process-queue'] = array(
-    'description' => 'Run a processing job for a queue.',
-    'arguments' => array(
-      'queue' => dt('The name of the queue to process.'),
-    ),
-    'options' => array(
-      'timeout' => 'The maximum execution time of the script.',
-      'all' => 'Process all queues.',
-    ),
-  );
-  return $items;
-}
-
-function drush_advancedqueue_process_queue() {
-  // Load information about the registred queues, and sort them by weight.
-  $all_queue_info = module_invoke_all('advanced_queue_info');
-  drupal_alter('advanced_queue_info', $all_queue_info);
-  uasort($all_queue_info, 'drupal_sort_weight');
-
-  $all_option = (bool) drush_get_option('all');
-  $queues = func_get_args();
-  if (!($all_option xor !empty($queues))) {
-    return drush_set_error(dt('You have to specify either a set of queues or the --all parameter.'));
-  }
-
-  if ($all_option) {
-    $queues = $all_queue_info;
-  }
-  else {
-    // Validate queues.
-    $queues = array_combine($queues, $queues);
-    $invalid_queues = array_diff_key($queues, $all_queue_info);
-    if ($invalid_queues) {
-      return drush_set_error(dt('The following queues are invalid: !queues. Aborting.', array('!queues' => implode(', ', $invalid_queues))));
-    }
-    $queues = array_intersect_key($all_queue_info, $queues);
-  }
-
-  // Run the worker for a certain period of time before killing it.
-  $timeout = drush_get_option('timeout');
-  $end = $timeout ? time() + $timeout : 0;
-
-  drush_log(dt('Starting processing loop.'));
-
-  while (!$end || time() < $end) {
-    foreach ($queues as $queue_name => $queue_info) {
-      $queue = DrupalQueue::get($queue_name);
-
-      if ($item = $queue->claimItem()) {
-        drush_advancedqueue_process_item($queue, $queue_name, $queue_info, $item);
-        continue 2;
-      }
-    }
-
-    // Not item processed in that round, let the CPU rest.
-    sleep(1);
-  }
-
-  drush_log(dt('Timeout: exiting processing loop.'));
-}
-
-function drush_advancedqueue_process_item($queue, $queue_name, $queue_info, $item) {
-  $function = $queue_info['worker callback'];
-  drush_log(dt('[!queue:!id] Starting processing item (!item).', array('!queue' => $queue_name, '!id' => $item->item_id, '!item' => json_encode($item->data))));
-
-  try {
-    $output = $function($item->data);
-    if (is_array($output)) {
-      $item->status = $output[0];
-      $item->result = $output[1];
-    }
-    else {
-      // TODO: remove magic constants.
-      $item->status = $output ? 1 : 2;
-    }
-  }
-  catch (Exception $e) {
-    drush_log(dt('[!queue:!id] failed processing: !message', array('!queue' => $queue_name, '!id' => $item->item_id, '!message' => (string) $e)));
-    // TODO: remove magic constants.
-    $item->status = 2;
-  }
-
-  drush_log(dt('[!queue:!id] Processing ended.', array('!queue' => $queue_name, '!id' => $item->item_id, '!item' => json_encode($item->data))));
-  $queue->deleteItem($item);
-}
diff --git a/advancedqueue.info b/advancedqueue.info
index e5480ed..7697e17 100644
--- a/advancedqueue.info
+++ b/advancedqueue.info
@@ -3,12 +3,12 @@ description = Helper module for advanced queuing.
 package = Other
 core = 7.x
 
-files[] = advancedqueue.module
-files[] = advancedqueue.install
 files[] = advancedqueue.queue.inc
 
-files[] = tests/advancedqueue.test
-
+; Views
 files[] = views/advancedqueue_handler_field_title.inc
 files[] = views/advancedqueue_handler_field_status.inc
 files[] = views/advancedqueue_handler_filter_status.inc
+
+; Test
+files[] = tests/advancedqueue.test
diff --git a/advancedqueue.install b/advancedqueue.install
index ae002f2..8295cad 100644
--- a/advancedqueue.install
+++ b/advancedqueue.install
@@ -1,7 +1,12 @@
 <?php
 
 /**
- * Implementation of hook_enable().
+ * @file
+ * Install, update, and uninstall functions for the Advanced-queue module.
+ */
+
+/**
+ * Implements hook_enable().
  */
 function advancedqueue_enable() {
   if (variable_get('queue_default_class', NULL) === NULL) {
@@ -11,7 +16,7 @@ function advancedqueue_enable() {
 }
 
 /**
- * Implementation of hook_disable().
+ * Implements hook_disable().
  */
 function advancedqueue_disable() {
   if (variable_get('queue_default_class', NULL) === 'AdvancedQueue') {
@@ -21,7 +26,7 @@ function advancedqueue_disable() {
 }
 
 /**
- * Implementation of hook_schema().
+ * Implements hook_schema().
  */
 function advancedqueue_schema() {
   $schema['advancedqueue'] = array(
@@ -76,7 +81,7 @@ function advancedqueue_schema() {
       'status' => array(
         'type' => 'int',
         'not null' => TRUE,
-        'default' => -1,
+        'default' => ADVANCEDQUEUE_STATUS_QUEUED,
         'size' => 'tiny',
         'description' => 'Indicates whether the item has been processed (-1 = queue, 0 = processing, 1 = successfully processed, 2 = failed).',
       ),
diff --git a/advancedqueue.js b/advancedqueue.js
deleted file mode 100644
index b044852..0000000
--- a/advancedqueue.js
+++ /dev/null
@@ -1,99 +0,0 @@
-(function ($) {
-  $(function() {
-    return;
-
-    var element_settings = {
-      'event': 'refreshRequest',
-      'progress': { 'type': 'throbber' },
-      'url': 'queues'
-    };
-
-    // Bind AJAX behaviors to all items showing the class.
-    $('.views-ajax-link').once('views-ajax-processed').each(function () {
-      var element_settings = base_element_settings;
-      // Set the URL to go to the anchor.
-      if ($(this).attr('href')) {
-        element_settings.url = $(this).attr('href');
-      }
-      var base = $(this).attr('id');
-      Drupal.ajax[base] = new Drupal.ajax(base, this, element_settings);
-    });
-
-  });
-
-  /**
-   * Handler for the form serialization.
-   *
-   * Runs before the beforeSend() handler (see below), and unlike that one, runs
-   * before field data is collected.
-   */
-  var simpleBeforeSerialize = function (element, options) {
-    // Allow detaching behaviors to update field values before collecting them.
-    // This is only needed when field values are added to the POST data, so only
-    // when there is a form such that this.form.ajaxSubmit() is used instead of
-    // $.ajax(). When there is no form and $.ajax() is used, beforeSerialize()
-    // isn't called, but don't rely on that: explicitly check this.form.
-    if (this.form) {
-      var settings = this.settings || Drupal.settings;
-      Drupal.detachBehaviors(this.form, settings, 'serialize');
-    }
-  };
-
-  Drupal.behaviors.ViewsAjaxView.attach = function() {
-    if (Drupal.settings && Drupal.settings.views && Drupal.settings.views.ajaxViews) {
-      // Retrieve the path to use for views' ajax.
-      var ajax_path = Drupal.settings.views.ajax_path;
-
-      // If there are multiple views this might've ended up showing up multiple times.
-      if (ajax_path.constructor.toString().indexOf("Array") != -1) {
-        ajax_path = ajax_path[0];
-      }
-
-      $.each(Drupal.settings.views.ajaxViews, function(i, settings) {
-        var view = '.view-dom-id-' + settings.view_dom_id;
-        var element_settings = {
-          url: ajax_path,
-          submit: settings,
-          setClick: true,
-          event: 'refreshRequested',
-          selector: view,
-          progress: { type: 'none' }
-        };
-
-        $(view).filter(':not(.views-refresh-processed)')
-          // Don't attach to nested views. Doing so would attach multiple behaviors
-          // to a given element.
-          .filter(function() {
-            // If there is at least one parent with a view class, this view
-            // is nested (e.g., an attachment). Bail.
-            return !$(this).parents('.view').size();
-          })
-          .each(function() {
-            $(this)
-              .addClass('views-refresh-processed')
-              .append($('<div></div>')
-                .each(function () {
-                  // Set a reference that will work in subsequent calls.
-                  var target = this;
-                  var viewData = {};
-                  $.extend(
-                    viewData,
-                    settings
-                  );
-
-                  element_settings.submit = viewData;
-                  var ajax = new Drupal.ajax(false, target, element_settings);
-                  ajax.options.type = 'GET';
-                  ajax.beforeSerialize = simpleBeforeSerialize;
-
-                  setInterval(function() {
-                    $(target).trigger('refreshRequested');
-                  }, 2000);
-                })
-              );
-        }); // $view.filter().each
-      }); // .each Drupal.settings.views.ajaxViews
-    } // if
-  };
-
-})(jQuery);
diff --git a/advancedqueue.module b/advancedqueue.module
index 6f13541..16c9450 100644
--- a/advancedqueue.module
+++ b/advancedqueue.module
@@ -1,6 +1,31 @@
 <?php
 
 /**
+ * @file
+ * Helper module for advanced queuing.
+ */
+
+/**
+ * Status indicating item was added to the queue.
+ */
+define('ADVANCEDQUEUE_STATUS_QUEUED', -1);
+
+/**
+ * Status indicating item is currently being processed.
+ */
+define('ADVANCEDQUEUE_STATUS_PROCESSING', 0);
+
+/**
+ * Status indicating item was processed successfuly.
+ */
+define('ADVANCEDQUEUE_STATUS_SUCCESS', 1);
+
+/**
+ * Status indicating item processing failed.
+ */
+define('ADVANCEDQUEUE_STATUS_FAILURE', 2);
+
+/**
  * Implements hook_views_api().
  */
 function advancedqueue_views_api() {
diff --git a/advancedqueue.queue.inc b/advancedqueue.queue.inc
index 2b19565..1df2ea4 100644
--- a/advancedqueue.queue.inc
+++ b/advancedqueue.queue.inc
@@ -1,6 +1,10 @@
 <?php
 
 /**
+ * Defintion of AdvancedQueue.
+ */
+
+/**
  * Extended queue.
  */
 class AdvancedQueue implements DrupalReliableQueueInterface {
@@ -25,7 +29,7 @@ class AdvancedQueue implements DrupalReliableQueueInterface {
         // We cannot rely on REQUEST_TIME because many items might be created
         // by a single request which takes longer than 1 second.
         'created' => time(),
-        'status' => -1,
+        'status' => ADVANCEDQUEUE_STATUS_QUEUED,
       ));
     return (bool) $query->execute();
   }
@@ -50,7 +54,7 @@ class AdvancedQueue implements DrupalReliableQueueInterface {
         // should really expire.
         $update = db_update('advancedqueue')
           ->fields(array(
-            'status' => 0,
+            'status' => ADVANCEDQUEUE_STATUS_PROCESSING,
             'expire' => time() + $lease_time,
           ))
           ->condition('item_id', $item->item_id)
@@ -72,7 +76,7 @@ class AdvancedQueue implements DrupalReliableQueueInterface {
     $update = db_update('advancedqueue')
       ->fields(array(
         'expire' => 0,
-        'status' => -1,
+        'status' => ADVANCEDQUEUE_STATUS_QUEUED,
       ))
       ->condition('item_id', $item->item_id);
     return $update->execute();
@@ -82,7 +86,7 @@ class AdvancedQueue implements DrupalReliableQueueInterface {
     db_update('advancedqueue')
       ->fields(array(
         'expire' => 0,
-        'status' => isset($item->status) ? $item->status : 1,
+        'status' => isset($item->status) ? $item->status : ADVANCEDQUEUE_STATUS_SUCCESS,
         'result' => serialize(isset($item->result) ? $item->result : array()),
         'processed' => time(),
       ))
diff --git a/advancedqueue_example/advancedqueue_example.info b/advancedqueue_example/advancedqueue_example.info
new file mode 100644
index 0000000..47e00de
--- /dev/null
+++ b/advancedqueue_example/advancedqueue_example.info
@@ -0,0 +1,6 @@
+name = Advanced Queues example
+description = Example module for Advanced Queues module.
+package = Other
+core = 7.x
+
+dependencies[] = advancedqueue
diff --git a/advancedqueue_example/advancedqueue_example.module b/advancedqueue_example/advancedqueue_example.module
new file mode 100644
index 0000000..9c62f30
--- /dev/null
+++ b/advancedqueue_example/advancedqueue_example.module
@@ -0,0 +1,50 @@
+<?php
+
+/**
+ * @file
+ * Example module for Advanced Queues module.
+ */
+
+/**
+ * Implements hook_advanced_queue_info().
+ */
+function advancedqueue_example_advanced_queue_info() {
+  $items['example_queue'] = array(
+    'worker callback' => 'advancedqueue_example_worker',
+  );
+  return $items;
+}
+
+/**
+ * Advanced queue worker; Process a queue item.
+ *
+ * @param $item
+ *   The item object to process.
+ * @param $end_time
+ *   (Optional) The time this process should end.
+ */
+function advancedqueue_example_worker($item, $end_time = FALSE) {
+  $data = $item->data;
+  $params = array(
+    '@id' => $item->item_id,
+    '@uid' => $data['uid'],
+    '@time' => date('r', $data['timestamp']),
+  );
+  drush_print(dt('The "worker" is now processing a example task number @id for user ID @uid created at @time.', $params));
+  return TRUE;
+}
+
+/**
+ * Implements hook_init().
+ *
+ * Create dummy queue items.
+ */
+function advancedqueue_example_init() {
+  global $user;
+  $queue = DrupalQueue::get('example_queue', TRUE);
+  $task = array(
+    'timestamp' => time(),
+    'uid' => $user->uid,
+  );
+  $queue->createItem($task);
+}
diff --git a/css/advancedqueue.css b/css/advancedqueue.css
new file mode 100644
index 0000000..d594125
--- /dev/null
+++ b/css/advancedqueue.css
@@ -0,0 +1,31 @@
+
+.advancedqueue-status-queued,
+.advancedqueue-status-processing,
+.advancedqueue-status-processed,
+.advancedqueue-status-failed {
+  display: inline-block;
+  height: 12px;
+  line-height: 12px;
+  padding-left: 16px;
+  width: 6em;
+
+  background-position: 0% 50%;
+  background-repeat: no-repeat;
+}
+
+.advancedqueue-status-queued {
+  background-image: url('images/queued.gif');
+}
+.advancedqueue-status-processing {
+  background-image: url('images/processing.gif');
+}
+.advancedqueue-status-processed {
+  background-image: url('images/processed.png');
+  color: #336633;
+  font-weight: bold;
+}
+.advancedqueue-status-failed {
+  background-image: url('images/failed.png');
+  color: #ff0000;
+  font-weight: bold;
+}
diff --git a/drush/advancedqueue.drush.inc b/drush/advancedqueue.drush.inc
new file mode 100644
index 0000000..ee5a8c3
--- /dev/null
+++ b/drush/advancedqueue.drush.inc
@@ -0,0 +1,132 @@
+<?php
+
+/**
+ * @file
+ * Drush worker for Advanced-queue.
+ */
+
+/**
+ * Implements hook_drush_command().
+ */
+function advancedqueue_drush_command() {
+  $items = array();
+  $items['advancedqueue-process-queue'] = array(
+    'description' => 'Run a processing job for a queue.',
+    'arguments' => array(
+      'queue' => dt('The name of the queue to process.'),
+    ),
+    'options' => array(
+      'timeout' => 'The maximum execution time of the script. Be warned that this is a rough estimate as the time is only checked between two items.',
+      'all' => 'Process all queues.',
+    ),
+    'aliases' => array('advancedqueue'),
+  );
+  return $items;
+}
+
+function drush_advancedqueue_process_queue() {
+  // Load information about the registred queues, and sort them by weight.
+  $all_queue_info = module_invoke_all('advanced_queue_info');
+  drupal_alter('advanced_queue_info', $all_queue_info);
+  uasort($all_queue_info, 'drupal_sort_weight');
+
+  $all_option = drush_get_option('all');
+  $queues = drush_get_option('queue');
+  if (!$all_option && !$queues) {
+    return drush_set_error(dt('You have to specify either a set of queues or the --all parameter.'));
+  }
+
+  if ($all_option) {
+    $queues = $all_queue_info;
+  }
+  else {
+    // Validate queues.
+    $queues = array_combine($queues, $queues);
+    $invalid_queues = array_diff_key($queues, $all_queue_info);
+    if ($invalid_queues) {
+      return drush_set_error(dt('The following queues are invalid: !queues. Aborting.', array('!queues' => implode(', ', $invalid_queues))));
+    }
+    $queues = array_intersect_key($all_queue_info, $queues);
+  }
+
+  if (!$queues) {
+    return drush_set_error(dt('No queues exist.'));
+  }
+
+  // Run the worker for a certain period of time before killing it.
+  $timeout = drush_get_option('timeout');
+  $end = $timeout ? time() + $timeout : 0;
+
+  drush_log(dt('Starting processing loop.'));
+
+  while (!$end || time() < $end) {
+    foreach ($queues as $queue_name => $queue_info) {
+      // Add default values.
+      $queue_info += array(
+        'delete when completed' => TRUE,
+      );
+
+      $queue = DrupalQueue::get($queue_name);
+
+      if ($item = $queue->claimItem()) {
+        drush_advancedqueue_process_item($queue, $queue_name, $queue_info, $item, $end);
+        continue 2;
+      }
+    }
+
+    // No item processed in that round, let the CPU rest.
+    sleep(1);
+  }
+
+  drush_log(dt('Timeout: exiting processing loop.'));
+}
+
+/**
+ * Process a queue item.
+ *
+ * @param $queue
+ *   The queue object.
+ * @param $queue_name
+ *   The queue name.
+ * @param $queue_info
+ *   The queue info.
+ * @param $item
+ *   The item to process.
+ * @param $end_time
+ *   (Optional) The time the process should end.
+ */
+function drush_advancedqueue_process_item($queue, $queue_name, $queue_info, $item, $end_time = FALSE) {
+  $function = $queue_info['worker callback'];
+  $params =  array(
+    '@queue' => $queue_name,
+    '@id' => $item->item_id,
+    '@title' => !empty($item->title) ? $item->title : dt('untitled'),
+  );
+  drush_log(dt('[@queue:@id] Starting processing item @title.', $params));
+
+  try {
+    // Pass the claimed item itself and end date along to the worker
+    // callback.
+    $output = $function($item, $end_time);
+    if (is_array($output)) {
+      $item->status = $output['status'];
+      $item->result = $output['result'];
+    }
+    else {
+      $item->status = $output ? ADVANCEDQUEUE_STATUS_SUCCESS : ADVANCEDQUEUE_STATUS_FAILURE;
+    }
+  }
+  catch (Exception $e) {
+    $item->status = ADVANCEDQUEUE_STATUS_FAILURE;
+    $params['!message'] = (string) $e;
+    drush_log(dt('[!queue:!id] failed processing: !message', $params));
+  }
+
+  drush_log(dt('[@queue:@id] Processing ended.', $params));
+
+  if ($queue_info['delete when completed']) {
+    // Item was processed, so we can "delete" it. This is not removing the
+    // item from the database, but rather updates it with the status.
+    $queue->deleteItem($item);
+  }
+}
diff --git a/tests/advancedqueue.test b/tests/advancedqueue.test
index 09e5148..119d305 100644
--- a/tests/advancedqueue.test
+++ b/tests/advancedqueue.test
@@ -2,6 +2,8 @@
 
 /**
  * Validate that a AdvancedQueue works as a normal queue.
+ *
+ * Note this class extends core's QueueTestCase, so we use its tests.
  */
 class AdvancedQueueTestCase extends QueueTestCase {
   public static function getInfo() {
diff --git a/views/advancedqueue_handler_field_status.inc b/views/advancedqueue_handler_field_status.inc
index 5b7af87..4765138 100644
--- a/views/advancedqueue_handler_field_status.inc
+++ b/views/advancedqueue_handler_field_status.inc
@@ -6,21 +6,22 @@
 class advancedqueue_handler_field_status extends views_handler_field {
   function render($values) {
     $options = array(
-      -1 => t('Queued'),
-      0 => t('Processing'),
-      1 => t('Processed'),
-      2 => t('Failed'),
+      ADVANCEDQUEUE_STATUS_QUEUED => t('Queued'),
+      ADVANCEDQUEUE_STATUS_PROCESSING => t('Processing'),
+      ADVANCEDQUEUE_STATUS_SUCCESS => t('Processed'),
+      ADVANCEDQUEUE_STATUS_FAILURE => t('Failed'),
     );
+
     $classes = array(
-      -1 => 'queued',
-      0 => 'processing',
-      1 => 'processed',
-      2 => 'failed',
+      ADVANCEDQUEUE_STATUS_QUEUED => 'queued',
+      ADVANCEDQUEUE_STATUS_PROCESSING => 'processing',
+      ADVANCEDQUEUE_STATUS_SUCCESS => 'processed',
+      ADVANCEDQUEUE_STATUS_FAILURE => 'failed',
     );
 
     $output = array(
       '#attached' => array(
-        'css' => array(drupal_get_path('module', 'advancedqueue') . '/advancedqueue.css'),
+        'css' => array(drupal_get_path('module', 'advancedqueue') . '/css/advancedqueue.css'),
       ),
       '#markup' => '<span class="' . check_plain($values->{$this->field_alias}) . ' advancedqueue-status-' . $classes[$values->{$this->field_alias}] . '">' . $options[$values->{$this->field_alias}] . '</span>',
     );
diff --git a/views/advancedqueue_handler_field_title.inc b/views/advancedqueue_handler_field_title.inc
index 98b6446..8ad6d01 100644
--- a/views/advancedqueue_handler_field_title.inc
+++ b/views/advancedqueue_handler_field_title.inc
@@ -26,6 +26,6 @@ class advancedqueue_handler_field_title extends views_handler_field {
       '@item_uid' => $values->{$this->aliases['uid']},
     );
 
-    return t($values->{$this->field_alias}, $placeholders);
+    return format_string($values->{$this->field_alias}, $placeholders);
   }
 }
