Fix memory delegation using smart pointers

Also fix the build system to actually use C++11.