Added lastInsert to database class

This is the function Brian added so that CID can be determined based on
last insert of contact.