Refactored queries to work on a single filename

This will make it easier to support multiple languages and
search/download in parallel