metrics from query: include sort order

When no records are selected for metrics, the query is used to retrieve all relevant bibcodes. However, the sort order is currently ignored, which is wrong if people sort the results list (e.g. by date) and then retrieve metrics. So, now the sort order is retrieved from the search parameters and included when bibcodes are retrieved.