Move comparray from libpromises to cf-agent

(Related: #1973)