Changed the CDERebaser class to be less trigger-happy with rebasing. The way the compaction is estimated has been changed. It used to just estimate the reduction in the number of object changes. Now it has a rough evaluation of the data change, and it also only triggers for 500 object changes or more.
Updated comment.
Added locking to rebaser, baseline consolidator, and the save monitor. They now lock the event store context to perform atomic operations, where necessary.
This was motivated by a case where a new object was lost on the saving device. There were a lot of rebases occurring on each device, and it seems possible that a race condition could have occurred between the save monitor creating a new event, and the rebaser absorbing that event.
Merge branch 'master' of https://github.com/drewmccormack/ensembles