A Scala state machine library