PGObject class that serializes hashrefs to json fields in db