Refactoring of overrideProperty()/restoreProperty():
extract fallback implementations of getOwnPropertyDescriptor() and defineProperty() to separate functions
Improve unwrapFunction(): just delete property, if original isn't own property
Improve wrapFunction(): don't "patch" native functions
Improve (un)wrapFunction(): automatically detect global object
Use wrapFunction() to override sidebar.setAttribute()
Improve (un)wrapFunction(): allow override functions with the same names