Refactored the way in which Entities are created.

Created a helper function which creates and returns a reference to a new empty Entity.