Support the `type` field sanely

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
rephrase slightly [ci skip]

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>
Use OrderedDict in all compilers

Signed-off-by: Chris “Kwpolska” Warrick <kwpolska@gmail.com>