Replaced mentions of `model` with state where appropriate

As the title says, I've replaced the "model" mentions for "state" where appropriate. I've also changed the default value of `typeAttribute` to `stateType`. Not sure if that last thing makes sense though.