Fixing name_field accessor bug and adding options_sort_field and options_sort_direction options for relationship fields