Simple finite state machine module for Python