Wrap and unwrap thenables so that you can pass them through promises