Don't pollute global namespace with setfenv if we don't have it
Replace setfenv implementation with a simpler one