Fix 'order-by' issues for resource queries

There were a couple of different issues preventing the order-by query parameter from working correctly on the resources endpoint. One was that it was validating keywords instead of strings for the legal list of order-by fields; another was that the post-processing code that aggregated the resource_params SQL query results into the correct resources response did not guarantee any ordering on the final results.

These commits fix both of those issues.

NOTE this pull request replaces #702