Fix logical $and and $or operations

A search for

```
{ $or: [
         { historyprice: 8.99, qty: 21 },
         { price: 1.99, qty: 20 }
]}
```

does not work as expected. Instead of implicit `$and` operations, we have implicit `$or` operations in the cases. See e.g. the queries in the added unit tests. This PR fixes them.