Added sorting function for BibtexDb