Write offsets of manifests to digests file.

To speed up access to the manifests desired it is useful to store
offsets in manifest and filelist files inside digest file. Then we
may read digests and quickly obtain manifests and the lists of files
by seeking to the desired position and skipping complete yaml file
parsing.
Sort digests list by origin.

We want to sort digest lists in the same way we will use in update
procedure, hence save it sorted instead of sort it each time
downloaded.