Refactored api_field_from_django_field() to allow easier overriding.