Implement require (with namespace isolation)