refactor: share leaves implementation from new std.base.tree.

* lib/std/base.lua (leaves): Move from here...
* lib/std/base/tree.lua (leaves): New file.  ...to here.
* local.mk (dist_luastdbase_DATA): Add lib/std/base/tree.lua.
* lib/std/io.lua, lib/std/list.lua, lib/std/tree.lua: Adjust.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
refactor: merge most of std.base.functional back into functional.

* lib/std/base/functional.lua: Remove comment about needing to
wait until deprecated access points are gone before merging.
(foldl, foldr, memoize, nop): Move from here...
* lib/std/functional.lua (foldl, foldr, memoize, nop): ...to here.
* lib/std/list.lua (foldl, foldr): Keep a file local copy of
these functions to satisfy deprecated access points.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>