Track obj -> id map separately to improve performance.

This hugely speeds up the ics writing, from 60s in id_assign to <<1s.

Also, why do you think this is necessary to do? It looks like an implementation detail that is neither overly complex nor particularly reusable.