Move synonyms from query to index

Per #550.