HSEARCH-1549

Replacement for #/573 rebased on latest master. No functional changes, only reorganizing test packages.