Added id_of

Added a struct called id_of, which is specialised with a type, and
holds the member id_of<T>::value, which gives the id of type T. Pointer
union can now be used in switch statements.

Fixed typos.