Fix the ID map association algorithm.
Turns out that it's not a good idea to associate titles linearly.
Instead, all titles should be given in a single batch so that the
algorithm can give precedence to exact matches.