Various ideas to speed up serializer class

When serializing a list of objects, restframework does a lot of repetitive computing. Most notably, the is_simple_callable checks and isinstance checks can be quite expensive.

I implemented a couple of changes to make restframework faster. The main idea is to cache the structure of the data using the first object of the data, and then later on use the cached information to speed up serializing objects.

Without the changes the speed of serializing 100000 objects was 21.4 seconds, with the changes the speed was 11.0 seconds, and when in addition using non-ordered dict as _dict_class (not included in this PR), the speed was 6.9 seconds. So, altogether these give a speedup of 3x. There is still some overhead, as a simple json.dumps() call takes around 0.8-0.9 seconds.

The approach I have used in this PR isn't meant for commit. It is non-DRY and likely causes regressions for more esoteric use cases (monkeypatching classes at run time for example). On the other hand, I think getting a 3x-4x speed up for list serialization is important. Currently I think the best approach could be implementing a FastSerializer class that has some limitations (no key ordering, data must be homogenous and no support for callables for some possible limitations). Then, if your use case matches the FastSerializer restrictions, then you could subclass from FastSerializer and get the speed up. If you need full range of features, use Serializer instead.

The test script was:
```
import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_test.settings'
from django import setup
setup()
from datetime import datetime
import json

from rest_framework import serializers
from rest_framework.renderers import JSONRenderer


class Dict(dict):
    pass

class MySerializer(serializers.Serializer):
    #_dict_class = Dict
    pass


class CommentSerializer(MySerializer):
    email = serializers.EmailField()
    content1 = serializers.CharField(max_length=200)
    content2 = serializers.CharField(max_length=200)
    content3 = serializers.CharField(max_length=200)
    content4 = serializers.CharField(max_length=200)
    content5 = serializers.CharField(max_length=200)
    content6 = serializers.CharField(max_length=200)
    content7 = serializers.CharField(max_length=200)
    content8 = serializers.CharField(max_length=200)
    date = serializers.DateField()


class Comment(object):
    def __init__(self):
        self.content1 = u'foo'
        self.content2 = u'foo'
        self.content3 = u'foo'
        self.content4 = u'foo'
        self.content5 = u'foo'
        self.content6 = u'foo'
        self.content7 = u'foo'
        self.content8 = u'foo'
        self.email = u'a@b.fi'
        self.date = datetime.now().date()

comments = [Comment() for i in range(0, 100000)]
start = datetime.now()
json.dumps([
    {
        'content1': getattr(c, 'content1'), 'email': getattr(c, 'email'),
        'date': getattr(c, 'date').isoformat(),
        'content2': getattr(c, 'content2'),
        'content3': getattr(c, 'content3'),
        'content4': getattr(c, 'content4'),
        'content5': getattr(c, 'content5'),
        'content6': getattr(c, 'content6'),
        'content7': getattr(c, 'content7'),
        'content8': getattr(c, 'content8'),
    } for c in comments])
print(datetime.now() - start)
start = datetime.now()
serializer = CommentSerializer(comments, many=True)
JSONRenderer().render(serializer.data)
print(datetime.now() - start)
```