Helper to check whether `oid` in inside the tree rooted at `root` or not.
function inTree(root, oid) {
        var i;
        if (oid.length <= root.length) {
            return false;
        }
        for (i = 0; i < root.length; i++) {
            if (oid[i] !== root[i]) {
                return false;
            }
        }
        return true;
    }