public static function autoload($klass) {
    $components = explode('\\', $klass);
    if (empty($components[0])) {
      array_shift($components);
    }

    // This class loader ONLY loads
    // our classes. A general purpose
    // classloader should be used for
    // more sophisticated needs.
    if ($components[0] != 'HPCloud') {
      return;
    }

    // We need the path up to, but not including, the root HPCloud dir:
    $loc = DIRECTORY_SEPARATOR . 'HPCloud';
    $local_path = substr(self::$basedir, 0, strrpos(self::$basedir, $loc));

    array_unshift($components, $local_path);
    $path = implode(DIRECTORY_SEPARATOR, $components) . '.php';

    if (file_exists($path)) {
      require $path;
      return;
    }
  }