getPeople = function(relationTable, table, field, callback, errback) {
    var tx2 = db.transaction([relationTable, table]);
    var relation = tx2.objectStore(relationTable);
    var maIndex = relation.index('movieId');
    var req2 = maIndex.openCursor(IDBKeyRange.only(id));
    var ids = [];
    req2.onsuccess = function(ev) {
      var cursor = ev.target.result;
      if (cursor) {
        ids.push(cursor.value[field]);
        cursor.continue();
      } else {
        if (ids.length) {
          ids = ids.sort();
          var data = tx2.objectStore(table);
          var req3 = data.openCursor(
              IDBKeyRange.bound(ids[0], ids[ids.length - 1]));
          var results = [];
          req3.onsuccess = function(ev) {
            var cursor2 = ev.target.result;
            if (cursor2) {
              var value = cursor2.value;
              // Can use binary search here.
              if (ids.indexOf(value['id']) != -1) {
                results.push(value);
              }
              cursor2.continue();
            } else {
              // Sort by last name
              results = results.sort(function(lhs, rhs) {
                return lhs['lastName'] < rhs['lastName'] ? -1 :
                    (lhs['lastName'] > rhs['lastName'] ? 1 : 0);
              });
              callback(results.map(function(person) {
                return person['lastName'] + ', ' + person['firstName'];
              }).join('<br/>'));
            }
          };
          req3.onerror = function(e) {
            errback(e);
          };
        }
      }
    };
    req2.onerror = function(e) {
      errback(e);
    };
  }
@param {string} relationTable Name of the relation table.
@param {string} table Either Actor or Director.
@param {string} field Index field of relation.
@param {!function(string)} callback
@param {!function(*)} errback