std: sync package functions with upstream.

* lib/specl/std.lua (func.case): New function.
(package.find, package.pathsub, package.normalize)
(package.insert, package.mappath, package.remove): Sync with
upstream.
* specs/spec_helper.lua: Simplify package.path mangling.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
refactor: improve sandbox comment.

* lib/main.lua (sandbox): The purpose of the shallow copy is to
prevent future changes to specls global environment leaking into
example environments.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
specl: allow examples to safely set environment table elements.

* specs/environment_spec.yaml (context do not leak references):
Specify behaviour of examples when setting environment table
elements.  They should not leak into sibling examples.
* lib/specl/runner.lua (initenv): Make sure _G and _ENV refer to
the innermost environment, not the source environment.
(env.require): Use package.path and package.cpath from innermost
environment for searching, and when calling core.require.
* lib/specl/util.lua (cow): New function.  Fast copy-on-write
table cloning.
* lib/specl/runner.lua (run_examples.block, run_examples): Use
util.cow for nested environments.
* NEWS: Update.

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