We improve the convert code by rewriting the `get_typ`. It is now more general and properly recurses on records and lists. This also surfaced a bug where definition aliases did not generate correct code.