Update State.js

Changed addTransition to account for the change to Transition. Specifically, Transition.endstate is now an array, so addTransition must treat it as such.