Rename state with entity, and reparent orphaned entity data

Fixes #599.

Ready for discussion and review. It's pretty complex -- parallel reference to http://flapjack.io/docs/1.0/development/DATA_STRUCTURES/ is assumed, and the merge case especially gets fairly complicated depending on the possible orders of events.
this might be easier to grok as: 

```
it 'renames the entity-name-to-id lookup and the name in the entity-hash-by-id' do 

or

it 'renames the "entity name to id lookup" and the name in the "entity hash by id"' do 
```