Change all_flags to return a dict

Instead of the list of key, value tuples.