Replace auto_ptr with shared_ptr

auto_ptr is deprecated and can easily be replaced by shared_ptr (from
C++11). Since the factory classes do not keep a pointer to the created
objects they can simply return a bare pointer and by semantics transfer
ownership for the new object to the caller. The caller can then decide
on how to store that pointer (actually a shared_ptr).