Lua 5.2 support by replacing setfenv

repl doesn't work on 5.2 purely because the `setfenv` library function was removed. http://lua-users.org/lists/lua-l/2010-06/msg00313.html provides a replacement for `setfenv`; drop this in and repl works fine on 5.2.