Don't reuse entity ids.

Reasoning:
- The entity ids are now of type long and should thus not reoccur.
- It allows for further simplifications.
 -> It is no longer necessary to manage external references.
    As they where mainly needed to check if the refrences
    of a restored entity are still valid and thus have not been reused yet.
Don't maintain and restore external references.

This code simplification is possible, as ids do no longer get reused.