Yarn is a singleton object that serves as a container for the story.
It captures and processes user input in the form of keyboard entry, mouse clicks, and drag and drop.
A plotpoint has a narration property which may be text or a Phrase. A plotpoint has an unfold method.
A Plotpoint unfolds a twist and returns zero or more episodes in an array.
An episode is a call-back function. Optionally, a numeric value may be assigned to the episode's salience property and a moment may be assigned for defered execution.
The default behavior of a plotpoint's unfold method is to send the twist to each plotpoint in the plotpoint's subplot, gather any episodes generated by the subplot into an array sorted by salience and return
The main plotpoint
The yarn's tell method: For each associated with the current viewpoint, check the clock has advanced far enought that the episode's moment equals or is less than the current episode. Execute the episode. If the episode returns a falsy value, remove it from the storyline. Advance the yarn's clock one tick. Repeat until the queue for the current viewpoint is exhausted.