Moved ref count into base object, added or & and to the atomic class, and set flags to be atomic in the base object.