Finite State Machine for Python (based on Jake Gordon's javascript-state-machine)