Fix doAndGlue Function.

The doAndGlue Function is a function that should be useful in a
Gibbs sampler, because it can apply a function to overr a list
to use subsequent values to calculate the first new value, then
incorporate that new value into the calculation for the next
element of the list.