A reference for finite state machine logic and functionality, implemented using Javascript.