Entity id generation bound to engine. (+1 squashed commits)

Squashed commits:

[17a1e8b] Entity id generation bound to engine.