filter by doc_type and domain before wrapping

https://github.com/dimagi/fluff/pull/83

@lrozanski