Type converions

Casting and coercions. Mostly descriptive, with a few bits of tidying up. Adds custom DST coercions for smart pointers.