Fix bunch of 'deleting pointer to incomplete type' errors detected by clang

(without explicit class destructors, destructors of SharedPtr<Impl>
are generated with incomplete Impl type, causing UB. With explicit
destructors defined in .cpp file where Impl's are properly defined
this is fixed).

This change may be incomplete - I've fixed only classes clang
complained to.
Set warning and debug compiler flags for clang as well as gcc

-Wno-unused-value is useful to hide warnings on sizeof()'s used in static asserts