Allow more sophisticated state machine tests

The state machine takes two optional channels:

* Into the StateLog channel all state names are pushed that the machine
  transitions into.
* The Ticker channel is polled after each state transition, allowing to
  control the timing of state transitions from outside of the machine.