Add asTypeOf to prelude

To help with situations that #349 is needed for.