Add a `@typedoc` attribute to document types

This fixes #1622.

It's a bit ugly in that the info is stored under the :type_doc attribute instead of :typedoc. That was necessary because :typedoc is what stores the info set using `@typedoc`, so it's more of a temporary variable.