Adding tests and fixing issues.
Adding semaphores
Adding mutableSet for outOfSyncValues.