retryWhen/repeatWhen

Rebase and clean up of #1326 while Aaron is at LambdaJam.
left over from when there was a closure in here that was accessing it.