A browser extension built to find every working discount code at checkout turned the chaos of coupon culture into a $4 billion business, and then into a scandal.