Move to Postgresql, update tests