Changed stateTransitions to a struct

In @imagestimulus, changed the stateTransitions field to be a struct
rather than an array (to allow for adding more fields and to make the
protocols easier to understand)