Move getReplaceAddToCartUrl and replaceAddToCart

Move getReplaceAddToCartUrl and replaceAddToCart into the new
replacements helper.