Switch DjangoJSONEncoder to use a dict lookup for types

Some applications JSON encode a lot of stuff, so this
micro-optimization may be significant. O(1) lookup vs O(n).