Use sql-query for dossier-details task listing.
Remove dead code.
Use integer sequence numbers in globalindex.