preserve order for ajax autocomplete requests

Previously, having js parse the json response was destructive because the JS object isn't ordered (it seemed in practice to be ordered by key). Rather than return an associative array and then reformat into an array in the JS, this change does the reformatting on the backend.