A mechanism of gene evolution generating mucin function