Fixed the function call that counts the number of results for a listing
of a directory. Right now the limit is 1000000.
Added more specific queries for sorting by different fields in ASC and
DESC order.
Fixed the reporting of top-level permissions for directory listings.
CORE-4804: Removed code that adds trailing slashes to directory names in
(list-paths).