Added fold_left and fold_right functions.