made the EntitiesContext members as protected. Clean up a bit. Added some code comments.