return a reference from sh.expose so that previous commit actually works.  add test cases to make sure states inside the closures are forking as intended.