> Yes, deep copy of whole _G into env is a solution.
> Don't forget to create new metatable for strings and set its
> __index field to env.string to prevent user from accessing original
> "string" library as debug.getmetatable"".__index
demo.lua with sandboxing: http://codepad.org/E87tf77T