Corrected Entity destruction.

Defined a custom Entity destructor and improve the way in which Entities are created within the EntityManager.