Make dict and tuple building a little nicer

Use monadic folding and iteration