Made reduce calls python3.3 safe
Removed unneccessary (and build failing) sorted(model.objects.all()) call
Wrapped calls to dict.keys() in list() where list operations were needed for python3.3