Started converting database to use GUID

Every database table which used an internally generated integer key will
be converted to use a GUID instead, in order to facilitate more reliable
merging of databases.