Python class for dealing with lists of dictionaries