Safely add methods to native object prototypes