First prototype of states

Committing the first prototype of granular states. They are NOT
integrated with the rest of the library currently. I want to be sure
I've got the concepts right first.