diff --git includes/database/query.inc includes/database/query.inc
index 3731adf..231bd58 100644
--- includes/database/query.inc
+++ includes/database/query.inc
@@ -218,6 +218,7 @@ interface QueryPlaceholderInterface {
  * Base class for the query builders.
  *
  * All query builders inherit from a common base class.
+ * PHP's magic __toString method is how we compile a query object to a prepared statement.
  */
 abstract class Query implements QueryPlaceholderInterface {
 
@@ -247,6 +248,14 @@ abstract class Query implements QueryPlaceholderInterface {
    */
   protected $comments = array();
 
+  /**
+   * Constructs a Query object.
+   *
+   * @param DatabaseConnection $connection
+   *   Database Connection object.
+   * @param array $options
+   *   Array of query options.
+   */
   public function __construct(DatabaseConnection $connection, $options) {
     $this->connection = $connection;
     $this->queryOptions = $options;
@@ -267,6 +276,12 @@ abstract class Query implements QueryPlaceholderInterface {
    */
   abstract public function __toString();
 
+  /**
+   * Gets the nextPlaceholder for this query object.
+   *
+   * @return int
+   *   Next placeholder value.
+   */
   public function nextPlaceholder() {
     return $this->nextPlaceholder++;
   }
@@ -356,6 +371,16 @@ class InsertQuery extends Query {
    */
   protected $fromQuery;
 
+  /**
+   * Constructs an InsertQuery object.
+   *
+   * @param DatabaseConnection $connection
+   *   A DatabaseConnection object.
+   * @param string $table
+   *   Name of the table to associate with this query.
+   * @param array $options
+   *   Array of database options.
+   */
   public function __construct($connection, $table, array $options = array()) {
     if (!isset($options['return'])) {
       $options['return'] = Database::RETURN_INSERT_ID;
@@ -443,6 +468,7 @@ class InsertQuery extends Query {
    * @param $fields
    *   An array of values for which to use the default values
    *   specified in the table definition.
+   *
    * @return InsertQuery
    *   The called object.
    */
@@ -451,6 +477,15 @@ class InsertQuery extends Query {
     return $this;
   }
 
+  /**
+   * Sets the fromQuery on this InsertQuery object.
+   *
+   * @param SelectQueryInterface $query
+   *   An object implementing SelectQueryInterface.
+   *
+   * @return InsertQuery
+   *   The called object.
+   */
   public function from(SelectQueryInterface $query) {
     $this->fromQuery = $query;
     return $this;
@@ -508,6 +543,12 @@ class InsertQuery extends Query {
     return $last_insert_id;
   }
 
+  /**
+   * Serializes the InsertQuery object into a string.
+   *
+   * @return string
+   *   The prepared statement.
+   */
   public function __toString() {
 
     // Create a comments string to prepend to the query.
@@ -630,6 +671,16 @@ class MergeQuery extends Query {
    */
   protected $expressionFields = array();
 
+  /**
+  * Constructs a MergeQuery object.
+  *
+  * @param DatabaseConnection $connection
+  *   A DatabaseConnection object.
+  * @param string $table
+  *   Name of the table to associate with this query.
+  * @param array $options
+  *   Array of database options.
+  */
   public function __construct($connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
@@ -881,6 +932,15 @@ class MergeQuery extends Query {
     // Transaction commits here where $transaction looses scope.
   }
 
+  /**
+   * Implements PHP magic __toString method.
+   *
+   * In the degenerate case, there is no string-able query as this operation
+   * is potentially two queries.
+   *
+   * @return string
+   *   The prepared statement.
+   */
   public function __toString() {
     // In the degenerate case, there is no string-able query as this operation
     // is potentially two queries.
@@ -909,6 +969,16 @@ class DeleteQuery extends Query implements QueryConditionInterface {
    */
   protected $condition;
 
+  /**
+   * Constructs a DeleteQuery object.
+   *
+   * @param DatabaseConnection $connection
+   *   A DatabaseConnection object.
+   * @param string $table
+   *   Name of the table to associate with this query.
+   * @param array $options
+   *   Array of database options.
+   */
   public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
@@ -917,38 +987,65 @@ class DeleteQuery extends Query implements QueryConditionInterface {
     $this->condition = new DatabaseCondition('AND');
   }
 
+  /**
+   * Implements QueryConditionInterface::condition().
+   */
   public function condition($field, $value = NULL, $operator = NULL) {
     $this->condition->condition($field, $value, $operator);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::isNull().
+   */
   public function isNull($field) {
     $this->condition->isNull($field);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::isNotNull().
+   */
   public function isNotNull($field) {
     $this->condition->isNotNull($field);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::conditions().
+   */
   public function &conditions() {
     return $this->condition->conditions();
   }
 
+  /**
+   * Implements QueryConditionInterface::arguments().
+   */
   public function arguments() {
     return $this->condition->arguments();
   }
 
+  /**
+   * Implements QueryConditionInterface::where().
+   */
   public function where($snippet, $args = array()) {
     $this->condition->where($snippet, $args);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::compile().
+   */
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
     return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
+  /**
+   * Executes the DELETE query.
+   *
+   * @return
+   *   The return value is dependant on the database connection.
+   */
   public function execute() {
     $values = array();
     if (count($this->condition)) {
@@ -959,6 +1056,12 @@ class DeleteQuery extends Query implements QueryConditionInterface {
     return $this->connection->query((string) $this, $values, $this->queryOptions);
   }
 
+  /**
+   * Serializes the DeleteQuery object into a string.
+   *
+   * @return string
+   *   The prepared statement.
+   */
   public function __toString() {
 
     // Create a comments string to prepend to the query.
@@ -989,20 +1092,54 @@ class TruncateQuery extends Query {
    */
   protected $table;
 
+  /**
+   * Constructs a TruncateQuery object.
+   *
+   * @param DatabaseConnection $connection
+   *   A DatabaseConnection object.
+   * @param string $table
+   *   Name of the table to associate with this query.
+   * @param array $options
+   *   Array of database options.
+   */
   public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
     $this->table = $table;
   }
 
+  /**
+   * Compiles the saved conditions for later retrieval.
+   *
+   * This method does not return anything, but simply prepares data to be
+   * retrieved via __toString() and arguments().
+   *
+   * @param $connection
+   *   The database connection for which to compile the conditionals.
+   * @param $query
+   *   The query this condition belongs to. If not given, the current query is
+   *   used.
+   */
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
     return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
 
+  /**
+   * Executes the TRUNCATE query.
+   *
+   * @return
+   *   Return is dependent on the database type.
+   */
   public function execute() {
     return $this->connection->query((string) $this, array(), $this->queryOptions);
   }
 
+  /**
+   * Serializes the TruncateQuery object into a string.
+   *
+   * @return string
+   *   The prepared statement.
+   */
   public function __toString() {
     // Create a comments string to prepend to the query.
     $comments = (!empty($this->comments)) ? '/* ' . implode('; ', $this->comments) . ' */ ' : '';
@@ -1058,6 +1195,16 @@ class UpdateQuery extends Query implements QueryConditionInterface {
    */
   protected $expressionFields = array();
 
+  /**
+   * Constructs an UpdateQuery object.
+   *
+   * @param DatabaseConnection $connection
+   *   A DatabaseConnection object.
+   * @param string $table
+   *   Name of the table to associate with this query.
+   * @param array $options
+   *   Array of database options.
+   */
   public function __construct(DatabaseConnection $connection, $table, array $options = array()) {
     $options['return'] = Database::RETURN_AFFECTED;
     parent::__construct($connection, $options);
@@ -1066,34 +1213,55 @@ class UpdateQuery extends Query implements QueryConditionInterface {
     $this->condition = new DatabaseCondition('AND');
   }
 
+  /**
+   * Implements QueryConditionInterface::condition().
+   */
   public function condition($field, $value = NULL, $operator = NULL) {
     $this->condition->condition($field, $value, $operator);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::isNull().
+   */
   public function isNull($field) {
     $this->condition->isNull($field);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::isNotNull().
+   */
   public function isNotNull($field) {
     $this->condition->isNotNull($field);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::conditions().
+   */
   public function &conditions() {
     return $this->condition->conditions();
   }
 
+  /**
+   * Implements QueryConditionInterface::arguments().
+   */
   public function arguments() {
     return $this->condition->arguments();
   }
 
+  /**
+   * Implements QueryConditionInterface::where().
+   */
   public function where($snippet, $args = array()) {
     $this->condition->where($snippet, $args);
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::compile().
+   */
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
     return $this->condition->compile($connection, isset($queryPlaceholder) ? $queryPlaceholder : $this);
   }
@@ -1138,6 +1306,9 @@ class UpdateQuery extends Query implements QueryConditionInterface {
     return $this;
   }
 
+  /**
+   * Executes the UPDATE query.
+   */
   public function execute() {
 
     // Expressions take priority over literal fields, so we process those first
@@ -1166,6 +1337,12 @@ class UpdateQuery extends Query implements QueryConditionInterface {
     return $this->connection->query((string) $this, $update_values, $this->queryOptions);
   }
 
+  /**
+   * Serializes the UpdateQuery object into a string.
+   *
+   * @return string
+   *   The prepared statement.
+   */
   public function __toString() {
 
     // Create a comments string to prepend to the query.
@@ -1203,17 +1380,43 @@ class UpdateQuery extends Query implements QueryConditionInterface {
  */
 class DatabaseCondition implements QueryConditionInterface, Countable {
 
+  /**
+   * Array of conditions.
+   *
+   * @var array
+   */
   protected $conditions = array();
+
+  /**
+   * Array of arguments.
+   *
+   * @var array 
+   */
   protected $arguments = array();
 
+  /**
+   * Whether the conditions have been changed.
+   *
+   * True if the condition has been changed since the last compile.
+   * False if the condition has been compiled and not changed.
+   *
+   * @var bool 
+   *   Whether this condition needs to be compiled.
+   */
   protected $changed = TRUE;
 
+  /**
+   * Constructs the DataBase Condition object.
+   *
+   * @param string $conjunction
+   *   The operator to use to combine conditions -- 'AND' or 'OR'.
+   */
   public function __construct($conjunction) {
     $this->conditions['#conjunction'] = $conjunction;
   }
 
   /**
-   * Return the size of this conditional. This is part of the Countable interface.
+   * Returns the size of this conditional. This is part of the Countable interface.
    *
    * The size of the conditional is the size of its conditional array minus
    * one, because one element is the the conjunction.
@@ -1222,6 +1425,9 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
     return count($this->conditions) - 1;
   }
 
+  /**
+   * Implements QueryConditionInterface::condition().
+   */
   public function condition($field, $value = NULL, $operator = NULL) {
     if (!isset($operator)) {
       if (is_array($value)) {
@@ -1245,6 +1451,9 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::where().
+   */
   public function where($snippet, $args = array()) {
     $this->conditions[] = array(
       'field' => $snippet,
@@ -1256,18 +1465,30 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
     return $this;
   }
 
+  /**
+   * Implements QueryConditionInterface::isNull().
+   */
   public function isNull($field) {
     return $this->condition($field);
   }
 
+  /**
+   * Implements QueryConditionInterface::isNotNull().
+   */
   public function isNotNull($field) {
     return $this->condition($field, NULL, 'IS NOT NULL');
   }
 
+  /**
+   * Implements QueryConditionInterface::conditions().
+   */
   public function &conditions() {
     return $this->conditions;
   }
 
+  /**
+   * Implements QueryConditionInterface::arguments().
+   */
   public function arguments() {
     // If the caller forgot to call compile() first, refuse to run.
     if ($this->changed) {
@@ -1276,6 +1497,9 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
     return $this->arguments;
   }
 
+  /**
+   * Implements QueryConditionInterface::compile().
+   */
   public function compile(DatabaseConnection $connection, QueryPlaceholderInterface $queryPlaceholder = NULL) {
     if ($this->changed) {
       $condition_fragments = array();
@@ -1349,6 +1573,12 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
     }
   }
 
+  /**
+   * Returns the string version of the condition.
+   *
+   * @return string
+   *   Returns string version of the condition.
+   */
   public function __toString() {
     // If the caller forgot to call compile() first, refuse to run.
     if ($this->changed) {
@@ -1357,6 +1587,12 @@ class DatabaseCondition implements QueryConditionInterface, Countable {
     return $this->stringVersion;
   }
 
+  /**
+   * PHP magic __clone() method.
+   *
+   * Only copies fields that implement QueryConditionInterface.
+   * Sets $this->changed to TRUE.
+   */
   function __clone() {
     $this->changed = TRUE;
     foreach ($this->conditions as $key => $condition) {
