Export detach

`detach` seems useful enough function to be worth exporting.