Encode django QuerySets to lists and not dicts in JSONEncoder

This fixes the regression mentioned in #1359