Manage shared object in wrappers and scopes

Introduces two new classes:
(1) SharedObject::Wrapper, a template class that manages allocation,
freeing and registering with SharedObject::Scope of objects shared
between Ruby and C++.

(2) SharedObject::Scope which keeps track of shared objects and prevents
those from being swept by Ruby GC while those are still in use.