Reorganize logic so state change event can be handled and not causing infinite loop
Reorganize logic so state change event can be handled and not causing infinite loop

rhyolight/nupic.tools,brev/nupic.tools,numenta/nupic.tools,brev/nupic.tools,rhyolight/nupic.tools,numenta/nupic.tools