function findPartialIntersections(requestedPath, optimizedPath, requestTree) {
    var depthDiff = requestedPath.length - optimizedPath.length;
    var i;

    // Descend into the request path tree for the optimized-path prefix (when the optimized path is longer than the
    // requested path)
    for (i = 0; requestTree && i < -depthDiff; i++) {
        requestTree = requestTree[optimizedPath[i]];
    }

    // There is no matching path in the request path tree, thus no candidates for deduplication
    if (!requestTree) {
        return [[], [optimizedPath], [requestedPath]];
    }

    if (depthDiff === 0) {
        return recurse(requestedPath, optimizedPath, requestTree, 0, [], []);
    } else if (depthDiff > 0) {
        return recurse(requestedPath, optimizedPath, requestTree, 0, requestedPath.slice(0, depthDiff), []);
    } else {
        return recurse(requestedPath, optimizedPath, requestTree, -depthDiff, [], optimizedPath.slice(0, -depthDiff));
    }
}
Recursive function to calculate intersection and complement paths in 2 given pathsets at a given depth.

Parameters:
 - requestedPath: full requested path set (can include ranges)
 - optimizedPath: corresponding optimized path (can include ranges)
 - requestTree: path tree for in-flight request, against which to dedupe

Returns a 3-tuple consisting of
 - the intersection of requested paths with requestTree
 - the complement of optimized paths with requestTree
 - the complement of corresponding requested paths with requestTree

Example scenario:
 - requestedPath: ['lolomo', 0, 0, 'tags', { from: 0, to: 2 }]
 - optimizedPath: ['videosById', 11, 'tags', { from: 0, to: 2 }]
 - requestTree: { videosById: 11: { tags: { 0: null, 1: null }}}

This returns:
[
  [['lolomo', 0, 0, 'tags', 0], ['lolomo', 0, 0, 'tags', 1]],
  [['videosById', 11, 'tags', 2]],
  [['lolomo', 0, 0, 'tags', 2]]
]