Split up the lua environment into a global and a plugin-local part.