The consumer goods giant is paying $40 million for the six-year-old startup, with the potential for more milestone payments down the line.