Added iterator to table object and fiddled some more with the sqlite upsert