Removed specialised entity identification stuff.

Since a new ID is created in all the constructors of AbstractEntity,
all entity objects will always have unique IDs. In fact, in the
equals method, the code would never reach the last lines where it
compares IDs. So we may as well indentify entities based on the
object itself.