Expands sum type and record definitions to a lot of helper definitions like eliminators and replace qualified identifiers by their module names.