support custom spawn function

run can now take a `spawn` function as part of options obj.