Simplified resource objects and eliminated most uses of shared_ptr.