Added safe pointer class, arranged a bit the code.
-- Ready for 1.3 pre-release.