Refactor search so it can be easily added to any entity controller.

Search now added to documentary units and repositories.