StateMachine: Use slice of states in On()

It is more pleasant experience to be able to call On() just once with a list of
states than to call it multiple times.

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>