NXP-12945: sort returned dir entries according to ordering field + use change TreeMap to HashMap for perf