Make sure to generate useful typenames

There is an additional restriction on type names. Besides that keywords
are not allowed, apparently it's not possible to define types that shadow
existing primitive types (this might be a bug in the compiler).