Add C++11 support and use std::unique_ptr.