refactor most of main into a standalone PGCli class
refactor most of main into a standalone PGCli class

dbcli/pgcli,joewalnes/pgcli,suzukaze/pgcli,bitemyapp/pgcli,d33tah/pgcli,janusnic/pgcli,n-someya/pgcli,TamasNo1/pgcli,koljonen/pgcli,w4ngyi/pgcli,thedrow/pgcli,w4ngyi/pgcli,bitemyapp/pgcli,MattOates/pgcli,d33tah/pgcli,nosun/pgcli,n-someya/pgcli,dbcli/pgcli,johshoff/pgcli,j-bennet/pgcli,lk1ngaa7/pgcli,zhiyuanshi/pgcli,j-bennet/pgcli,nosun/pgcli,joewalnes/pgcli,koljonen/pgcli,yx91490/pgcli,yx91490/pgcli,darikg/pgcli,janusnic/pgcli,MattOates/pgcli,dbcli/vcli,TamasNo1/pgcli,bitmonk/pgcli,bitmonk/pgcli,johshoff/pgcli,lk1ngaa7/pgcli,darikg/pgcli,thedrow/pgcli,dbcli/vcli,zhiyuanshi/pgcli,suzukaze/pgcli