working on tests, fixing up the postgres client, a few other fixes