Adding SyncExtract

> but I think this is getting to type class territory

Woah. Yeah I'll take the type-class over what we have. That said having I think `withShadowOutputDataset` is probably a simpler way to achieve the same thing? @nhibberd ?

>  and we can also do some tuple implementations to remove the nesting.

Did you mention a way of registering exit handlers? (Or is that just `IO.onExit`)? Either way, I think it's about time to do something about the nesting (not just here).