fix(db): Rewrite method to convert postgresql arrays (refs #4739)

extract method Doc::pgArray* from Doc class and move to a new class Dcp\Utils\PgArray
Merge pull request #1160 from Eric-Brison/3.3-I4739

fix(db): Rewrite method to convert postgresql arrays (closes #4739)