Make all tests pass. Migrate to ThreadLocal storage on the FakeDatabase to avoid explicit locking to isolate tests