This should have been part of the previous commit
Added ReadLock() and WriteLock() to Identifiable

Will probably have to come up with a different name for that interface.
Fixed a race condition that could occur if an object was being modified
at the same time it was being written to the database.
Use the Write/Read/Lock/Unlock functions

for consistency and potential ease of debugging in the future