Memoize trans::adt::represent_type
Add lots of comments, and a few minor changes noticed while writing them.