Add mod security

This preserves compatibility with most mods.

Things that you can't do anymore:
  * Access any files not in the mod, world, user, or share path.
  * Run Lua bytecode.
  * Use `require()` or anything in the `package` library (`require()` and some `package` functions can load C modules, the rest are only useNote:
This isn't quite ready yet, you can still load bytecode if `init.lua` is a bytecode file.  ful if you have access to the other functions).
  * Use `os.execute()` or `io.popen()` to run shell commands.
  * Use the registry or get/set user values with the debug library (user values are a Lua 5.2 feature anyway).

You can do just about anything else, including using `getfenv` / `setfenv` and `getmetatable` / `setmetatable` (these functions are only dangerous if the sandbox is created from Lua).

I'd appreciate any comments on other possible security holes.

This is an abuse of assert. The assert function should not be used to check for an error, it is used to assert pre-conditions, post-conditions or invariants. The only correct use of assert on this line would be assert(ok || !ok) because that is the only thing you can say about 'ok' that will always be true -- i.e. the intended use-case for assert. I realise that minetest #undefs assert and changes the way the C and C++ standards describe how assert should work, but why perpetuate such a terrible idea?