A series of fixes and an enhancement  for Document Search.

Document search breaks on automatically registered modules. Also searching from the Document homepage never yields any results. These are fixes for that.

I've added an enhancement that allows for optional disabling of the advanced search. In situations where multiple entities have different versions, the list of versions allows for invalid entity/version combinations, which can be very confusing.

I've also added a fix for DocumentViewerTest, that was throwing errors. These errors were not related to this set of commits, but already existing in the current version, and I'm quite sure the error is in the test itself, not in code.