added a number of functions from CSSselect, + a `replaceElement` function