Address entities by new getId method

Entities should be addressed by a unique
identifier in the entity caches.