switched the object registry to a bimap

this allows optimized queries in both directions (either by physical ptr
to obtain id, or by id to obtain physical ptr)