Add JSON deserializer utils

This is a rip from #230, adding some utils for the JSON
deserializer implementation.
`state chart`, not `state machine`, in this case