Add test for reusing an Entity.
This will lead to a crash.
Entity allocation error fixed.
Need to save the id before erasing.
Added comment.
Merge pull request #2 from larspensjo/ReuseEntity

Bug in allocation of freed entities.