Entities now have a unique id that can be used to retrieve them

We use entity groups, so having a primitive type key is useful.
lastId can be used instead of nameCount in the constructor. You can remove nameCount.