cleaning up intrusive_ptr for maximum correctness

 - now works with derived types -> base types
 - now works better for const-types
 - using enable_if bestly
 - removed unused bits
 - cast_static/cast_dynamic written
formatting in shared_memory.hpp
cleanup of unique_memory