Fixes foldr, implements foldl

Foldr was actually acting as foldl. Oops