Allow override of JSONEncoder

This allows the developer to sub in a JSONEncoder class that can handle, for instance, datetime.datetime objects or Django models, or any other custom needs.