The grammaticalization of agreement