Add :allStateIds() and allAtomicIds()
Rework local assignment to use less magic, be 5.2 compatible