Some more refactoring and commenting of Entity.cs