Fix apply_to scope
Update reduce to work with ipairs and pairs

Also update lazily to return an ipairs-like iterator.
Add branch_and_merge