Commutative idempotent groupoids and the constraint satisfaction problem