Track obj -> id map separately to improve performance.

This hugely speeds up the ics writing, from 60s in id_assign to <<1s for one of
my setups (500.000 cells).

Memory shouldn't be a problem, as the map only saves the hash of the key,
and the reference to the key and value.

See the implementation of dict in 'Objects/dictobject.c' of the Python source
tarball, or
http://stackoverflow.com/questions/327311/how-are-pythons-built-in-dictionaries-implemented