refactor: move leaves and ileaves from base to tree module.

* lib/std/base.lua (ileaves, leaves): Move from here...
* lib/std/tree.lua (ileaves, leaves): ...to here.
* lib/std/base.lua (_leaves): Rename from this...
(leaves): ...to this.
* lib/std/list.lua (flatten): Adjust.

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