Added 'team_number()' to the list of functions that are evaluated as intrinsic. Also changed the type of TEAM_TYPE (in TypePattern) to be DerivedType rather than IntType.
Implementation now no longer needs the static function MissingDerivedType() hack.
I think that the type here should be DerivedType rather than IntType (as I've changed it to be). However, I'm not sure as I'm rather confused about the implications of this. It does apparently fix the intrinsic function image_status() (for which there isn't a test yet).