Change EntityState properties to read-only and add methods for setting

This allows the asyncness (sometimes needed to change state to Added) to be more explicit in the API and also makes it more clear that setting the state can involve doing non-negligible work.

See Issue #1230.