Updated gateways

The StubDBObjectGateway now sets the objects ID when it gets added to
the DB, and returns false if the ID was not 0 (meaning the object should
already exist).