Rewrote tee to eliminate some possible stack overflows

Plan.andThen has a similar measure