Add test case for porperty matching
SQL clean up to work with postgresql
Fix record insertion to work with pg