Refactor the `with` helper to not rely on `bind`

cc @ebryn