Subshells and variables
Unfortunately this work got complicated quickly and resulted in more
fixes and features than I wished. Primarily, we now have subshell
support. This also meant rejigging how we expand and collect variable
assignments. There is a new, rather janky, concept of local_state which
is something we clear immediately after executing a command. This might
need some more work in the future.