Recusrive implementation of List.map uses too much stack; switch to iterative version. Reviewed-by: jlahoda