CORE-5157 modified queries to consider only distinct

The data object count query was modified to only count distinct data Ids.

The data objects listing query has been made a little more complicated. For each set of entries with the same Id, it selects only the one with the lowest replica number.
Merge branch 'dev' of https://github.com/iPlantCollaborativeOpenSource/DiscoveryEnvironmentBackend into dev