dynamic::unique_ptr implementation & UT

Also fixed a few marginal issues in dynamic::shared_ptr code.