Add SharedPtrWrapper class to wrap classes that need to be copied but can't.

This should solve #36.