refinements to State, and some renaming refactorings
merge of new state into master