A utility/helper for monkey patching JavaScript functions.