* Refreshes a given element with the given text or node.
*
* @param {HTMLElement|DocumentFragment} el The element to be refreshed.
* @param {string|HTMLElement|DocumentFragment|function():HTMLElement} replacement The text or node to refresh with. Can be a function returning a node.
*
* @example
* const div = document.createElement("div");
* const text = `Any text, including template literals`;
* div.append(App.UI.DOM.link("Link text", () => { // this link will be replaced with the given text
* App.UI.DOM.refresh(div, text);
* }));
*
* function test() {
* const div = document.createElement("div");
* div.append(App.UI.DOM.link("Link text", () => {
* App.UI.DOM.refresh(div, test); // if function returns a DocumentFragment, use refresh(div, test());
* }));
* return div;
* }
*
* @see For more examples, see killSlave.js and pit.js