Update manipulation.js

return new element for replaceWith