Make CppObject base class more configurable

Update CppObject so that users can define custom CppObjectSharedPtr specializations that do not dereference the pointer on construction.