'Create a usable data structure for serializing.'

def freeze(self):

    (docnames, titles) = zip(*sorted(self._titles.items()))
    filenames = [self._filenames.get(docname) for docname in docnames]
    fn2index = dict(((f, i) for (i, f) in enumerate(docnames)))
    (terms, title_terms) = self.get_terms(fn2index)
    objects = self.get_objects(fn2index)
    objtypes = dict(((v, ((k[0] + ':') + k[1])) for (k, v) in iteritems(self._objtypes)))
    objnames = self._objnames
    return dict(docnames=docnames, filenames=filenames, titles=titles, terms=terms, objects=objects, objtypes=objtypes, objnames=objnames, titleterms=title_terms, envversion=self.env.version)
