Change malformed from dict to list of tuples

This makes it easier to iterate over, and also means we can pre-sort it
for the user.