Reuse IRI and prefixed name matching for types.

Fixes #32.