Rewrite adjacency lists with new format in thermo groups

Unfortunately saveDatabse() reordered the entries.