Refactr peergrouper to export less API

Changes where made to make all of peergrouper changes external
but, after comments from @rogpeppe the changes have been
reworked to only export the necessary API from tests
and make a peergrouper_test packages only including the
part of the code that is indirectly using dummy provider
and therefore causing an import cycle when apiserver is
imported from state
d