support lambdas in threads

@amw does this look good ?
I'll try processes next ...