refactor: split out base functions for `std.functional`.

* lib/std/base.lua (foldl, foldr, memoize, nop, reduce): Move
from here...
* lib/std/base/functional.lua (foldl, foldr, memoize, nop)
(reduce): New file. ...to here.
* lib/std/functional.lua, lib/std/list.lua: Adjust imports
accordingly.
* local.mk (luastdbasedir, dist_luastdbase_DATA): Install new
file correctly.

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