Smart pointer conversion

All homemades smart pointers have been removed.