database: Add an IdCol

Add an IdCol abstraction so we can change the datatype behind
the id without having to update all the domain classes.

Change-Id: Ia7233aedb89790e4273425dd7d1500a03ff38bf3