ZVISION: Move setState to use queuePuzzle.
ZVISION: Added global StateFlags and set/get/unset functions.