various changes, including a more complex freya state type, wrapping the env
refactoring machine, consolidating things now a more obvious shape becomes apparent
some fairly chunky refactoring inside machine and other places, and tweaked example