Preserve OpenSearch result count

Previously DDF ignored the <os:totalResults> tag when connected to an
OpenSearch endpoint, so users could not see the number of results.
Refactored result count retrieval

If any OpenSearch result set happens to not include the total result
count, or returns bogus data, the code will still work.