Renamed lua_ref to lua_var and added implementation for lua_var