UUIDManager fixes + tests

Fixes concurrency/synchronization issues & adds tests for UUIDManager.