Improve finding of company_id [MJ-934]

Change how company_id is found:
- If buid is 0 and a domain is present, search by domain
- Else, filter companies by buid and take the first

There are roughly 30 million docs in the last month's collection. 10 million of those have buid defaulted to 0. In those cases, we should find company_id by domain, not by buid.

All tests pass.