Apply smart pointers to File and related classes