Cherry-pick of new changes from master.

By merging the LockFree branch into master I made a mess, so that
merging master into LockFree just moved it to the master's HEAD,
which does not include CommitLocker. So, I had to now cherry-pick,
when I should have probably cherry-picked before.