Added support for ordering by key and ascending descending

@jdoconnor || @darbyfrey
Can this be part of paginate instead of distinct?