A state machine implementation for ImpactJS.